浏览代码

Update adminOperation.vue

lex-xin 3 年之前
父节点
当前提交
069f93544a
共有 1 个文件被更改,包括 9 次插入12 次删除
  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 halfIds = this.$refs.tree.getHalfCheckedKeys();
       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) {
-        tenantId = -1;
+        params.tenantId = -1;
       }
       if (this.pageType == "update") {
         roleUpdate({
           id: this.id,
-          organId: this.organId,
-          roleDesc: this.result.roleDesc,
-          roleName: this.result.roleName,
-          menuIds: allIds,
-          tenantId,
+          ...params
         }).then((res) => {
           this.messageTips("修改", res);
         });
       } else if (this.pageType == "create") {
         roleAdd({
-          organId: this.organId,
-          roleDesc: this.result.roleDesc,
-          roleName: this.result.roleName,
-          menuIds: allIds,
-          tenantId,
+          ...params
         }).then((res) => {
           this.messageTips("添加", res);
         });