Commit 7864653c0378991f8cacf5bfe077b7d3bf58c0be
1 parent
91d12a91
规范变量、参数命名
Showing
3 changed files
with
60 additions
and
60 deletions
ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 | @expand="onExpand" |
21 | 21 | @select="onTreeNodeSelect" |
22 | 22 | :selectedKeys="selectedKeys" |
23 | - :expandedKeys="expandedKeysss" | |
23 | + :expandedKeys="expandedKeys" | |
24 | 24 | :checkStrictly="checkStrictly"> |
25 | 25 | <span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}"> |
26 | 26 | {{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon> |
... | ... | @@ -34,14 +34,14 @@ |
34 | 34 | <a-form-item label='所拥有的权限'> |
35 | 35 | <a-tree |
36 | 36 | checkable |
37 | - @check="onCheck2" | |
38 | - :checkedKeys="checkedKeys2" | |
39 | - :treeData="treeData2" | |
40 | - @expand="onExpand2" | |
41 | - @select="onTreeNodeSelect2" | |
42 | - :selectedKeys="selectedKeys2" | |
43 | - :expandedKeys="expandedKeysss2" | |
44 | - :checkStrictly="checkStrictly2"> | |
37 | + @check="dataOnCheck" | |
38 | + :checkedKeys="dataCheckedKeys" | |
39 | + :treeData="dataTreeData" | |
40 | + @expand="dataOnExpand" | |
41 | + @select="dataOnTreeNodeSelect" | |
42 | + :selectedKeys="dataSelectedKeys" | |
43 | + :expandedKeys="dataExpandedKeys" | |
44 | + :checkStrictly="dataCheckStrictly"> | |
45 | 45 | <span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}"> |
46 | 46 | {{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon> |
47 | 47 | </span> |
... | ... | @@ -100,19 +100,19 @@ export default { |
100 | 100 | defaultCheckedKeys: [], |
101 | 101 | selectedKeys: [], |
102 | 102 | checkedKeys: [], |
103 | - expandedKeysss: [], | |
103 | + expandedKeys: [], | |
104 | 104 | allTreeKeys: [], |
105 | 105 | autoExpandParent: true, |
106 | 106 | checkStrictly: true, |
107 | 107 | |
108 | - treeData2: [], | |
109 | - defaultCheckedKeys2: [], | |
110 | - selectedKeys2: [], | |
111 | - checkedKeys2: [], | |
112 | - expandedKeysss2: [], | |
113 | - allTreeKeys2: [], | |
114 | - autoExpandParent2: true, | |
115 | - checkStrictly2: true, | |
108 | + dataTreeData: [], | |
109 | + dataDefaultCheckedKeys: [], | |
110 | + dataSelectedKeys: [], | |
111 | + dataCheckedKeys: [], | |
112 | + dataExpandedKeys: [], | |
113 | + dataAllTreeKeys: [], | |
114 | + dataAutoExpandParent: true, | |
115 | + dataCheckStrictly: true, | |
116 | 116 | } |
117 | 117 | }, |
118 | 118 | methods: { |
... | ... | @@ -122,11 +122,11 @@ export default { |
122 | 122 | } |
123 | 123 | this.$refs.datarule.show(this.selectedKeys[0], this.roleId) |
124 | 124 | }, |
125 | - onTreeNodeSelect2(id) { | |
125 | + dataOnTreeNodeSelect(id) { | |
126 | 126 | if (id && id.length > 0) { |
127 | - this.selectedKeys2 = id | |
127 | + this.dataSelectedKeys = id | |
128 | 128 | } |
129 | - this.$refs.datarule.show(this.selectedKeys2[0], this.roleId) | |
129 | + this.$refs.datarule.show(this.dataSelectedKeys[0], this.roleId) | |
130 | 130 | }, |
131 | 131 | onCheck(o) { |
132 | 132 | if (this.checkStrictly) { |
... | ... | @@ -135,11 +135,11 @@ export default { |
135 | 135 | this.checkedKeys = o |
136 | 136 | } |
137 | 137 | }, |
138 | - onCheck2(o) { | |
139 | - if (this.checkStrictly2) { | |
140 | - this.checkedKeys2 = o.checked | |
138 | + dataOnCheck(o) { | |
139 | + if (this.dataCheckStrictly) { | |
140 | + this.dataCheckedKeys = o.checked | |
141 | 141 | } else { |
142 | - this.checkedKeys2 = o | |
142 | + this.dataCheckedKeys = o | |
143 | 143 | } |
144 | 144 | }, |
145 | 145 | show(roleId) { |
... | ... | @@ -152,36 +152,36 @@ export default { |
152 | 152 | this.visible = false |
153 | 153 | }, |
154 | 154 | onExpand(expandedKeys) { |
155 | - this.expandedKeysss = expandedKeys | |
155 | + this.expandedKeys = expandedKeys | |
156 | 156 | this.autoExpandParent = false |
157 | 157 | }, |
158 | - onExpand2(expandedKeys) { | |
159 | - this.expandedKeysss2 = expandedKeys | |
160 | - this.autoExpandParent2 = false | |
158 | + dataOnExpand(expandedKeys) { | |
159 | + this.dataExpandedKeys = expandedKeys | |
160 | + this.dataAutoExpandParent = false | |
161 | 161 | }, |
162 | 162 | reset() { |
163 | - this.expandedKeysss = [] | |
164 | - this.expandedKeysss2 = [] | |
163 | + this.expandedKeys = [] | |
164 | + this.dataExpandedKeys = [] | |
165 | 165 | this.checkedKeys = [] |
166 | - this.checkedKeys2 = [] | |
166 | + this.dataCheckedKeys = [] | |
167 | 167 | this.defaultCheckedKeys = [] |
168 | - this.defaultCheckedKeys2 = [] | |
168 | + this.dataDefaultCheckedKeys = [] | |
169 | 169 | this.loading = false |
170 | 170 | }, |
171 | 171 | expandAll() { |
172 | 172 | let activeKey = this.activeKey |
173 | 173 | if (activeKey === '1') { |
174 | - this.expandedKeysss = this.allTreeKeys | |
174 | + this.expandedKeys = this.allTreeKeys | |
175 | 175 | } else if (activeKey === '2') { |
176 | - this.expandedKeysss2 = this.allTreeKeys2 | |
176 | + this.dataExpandedKeys = this.dataAllTreeKeys | |
177 | 177 | } |
178 | 178 | }, |
179 | 179 | closeAll() { |
180 | 180 | let activeKey = this.activeKey |
181 | 181 | if (activeKey === '1') { |
182 | - this.expandedKeysss = [] | |
182 | + this.expandedKeys = [] | |
183 | 183 | } else if (activeKey === '2') { |
184 | - this.expandedKeysss2 = [] | |
184 | + this.dataExpandedKeys = [] | |
185 | 185 | } |
186 | 186 | }, |
187 | 187 | checkALL() { |
... | ... | @@ -189,7 +189,7 @@ export default { |
189 | 189 | if (activeKey === '1') { |
190 | 190 | this.checkedKeys = this.allTreeKeys |
191 | 191 | } else if (activeKey === '2') { |
192 | - this.checkedKeys2 = this.allTreeKeys2 | |
192 | + this.dataCheckedKeys = this.dataAllTreeKeys | |
193 | 193 | } |
194 | 194 | }, |
195 | 195 | cancelCheckALL() { |
... | ... | @@ -197,7 +197,7 @@ export default { |
197 | 197 | if (activeKey === '1') { |
198 | 198 | this.checkedKeys = [] |
199 | 199 | } else if (activeKey === '2') { |
200 | - this.checkedKeys2 = [] | |
200 | + this.dataCheckedKeys = [] | |
201 | 201 | } |
202 | 202 | }, |
203 | 203 | switchCheckStrictly(v) { |
... | ... | @@ -206,13 +206,13 @@ export default { |
206 | 206 | if (activeKey === '1') { |
207 | 207 | this.checkStrictly = false |
208 | 208 | } else if (activeKey === '2') { |
209 | - this.checkStrictly2 = false | |
209 | + this.dataCheckStrictly = false | |
210 | 210 | } |
211 | 211 | } else if (v === 2) { |
212 | 212 | if (activeKey === '1') { |
213 | 213 | this.checkStrictly = true |
214 | 214 | } else if (activeKey === '2') { |
215 | - this.checkStrictly2 = true | |
215 | + this.dataCheckStrictly = true | |
216 | 216 | } |
217 | 217 | } |
218 | 218 | }, |
... | ... | @@ -224,9 +224,9 @@ export default { |
224 | 224 | let params = { |
225 | 225 | roleId: that.roleId, |
226 | 226 | permissionIds: that.checkedKeys.join(','), |
227 | - lastpermissionIds: that.defaultCheckedKeys.join(','), | |
228 | - permissionIds2: that.checkedKeys2.join(','), | |
229 | - lastpermissionIds2: that.defaultCheckedKeys2.join(',') | |
227 | + lastPermissionIds: that.defaultCheckedKeys.join(','), | |
228 | + dataPermissionIds: that.dataCheckedKeys.join(','), | |
229 | + dataLastPermissionIds: that.dataDefaultCheckedKeys.join(',') | |
230 | 230 | } |
231 | 231 | that.loading = true |
232 | 232 | saveRolePermission(params).then((res) => { |
... | ... | @@ -249,25 +249,25 @@ export default { |
249 | 249 | loadData() { |
250 | 250 | queryTreeListForRole().then((res) => { |
251 | 251 | this.treeData = res.result.treeList |
252 | - this.treeData2 = res.result.treeList2 | |
252 | + this.dataTreeData = res.result.dataTreeList | |
253 | 253 | this.allTreeKeys = res.result.ids |
254 | - this.allTreeKeys2 = res.result.ids2 | |
254 | + this.dataAllTreeKeys = res.result.dataIds | |
255 | 255 | queryRolePermission({ roleId: this.roleId }).then((res) => { |
256 | 256 | this.checkedKeys = [...res.result.permissionIds] |
257 | 257 | this.defaultCheckedKeys = [...res.result.permissionIds] |
258 | - this.checkedKeys2 = [...res.result.dataPermissionIds] | |
259 | - this.defaultCheckedKeys2 = [...res.result.dataPermissionIds] | |
260 | - //this.expandedKeysss = this.allTreeKeys 注释为了加载数据后,控件不展开 | |
258 | + this.dataCheckedKeys = [...res.result.dataPermissionIds] | |
259 | + this.dataDefaultCheckedKeys = [...res.result.dataPermissionIds] | |
260 | + //this.expandedKeys = this.allTreeKeys 注释为了加载数据后,控件不展开 | |
261 | 261 | }) |
262 | 262 | }) |
263 | 263 | |
264 | 264 | /*queryDataTreeListForRole().then((res) => { |
265 | - this.treeData2 = res.result.treeList | |
266 | - this.allTreeKeys2 = res.result.ids | |
265 | + this.dataTreeData = res.result.treeList | |
266 | + this.dataAllTreeKeys = res.result.ids | |
267 | 267 | queryRoleDataPermission({ roleId: this.roleId }).then((res) => { |
268 | - this.checkedKeys2 = [...res.result] | |
269 | - this.defaultCheckedKeys2 = [...res.result] | |
270 | - //this.expandedKeysss = this.allTreeKeys2 注释为了加载数据后,控件不展开 | |
268 | + this.dataCheckedKeys = [...res.result] | |
269 | + this.dataDefaultCheckedKeys = [...res.result] | |
270 | + //this.expandedKeys = this.dataAllTreeKeys 注释为了加载数据后,控件不展开 | |
271 | 271 | }) |
272 | 272 | })*/ |
273 | 273 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
... | ... | @@ -480,11 +480,11 @@ public class SysPermissionController { |
480 | 480 | try { |
481 | 481 | String roleId = json.getString("roleId"); |
482 | 482 | String permissionIds = json.getString("permissionIds"); |
483 | - String lastPermissionIds = json.getString("lastpermissionIds"); | |
483 | + String lastPermissionIds = json.getString("lastPermissionIds"); | |
484 | 484 | this.sysRolePermissionService.saveRolePermission(roleId, permissionIds, lastPermissionIds); |
485 | - String permissionIds2 = json.getString("permissionIds2"); | |
486 | - String lastPermissionIds2 = json.getString("lastpermissionIds2"); | |
487 | - sysRoleDataPermissionService.saveRoleDataPermission(roleId, permissionIds2, lastPermissionIds2); | |
485 | + String dataPermissionIds = json.getString("dataPermissionIds"); | |
486 | + String dataLastPermissionIds = json.getString("dataLastPermissionIds"); | |
487 | + sysRoleDataPermissionService.saveRoleDataPermission(roleId, dataPermissionIds, dataLastPermissionIds); | |
488 | 488 | result.success("保存成功!"); |
489 | 489 | log.info("======角色授权成功=====耗时:{}毫秒", System.currentTimeMillis() - start); |
490 | 490 | } catch (Exception e) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java
... | ... | @@ -385,8 +385,8 @@ public class SysRoleController { |
385 | 385 | Map<String, Object> resMap = new HashMap<>(); |
386 | 386 | resMap.put("treeList", treeList); // 全部菜单树节点数据 |
387 | 387 | resMap.put("ids", ids);// 全部菜单树ids |
388 | - resMap.put("treeList2", dataTreeList); // 全部数据树节点数据 | |
389 | - resMap.put("ids2", dataIds);// 全部数据树ids | |
388 | + resMap.put("dataTreeList", dataTreeList); // 全部数据树节点数据 | |
389 | + resMap.put("dataIds", dataIds);// 全部数据树ids | |
390 | 390 | result.setResult(resMap); |
391 | 391 | result.setSuccess(true); |
392 | 392 | } catch (Exception e) { |
... | ... |