浏览代码

Merge branch 'dev' of http://94.191.59.107:3000/wukai/lzga-doc into dev

yxc 2 年之前
父节点
当前提交
afb3ff7252

+ 4 - 4
src/api/doc/share.js

@@ -10,9 +10,9 @@ export function listShare(query) {
 }
 
 // 查询文档分享详细
-export function getShare(shareId) {
+export function getShare(docId) {
   return request({
-    url: '/doc/share/' + shareId,
+    url: '/doc/share/' + docId,
     method: 'get'
   })
 }
@@ -36,9 +36,9 @@ export function updateShare(data) {
 }
 
 // 删除文档分享
-export function delShare(shareId) {
+export function delShare(docId) {
   return request({
-    url: '/doc/share/' + shareId,
+    url: '/doc/share/' + docId,
     method: 'delete'
   })
 }

+ 50 - 4
src/api/doc/shareAccepter.js

@@ -10,9 +10,9 @@ export function listShareAccepter(query) {
 }
 
 // 查询文档分享接收人详细
-export function getShareAccepter(shareId) {
+export function getShareAccepter(docId) {
   return request({
-    url: '/doc/shareAccepter/' + shareId,
+    url: '/doc/shareAccepter/' + docId,
     method: 'get'
   })
 }
@@ -36,9 +36,55 @@ export function updateShareAccepter(data) {
 }
 
 // 删除文档分享接收人
-export function delShareAccepter(shareId) {
+export function delShareAccepter(docId) {
   return request({
-    url: '/doc/shareAccepter/' + shareId,
+    url: '/doc/shareAccepter/' + docId,
     method: 'delete'
   })
 }
+
+// 查询角色已授权用户列表
+export function allocatedUserList(query) {
+  return request({
+    url: '/doc/shareAccepter/allocatedList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询角色未授权用户列表
+export function unallocatedUserList(query) {
+  return request({
+    url: '/doc/shareAccepter/unallocatedList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 取消用户授权角色
+export function shareUserCancel(data) {
+  return request({
+    url: '/doc/shareAccepter/cancel',
+    method: 'put',
+    data: data
+  })
+}
+
+// 批量取消用户授权角色
+export function shareUserCancelAll(data) {
+  console.log(data);
+  return request({
+    url: '/doc/shareAccepter/cancelAll',
+    method: 'put',
+    params: data
+  })
+}
+
+// 授权用户选择
+export function shareUserSelectAll(data) {
+  return request({
+    url: '/doc/shareAccepter/selectAll',
+    method: 'put',
+    params: data
+  })
+}

+ 28 - 15
src/router/index.js

@@ -30,14 +30,14 @@ import Layout from '@/layout'
 
 // 公共路由
 export const constantRoutes = [{
-  path: '/redirect',
-  component: Layout,
-  hidden: true,
-  children: [{
-    path: '/redirect/:path(.*)',
-    component: () => import('@/views/redirect')
-  }]
-},
+    path: '/redirect',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/redirect/:path(.*)',
+      component: () => import('@/views/redirect')
+    }]
+  },
   {
     path: '/login',
     component: () => import('@/views/login'),
@@ -93,9 +93,9 @@ export const constantRoutes = [{
     component: () => import('@/views1/HomeView.vue'),
     hidden: true,
     children: [{
-      path: "/home/page",
-      component: () => import('@/views1/Page/PageView.vue')
-    },
+        path: "/home/page",
+        component: () => import('@/views1/Page/PageView.vue')
+      },
       {
         path: "/home/retrieval",
         component: () => import('@/views1/Retrieval/RetrievalView.vue')
@@ -203,8 +203,7 @@ export const constantRoutes = [{
       {
         path: "/home/group/groups",
         component: () => import('@/views1/Group/Groups/GroupsView.vue')
-      }
-      ,
+      },
       {
         path: "/home/group/subgroup/:groupId",
         component: () => import('@/views1/Group/Subgroup/SubgroupView.vue')
@@ -311,12 +310,26 @@ export const dynamicRoutes = [{
   children: [{
     path: 'user/:groupId(\\d+)',
     component: () => import('@/views/doc/groupUser/index'),
-    name: 'AuthUser',
+    name: 'GroupUser',
     meta: {
       title: '分配成员',
       activeMenu: '/doc/group'
     }
   }]
+}, {
+  path: '/doc/share-user/',
+  component: Layout,
+  hidden: true,
+  permissions: ['doc:groupUser:edit'],
+  children: [{
+    path: 'user/:docId(\\d+)',
+    component: () => import('@/views/doc/shareAccepter/index'),
+    name: 'ShareUser',
+    meta: {
+      title: '分享接收者',
+      activeMenu: '/info'
+    }
+  }]
 }]
 
 // 防止连续点击多次路由报错
@@ -331,4 +344,4 @@ export default new Router({
     y: 0
   }),
   routes: constantRoutes
-})
+})

+ 6 - 3
src/views/doc/info/index.vue

@@ -235,8 +235,7 @@
       },
       //分享
       handleShare(row) {
-        row.isEdit = false;
-        this.$tab.openPage("文件[" + row.docName + "]预览", '/doc/oo-edit/index/' + row.docId, row);
+        this.$router.push("/doc/share-user/user/" + row.docId);
       },
       /**下载按钮操作*/
       handleDownload(row) {
@@ -312,6 +311,10 @@
       },
       /** 搜索按钮操作 */
       handleQuery() {
+        const para = {
+          tagId: 123
+        }
+        this.queryParams.params = para;
         this.queryParams.pageNum = 1;
         this.getList();
       },
@@ -413,4 +416,4 @@
       }
     }
   };
-</script>
+</script>

+ 59 - 22
src/views/doc/share/index.vue

@@ -9,21 +9,33 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="是否机密;1.机密  非1.一般" prop="isSecret">
+      <el-form-item label="文档年份" prop="docYear">
         <el-input
-          v-model="queryParams.isSecret"
-          placeholder="请输入是否机密;1.机密  非1.一般"
+          v-model="queryParams.docYear"
+          placeholder="请输入文档年份"
           clearable
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="是否机密;1.机密  非1.一般" prop="isSecret">
+        <el-select v-model="queryParams.isSecret" placeholder="请选择是否机密;1.机密  非1.一般" clearable>
+          <el-option
+            v-for="dict in dict.type.sys_yes_no"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="是否一次性;1.是 非1.否" prop="onlyOneTime">
-        <el-input
-          v-model="queryParams.onlyOneTime"
-          placeholder="请输入是否一次性;1.是 非1.否"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-select v-model="queryParams.onlyOneTime" placeholder="请选择是否一次性;1.是 非1.否" clearable>
+          <el-option
+            v-for="dict in dict.type.sys_yes_no"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
       </el-form-item>
       <el-form-item label="创建人" prop="createBy">
         <el-input
@@ -127,10 +139,18 @@
 
     <el-table v-loading="loading" :data="shareList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="共享ID" align="center" prop="shareId" />
       <el-table-column label="文档ID" align="center" prop="docId" />
-      <el-table-column label="是否机密;1.机密  非1.一般" align="center" prop="isSecret" />
-      <el-table-column label="是否一次性;1.是 非1.否" align="center" prop="onlyOneTime" />
+      <el-table-column label="文档年份" align="center" prop="docYear" />
+      <el-table-column label="是否机密;1.机密  非1.一般" align="center" prop="isSecret">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isSecret"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="是否一次性;1.是 非1.否" align="center" prop="onlyOneTime">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.onlyOneTime"/>
+        </template>
+      </el-table-column>
       <el-table-column label="创建人" align="center" prop="createBy" />
       <el-table-column label="创建时间" align="center" prop="createTime" width="180">
         <template slot-scope="scope">
@@ -179,11 +199,26 @@
         <el-form-item label="文档ID" prop="docId">
           <el-input v-model="form.docId" placeholder="请输入文档ID" />
         </el-form-item>
+        <el-form-item label="文档年份" prop="docYear">
+          <el-input v-model="form.docYear" placeholder="请输入文档年份" />
+        </el-form-item>
         <el-form-item label="是否机密;1.机密  非1.一般" prop="isSecret">
-          <el-input v-model="form.isSecret" placeholder="请输入是否机密;1.机密  非1.一般" />
+          <el-radio-group v-model="form.isSecret">
+            <el-radio
+              v-for="dict in dict.type.sys_yes_no"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
         </el-form-item>
         <el-form-item label="是否一次性;1.是 非1.否" prop="onlyOneTime">
-          <el-input v-model="form.onlyOneTime" placeholder="请输入是否一次性;1.是 非1.否" />
+          <el-radio-group v-model="form.onlyOneTime">
+            <el-radio
+              v-for="dict in dict.type.sys_yes_no"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
         </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" placeholder="请输入备注" />
@@ -205,6 +240,7 @@ import { listShare, getShare, delShare, addShare, updateShare } from "@/api/doc/
 
 export default {
   name: "Share",
+  dicts: ['sys_yes_no'],
   data() {
     return {
       // 遮罩层
@@ -230,6 +266,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         docId: null,
+        docYear: null,
         isSecret: null,
         onlyOneTime: null,
         createBy: null,
@@ -267,8 +304,8 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        shareId: null,
         docId: null,
+        docYear: null,
         isSecret: null,
         onlyOneTime: null,
         createBy: null,
@@ -292,7 +329,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.shareId)
+      this.ids = selection.map(item => item.docId)
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
@@ -305,8 +342,8 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const shareId = row.shareId || this.ids
-      getShare(shareId).then(response => {
+      const docId = row.docId || this.ids
+      getShare(docId).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改文档分享";
@@ -316,7 +353,7 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.shareId != null) {
+          if (this.form.docId != null) {
             updateShare(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
@@ -334,9 +371,9 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const shareIds = row.shareId || this.ids;
-      this.$modal.confirm('是否确认删除文档分享编号为"' + shareIds + '"的数据项?').then(function() {
-        return delShare(shareIds);
+      const docIds = row.docId || this.ids;
+      this.$modal.confirm('是否确认删除文档分享编号为"' + docIds + '"的数据项?').then(function() {
+        return delShare(docIds);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");

+ 203 - 195
src/views/doc/shareAccepter/index.vue

@@ -1,6 +1,20 @@
 <template>
   <div class="app-container">
+    <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form-item label="是否机密" prop="isSecret">
+        <el-switch v-model="form.isSecret" active-value="1" inactive-value="0" @change="shareChange()"> 如果选择机密,则共享用户打开时需要输入自己的用户密码才能查看。</el-switch>
+      </el-form-item>
+      <el-form-item label="阅后即焚" prop="onlyOneTime">
+        <el-switch v-model="form.onlyOneTime" active-value="1" inactive-value="0" @change="shareChange()"> 如果阅后即焚,则共享用户只能打开一次。</el-switch>
+      </el-form-item>
+    </el-form>
     <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-form-item>
+      <el-form-item label="用户姓名" prop="userName">
+        <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>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -9,225 +23,219 @@
 
     <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:shareAccepter: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:shareAccepter:edit']"
-        >修改</el-button>
+        <el-button type="danger" plain icon="el-icon-circle-close" size="mini" :disabled="multiple"
+          @click="cancelGroupUserAll" 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:shareAccepter: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:shareAccepter: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>
 
-    <el-table v-loading="loading" :data="shareAccepterList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="groupUserList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="共享ID" align="center" prop="shareId" />
-      <el-table-column label="用户ID" align="center" prop="userId" />
+      <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" 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:shareAccepter:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['doc:shareAccepter:remove']"
-          >删除</el-button>
+          <el-button size="mini" type="text" icon="el-icon-circle-close" @click="cancelGroupUser(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>
-      <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" :docId="queryParams.docId" @ok="handleQuery" />
   </div>
 </template>
 
 <script>
-import { listShareAccepter, getShareAccepter, delShareAccepter, addShareAccepter, updateShareAccepter } from "@/api/doc/shareAccepter";
+  import {
+    listShareAccepter,
+    getShareAccepter,
+    delShareAccepter,
+    addShareAccepter,
+    updateShareAccepter,
+    shareUserCancelAll
+  } from "@/api/doc/shareAccepter";
 
-export default {
-  name: "ShareAccepter",
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 文档分享接收人表格数据
-      shareAccepterList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询文档分享接收人列表 */
-    getList() {
-      this.loading = true;
-      listShareAccepter(this.queryParams).then(response => {
-        this.shareAccepterList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
+  import {
+    listShare,
+    getShare,
+    delShare,
+    addShare,
+    updateShare
+  } from "@/api/doc/share";
+
+  import selectUser from "./selectUser";
+  export default {
+    name: "GroupUser",
+    dicts: ['sys_yes_no'],
+    components: {
+      selectUser
     },
-    // 表单重置
-    reset() {
-      this.form = {
-        shareId: null,
-        userId: 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.shareId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加文档分享接收人";
     },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const shareId = row.shareId || this.ids
-      getShareAccepter(shareId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改文档分享接收人";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.shareId != null) {
-            updateShareAccepter(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addShareAccepter(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
+    created() {
+      const docId = this.$route.params && this.$route.params.docId;
+      if (docId) {
+        this.queryParams.docId = docId;
+        this.getList();
+      }
     },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const shareIds = row.shareId || this.ids;
-      this.$modal.confirm('是否确认删除文档分享接收人编号为"' + shareIds + '"的数据项?').then(function() {
-        return delShareAccepter(shareIds);
-      }).then(() => {
+    methods: {
+      shareChange() {
+        this.form.docId = this.queryParams.docId;
+        updateShare(this.form).then(response => {
+          this.$modal.msgSuccess("修改成功");
+        });
+      },
+      // 返回按钮
+      handleClose() {
+        const obj = {
+          path: "/info"
+        };
+        this.$tab.closeOpenPage(obj);
+      },
+      /** 查询分组成员列表 */
+      getList() {
+        this.loading = true;
+        getShare(this.queryParams.docId).then(response => {
+          this.form.isSecret = response.data.isSecret;
+          this.form.onlyOneTime = response.data.onlyOneTime;
+        });
+
+        listShareAccepter(this.queryParams).then(response => {
+          this.groupUserList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          docId: null,
+          userId: null,
+          userName: null
+        };
+        this.resetForm("form");
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
         this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.userId)
+        this.single = selection.length !== 1
+        this.multiple = !selection.length
+      },
+      /** 新增按钮操作 */
+      handleAdd() {
+        this.$refs.select.show();
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.docId != 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();
+              });
+            }
+          }
+        });
+      },
+      /** 删除按钮操作 */
+      cancelGroupUserAll(row) {
+        const docId = this.queryParams.docId;
+        const userIds = this.ids.join(",");
+        this.$modal.confirm('是否确认删除选中的分组成员?').then(function() {
+          return shareUserCancelAll({
+            docId: docId,
+            userIds: userIds
+          });
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      },
+      /** 删除按钮操作 */
+      cancelGroupUser(row) {
+        const docId = this.queryParams.docId;
+        const userIds = row.userId
+        this.$modal.confirm('是否确认删除分组成员"' + row.userName + '"的数据项?').then(function() {
+          return shareUserCancelAll({
+            docId: docId,
+            userIds: userIds
+          });
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      },
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('doc/shareAccepter/export', {
-        ...this.queryParams
-      }, `shareAccepter_${new Date().getTime()}.xlsx`)
-    }
-  }
-};
+  };
 </script>

+ 130 - 0
src/views/doc/shareAccepter/selectUser.vue

@@ -0,0 +1,130 @@
+<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,
+    shareUserSelectAll
+  } from "@/api/doc/shareAccepter";
+  export default {
+    dicts: ['sys_normal_disable'],
+    props: {
+      // 角色编号
+      docId: {
+        type: [String]
+      }
+    },
+    data() {
+      return {
+        // 遮罩层
+        visible: false,
+        // 选中数组值
+        userIds: [],
+        // 总条数
+        total: 0,
+        // 未授权用户数据
+        userList: [],
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          docId: undefined,
+          // userName: undefined,
+          // phonenumber: undefined
+        }
+      };
+    },
+    methods: {
+      // 显示弹框
+      show() {
+        this.queryParams.docId = this.docId;
+        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 docId = this.queryParams.docId;
+        const userIds = this.userIds.join(",");
+        if (userIds == "") {
+          this.$modal.msgError("请选择要分配的用户");
+          return;
+        }
+        shareUserSelectAll({
+          docId: docId,
+          userIds: userIds
+        }).then(res => {
+          this.$modal.msgSuccess(res.msg);
+          if (res.code === 200) {
+            this.visible = false;
+            this.$emit("ok");
+          }
+        });
+      }
+    }
+  };
+</script>