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. 53
      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,11 +385,33 @@ export default {
lcJudgmentPoint: judgmentPoint, lcJudgmentPoint: judgmentPoint,
lcJudgmentRuleList: judgmentRuleList lcJudgmentRuleList: judgmentRuleList
}; };
this.anewPosttingData(judgmentRuleList)
this.tableData.forEach(async (item, index) => {
//
if (item.operationIds) {
this.$nextTick(() => {
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
// this.scrollToDepTree(item.operationIds)
});
}
// id,
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) {
await this.getSubjectData(item.emptyOne, index);
}
});
} else {
this.$message.warning(res.message);
}
}).catch(err => {
console.log(err);
});
},
// //
anewPosttingData(judgmentRuleList){
let length = judgmentRuleList.length; let length = judgmentRuleList.length;
let tempArr = []; let tempArr = [];
console.log(judgmentRuleList)
judgmentRuleList.forEach((item, index) => { judgmentRuleList.forEach((item, index) => {
let obj = { let obj = {
...item, ...item,
@ -427,26 +449,6 @@ export default {
} }
this.tableData = tempArr; this.tableData = tempArr;
}); });
this.tableData.forEach(async (item, index) => {
//
if (item.operationIds) {
this.$nextTick(() => {
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
});
}
// id,
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) {
await this.getSubjectData(item.emptyOne, index);
}
});
} else {
this.$message.warning(res.message);
}
}).catch(err => {
console.log(err);
});
}, },
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 => {
@ -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