Merge branch 'master-500-dev-lushangqing' into 'master-500-dev'
【无】机构用户树组件 #3 See merge request !1024
Showing
2 changed files
with
23 additions
and
24 deletions
@@ -13,7 +13,6 @@ | @@ -13,7 +13,6 @@ | ||
13 | :render-after-expand="false" | 13 | :render-after-expand="false" |
14 | > | 14 | > |
15 | <template #default="{ node, data }"> | 15 | <template #default="{ node, data }"> |
16 | -<!-- //lsq 菜单类型,1:监控菜单,2:巡检菜单,3:个人工作台,4:系统菜单,5:跳转菜单,6:报表菜单 可以删除和编辑 2022-08-26--> | ||
17 | <el-tag v-if="isTag" style="height: 18px;margin-right:6px;"> | 16 | <el-tag v-if="isTag" style="height: 18px;margin-right:6px;"> |
18 | {{getTypeName(data.type)}}</el-tag> | 17 | {{getTypeName(data.type)}}</el-tag> |
19 | <span>{{ node.label }}</span> | 18 | <span>{{ node.label }}</span> |
@@ -55,6 +55,7 @@ export default { | @@ -55,6 +55,7 @@ export default { | ||
55 | const {proxy} = Vue.getCurrentInstance(); | 55 | const {proxy} = Vue.getCurrentInstance(); |
56 | let data=Vue.ref([]); | 56 | let data=Vue.ref([]); |
57 | let change=(val)=>{ | 57 | let change=(val)=>{ |
58 | + //change事件传个父组件的值 | ||
58 | emit("changeSelect",val) | 59 | emit("changeSelect",val) |
59 | } | 60 | } |
60 | //获取菜单类型 | 61 | //获取菜单类型 |
@@ -83,34 +84,33 @@ export default { | @@ -83,34 +84,33 @@ export default { | ||
83 | 84 | ||
84 | const load = (node, resolve) => { | 85 | const load = (node, resolve) => { |
85 | if (node.isLeaf) return resolve([]) | 86 | if (node.isLeaf) return resolve([]) |
86 | - | ||
87 | - setTimeout(() => { | ||
88 | - | ||
89 | - proxy.$http.get(`/api-user/users/getAll`, {}, function (res) { | ||
90 | - let arr=[]; | ||
91 | - if(res && res.data){ | ||
92 | - arr= res.data; | 87 | + if(node.data.type && node.data.type=='org'){ |
88 | + // setTimeout(() => { | ||
89 | + if(node.data.type && node.data.type=='org') { | ||
90 | + let param = { | ||
91 | + page: 1, | ||
92 | + limit: 99999, | ||
93 | + orgId: node.data.value | ||
94 | + } | ||
95 | + proxy.$http.get(`/api-user/users`, param, function (res) { | ||
96 | + let arr = []; | ||
97 | + if (res && res.data) { | ||
98 | + arr = res.data; | ||
93 | } | 99 | } |
94 | - if(arr.length>0){ | ||
95 | - arr.map(item=>{ | ||
96 | - item.name=item.nickName; | ||
97 | - item.type='user' | 100 | + if (arr.length > 0) { |
101 | + arr.map(item => { | ||
102 | + item.name = item.nickname; | ||
103 | + item.type = 'user'; | ||
104 | + item.value=item.username; | ||
98 | }) | 105 | }) |
99 | } | 106 | } |
100 | resolve(arr) | 107 | resolve(arr) |
101 | }) | 108 | }) |
102 | - /*resolve([ | ||
103 | - { | ||
104 | - value: ++id, | ||
105 | - label: `lazy load node${id}`, | ||
106 | - }, | ||
107 | - { | ||
108 | - value: ++id, | ||
109 | - label: `lazy load node${id}`, | ||
110 | - isLeaf: true, | ||
111 | - }, | ||
112 | - ])*/ | ||
113 | - }, 400) | 109 | + } |
110 | + // }, 100) | ||
111 | + }else{ | ||
112 | + resolve([]) | ||
113 | + } | ||
114 | } | 114 | } |
115 | // 监听编辑状态 | 115 | // 监听编辑状态 |
116 | Vue.watch(() => props.value, (newValue, oldVlaue) => { | 116 | Vue.watch(() => props.value, (newValue, oldVlaue) => { |
-
Please register or login to post a comment