瀏覽代碼

处理分组

wukai 2 年之前
父節點
當前提交
88104e203e
共有 5 個文件被更改,包括 567 次插入444 次删除
  1. 46 1
      src/api/doc/groupUser.js
  2. 213 230
      src/router/index.js
  3. 8 1
      src/views/doc/group/index.vue
  4. 161 212
      src/views/doc/groupUser/index.vue
  5. 139 0
      src/views/doc/groupUser/selectUser.vue

+ 46 - 1
src/api/doc/groupUser.js

@@ -41,4 +41,49 @@ export function delGroupUser(groupId) {
     url: '/doc/groupUser/' + groupId,
     method: 'delete'
   })
-}
+}
+
+// 查询角色已授权用户列表
+export function allocatedUserList(query) {
+  return request({
+    url: '/doc/groupUser/allocatedList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询角色未授权用户列表
+export function unallocatedUserList(query) {
+  return request({
+    url: '/doc/groupUser/unallocatedList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 取消用户授权角色
+export function groupUserCancel(data) {
+  return request({
+    url: '/doc/groupUser/cancel',
+    method: 'put',
+    data: data
+  })
+}
+
+// 批量取消用户授权角色
+export function groupUserCancelAll(data) {
+  return request({
+    url: '/doc/groupUser/cancelAll',
+    method: 'put',
+    params: data
+  })
+}
+
+// 授权用户选择
+export function groupUserSelectAll(data) {
+  return request({
+    url: '/doc/groupUser/selectAll',
+    method: 'put',
+    params: data
+  })
+}

+ 213 - 230
src/router/index.js

@@ -30,239 +30,222 @@ import Layout from '@/layout'
 
 // 公共路由
 export const constantRoutes = [{
-    path: '/redirect',
-    component: Layout,
-    hidden: true,
-    children: [{
-      path: '/redirect/:path(.*)',
-      component: () => import('@/views/redirect')
-    }]
-  },
-  {
-    path: '/login',
-    component: () => import('@/views/login'),
-    hidden: true
-  },
-  {
-    path: '/register',
-    component: () => import('@/views/register'),
-    hidden: true
-  },
-  {
-    path: '/404',
-    component: () => import('@/views/error/404'),
-    hidden: true
-  },
-  {
-    path: '/401',
-    component: () => import('@/views/error/401'),
-    hidden: true
-  },
-  {
-    path: '',
-    component: Layout,
-    redirect: 'index',
-    children: [{
-      path: 'index',
-      component: () => import('@/views/index'),
-      name: 'Index',
-      meta: {
-        title: '首页',
-        icon: 'dashboard',
-        affix: true
-      }
-    }]
-  },
-  {
-    path: '/user',
-    component: Layout,
-    hidden: true,
-    redirect: 'noredirect',
-    children: [{
-      path: 'profile',
-      component: () => import('@/views/system/user/profile/index'),
-      name: 'Profile',
-      meta: {
-        title: '个人中心',
-        icon: 'user'
-      }
-    }]
-  },
-  {
-    path: '/home',
-    component: () => import('@/views1/HomeView.vue'),
-    hidden: true,
-    children: [{
-        path: "/home/page",
-        component: () => import('@/views1/Page/PageView.vue')
-      },
-      {
-        path: "/home/retrieval",
-        component: () => import('@/views1/Retrieval/RetrievalView.vue')
-      },
-      {
-        path: "/home/retrieval/list",
-        component: () => import('@/views1/Retrieval/List/ListView.vue')
-      },
-      {
-        path: "/home/file",
-        component: () => import('@/views1/File/FileView.vue')
-      },
-      {
-        path: "/home/file/part",
-        component: () => import('@/views1/File/Part/PartView.vue')
-      },
-      {
-        path: "/home/file/publi",
-        component: () => import('@/views1/File/Publi/PublicView.vue')
-      },
-      {
-        path: "/home/file/individual",
-        component: () => import('@/views1/File/Individual/IndividualView.vue')
-      },
-      {
-        path: "/home/file/set",
-        component: () => import('@/views1/File/Set/SetView.vue')
-      },
-      {
-        path: "/home/personal",
-        component: () => import('@/views1/Personal/PersonalView.vue')
-      },
-      {
-        path: "/home/personal/classify",
-        component: () => import('@/views1/Personal/Classify/ClassifyView.vue')
-      },
-      {
-        path: "/home/personal/space",
-        component: () => import('@/views1/Personal/Space/SpaceView.vue')
-      },
-      {
-        path: "/home/personal/modify",
-        component: () => import('@/views1/Personal/Modify/ModifyView.vue')
-      },
-      {
-        path: "/home/system",
-        component: () => import('@/views1/System/SystemView.vue')
-      },
-      {
-        path: "/home/system/organization",
-        component: () => import('@/views1/System/Organization/OrganizationView.vue')
-      },
-      {
-        path: "/home/system/user",
-        component: () => import('@/views1/System/User/UserView.vue')
-      },
-      {
-        path: "/home/system/authority",
-        component: () => import('@/views1/System/Authority/AuthorityView.vue')
-      },{
-        path: "/home/system/notes",
-        component: () => import('@/views1/System/Notes/NotesView.vue')
-      },{
-        path: "/home/system/space",
-        component: () => import('@/views1/System/Space/SpaceView.vue')
-      }
-    ],
-  },
-  {
-    path: '/login1',
-    component: () => import('@/views1/LoginView.vue'),
-    hidden: true,
-  },
-]
+  path: '/redirect',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/redirect/:path(.*)',
+    component: () => import('@/views/redirect')
+  }]
+}, {
+  path: '/login',
+  component: () => import('@/views/login'),
+  hidden: true
+}, {
+  path: '/register',
+  component: () => import('@/views/register'),
+  hidden: true
+}, {
+  path: '/404',
+  component: () => import('@/views/error/404'),
+  hidden: true
+}, {
+  path: '/401',
+  component: () => import('@/views/error/401'),
+  hidden: true
+}, {
+  path: '',
+  component: Layout,
+  redirect: 'index',
+  children: [{
+    path: 'index',
+    component: () => import('@/views/index'),
+    name: 'Index',
+    meta: {
+      title: '首页',
+      icon: 'dashboard',
+      affix: true
+    }
+  }]
+}, {
+  path: '/user',
+  component: Layout,
+  hidden: true,
+  redirect: 'noredirect',
+  children: [{
+    path: 'profile',
+    component: () => import('@/views/system/user/profile/index'),
+    name: 'Profile',
+    meta: {
+      title: '个人中心',
+      icon: 'user'
+    }
+  }]
+}, {
+  path: '/home',
+  component: () => import('@/views1/HomeView.vue'),
+  hidden: true,
+  children: [{
+    path: "/home/page",
+    component: () => import('@/views1/Page/PageView.vue')
+  }, {
+    path: "/home/retrieval",
+    component: () => import('@/views1/Retrieval/RetrievalView.vue')
+  }, {
+    path: "/home/retrieval/list",
+    component: () => import('@/views1/Retrieval/List/ListView.vue')
+  }, {
+    path: "/home/file",
+    component: () => import('@/views1/File/FileView.vue')
+  }, {
+    path: "/home/file/part",
+    component: () => import('@/views1/File/Part/PartView.vue')
+  }, {
+    path: "/home/file/publi",
+    component: () => import('@/views1/File/Publi/PublicView.vue')
+  }, {
+    path: "/home/file/individual",
+    component: () => import('@/views1/File/Individual/IndividualView.vue')
+  }, {
+    path: "/home/file/set",
+    component: () => import('@/views1/File/Set/SetView.vue')
+  }, {
+    path: "/home/personal",
+    component: () => import('@/views1/Personal/PersonalView.vue')
+  }, {
+    path: "/home/personal/classify",
+    component: () => import('@/views1/Personal/Classify/ClassifyView.vue')
+  }, {
+    path: "/home/personal/space",
+    component: () => import('@/views1/Personal/Space/SpaceView.vue')
+  }, {
+    path: "/home/personal/modify",
+    component: () => import('@/views1/Personal/Modify/ModifyView.vue')
+  }, {
+    path: "/home/system",
+    component: () => import('@/views1/System/SystemView.vue')
+  }, {
+    path: "/home/system/organization",
+    component: () => import('@/views1/System/Organization/OrganizationView.vue')
+  }, {
+    path: "/home/system/user",
+    component: () => import('@/views1/System/User/UserView.vue')
+  }, {
+    path: "/home/system/authority",
+    component: () => import('@/views1/System/Authority/AuthorityView.vue')
+  }, {
+    path: "/home/system/notes",
+    component: () => import('@/views1/System/Notes/NotesView.vue')
+  }, {
+    path: "/home/system/space",
+    component: () => import('@/views1/System/Space/SpaceView.vue')
+  }],
+}, {
+  path: '/login1',
+  component: () => import('@/views1/LoginView.vue'),
+  hidden: true,
+}, ]
 
 // 动态路由,基于用户权限动态去加载
 export const dynamicRoutes = [{
-    path: '/system/user-auth',
-    component: Layout,
-    hidden: true,
-    permissions: ['system:user:edit'],
-    children: [{
-      path: 'role/:userId(\\d+)',
-      component: () => import('@/views/system/user/authRole'),
-      name: 'AuthRole',
-      meta: {
-        title: '分配角色',
-        activeMenu: '/system/user'
-      }
-    }]
-  },
-  {
-    path: '/system/role-auth',
-    component: Layout,
-    hidden: true,
-    permissions: ['system:role:edit'],
-    children: [{
-      path: 'user/:roleId(\\d+)',
-      component: () => import('@/views/system/role/authUser'),
-      name: 'AuthUser',
-      meta: {
-        title: '分配用户',
-        activeMenu: '/system/role'
-      }
-    }]
-  },
-  {
-    path: '/system/dict-data',
-    component: Layout,
-    hidden: true,
-    permissions: ['system:dict:list'],
-    children: [{
-      path: 'index/:dictId(\\d+)',
-      component: () => import('@/views/system/dict/data'),
-      name: 'Data',
-      meta: {
-        title: '字典数据',
-        activeMenu: '/system/dict'
-      }
-    }]
-  },
-  {
-    path: '/monitor/job-log',
-    component: Layout,
-    hidden: true,
-    permissions: ['monitor:job:list'],
-    children: [{
-      path: 'index/:jobId(\\d+)',
-      component: () => import('@/views/monitor/job/log'),
-      name: 'JobLog',
-      meta: {
-        title: '调度日志',
-        activeMenu: '/monitor/job'
-      }
-    }]
-  },
-  {
-    path: '/tool/gen-edit',
-    component: Layout,
-    hidden: true,
-    permissions: ['tool:gen:edit'],
-    children: [{
-      path: 'index/:tableId(\\d+)',
-      component: () => import('@/views/tool/gen/editTable'),
-      name: 'GenEdit',
-      meta: {
-        title: '修改生成配置',
-        activeMenu: '/tool/gen'
-      }
-    }]
-  },
-  {
-    path: '/doc/oo-edit',
-    component: Layout,
-    hidden: true,
-    permissions: ['tool:gen:edit'],
-    children: [{
-      path: 'index/:docId(\\d+)',
-      component: () => import('@/views/doc/oo/edit'),
-      name: 'OoEdit',
-      meta: {
-        title: '文件在线编辑',
-        activeMenu: '/doc/info'
-      }
-    }]
-  }
-]
+  path: '/system/user-auth',
+  component: Layout,
+  hidden: true,
+  permissions: ['system:user:edit'],
+  children: [{
+    path: 'role/:userId(\\d+)',
+    component: () => import('@/views/system/user/authRole'),
+    name: 'AuthRole',
+    meta: {
+      title: '分配角色',
+      activeMenu: '/system/user'
+    }
+  }]
+}, {
+  path: '/system/role-auth',
+  component: Layout,
+  hidden: true,
+  permissions: ['system:role:edit'],
+  children: [{
+    path: 'user/:roleId(\\d+)',
+    component: () => import('@/views/system/role/authUser'),
+    name: 'AuthUser',
+    meta: {
+      title: '分配用户',
+      activeMenu: '/system/role'
+    }
+  }]
+}, {
+  path: '/system/dict-data',
+  component: Layout,
+  hidden: true,
+  permissions: ['system:dict:list'],
+  children: [{
+    path: 'index/:dictId(\\d+)',
+    component: () => import('@/views/system/dict/data'),
+    name: 'Data',
+    meta: {
+      title: '字典数据',
+      activeMenu: '/system/dict'
+    }
+  }]
+}, {
+  path: '/monitor/job-log',
+  component: Layout,
+  hidden: true,
+  permissions: ['monitor:job:list'],
+  children: [{
+    path: 'index/:jobId(\\d+)',
+    component: () => import('@/views/monitor/job/log'),
+    name: 'JobLog',
+    meta: {
+      title: '调度日志',
+      activeMenu: '/monitor/job'
+    }
+  }]
+}, {
+  path: '/tool/gen-edit',
+  component: Layout,
+  hidden: true,
+  permissions: ['tool:gen:edit'],
+  children: [{
+    path: 'index/:tableId(\\d+)',
+    component: () => import('@/views/tool/gen/editTable'),
+    name: 'GenEdit',
+    meta: {
+      title: '修改生成配置',
+      activeMenu: '/tool/gen'
+    }
+  }]
+}, {
+  path: '/doc/oo-edit',
+  component: Layout,
+  hidden: true,
+  permissions: ['doc:info:edit'],
+  children: [{
+    path: 'index/:docId(\\d+)',
+    component: () => import('@/views/doc/oo/edit'),
+    name: 'OoEdit',
+    meta: {
+      title: '文件在线编辑',
+      activeMenu: '/doc/info'
+    }
+  }]
+}, {
+  path: '/doc/group-user/',
+  component: Layout,
+  hidden: true,
+  permissions: ['doc:groupUser:edit'],
+  children: [{
+    path: 'user/:groupId(\\d+)',
+    component: () => import('@/views/doc/groupUser/index'),
+    name: 'AuthUser',
+    meta: {
+      title: '分配成员',
+      activeMenu: '/doc/group'
+    }
+  }]
+}]
 
 // 防止连续点击多次路由报错
 let routerPush = Router.prototype.push;

