master
e 3 years ago
parent a8ff72aa41
commit 9fac3e4669
  1. 89
      src/views/Transaction.vue

@ -89,19 +89,20 @@
<p class="p">操作一致性规则用户完成的功能操作与下方设置的操作点一致</p>
<div class="tree-con">
<div class="block1" :id="'divTree'+scope.$index">
<my-tree
:id="'depTree'+scope.$index"
class="action"
:ref="'tree-'+scope.$index"
:data="treeData"
:props="defaultProps"
default-expand-all
node-key="operationIds"
show-checkbox
@check-change="(data, checked, indeterminate) => {
handleCheckChange(data, checked, indeterminate, scope.row, scope.$index);
}"
></my-tree>
<el-tree :data="scope.row.operationIData" :props="defaultProp"></el-tree>
<!-- <my-tree-->
<!-- :id="'depTree'+scope.$index"-->
<!-- class="action"-->
<!-- :ref="'tree-'+scope.$index"-->
<!-- :data="treeData"-->
<!-- :props="defaultProps"-->
<!-- default-expand-all-->
<!-- node-key="operationIds"-->
<!-- show-checkbox-->
<!-- @check-change="(data, checked, indeterminate) => {-->
<!-- handleCheckChange(data, checked, indeterminate, scope.row, scope.$index);-->
<!-- }"-->
<!-- ></my-tree>-->
</div>
<div v-show="scope.row.isDisabled" class="mask"></div>
</div>
@ -370,6 +371,10 @@ export default {
children: "children",
label: "name"
}, //
defaultProp: {
children: "children",
label: "name"
}, //
currentNodeData: {}, //
formData: {
lcJudgmentPoint: {
@ -415,36 +420,23 @@ export default {
this.anewPosttingData(judgmentRuleList)
this.tableData.forEach(async (item, index) => {
//
let lists = JSON.parse(JSON.stringify(this.treeData))
if (item.operationIds) {
this.operationIData = []
let list = this.treeData
let list = lists
let idstr = item.operationIds
item.operationIData = []
let idArr = idstr.split(',')
idArr.shift()
let startId = idArr.shift()
let findOut = null
let testObj = null
for(let i=0; i<list.length; i++) {
if(list[i].id == startId) {
testObj = list[i]
findOut = this.cxk(idArr, list[i], testObj)
// item.operationIData.push(findOut)
}
}
console.log('testObj')
console.log(testObj)
this.operationIData.push(findOut)
// for (let a=0;a<this.operationIData.length;a++){
// console.log(a+1)
// this.operationIData[a].nub = 'aaa'
// }
// console.log(this.operationIData)
// console.log(item.operationIData)
// this.$nextTick(() => {
// this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
// })
item.operationIData.push(testObj)
}
// id,
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) {
@ -462,9 +454,6 @@ export default {
if(arr.length === 0) {
return obj
}
// console.log('arr')
// console.log(arr)
this.operationIData.push(obj)
let findIt = arr.shift()
let tmp = obj.children.find(item => item.id == findIt)
needObj.children = obj.children.filter(item => item.id == findIt)
@ -495,13 +484,25 @@ export default {
this.anewPosttingDatas(list)
this.tableData.forEach(async (item, index) => {
//
// item.operationIds = item.id
let lists = JSON.parse(JSON.stringify(this.treeData))
if (item.operationIds) {
this.$nextTick(() => {
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
})
let list = lists
let idstr = item.operationIds
item.operationIData = []
let idArr = idstr.split(',')
idArr.shift()
let startId = idArr.shift()
let findOut = null
let testObj = null
for(let i=0; i<list.length; i++) {
if(list[i].id == startId) {
testObj = list[i]
findOut = this.cxk(idArr, list[i], testObj)
}
})
}
item.operationIData.push(testObj)
}
});
this.configVisible = false
},
anewPosttingDatas(judgmentRuleList){
@ -864,11 +865,11 @@ export default {
row.isSave = false;
},
handleSave(row, index) { //
let keys = this.$refs[`tree-${index}`].getCheckedKeys();
// let keys = this.$refs[`tree-${index}`].getCheckedKeys();
// if(!row.operationIds){
// row.operationIds = keys[0]
// }
if (!row.operationIds) {
row.operationIds = keys[0]
}
if (!keys.length || !row.operationIds) {
this.$message.warning(`请选择操作点`);
return;
} else {
@ -915,9 +916,9 @@ export default {
this.judgePoints = false
this.$set(this.tableData, index, this.tableDataCopy[index]);
if (!this.tableData[index].operationIds) {
this.$refs[`tree-${index}`].setCheckedKeys([]);
// this.$refs[`tree-${index}`].setCheckedKeys([]);
} else {
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]);
// this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]);
}
} else {
if (index+1 == this.tableData.length){
@ -945,7 +946,7 @@ export default {
//
if (item.operationIds) {
this.$nextTick(() => {
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
// this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
});
}
// id,

Loading…
Cancel
Save