diff --git a/src/utils/http.js b/src/utils/http.js index d0d8ef9..e235d67 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -197,9 +197,7 @@ export function post(url, params) { break; case 500: resolve(res.data); - this.$message.error( - res.data.errmessage || res.data.message - ); + // this.$message.error(res.data.errmessage || res.data.message); break; case 404: this.$message.error( diff --git a/src/views/Home.vue b/src/views/Home.vue index 6d0e831..046cf56 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -100,6 +100,7 @@ export default { keyword: function (val) { clearTimeout(this.searchTimer) this.searchTimer = setTimeout(() => { + this.pageNum = 1; this.initData() }, 500) }, @@ -136,7 +137,7 @@ export default { this.getProcessClassData(params); } else { // 编程类 - this.getProgrammingClassData(params) + this.getProgrammingClassData(params); } }, getProcessClassData(params) { // 获取流程类判分点列表数据 diff --git a/src/views/Program.vue b/src/views/Program.vue index e027e1f..df4a0b5 100644 --- a/src/views/Program.vue +++ b/src/views/Program.vue @@ -24,6 +24,7 @@
判分点名称
实验要求
- +
@@ -44,7 +45,7 @@

参考答案

- +
@@ -105,9 +106,9 @@ @@ -125,9 +126,10 @@ export default { components: {quill}, data() { return { - isAdd: false, // 添加 - isEdit: false, // 编辑 - isView: false, // 查看 + bcId: "", // 编程类判分点id + isAdd: Boolean(this.$route.query.isAdd), // 添加 + isEdit: Boolean(this.$route.query.isEdit), // 编辑 + isView: Boolean(this.$route.query.isView), // 查看 isNameRepeat: false, // 名称是否重复 formData: { points: { @@ -143,21 +145,20 @@ export default { }, // 表单参数 tableData: [], // 规则表格数据 tableDataCopy: [], // 规则表格数据备份 - isAddRule: false, // 是否可以新增规则 + isAddRule: false, // 是否禁用新增规则按钮 }; }, mounted() { + console.log('当前地址=', location.host); + console.log("token=", this.$route.query.token) + console.log("systemId=", this.$route.query.systemId) + this.$route.query.token && this.$store.commit('setParam', { - token: atob(decodeURI(this.$route.query.token)) + token: atob(decodeURI(this.$route.query.token)), + referrer: atob(decodeURI(this.$route.query.referrer)) }); - if (this.$route.query.isView) { - this.isView = true; - } else if (this.$route.query.isEdit) { - this.isEdit = true; - } else if (this.$route.query.isAdd) { - this.isAdd = true; - } if (this.$route.query.bcId) { + this.bcId = this.$route.query.bcId; this.getInfoData(this.$route.query.bcId); } if (this.$route.query.systemId) { @@ -178,7 +179,12 @@ export default { } // 重新封装数据 judgmentRule.forEach((item, index) => { - this.tableData.push({ ...item, isSubject: true, isDisabled: true, isSave: false}); + this.tableData.push({ + ...item, + isSubject: true, + isDisabled: true, + isSave: true + }); }) } else { this.$message.warning(res.message); @@ -190,7 +196,7 @@ export default { handleBlur() { // 新增/编辑判分点名称判重 if (this.formData.points.name) { let params = { - lcId: this.$route.query.lcId ? this.$route.query.lcId : "", + bcId: this.bcId, name: this.formData.points.name } this.$post(this.api.bcQueryNameIsExist, params).then(res => { @@ -232,7 +238,7 @@ export default { } else if (!this.tableData[i].result) { this.$message.warning(`第${i + 1}项,规则结果不能为空`); return; - } else if (this.tableData[i].isSave) { + } else if (!this.tableData[i].isSave) { this.$message.warning(`第${i + 1}项,未保存`); return; } @@ -242,7 +248,7 @@ export default { this.tableData.forEach(i => { let obj = { id: i.id ? i.id : "", - bcId: i.bcId ? i.bcId : "", + bcId: i.bcId, required: i.required, result: i.result, withOr: i.withOr @@ -277,8 +283,9 @@ export default { addRule() { // 新增规则 this.isAddRule = true; this.tableData.push({ - isDisabled: true, - isSave: false, + isDisabled: false, // 不禁用 + isSave: false, // 未保存 + bcId: this.bcId, required: "", result: "", withOr: 0 @@ -290,7 +297,6 @@ export default { handleEdit(row) { // 处理编辑规则 this.tableDataCopy = deepCopy(this.tableData); // 深拷贝 row.isDisabled = false; - row.isSave = true; }, handleSave(row) { // 处理保存规则 if (!row.required) { @@ -301,12 +307,17 @@ export default { this.$message.warning(`规则结果不能为空`); return; } - row.isSave = false; + row.isSave = true; row.isDisabled = true; this.isAddRule = false; }, - handleCancel(index) { // 处理取消编辑规则 - this.$set(this.tableData, index, this.tableDataCopy[index]); + handleCancel(row, index) { // 处理取消编辑规则 + if (row.isSave) { + this.$set(this.tableData, index, this.tableDataCopy[index]); + } else { + this.tableData.splice(index, 1); + this.isAddRule = false; + } }, handleDelete(index) { // 处理删除规则 this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", { @@ -449,6 +460,7 @@ export default { position: absolute; top: 0; bottom: 0; + right: 10px; cursor:not-allowed; z-index: 99999; } diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index 5ac318d..94b837d 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -23,6 +23,7 @@
判分点名称
实验要求
- +
@@ -102,7 +109,7 @@