Quellcode durchsuchen

Update adminOperation.vue

lex-xin vor 3 Jahren
Ursprung
Commit
069f93544a
1 geänderte Dateien mit 9 neuen und 12 gelöschten Zeilen
  1. 9 12
      src/views/categroyManager/insideSetting/adminOperation.vue

+ 9 - 12
src/views/categroyManager/insideSetting/adminOperation.vue

@@ -124,28 +124,25 @@ export default {
       let tempIds = this.$refs.tree.getCheckedKeys();
       let tempIds = this.$refs.tree.getCheckedKeys();
       let halfIds = this.$refs.tree.getHalfCheckedKeys();
       let halfIds = this.$refs.tree.getHalfCheckedKeys();
       let allIds = [...tempIds, ...halfIds];
       let allIds = [...tempIds, ...halfIds];
-      let tenantId = null;
+      let params = {
+        organId: this.organId,
+        roleDesc: this.result.roleDesc,
+        roleName: this.result.roleName,
+        menuIds: allIds,
+      }
       if (this.isplatform) {
       if (this.isplatform) {
-        tenantId = -1;
+        params.tenantId = -1;
       }
       }
       if (this.pageType == "update") {
       if (this.pageType == "update") {
         roleUpdate({
         roleUpdate({
           id: this.id,
           id: this.id,
-          organId: this.organId,
-          roleDesc: this.result.roleDesc,
-          roleName: this.result.roleName,
-          menuIds: allIds,
-          tenantId,
+          ...params
         }).then((res) => {
         }).then((res) => {
           this.messageTips("修改", res);
           this.messageTips("修改", res);
         });
         });
       } else if (this.pageType == "create") {
       } else if (this.pageType == "create") {
         roleAdd({
         roleAdd({
-          organId: this.organId,
-          roleDesc: this.result.roleDesc,
-          roleName: this.result.roleName,
-          menuIds: allIds,
-          tenantId,
+          ...params
         }).then((res) => {
         }).then((res) => {
           this.messageTips("添加", res);
           this.messageTips("添加", res);
         });
         });