提交 827b3c18 编写于 作者: zhentian.jia's avatar zhentian.jia

fix no change tree

上级 e7864bb2
......@@ -1182,7 +1182,7 @@ export default {
//新建
} else {
//编辑
if(this.idType == 1) {
if (this.idType == 1) {
this.getAdministrative();
}
}
......@@ -1341,6 +1341,22 @@ export default {
this.updateOrganizationAndPerson(allSelectedKeys);
this.updatedTree = true;
},
getTreeCheck() {
let cData = [],
oldData = (this.treeData.length && this.treeData.slice()) || [],
checkedKeys = this.$refs.tree.getCheckedKeys(),
halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys(),
savedCheckedKeys = this.handlerCheckedData(oldData, checkedKeys).map(
key => {
return { type: 1, key: key };
}
),
savedHalfCheckedKeys = halfCheckedKeys.map(key => {
return { type: 2, key: key };
}),
allSelectedKeys = savedCheckedKeys.concat(savedHalfCheckedKeys);
return allSelectedKeys;
},
// 递归删除列表中所有子节点
delSubKeysByNode(node, checkedKeys) {
let idIndex;
......@@ -1490,7 +1506,7 @@ export default {
getKind(type) {
let kind = 0;
if (type == "administrative") {
console.log('this.updatedTree',this.updatedTree);
console.log("this.updatedTree", this.updatedTree);
if (this.tagsRegion.length > 0 && this.updatedTree == true) {
kind = 3;
}
......@@ -1552,12 +1568,24 @@ export default {
}
}
} else if (type == "administrativeUpdate") {
//console.log("allSelectedKeys", this.allSelectedKeys);
for (let i = 0; i < this.allSelectedKeys.length; i++) {
scope +=
this.allSelectedKeys[i].key + ":" + this.allSelectedKeys[i].type;
if (i < this.allSelectedKeys.length - 1) {
scope += "|";
//console.log(this.allSelectedKeys.length);
if(this.allSelectedKeys.length > 0) {
for (let i = 0; i < this.allSelectedKeys.length; i++) {
scope +=
this.allSelectedKeys[i].key + ":" + this.allSelectedKeys[i].type;
if (i < this.allSelectedKeys.length - 1) {
scope += "|";
}
}
} else {
let noChangeTree = this.getTreeCheck();
console.log(noChangeTree);
for (let i = 0; i < noChangeTree.length; i++) {
scope +=
noChangeTree[i].key + ":" + noChangeTree[i].type;
if (i < noChangeTree.length - 1) {
scope += "|";
}
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册