master
e 3 years ago
parent b9a0875540
commit ed8235ff6a
  1. 51
      src/views/Transaction.vue

@ -69,8 +69,9 @@
<template slot-scope="scope" v-if="scope.row.isSubject"> <template slot-scope="scope" v-if="scope.row.isSubject">
<p class="p">操作一致性规则用户完成的功能操作与下方设置的操作点一致</p> <p class="p">操作一致性规则用户完成的功能操作与下方设置的操作点一致</p>
<div class="tree-con"> <div class="tree-con">
<div class="block1"> <div class="block1" id="divTree">
<my-tree <my-tree
id="depTree"
class="action" class="action"
:ref="'tree-'+scope.$index" :ref="'tree-'+scope.$index"
:data="treeData" :data="treeData"
@ -388,11 +389,52 @@ export default {
this.anewPosttingData(judgmentRuleList) this.anewPosttingData(judgmentRuleList)
this.tableData.forEach(async (item, index) => { this.tableData.forEach(async (item, index) => {
// //
console.log(item.operationIds)
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.$refs.tree.setCurrentKey(item.operationIds) let currentNode = this.$refs[`tree-${index}`].getNode([item]);
let parentLevel
let nodeCount = 1//
let nodeIndex = 1//
let dataIndex; //
for ( let i=0; i<this.treeData.length; i++){
if(this.treeData[i].children !=null){//
if(this.treeData[i].children==this.treeData[i].children){ //this.orgListLine[i].orgCodeorgCodethis.orgListLine[i].orgCodeorgCode()
dataIndex =i
}
}
if(this.treeData[i].children==item.operationIds){ //
dataIndex =i
}
}
console.log(dataIndex)
let topHeight=dataIndex*20;//
if(currentNode){
let currentNodeOrgCode= currentNode&&currentNode.children.operationIds;
//nodeCountnodeIndex
do {
currentNode = currentNode.parent
parentLevel = currentNode.level
let childNodes = currentNode.childNodes
nodeCount += childNodes.length
for (let i = 0; i < childNodes.length; i ++) {
if (childNodes[i].data.children == currentNodeOrgCode) {
nodeIndex += (i + 1)
}
}
currentNodeOrgCode = currentNode.children.operationIds
}
while ( parentLevel>0)//while ( 1!=parentLevel)
let dom = document.querySelector("#divTree")
let dom1 = document.querySelector("#depTree")
//26px,
let nodeHight =26
dom1.style.height = (nodeCount * nodeHight) + "px"
let contHeight=(nodeIndex * nodeHight)+topHeight-300//,
dom.scrollTo(0, contHeight)
}
// this.scrollToDepTree(item.operationIds) // this.scrollToDepTree(item.operationIds)
}); });
} }
@ -401,13 +443,16 @@ export default {
await this.getSubjectData(item.emptyOne, index); await this.getSubjectData(item.emptyOne, index);
} }
}); });
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
},
//1.+-
scrollToDepTree(deptCode){
}, },
// //
anewPosttingData(judgmentRuleList){ anewPosttingData(judgmentRuleList){

Loading…
Cancel
Save