+ 8 - 1
src/views/doc/group/index.vue

@@ -50,6 +50,8 @@
             v-hasPermi="['doc:group:edit']">修改</el-button>
           <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
             v-hasPermi="['doc:group:remove']">删除</el-button>
+          <el-button size="mini" type="text" icon="el-icon-user" @click="handleGroupUser(scope.row)"
+            v-hasPermi="['doc:group:user']">分配成员</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -189,6 +191,11 @@
         this.open = true;
         this.title = "添加分组";
       },
+      /** 新增按钮操作 */
+      handleGroupUser(row) {
+        const groupId = row.groupId;
+        this.$router.push("/doc/group-user/user/" + groupId);
+      },
       /** 修改按钮操作 */
       handleUpdate(row) {
         this.reset();
@@ -237,4 +244,4 @@
       }
     }
   };
-</script>
+</script>

+ 161 - 212
src/views/doc/groupUser/index.vue

@@ -2,20 +2,10 @@
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="用户ID" prop="userId">
-        <el-input
-          v-model="queryParams.userId"
-          placeholder="请输入用户ID"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-input v-model="queryParams.userId" placeholder="请输入用户ID" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item label="用户姓名" prop="userName">
-        <el-input
-          v-model="queryParams.userName"
-          placeholder="请输入用户姓名"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-input v-model="queryParams.userName" placeholder="请输入用户姓名" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -25,46 +15,15 @@
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['doc:groupUser:add']"
-        >新增</el-button>
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
+          v-hasPermi="['doc:groupUser:add']">分配成员</el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['doc:groupUser:edit']"
-        >修改</el-button>
+        <el-button type="danger" plain icon="el-icon-circle-close" size="mini" :disabled="multiple"
+          @click="handleDelete" v-hasPermi="['doc:groupUser:remove']">批量取消分配</el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['doc:groupUser:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['doc:groupUser:export']"
-        >导出</el-button>
+        <el-button type="warning" plain icon="el-icon-close" size="mini" @click="handleClose">关闭</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -76,181 +35,171 @@
       <el-table-column label="用户姓名" align="center" prop="userName" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['doc:groupUser:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['doc:groupUser:remove']"
-          >删除</el-button>
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
+            v-hasPermi="['doc:groupUser:edit']">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
+            v-hasPermi="['doc:groupUser:remove']">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-    
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
 
-    <!-- 添加或修改分组成员对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="用户姓名" prop="userName">
-          <el-input v-model="form.userName" placeholder="请输入用户姓名" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
+    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+      @pagination="getList" />
+    <select-user ref="select" :groupId="queryParams.groupId" @ok="handleQuery" />
   </div>
 </template>
 
 <script>
-import { listGroupUser, getGroupUser, delGroupUser, addGroupUser, updateGroupUser } from "@/api/doc/groupUser";
-
-export default {
-  name: "GroupUser",
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 分组成员表格数据
-      groupUserList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        userId: null,
-        userName: null
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询分组成员列表 */
-    getList() {
-      this.loading = true;
-      listGroupUser(this.queryParams).then(response => {
-        this.groupUserList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
+  import {
+    listGroupUser,
+    getGroupUser,
+    delGroupUser,
+    addGroupUser,
+    updateGroupUser
+  } from "@/api/doc/groupUser";
+  import selectUser from "./selectUser";
+  export default {
+    name: "GroupUser",
+    components: {
+      selectUser
     },
-    // 表单重置
-    reset() {
-      this.form = {
-        groupId: null,
-        userId: null,
-        userName: null
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 分组成员表格数据
+        groupUserList: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          userId: null,
+          userName: null
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {}
       };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
     },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.groupId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加分组成员";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const groupId = row.groupId || this.ids
-      getGroupUser(groupId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改分组成员";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.groupId != null) {
-            updateGroupUser(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addGroupUser(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const groupIds = row.groupId || this.ids;
-      this.$modal.confirm('是否确认删除分组成员编号为"' + groupIds + '"的数据项?').then(function() {
-        return delGroupUser(groupIds);
-      }).then(() => {
+    created() {
+      const groupId = this.$route.params && this.$route.params.groupId;
+      if (groupId) {
+        this.queryParams.groupId = groupId;
         this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      }
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('doc/groupUser/export', {
-        ...this.queryParams
-      }, `groupUser_${new Date().getTime()}.xlsx`)
+    methods: {
+      // 返回按钮
+      handleClose() {
+        const obj = {
+          path: "/group/group"
+        };
+        this.$tab.closeOpenPage(obj);
+      },
+      /** 查询分组成员列表 */
+      getList() {
+        this.loading = true;
+        listGroupUser(this.queryParams).then(response => {
+          this.groupUserList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          groupId: null,
+          userId: null,
+          userName: null
+        };
+        this.resetForm("form");
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.groupId)
+        this.single = selection.length !== 1
+        this.multiple = !selection.length
+      },
+      /** 新增按钮操作 */
+      handleAdd() {
+        this.$refs.select.show();
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        const groupId = row.groupId || this.ids
+        getGroupUser(groupId).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改分组成员";
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.groupId != null) {
+              updateGroupUser(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addGroupUser(this.form).then(response => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        const groupIds = row.groupId || this.ids;
+        this.$modal.confirm('是否确认删除分组成员编号为"' + groupIds + '"的数据项?').then(function() {
+          return delGroupUser(groupIds);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      },
+      /** 导出按钮操作 */
+      handleExport() {
+        this.download('doc/groupUser/export', {
+          ...this.queryParams
+        }, `groupUser_${new Date().getTime()}.xlsx`)
+      }
     }
-  }
-};
-</script>
+  };
+</script>

+ 139 - 0
src/views/doc/groupUser/selectUser.vue

@@ -0,0 +1,139 @@
+<template>
+  <!-- 授权用户 -->
+  <el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
+      <el-form-item label="用户名称" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入用户名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="手机号码" prop="phonenumber">
+        <el-input
+          v-model="queryParams.phonenumber"
+          placeholder="请输入手机号码"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row>
+      <el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
+        <el-table-column type="selection" width="55"></el-table-column>
+        <el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
+        <el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
+        <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
+        <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
+        <el-table-column label="状态" align="center" prop="status">
+          <template slot-scope="scope">
+            <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
+          </template>
+        </el-table-column>
+        <el-table-column label="创建时间" align="center" prop="createTime" width="180">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.createTime) }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </el-row>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="handleSelectUser">确 定</el-button>
+      <el-button @click="visible = false">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { unallocatedUserList, groupUserSelectAll } from "@/api/doc/groupUser";
+export default {
+  dicts: ['sys_normal_disable'],
+  props: {
+    // 角色编号
+    groupId: {
+      type: [String]
+    }
+  },
+  data() {
+    return {
+      // 遮罩层
+      visible: false,
+      // 选中数组值
+      userIds: [],
+      // 总条数
+      total: 0,
+      // 未授权用户数据
+      userList: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        groupId: undefined,
+        // userName: undefined,
+        // phonenumber: undefined
+      }
+    };
+  },
+  methods: {
+    // 显示弹框
+    show() {
+      console.log(this.queryParams)
+      this.queryParams.groupId = parseInt(this.groupId);
+      this.getList();
+      this.visible = true;
+    },
+    clickRow(row) {
+      this.$refs.table.toggleRowSelection(row);
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.userIds = selection.map(item => item.userId);
+    },
+    // 查询表数据
+    getList() {
+      unallocatedUserList(this.queryParams).then(res => {
+        this.userList = res.rows;
+        this.total = res.total;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 选择授权用户操作 */
+    handleSelectUser() {
+      const groupId = this.queryParams.groupId;
+      const userIds = this.userIds.join(",");
+      if (userIds == "") {
+        this.$modal.msgError("请选择要分配的用户");
+        return;
+      }
+      authUserSelectAll({ groupId: groupId, userIds: userIds }).then(res => {
+        this.$modal.msgSuccess(res.msg);
+        if (res.code === 200) {
+          this.visible = false;
+          this.$emit("ok");
+        }
+      });
+    }
+  }
+};
+</script>