|
@@ -34,8 +34,8 @@
|
|
|
<el-form-item label="限制类型">
|
|
|
<el-select v-model="formSearch.limitType" class="input">
|
|
|
<el-option label="未选择" value=""></el-option>
|
|
|
- <el-option label="允许访问" value="false"></el-option>
|
|
|
- <el-option label="限制访问" value="true"></el-option>
|
|
|
+ <el-option label="允许访问" value="0"></el-option>
|
|
|
+ <el-option label="禁止访问" value="1"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
@@ -383,6 +383,19 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
|
+ <!-- 导入错误信息列表 -->
|
|
|
+ <el-dialog title="错误提示" :visible.sync="errDialog">
|
|
|
+ <div
|
|
|
+ v-for="errMessage in errMessages"
|
|
|
+ :key="errMessage.lineNum"
|
|
|
+ class="text-danger"
|
|
|
+ >
|
|
|
+ 第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="errDialog = false">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</section>
|
|
@@ -478,6 +491,7 @@ export default {
|
|
|
uploadAction: EXAM_WORK_API + "/exam/ipLimited/import",
|
|
|
uploadData: {},
|
|
|
fileLoading: false,
|
|
|
+ errDialog: false,
|
|
|
fileList: [],
|
|
|
uploadHeaders: {},
|
|
|
};
|
|
@@ -599,10 +613,18 @@ export default {
|
|
|
}
|
|
|
this.examIpLimitForm.id = row.id;
|
|
|
this.examIpLimitForm.ip = row.ip;
|
|
|
- this.examIpLimitForm.limitType = row.limitType;
|
|
|
+ this.examIpLimitForm.limitType = this.getLimitType(row.limitType);
|
|
|
this.addingIpLimitDialog = true;
|
|
|
this.showIpColumn = true;
|
|
|
},
|
|
|
+ getLimitType(type) {
|
|
|
+ if (type === "允许访问") {
|
|
|
+ return 0;
|
|
|
+ } else if (type === "禁止访问") {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ },
|
|
|
batchDelete() {
|
|
|
this.$confirm("确定删除所选数据吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -729,15 +751,21 @@ export default {
|
|
|
this.ipLimitImportDialog = true;
|
|
|
this.initUpload();
|
|
|
},
|
|
|
- uploadSuccess() {
|
|
|
- console.log("uploadSuccess");
|
|
|
- this.$notify({
|
|
|
- message: "上传成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.fileLoading = false;
|
|
|
- this.ipLimitImportDialog = false;
|
|
|
- this.searchForm();
|
|
|
+ uploadSuccess(response) {
|
|
|
+ if (!response.hasError) {
|
|
|
+ this.$notify({
|
|
|
+ message: "上传成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.fileLoading = false;
|
|
|
+ this.ipLimitImportDialog = false;
|
|
|
+ this.searchForm();
|
|
|
+ } else {
|
|
|
+ this.fileLoading = false;
|
|
|
+ this.ipLimitImportDialog = false;
|
|
|
+ this.errMessages = response.failRecords;
|
|
|
+ this.errDialog = true;
|
|
|
+ }
|
|
|
},
|
|
|
uploadError(response) {
|
|
|
console.log("uploadError");
|