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 ""; return "";
} }
}, },
type: {
type: String,
default () {
return "";
}
},
urlChild: { urlChild: {
type: String, type: String,
default () { default () {
@@ -169,7 +175,7 @@
if (node.level >= 1) { if (node.level >= 1) {
setTimeout(() => { setTimeout(() => {
this.getChildByList(node.data.id, resolve); this.getChildByList(node.data.level,node.data.vppsCode, resolve);
}, 500); }, 500);
return resolve([]); // 加上这个,防止在该节点没有子节点时一直转圈的问题发生。 return resolve([]); // 加上这个,防止在该节点没有子节点时一直转圈的问题发生。
} }
@@ -186,8 +192,8 @@
} }
}) })
}, },
getChildByList( _parentID,resolve) { // 获取子节点请求 getChildByList( level,vppsCode,resolve) { // 获取子节点请求
let params = {ids : _parentID}; let params = {level : level,vppsCode :vppsCode,type : this.type};
this.$http.get(this.urlChild, params, { this.$http.get(this.urlChild, params, {
_this: this _this: this
}, res => { }, res => {
@@ -200,7 +206,7 @@
}, },
loadTreeData(resolve) { loadTreeData(resolve) {
// 获取loadtreeData 就是父节点数据,getChildByList就是异步获取子节点数据 // 获取loadtreeData 就是父节点数据,getChildByList就是异步获取子节点数据
this.$http.get(this.url, '', { this.$http.get(this.url, {type : this.type}, {
_this: this _this: this
}, res => { }, res => {
if(res.data){ if(res.data){
@@ -1171,6 +1171,7 @@
:modalShowFlag="modalShowFlag2" :modalShowFlag="modalShowFlag2"
:drawerTitle="drawerTitle" :drawerTitle="drawerTitle"
:url="url" :url="url"
:type="'car'"
:urlChild="urlChild" :urlChild="urlChild"
:defaultProps="defaultCodeProps" :checkedKeys="defaultCheckedKeys1" :defaultProps="defaultCodeProps" :checkedKeys="defaultCheckedKeys1"
:nodeKey="nodeKeyCode" @popoverHide="popoverHideBusVs" @popoverHideCancel="popoverHideBusVsCancel"></tree-select-new> :nodeKey="nodeKeyCode" @popoverHide="popoverHideBusVs" @popoverHideCancel="popoverHideBusVsCancel"></tree-select-new>
@@ -1182,6 +1183,7 @@
:modalShowFlag="modalShowFlag3" :modalShowFlag="modalShowFlag3"
:drawerTitle="drawerTitle" :drawerTitle="drawerTitle"
:url="url" :url="url"
:type="'truck'"
:urlChild="urlChild" :urlChild="urlChild"
:defaultProps="defaultCodeProps" :checkedKeys="defaultCheckedKeys2" :defaultProps="defaultCodeProps" :checkedKeys="defaultCheckedKeys2"
:nodeKey="nodeKeyCode" @popoverHide="popoverHideCarVs" @popoverHideCancel="popoverHideCarVsCancel()"></tree-select-new> :nodeKey="nodeKeyCode" @popoverHide="popoverHideCarVs" @popoverHideCancel="popoverHideCarVsCancel()"></tree-select-new>