From 7864653c0378991f8cacf5bfe077b7d3bf58c0be Mon Sep 17 00:00:00 2001
From: pengyongcheng <pyc_1215@163.com>
Date: Mon, 30 Dec 2024 11:28:44 +0800
Subject: [PATCH] 规范变量、参数命名

---
 ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue                                 | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------
 huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java |   8 ++++----
 huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java       |   4 ++--
 3 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue b/ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue
index 94ac134..29326e3 100644
--- a/ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue
+++ b/ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue
@@ -20,7 +20,7 @@
               @expand="onExpand"
               @select="onTreeNodeSelect"
               :selectedKeys="selectedKeys"
-              :expandedKeys="expandedKeysss"
+              :expandedKeys="expandedKeys"
               :checkStrictly="checkStrictly">
               <span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
                 {{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
@@ -34,14 +34,14 @@
           <a-form-item label='所拥有的权限'>
             <a-tree
               checkable
-              @check="onCheck2"
-              :checkedKeys="checkedKeys2"
-              :treeData="treeData2"
-              @expand="onExpand2"
-              @select="onTreeNodeSelect2"
-              :selectedKeys="selectedKeys2"
-              :expandedKeys="expandedKeysss2"
-              :checkStrictly="checkStrictly2">
+              @check="dataOnCheck"
+              :checkedKeys="dataCheckedKeys"
+              :treeData="dataTreeData"
+              @expand="dataOnExpand"
+              @select="dataOnTreeNodeSelect"
+              :selectedKeys="dataSelectedKeys"
+              :expandedKeys="dataExpandedKeys"
+              :checkStrictly="dataCheckStrictly">
               <span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
                 {{ slotTitle }}<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
               </span>
@@ -100,19 +100,19 @@ export default {
       defaultCheckedKeys: [],
       selectedKeys: [],
       checkedKeys: [],
-      expandedKeysss: [],
+      expandedKeys: [],
       allTreeKeys: [],
       autoExpandParent: true,
       checkStrictly: true,
 
-      treeData2: [],
-      defaultCheckedKeys2: [],
-      selectedKeys2: [],
-      checkedKeys2: [],
-      expandedKeysss2: [],
-      allTreeKeys2: [],
-      autoExpandParent2: true,
-      checkStrictly2: true,
+      dataTreeData: [],
+      dataDefaultCheckedKeys: [],
+      dataSelectedKeys: [],
+      dataCheckedKeys: [],
+      dataExpandedKeys: [],
+      dataAllTreeKeys: [],
+      dataAutoExpandParent: true,
+      dataCheckStrictly: true,
     }
   },
   methods: {
@@ -122,11 +122,11 @@ export default {
       }
       this.$refs.datarule.show(this.selectedKeys[0], this.roleId)
     },
-    onTreeNodeSelect2(id) {
+    dataOnTreeNodeSelect(id) {
       if (id && id.length > 0) {
-        this.selectedKeys2 = id
+        this.dataSelectedKeys = id
       }
-      this.$refs.datarule.show(this.selectedKeys2[0], this.roleId)
+      this.$refs.datarule.show(this.dataSelectedKeys[0], this.roleId)
     },
     onCheck(o) {
       if (this.checkStrictly) {
@@ -135,11 +135,11 @@ export default {
         this.checkedKeys = o
       }
     },
-    onCheck2(o) {
-      if (this.checkStrictly2) {
-        this.checkedKeys2 = o.checked
+    dataOnCheck(o) {
+      if (this.dataCheckStrictly) {
+        this.dataCheckedKeys = o.checked
       } else {
-        this.checkedKeys2 = o
+        this.dataCheckedKeys = o
       }
     },
     show(roleId) {
@@ -152,36 +152,36 @@ export default {
       this.visible = false
     },
     onExpand(expandedKeys) {
-      this.expandedKeysss = expandedKeys
+      this.expandedKeys = expandedKeys
       this.autoExpandParent = false
     },
-    onExpand2(expandedKeys) {
-      this.expandedKeysss2 = expandedKeys
-      this.autoExpandParent2 = false
+    dataOnExpand(expandedKeys) {
+      this.dataExpandedKeys = expandedKeys
+      this.dataAutoExpandParent = false
     },
     reset() {
-      this.expandedKeysss = []
-      this.expandedKeysss2 = []
+      this.expandedKeys = []
+      this.dataExpandedKeys = []
       this.checkedKeys = []
-      this.checkedKeys2 = []
+      this.dataCheckedKeys = []
       this.defaultCheckedKeys = []
-      this.defaultCheckedKeys2 = []
+      this.dataDefaultCheckedKeys = []
       this.loading = false
     },
     expandAll() {
       let activeKey = this.activeKey
       if (activeKey === '1') {
-        this.expandedKeysss = this.allTreeKeys
+        this.expandedKeys = this.allTreeKeys
       } else if (activeKey === '2') {
-        this.expandedKeysss2 = this.allTreeKeys2
+        this.dataExpandedKeys = this.dataAllTreeKeys
       }
     },
     closeAll() {
       let activeKey = this.activeKey
       if (activeKey === '1') {
-        this.expandedKeysss = []
+        this.expandedKeys = []
       } else if (activeKey === '2') {
-        this.expandedKeysss2 = []
+        this.dataExpandedKeys = []
       }
     },
     checkALL() {
@@ -189,7 +189,7 @@ export default {
       if (activeKey === '1') {
         this.checkedKeys = this.allTreeKeys
       } else if (activeKey === '2') {
-        this.checkedKeys2 = this.allTreeKeys2
+        this.dataCheckedKeys = this.dataAllTreeKeys
       }
     },
     cancelCheckALL() {
@@ -197,7 +197,7 @@ export default {
       if (activeKey === '1') {
         this.checkedKeys = []
       } else if (activeKey === '2') {
-        this.checkedKeys2 = []
+        this.dataCheckedKeys = []
       }
     },
     switchCheckStrictly(v) {
@@ -206,13 +206,13 @@ export default {
         if (activeKey === '1') {
           this.checkStrictly = false
         } else if (activeKey === '2') {
-          this.checkStrictly2 = false
+          this.dataCheckStrictly = false
         }
       } else if (v === 2) {
         if (activeKey === '1') {
           this.checkStrictly = true
         } else if (activeKey === '2') {
-          this.checkStrictly2 = true
+          this.dataCheckStrictly = true
         }
       }
     },
@@ -224,9 +224,9 @@ export default {
       let params = {
         roleId: that.roleId,
         permissionIds: that.checkedKeys.join(','),
-        lastpermissionIds: that.defaultCheckedKeys.join(','),
-        permissionIds2: that.checkedKeys2.join(','),
-        lastpermissionIds2: that.defaultCheckedKeys2.join(',')
+        lastPermissionIds: that.defaultCheckedKeys.join(','),
+        dataPermissionIds: that.dataCheckedKeys.join(','),
+        dataLastPermissionIds: that.dataDefaultCheckedKeys.join(',')
       }
       that.loading = true
       saveRolePermission(params).then((res) => {
@@ -249,25 +249,25 @@ export default {
     loadData() {
       queryTreeListForRole().then((res) => {
         this.treeData = res.result.treeList
-        this.treeData2 = res.result.treeList2
+        this.dataTreeData = res.result.dataTreeList
         this.allTreeKeys = res.result.ids
-        this.allTreeKeys2 = res.result.ids2
+        this.dataAllTreeKeys = res.result.dataIds
         queryRolePermission({ roleId: this.roleId }).then((res) => {
           this.checkedKeys = [...res.result.permissionIds]
           this.defaultCheckedKeys = [...res.result.permissionIds]
-          this.checkedKeys2 = [...res.result.dataPermissionIds]
-          this.defaultCheckedKeys2 = [...res.result.dataPermissionIds]
-          //this.expandedKeysss = this.allTreeKeys 注释为了加载数据后,控件不展开
+          this.dataCheckedKeys = [...res.result.dataPermissionIds]
+          this.dataDefaultCheckedKeys = [...res.result.dataPermissionIds]
+          //this.expandedKeys = this.allTreeKeys 注释为了加载数据后,控件不展开
         })
       })
 
       /*queryDataTreeListForRole().then((res) => {
-        this.treeData2 = res.result.treeList
-        this.allTreeKeys2 = res.result.ids
+        this.dataTreeData = res.result.treeList
+        this.dataAllTreeKeys = res.result.ids
         queryRoleDataPermission({ roleId: this.roleId }).then((res) => {
-          this.checkedKeys2 = [...res.result]
-          this.defaultCheckedKeys2 = [...res.result]
-          //this.expandedKeysss = this.allTreeKeys2 注释为了加载数据后,控件不展开
+          this.dataCheckedKeys = [...res.result]
+          this.dataDefaultCheckedKeys = [...res.result]
+          //this.expandedKeys = this.dataAllTreeKeys 注释为了加载数据后,控件不展开
         })
       })*/
     }
diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
index 227c84b..a30932a 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
@@ -480,11 +480,11 @@ public class SysPermissionController {
         try {
             String roleId = json.getString("roleId");
             String permissionIds = json.getString("permissionIds");
-            String lastPermissionIds = json.getString("lastpermissionIds");
+            String lastPermissionIds = json.getString("lastPermissionIds");
             this.sysRolePermissionService.saveRolePermission(roleId, permissionIds, lastPermissionIds);
-            String permissionIds2 = json.getString("permissionIds2");
-            String lastPermissionIds2 = json.getString("lastpermissionIds2");
-            sysRoleDataPermissionService.saveRoleDataPermission(roleId, permissionIds2, lastPermissionIds2);
+            String dataPermissionIds = json.getString("dataPermissionIds");
+            String dataLastPermissionIds = json.getString("dataLastPermissionIds");
+            sysRoleDataPermissionService.saveRoleDataPermission(roleId, dataPermissionIds, dataLastPermissionIds);
             result.success("保存成功!");
             log.info("======角色授权成功=====耗时:{}毫秒", System.currentTimeMillis() - start);
         } catch (Exception e) {
diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java
index 3762476..4724841 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java
@@ -385,8 +385,8 @@ public class SysRoleController {
             Map<String, Object> resMap = new HashMap<>();
             resMap.put("treeList", treeList); // 全部菜单树节点数据
             resMap.put("ids", ids);// 全部菜单树ids
-            resMap.put("treeList2", dataTreeList); // 全部数据树节点数据
-            resMap.put("ids2", dataIds);// 全部数据树ids
+            resMap.put("dataTreeList", dataTreeList); // 全部数据树节点数据
+            resMap.put("dataIds", dataIds);// 全部数据树ids
             result.setResult(resMap);
             result.setSuccess(true);
         } catch (Exception e) {
--
libgit2 0.22.2