树控件自动定位到默认选中的位置bug

master
e 3 years ago
parent 502ae60db5
commit 84bad8865d
  1. 20
      src/views/Transaction.vue

@ -485,16 +485,6 @@ export default {
}); });
}, },
handleCheckChange(data, checked, indeterminate, row, index) { // handleCheckChange(data, checked, indeterminate, row, index) { //
this.checkChange.splice(index, 1, true)
this.checkChange.push(false)
let divTree = '#divTree'+index;
let dom = document.querySelector(divTree)
let depTree = '#depTree'+index;
let dom1 = document.querySelector(depTree)
let nodeHight =26
dom1.style.height = (data.number * nodeHight) + "px"
let contHeight=(data.number * nodeHight)//,
dom.scrollTo(0, contHeight)
if (checked && data.isNode === 1) { if (checked && data.isNode === 1) {
this.tableData[index].operationIds = data.id; // id this.tableData[index].operationIds = data.id; // id
// for () // for ()
@ -511,6 +501,15 @@ export default {
this.currentNodeData = {}; this.currentNodeData = {};
this.$refs[`tree-${index}`].setCheckedNodes([data]); this.$refs[`tree-${index}`].setCheckedNodes([data]);
} }
let divTree = '#divTree'+index;
let dom = document.querySelector(divTree)
let depTree = '#depTree'+index;
let dom1 = document.querySelector(depTree)
let nodeHight =26
dom.scrollTo(0, 26)
dom1.style.height = (data.number * nodeHight) + "px"
let contHeight=(data.number * nodeHight)//,
dom.scrollTo(0, contHeight)
} }
}, },
getTreeData() { // getTreeData() { //
@ -518,7 +517,6 @@ export default {
if (res.status == 200 && res.list.length>0) { if (res.status == 200 && res.list.length>0) {
if (res.list.length>0) { if (res.list.length>0) {
this.treeData = this.toTreeId(res.list, res.list[0].parentId); this.treeData = this.toTreeId(res.list, res.list[0].parentId);
console.log(this.treeData)
if (this.$route.query.lcId) { if (this.$route.query.lcId) {
this.lcId = this.$route.query.lcId; this.lcId = this.$route.query.lcId;
this.getInfoData(this.$route.query.lcId); this.getInfoData(this.$route.query.lcId);

Loading…
Cancel
Save