Просмотр исходного кода

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

# Conflicts:
#	lzga-ui/src/router/index.js
yxc 2 лет назад
Родитель
Сommit
123dd5a9fb

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

@@ -72,6 +72,7 @@ export function groupUserCancel(data) {
 
 // 批量取消用户授权角色
 export function groupUserCancelAll(data) {
+  console.log(data);
   return request({
     url: '/doc/groupUser/cancelAll',
     method: 'put',

+ 11 - 12
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')
@@ -218,7 +218,6 @@ export const constantRoutes = [{
   },
 ]
 
-
 // 动态路由,基于用户权限动态去加载
 export const dynamicRoutes = [{
   path: '/system/user-auth',

+ 40 - 32
src/views/doc/groupUser/index.vue

@@ -20,7 +20,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button type="danger" plain icon="el-icon-circle-close" size="mini" :disabled="multiple"
-          @click="handleDelete" v-hasPermi="['doc:groupUser:remove']">批量取消分配</el-button>
+          @click="cancelGroupUserAll" v-hasPermi="['doc:groupUser:remove']">删除成员</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button type="warning" plain icon="el-icon-close" size="mini" @click="handleClose">关闭</el-button>
@@ -30,15 +30,19 @@
 
     <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="groupId" />
-      <el-table-column label="用户ID" align="center" prop="userId" />
-      <el-table-column label="用户姓名" align="center" prop="userName" />
+      <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: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-circle-close" @click="cancelGroupUser(scope.row)"
+            v-hasPermi="['doc:groupUser:remove']">删除成员</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -55,11 +59,13 @@
     getGroupUser,
     delGroupUser,
     addGroupUser,
-    updateGroupUser
+    updateGroupUser,
+    groupUserCancelAll
   } from "@/api/doc/groupUser";
   import selectUser from "./selectUser";
   export default {
     name: "GroupUser",
+    dicts: ['sys_normal_disable'],
     components: {
       selectUser
     },
@@ -146,7 +152,7 @@
       },
       // 多选框选中数据
       handleSelectionChange(selection) {
-        this.ids = selection.map(item => item.groupId)
+        this.ids = selection.map(item => item.userId)
         this.single = selection.length !== 1
         this.multiple = !selection.length
       },
@@ -154,16 +160,6 @@
       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 => {
@@ -185,21 +181,33 @@
         });
       },
       /** 删除按钮操作 */
-      handleDelete(row) {
-        const groupIds = row.groupId || this.ids;
-        this.$modal.confirm('是否确认删除分组成员编号为"' + groupIds + '"的数据项?').then(function() {
-          return delGroupUser(groupIds);
+      cancelGroupUserAll(row) {
+        const groupId = this.queryParams.groupId;
+        const userIds = this.ids.join(",");
+        this.$modal.confirm('是否确认删除选中的分组成员?').then(function() {
+          return groupUserCancelAll({
+            groupId: groupId,
+            userIds: userIds
+          });
         }).then(() => {
           this.getList();
           this.$modal.msgSuccess("删除成功");
         }).catch(() => {});
       },
-      /** 导出按钮操作 */
-      handleExport() {
-        this.download('doc/groupUser/export', {
-          ...this.queryParams
-        }, `groupUser_${new Date().getTime()}.xlsx`)
-      }
-    }
+      /** 删除按钮操作 */
+      cancelGroupUser(row) {
+        const groupId = this.queryParams.groupId;
+        const userIds = row.userId
+        this.$modal.confirm('是否确认删除分组成员"' + row.userName + '"的数据项?').then(function() {
+          return groupUserCancelAll({
+            groupId: groupId,
+            userIds: userIds
+          });
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      },
+    },
   };
-</script>
+</script>

+ 0 - 126
src/views/doc/groupUser/oo.vue

@@ -1,126 +0,0 @@
-<!--onlyoffice 编辑器-->
-<template>
-  <div id='vabOnlyOffice'></div>
-</template>
-
-<script>
-  export default {
-    name: 'VabOnlyOffice',
-    props: {
-      option: {
-        type: Object,
-        default: () => {
-          return {}
-        },
-      },
-    },
-    data() {
-      return {
-        doctype: '',
-        docEditor: null,
-      }
-    },
-    beforeDestroy() {
-      if (this.docEditor !== null) {
-        this.docEditor.destroyEditor();
-        this.docEditor = null;
-      }
-    },
-    watch: {
-      option: {
-        handler: function(n) {
-          this.setEditor(n)
-          this.doctype = this.getFileType(n.fileType)
-        },
-        deep: true,
-      },
-    },
-    mounted() {
-      if (this.option.url) {
-        this.setEditor(this.option)
-      }
-    },
-    methods: {
-      async setEditor(option) {
-        if (this.docEditor !== null) {
-          this.docEditor.destroyEditor();
-          this.docEditor = null;
-        }
-
-        this.doctype =this.getFileType(option.fileType);
-        let config = {
-          document: {
-            //后缀
-            fileType: option.fileType,
-            key: option.key || '',
-            title: option.title,
-            permissions: {
-              edit: option.isEdit, //是否可以编辑: 只能查看,传false
-              print: option.isPrint, //是否可以打印
-              download: option.isEdit, //是否可以下载
-              // "fillForms": true,//是否可以填写表格,如果将mode参数设置为edit,则填写表单仅对文档编辑器可用。 默认值与edit或review参数的值一致。
-              // "review": true //跟踪变化
-            },
-            url: option.url,
-          },
-          documentType: this.doctype,
-          editorConfig: {
-            callbackUrl: option.editUrl, //"编辑word后保存时回调的地址,这个api需要自己写了,将编辑后的文件通过这个api保存到自己想要的位置
-            lang: option.lang, //语言设置
-            //定制
-            customization: {
-              autosave: false, //是否自动保存
-              chat: false,
-              comments: false,
-              help: false,
-              // "hideRightMenu": false,//定义在第一次加载时是显示还是隐藏右侧菜单。 默认值为false
-              //是否显示插件
-              plugins: false,
-            },
-            user: {
-              id: option.user.id,
-              name: option.user.name
-            },
-            mode: option.model ? option.model : 'edit',
-             // 定义共享编辑模式(快速fast/严格strict), change为控制是否允许修改
-            coEditing: {
-              mode: 'fast',
-              change: false
-            }
-          },
-          width: '100%',
-          height: document.body.clientHeight-110,
-          token: option.token || ''
-        }
-
-        // eslint-disable-next-line no-undef,no-unused-vars
-        this.docEditor = new DocsAPI.DocEditor('vabOnlyOffice', config)
-
-      },
-      getFileType(fileType) {
-        let docType = ''
-
-        let fileTypesDoc = [
-          'doc', 'docm', 'docx', 'dot', 'dotm', 'dotx', 'epub', 'fodt', 'htm', 'html', 'mht', 'odt', 'ott', 'pdf',
-          'rtf', 'txt', 'djvu', 'xps',
-        ]
-        let fileTypesCsv = [
-          'csv', 'fods', 'ods', 'ots', 'xls', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx',
-        ]
-        let fileTypesPPt = [
-          'fodp', 'odp', 'otp', 'pot', 'potm', 'potx', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx',
-        ]
-        if (fileTypesDoc.includes(fileType)) {
-          docType = 'word'
-        }
-        if (fileTypesCsv.includes(fileType)) {
-          docType = 'cell'
-        }
-        if (fileTypesPPt.includes(fileType)) {
-          docType = 'slide'
-        }
-        return docType
-      }
-    },
-  }
-</script>

+ 1 - 1
src/views/doc/groupUser/selectUser.vue

@@ -126,7 +126,7 @@ export default {
         this.$modal.msgError("请选择要分配的用户");
         return;
       }
-      authUserSelectAll({ groupId: groupId, userIds: userIds }).then(res => {
+      groupUserSelectAll({ groupId: groupId, userIds: userIds }).then(res => {
         this.$modal.msgSuccess(res.msg);
         if (res.code === 200) {
           this.visible = false;