vpps查找select组件

This commit is contained in:
zhaokaiyao@91isoft.com
2021-11-25 18:05:51 +08:00
parent 53ce91037b
commit 5c9154ee1c
2 changed files with 12 additions and 4 deletions
+10 -4
View File
@@ -43,6 +43,12 @@
return "";
}
},
type: {
type: String,
default () {
return "";
}
},
urlChild: {
type: String,
default () {
@@ -169,7 +175,7 @@
if (node.level >= 1) {
setTimeout(() => {
this.getChildByList(node.data.id, resolve);
this.getChildByList(node.data.level,node.data.vppsCode, resolve);
}, 500);
return resolve([]); // 加上这个,防止在该节点没有子节点时一直转圈的问题发生。
}
@@ -186,8 +192,8 @@
}
})
},
getChildByList( _parentID,resolve) { // 获取子节点请求
let params = {ids : _parentID};
getChildByList( level,vppsCode,resolve) { // 获取子节点请求
let params = {level : level,vppsCode :vppsCode,type : this.type};
this.$http.get(this.urlChild, params, {
_this: this
}, res => {
@@ -200,7 +206,7 @@
},
loadTreeData(resolve) {
// 获取loadtreeData 就是父节点数据,getChildByList就是异步获取子节点数据
this.$http.get(this.url, '', {
this.$http.get(this.url, {type : this.type}, {
_this: this
}, res => {
if(res.data){