+
+
{{ scope.row.name }}
+
交易指标区间
@@ -274,9 +285,9 @@
- 编辑
- 保存
- 取消
+ 编辑
+ 保存
+ 取消
删除
@@ -294,9 +305,10 @@ export default {
components: {quill},
data() {
return {
- isAdd: false, // 添加
- isEdit: false, // 编辑
- isView: false, // 查看
+ lcId: "", // 流程类判分点id
+ isAdd: Boolean(this.$route.query.isAdd), // 添加
+ isEdit: Boolean(this.$route.query.isEdit), // 编辑
+ isView: Boolean(this.$route.query.isView), // 查看
isNameRepeat: false, // 名称是否重复
treeData: [], // 树结构数据
defaultProps: {
@@ -317,22 +329,16 @@ export default {
}, // 表单参数
tableData: [], // 规则表格数据
tableDataCopy: [], // 规则表格数据备份
- isAddRule: false, // 是否可以新增规则
+ isAddRule: false, // 是否禁用新增规则按钮
};
},
mounted() {
this.$route.query.token && this.$store.commit('setParam', {
token: atob(decodeURI(this.$route.query.token))
});
- 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;
- }
this.getTreeData();
if (this.$route.query.lcId) {
+ this.lcId = this.$route.query.lcId;
this.getInfoData(this.$route.query.lcId);
}
if (this.$route.query.systemId) {
@@ -353,9 +359,14 @@ export default {
let length = judgmentRuleList.length;
let tempArr = [];
judgmentRuleList.forEach((item, index) => {
- let obj = { ...item, isSubject: true, isDisabled: true, isSave: false};
+ let obj = {
+ ...item,
+ isSubject: true,
+ isDisabled: true, // 已禁用
+ isSave: true // 已保存
+ };
//题目类型(1选择 2判断 3填空 4问答 5指标结果)
- if (item.type == 1) {
+ if (item.type == 1 || item.type == 2) {
obj.subjectId = Number(item.emptyOne);
obj.value1 = Number(item.emptyTwo);
} else if (item.type == 3) {
@@ -367,8 +378,8 @@ export default {
obj.value1 = item.emptyOne;
obj.value2 = "";
} else {
- obj.value1 = item.emptyOne.substring(1,item.emptyOne.indexOf(','));
- obj.value2 = item.emptyOne.substring(item.emptyOne.indexOf(',') + 1,item.emptyOne.length - 1)
+ obj.value1 = item.emptyOne.substring(0,item.emptyOne.indexOf(','));
+ obj.value2 = item.emptyOne.substring(item.emptyOne.indexOf(',') + 1,item.emptyOne.length)
}
obj.value3 = item.emptyTwo;
} else if (item.type == 5) {
@@ -385,7 +396,7 @@ export default {
this.tableData = tempArr;
});
- this.tableData.forEach((item, index) => {
+ this.tableData.forEach(async (item, index) => {
// 勾选树节点
if (item.operationIds) {
this.$nextTick(() => {
@@ -393,8 +404,8 @@ export default {
});
}
// 根据题目id,获取题目信息
- if (item.type && item.type != 4 && item.emptyOne) {
- this.getSubjectData(item.subjectId, index);
+ if (item.isSubject && item.type && item.type != 4 && item.emptyOne) {
+ await this.getSubjectData(item.emptyOne, index);
}
});
@@ -470,7 +481,7 @@ export default {
handleBlur() { // 新增/编辑判分点名称判重
if (this.formData.lcJudgmentPoint.name) {
let params = {
- lcId: this.$route.query.lcId ? this.$route.query.lcId : "",
+ lcId: this.lcId,
name: this.formData.lcJudgmentPoint.name
}
this.$post(this.api.queryNameIsExist, params).then(res => {
@@ -505,7 +516,7 @@ export default {
if (this.tableData[i].isSubject && !this.tableData[i].operationIds) {
this.$message.warning(`第${i + 1}项请选择操作点`);
return;
- } else if (this.tableData[i].isSave) {
+ } else if (this.tableData[i].isSubject && !this.tableData[i].isSave) {
this.$message.warning(`第${i + 1}项,未保存`);
return;
}
@@ -518,7 +529,7 @@ export default {
emptyOne: "",
emptyTwo: "",
id: i.id ? i.id : "",
- lcId: i.lcId ? i.lcId : "",
+ lcId: i.lcId,
type: i.type ? i.type : "",
operationIds: i.operationIds,
resultOperation: i.resultOperation,
@@ -577,8 +588,9 @@ export default {
this.tableData.length && this.tableData.push({ruleOperation: 0});
this.tableData.push({
isSubject: true,
- isDisabled: true,
- isSave: false,
+ isDisabled: false, // 不禁用
+ isSave: false, // 未保存
+ lcId: this.lcId,
resultOperation: 0,
ruleOperation: 0,
operationIds: "",
@@ -599,7 +611,6 @@ export default {
handleEdit(row) { // 处理编辑规则
this.tableDataCopy = deepCopy(this.tableData); // 深拷贝
row.isDisabled = false;
- row.isSave = true;
},
handleSave(row, index) { // 处理保存规则
let keys = this.$refs[`tree-${index}`].getCheckedKeys();
@@ -641,16 +652,22 @@ export default {
}
}
}
- row.isSave = false;
+ row.isSave = true;
row.isDisabled = true;
this.isAddRule = false;
},
handleCancel(row, index) { // 处理取消编辑规则
- this.$set(this.tableData, index, this.tableDataCopy[index]);
- if (!this.tableData[index].operationIds) {
- this.$refs[`tree-${index}`].setCheckedKeys([]);
+ if (row.isSave) {
+ this.$set(this.tableData, index, this.tableDataCopy[index]);
+ if (!this.tableData[index].operationIds) {
+ this.$refs[`tree-${index}`].setCheckedKeys([]);
+ } else {
+ this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]);
+ }
} else {
- this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]);
+ this.tableData.splice(index, 1);
+ index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
+ this.isAddRule = false;
}
},
handleDelete(row, index) { // 处理删除规则
@@ -662,7 +679,7 @@ export default {
}).then(() => {
this.tableData.splice(index, 1);
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
- this.isAddRule = index === 0 ? false : true;
+ this.isAddRule = false;
}).catch(() => {})
},
// 表头样式设置
@@ -795,6 +812,7 @@ export default {
position: absolute;
top: 0;
bottom: 0;
+ right: 10px;
cursor:not-allowed;
z-index: 99999;
}
diff --git a/vue.config.js b/vue.config.js
index 5c5be6d..48ce8c5 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -20,7 +20,7 @@ module.exports = {
}
},
- publicPath: './',
+ publicPath: '/',
outputDir: 'dist',
assetsDir: 'static',
devServer: {