master
e 3 years ago
parent 3d16464f13
commit 0336e798e9
  1. 5
      src/components/myTree/src/tree.vue
  2. 1
      src/components/quill/index.vue
  3. 97
      src/views/Transaction.vue

@ -13,10 +13,12 @@
v-for="child in root.childNodes" v-for="child in root.childNodes"
:node="child" :node="child"
:props="props" :props="props"
highlight-current
:render-after-expand="renderAfterExpand" :render-after-expand="renderAfterExpand"
:show-checkbox="showCheckbox" :show-checkbox="showCheckbox"
:key="getNodeKey(child)" :key="getNodeKey(child)"
:render-content="renderContent" :render-content="renderContent"
node-key="orgCode"
@node-expand="handleNodeExpand"> @node-expand="handleNodeExpand">
</el-tree-node> </el-tree-node>
<div class="el-tree__empty-block" v-if="isEmpty"> <div class="el-tree__empty-block" v-if="isEmpty">
@ -135,8 +137,10 @@
children: { children: {
set(value) { set(value) {
this.data = value; this.data = value;
console.log(this.data)
}, },
get() { get() {
console.log(this.data)
return this.data; return this.data;
} }
}, },
@ -484,6 +488,7 @@
}, },
mounted() { mounted() {
console.log(this.data)
this.initTabIndex(); this.initTabIndex();
this.$el.addEventListener('keydown', this.handleKeydown); this.$el.addEventListener('keydown', this.handleKeydown);
}, },

@ -148,7 +148,6 @@
}); });
// quill // quill
this.Quill.on('text-change', (delta, oldDelta, source) => { this.Quill.on('text-change', (delta, oldDelta, source) => {
console.log(this.Quill)
this.$emit('on-text-change', delta, oldDelta, source); this.$emit('on-text-change', delta, oldDelta, source);
}); });
this.Quill.on('selection-change', (range, oldRange, source) => { this.Quill.on('selection-change', (range, oldRange, source) => {

@ -385,54 +385,14 @@ export default {
lcJudgmentPoint: judgmentPoint, lcJudgmentPoint: judgmentPoint,
lcJudgmentRuleList: judgmentRuleList lcJudgmentRuleList: judgmentRuleList
}; };
this.anewPosttingData(judgmentRuleList)
//
let length = judgmentRuleList.length;
let tempArr = [];
console.log(judgmentRuleList)
judgmentRuleList.forEach((item, index) => {
let obj = {
...item,
isSubject: true,
isDisabled: true, //
isSave: true //
};
//(1 2 3 4 5)
if (item.type == 1 || item.type == 2) {
obj.subjectId = Number(item.emptyOne);
obj.value1 = item.itemId;
} else if (item.type == 3) {
obj.subjectId = Number(item.emptyOne);
obj.value1 = item.emptyTwo;
} else if (item.type == 4) {
// id
if (item.emptyOne === "无限制") {
obj.value1 = item.emptyOne;
obj.value2 = "";
} else {
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) {
obj.subjectId = Number(item.emptyOne);
obj.value2 = item.emptyTwo[0];
obj.value3 = item.emptyTwo.substring(1, item.emptyTwo.indexOf("~"));
obj.value4 = item.emptyTwo.substring(item.emptyTwo.indexOf("~") + 1, item.emptyTwo.length - 1);
obj.value5 = item.emptyTwo[item.emptyTwo.length - 1];
}
tempArr.push(obj);
if (length > 1 && index !== (length - 1)) {
tempArr.push({ruleOperation: item.ruleOperation});
}
this.tableData = tempArr;
});
this.tableData.forEach(async (item, index) => { this.tableData.forEach(async (item, index) => {
// //
if (item.operationIds) { if (item.operationIds) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
// this.scrollToDepTree(item.operationIds)
}); });
} }
// id, // id,
@ -448,6 +408,48 @@ export default {
console.log(err); console.log(err);
}); });
}, },
//
anewPosttingData(judgmentRuleList){
let length = judgmentRuleList.length;
let tempArr = [];
judgmentRuleList.forEach((item, index) => {
let obj = {
...item,
isSubject: true,
isDisabled: true, //
isSave: true //
};
//(1 2 3 4 5)
if (item.type == 1 || item.type == 2) {
obj.subjectId = Number(item.emptyOne);
obj.value1 = item.itemId;
} else if (item.type == 3) {
obj.subjectId = Number(item.emptyOne);
obj.value1 = item.emptyTwo;
} else if (item.type == 4) {
// id
if (item.emptyOne === "无限制") {
obj.value1 = item.emptyOne;
obj.value2 = "";
} else {
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) {
obj.subjectId = Number(item.emptyOne);
obj.value2 = item.emptyTwo[0];
obj.value3 = item.emptyTwo.substring(1, item.emptyTwo.indexOf("~"));
obj.value4 = item.emptyTwo.substring(item.emptyTwo.indexOf("~") + 1, item.emptyTwo.length - 1);
obj.value5 = item.emptyTwo[item.emptyTwo.length - 1];
}
tempArr.push(obj);
if (length > 1 && index !== (length - 1)) {
tempArr.push({ruleOperation: item.ruleOperation});
}
this.tableData = tempArr;
});
},
getSubjectData(subjectId, index) { // getSubjectData(subjectId, index) { //
this.$get(`${this.api.getSubjectInfo}?subject_id=${subjectId}`).then(res => { this.$get(`${this.api.getSubjectInfo}?subject_id=${subjectId}`).then(res => {
if (res.status === 200) { if (res.status === 200) {
@ -488,7 +490,7 @@ export default {
if (res.status === 200 && res.list) { if (res.status === 200 && res.list) {
if (res.list.length) { if (res.list.length) {
this.treeData = this.toTreeId(res.list, res.list[0].parentId); this.treeData = this.toTreeId(res.list, res.list[0].parentId);
console.log(this.treeData) // console.log(this.treeData)
} }
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
@ -630,6 +632,8 @@ export default {
this.isAddRule = true; this.isAddRule = true;
// this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""}); // this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""});
this.tableData.push({ this.tableData.push({
ruleOperation: 0
},{
indexNo: this.tableData.length +1, indexNo: this.tableData.length +1,
isSubject: true, isSubject: true,
isDisabled: false, // isDisabled: false, //
@ -645,6 +649,7 @@ export default {
value5: "" value5: ""
}); });
console.log(this.tableData) console.log(this.tableData)
// anewPosttingData(judgmentRuleList)
}, },
changeResult(row) { // (0 1 0) changeResult(row) { // (0 1 0)
row.resultOperation = row.resultOperation === 0 ? 1 : 0; row.resultOperation = row.resultOperation === 0 ? 1 : 0;
@ -713,7 +718,7 @@ export default {
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]); this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]);
} }
} else { } else {
this.tableData.splice(index, 1); this.tableData.splice(index-1, 2);
// index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); // index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
this.isAddRule = false; this.isAddRule = false;
} }
@ -728,7 +733,7 @@ export default {
// if(index+1 == this.tableData.length){ // if(index+1 == this.tableData.length){
// index = index-1 // index = index-1
// } // }
this.tableData.splice(index,1); this.tableData.splice(index,2);
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
this.itemkey = Math.random() this.itemkey = Math.random()
this.tableData.forEach(async (item, index) => { this.tableData.forEach(async (item, index) => {

Loading…
Cancel
Save