Merge branch 'master-500-dev-lushangqing' into 'master-500-dev'
【无】机构用户树组件-是否任意级别可选择 #4 See merge request !1026
Showing
2 changed files
with
26 additions
and
24 deletions
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | @change="change" | 9 | @change="change" |
10 | lazy | 10 | lazy |
11 | :load="load" | 11 | :load="load" |
12 | - check-strictly | 12 | + :check-strictly="checkStrictly" |
13 | :render-after-expand="false" | 13 | :render-after-expand="false" |
14 | > | 14 | > |
15 | <template #default="{ node, data }"> | 15 | <template #default="{ node, data }"> |
@@ -45,6 +45,11 @@ export default { | @@ -45,6 +45,11 @@ export default { | ||
45 | filterable:{ | 45 | filterable:{ |
46 | type:Boolean, | 46 | type:Boolean, |
47 | default:false | 47 | default:false |
48 | + }, | ||
49 | + //是否任意级别被选择 | ||
50 | + checkStrictly:{ | ||
51 | + type:Boolean, | ||
52 | + default:false | ||
48 | } | 53 | } |
49 | 54 | ||
50 | }, | 55 | }, |
@@ -80,34 +85,31 @@ export default { | @@ -80,34 +85,31 @@ export default { | ||
80 | } | 85 | } |
81 | }) | 86 | }) |
82 | } | 87 | } |
83 | - let id = 0 | ||
84 | 88 | ||
85 | const load = (node, resolve) => { | 89 | const load = (node, resolve) => { |
86 | if (node.isLeaf) return resolve([]) | 90 | if (node.isLeaf) return resolve([]) |
87 | if(node.data.type && node.data.type=='org'){ | 91 | 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; | ||
99 | - } | ||
100 | - if (arr.length > 0) { | ||
101 | - arr.map(item => { | ||
102 | - item.name = item.nickname; | ||
103 | - item.type = 'user'; | ||
104 | - item.value=item.username; | ||
105 | - }) | ||
106 | - } | ||
107 | - resolve(arr) | ||
108 | - }) | 92 | + if(node.data.type && node.data.type=='org') { |
93 | + let param = { | ||
94 | + page: 1, | ||
95 | + limit: 99999, | ||
96 | + orgId: node.data.value | ||
109 | } | 97 | } |
110 | - // }, 100) | 98 | + proxy.$http.get(`/api-user/users`, param, function (res) { |
99 | + let arr = []; | ||
100 | + if (res && res.data) { | ||
101 | + arr = res.data; | ||
102 | + } | ||
103 | + if (arr.length > 0) { | ||
104 | + arr.map(item => { | ||
105 | + item.name = item.nickname; | ||
106 | + item.type = 'user'; | ||
107 | + item.value=item.username; | ||
108 | + }) | ||
109 | + } | ||
110 | + resolve(arr) | ||
111 | + }) | ||
112 | + } | ||
111 | }else{ | 113 | }else{ |
112 | resolve([]) | 114 | resolve([]) |
113 | } | 115 | } |
-
Please register or login to post a comment