Parcourir la source

用户批量启用禁用

deason il y a 4 ans
Parent
commit
9c30b4b3ad
1 fichiers modifiés avec 23 ajouts et 1 suppressions
  1. 23 1
      src/modules/basic/view/user.vue

+ 23 - 1
src/modules/basic/view/user.vue

@@ -92,7 +92,26 @@
         </el-form>
 
         <div class="block-seperator"></div>
+        <span>批量操作:</span>
 
+        <el-button
+          size="small"
+          type="success"
+          icon="el-icon-check"
+          :disabled="noBatchSelected"
+          @click="enableByIds"
+          >启用
+        </el-button>
+        <el-button
+          size="small"
+          type="danger"
+          icon="el-icon-close"
+          :disabled="noBatchSelected"
+          @click="disableByIds"
+          >禁用
+        </el-button>
+
+        <div class="block-seperator"></div>
         <!-- 添加用户信息弹出框 -->
         <el-dialog title="新增用户" width="450px" :visible.sync="addingDialog">
           <el-form
@@ -360,6 +379,7 @@
           style="width: 100%;"
           @selection-change="selectChange"
         >
+          <el-table-column type="selection" width="50"></el-table-column>
           <el-table-column prop="id" width="80" label="ID" />
           <el-table-column prop="name" width="120" label="姓名" />
           <el-table-column prop="loginName" width="100" label="登录名" />
@@ -598,6 +618,9 @@ export default {
       }
       return userIds;
     },
+    noBatchSelected() {
+      return this.selectedUserIds.length === 0;
+    },
     roleList4InsertOrUpdateWithoutSuperAdmin() {
       return this.roleList4InsertOrUpdate.filter(
         item => item.roleCode != "SUPER_ADMIN"
@@ -997,7 +1020,6 @@ export default {
         });
       });
     },
-
     /*初始化*/
     init() {
       this.searchForm.rootOrgId = this.user.rootOrgId;