Browse Source

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

yxc 2 years ago
parent
commit
156fcd0413

+ 13 - 13
src/components/FileUpload/index.vue

@@ -20,7 +20,7 @@
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传
         <template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
-        <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
+        <!-- <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template> -->
         的文件
       </div>
     </el-upload>
@@ -55,12 +55,12 @@ export default {
     // 大小限制(MB)
     fileSize: {
       type: Number,
-      default: 5,
+      default: 1024,
     },
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
       type: Array,
-      default: () => ["doc","docx", "xls","xlsx", "ppt", "txt", "pdf"],
+      default: () => ["doc","docx", "xls","xlsx", "ppt", "txt", "pdf","gz"],
     },
     // 是否显示提示
     isShowTip: {
@@ -113,15 +113,15 @@ export default {
     // 上传前校检格式和大小
     handleBeforeUpload(file) {
       // 校检文件类型
-      if (this.fileType) {
-        const fileName = file.name.split('.');
-        const fileExt = fileName[fileName.length - 1];
-        const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
-        if (!isTypeOk) {
-          this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
-          return false;
-        }
-      }
+      // if (this.fileType) {
+      //   const fileName = file.name.split('.');
+      //   const fileExt = fileName[fileName.length - 1];
+      //   const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
+      //   if (!isTypeOk) {
+      //     this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
+      //     return false;
+      //   }
+      // }
       // 校检文件大小
       if (this.fileSize) {
         const isLt = file.size / 1024 / 1024 < this.fileSize;
@@ -211,4 +211,4 @@ export default {
 .ele-upload-list__item-content-action .el-link {
   margin-right: 10px;
 }
-</style>
+</style>

+ 2 - 0
src/main.js

@@ -85,3 +85,5 @@ new Vue({
   store,
   render: h => h(App)
 })
+//弹窗时点击空白处不关闭弹窗
+Element.Dialog.props.closeOnClickModal.default = false;

+ 82 - 62
src/router/index.js

@@ -29,17 +29,14 @@ import Layout from '@/layout'
  */
 
 // 公共路由
-export const constantRoutes = [
-  {
+export const constantRoutes = [{
     path: '/redirect',
     component: Layout,
     hidden: true,
-    children: [
-      {
-        path: '/redirect/:path(.*)',
-        component: () => import('@/views/redirect')
-      }
-    ]
+    children: [{
+      path: '/redirect/:path(.*)',
+      component: () => import('@/views/redirect')
+    }]
   },
   {
     path: '/login',
@@ -65,35 +62,37 @@ export const constantRoutes = [
     path: '',
     component: Layout,
     redirect: 'index',
-    children: [
-      {
-        path: 'index',
-        component: () => import('@/views/index'),
-        name: 'Index',
-        meta: { title: '首页', icon: 'dashboard', affix: true }
+    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' }
+    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: [
-      {
+    children: [{
         path: "/home/page",
         component: () => import('@/views1/Page/PageView.vue')
       },
@@ -199,76 +198,95 @@ export const constantRoutes = [
 ]
 
 // 动态路由,基于用户权限动态去加载
-export const dynamicRoutes = [
-  {
+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' }
+    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' }
+    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' }
+    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' }
+    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' }
+    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'
       }
-    ]
+    }]
   }
 ]
 
@@ -280,6 +298,8 @@ Router.prototype.push = function push(location) {
 
 export default new Router({
   mode: 'history', // 去掉url中的#
-  scrollBehavior: () => ({ y: 0 }),
+  scrollBehavior: () => ({
+    y: 0
+  }),
   routes: constantRoutes
 })

+ 98 - 3
src/views/doc/dir/index.vue

@@ -26,7 +26,7 @@
 
     <el-table v-if="refreshTable" v-loading="loading" :data="dirList" row-key="dirId" :default-expand-all="isExpandAll"
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
-      <el-table-column label="目录名称" align="center" prop="dirName" />
+      <el-table-column label="目录名称" align="left" prop="dirName" />
       <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-plus" @click="handleAdd(scope.row)"
@@ -39,6 +39,13 @@
       </el-table-column>
     </el-table>
 
+    <!-- 个人空间相关信息 -->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        总容量:{{spaceData.spaceCap}} GB 已使用容量:{{spaceData.usedCap}} GB 可用容量:{{spaceData.avlCap}} GB
+        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleExpand">扩容申请</el-button>
+      </el-col>
+    </el-row>
     <!-- 添加或修改目录信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
@@ -57,6 +64,23 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 扩容申请对话框 -->
+    <el-dialog :title="title" :visible.sync="openSpace" width="500px" append-to-body>
+      <el-form ref="formSpace" :model="formSpace" :rules="rulesSpace" label-width="80px">
+        <el-form-item label="扩充容量" prop="expandCap">
+          <el-input-number v-model="formSpace.expandCap" placeholder="扩充容量"></el-input-number><label>GB</label>
+        </el-form-item>
+        <el-form-item label="申请理由" prop="remark">
+          <el-input v-model="formSpace.remark" type="textarea" rows="5" placeholder="请输入申请理由" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFormSpace">确 定</el-button>
+        <el-button @click="cancelSpace">取 消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -69,9 +93,19 @@
     updateDir,
     personalList
   } from "@/api/doc/dir";
+
   import {
     getPersonalSpace
   } from "@/api/doc/space";
+
+  import {
+    listExpand,
+    getExpand,
+    delExpand,
+    addExpand,
+    updateExpand
+  } from "@/api/doc/expand";
+
   import Treeselect from "@riophae/vue-treeselect";
   import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
@@ -94,6 +128,7 @@
         title: "",
         // 是否显示弹出层
         open: false,
+        openSpace: false,
         // 是否展开,默认全部展开
         isExpandAll: true,
         // 重新渲染表格状态
@@ -103,9 +138,11 @@
           parentId: null,
           dirName: null,
         },
+        //个人空间数据
+        spaceData: {},
         // 表单参数
         form: {},
-        // 表单校验
+        formSpace: {},
         // 表单校验
         rules: {
           dirName: [{
@@ -118,13 +155,35 @@
             message: "上级目录不能为空",
             trigger: "blur"
           }],
+        },
+        // 表单校验
+        rulesSpace: {
+          expandCap: [{
+            required: true,
+            message: "扩容容量不能为空",
+            trigger: "blur"
+          }],
+          remark: [{
+            required: true,
+            message: "申请理由不能为空",
+            trigger: "blur"
+          }],
         }
       };
     },
     created() {
       this.getList();
+      this.spaceInfo();
     },
     methods: {
+      /** 查询个人空间相关信息 */
+      spaceInfo() {
+        this.loading = true;
+        getPersonalSpace().then(response => {
+          this.spaceData = response.data;
+          this.loading = false;
+        });
+      },
       /** 查询目录信息列表 */
       getList() {
         this.loading = true;
@@ -149,6 +208,11 @@
         this.open = false;
         this.reset();
       },
+      // 取消按钮
+      cancelSpace() {
+        this.openSpace = false;
+        this.reset();
+      },
       // 表单重置
       reset() {
         this.form = {
@@ -191,6 +255,25 @@
           this.dirOptions = this.handleTree(response.data, "dirId");
         });
       },
+      /** 扩容申请 */
+      handleExpand(row) {
+        this.formSpace.currentCap = this.spaceData.spaceCap;
+        this.formSpace.spaceId = this.spaceData.spaceId;
+        this.formSpace.spaceName = this.spaceData.spaceName;
+        this.reset();
+        // this.getTreeselect();
+        if (row != null && row.dirId) {
+          this.form.parentId = row.dirId;
+          // } else {
+          // 	this.form.parentId = 0;
+        }
+        this.openSpace = true;
+        this.title = "扩容申请";
+        personalList().then(response => {
+          this.form.spaceId = response.data[0].spaceId;
+          this.dirOptions = this.handleTree(response.data, "dirId");
+        });
+      },
       /** 展开/折叠操作 */
       toggleExpandAll() {
         this.refreshTable = false;
@@ -234,6 +317,18 @@
           }
         });
       },
+      /** 提交按钮 */
+      submitFormSpace() {
+        console.log(this.formSpace);
+        this.$refs["formSpace"].validate(valid => {
+          if (valid) {
+            addExpand(this.formSpace).then(response => {
+              this.$modal.msgSuccess("扩容申请提交成功");
+              this.openSpace = false;
+            });
+          }
+        });
+      },
       /** 删除按钮操作 */
       handleDelete(row) {
         this.$modal.confirm('是否确认删除目录信息编号为"' + row.dirId + '"的数据项?').then(function() {
@@ -245,4 +340,4 @@
       }
     }
   };
-</script>
+</script>

+ 58 - 9
src/views/doc/expand/index.vue

@@ -1,10 +1,10 @@
 <template>
   <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="spaceId">
+      <el-form-item label="空间名称" prop="spaceName">
         <el-input
-          v-model="queryParams.spaceId"
-          placeholder="请输入空间ID"
+          v-model="queryParams.spaceName"
+          placeholder="请输入空间名称"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -25,6 +25,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="扩容状态" prop="expandStatus">
+        <el-select v-model="queryParams.expandStatus" placeholder="请选择扩容状态" clearable>
+          <el-option
+            v-for="dict in dict.type.expand_status"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </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>
@@ -80,11 +90,26 @@
     <el-table v-loading="loading" :data="expandList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="容量信息ID" align="center" prop="expandId" />
-      <el-table-column label="空间ID" align="center" prop="spaceId" />
+      <el-table-column label="空间名称" align="center" prop="spaceName" />
       <el-table-column label="当前容量" align="center" prop="currentCap" />
       <el-table-column label="扩充容量" align="center" prop="expandCap" />
-      <el-table-column label="扩容状态" align="center" prop="expandStatus" />
-      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="扩容状态" align="center" prop="expandStatus">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.expand_status" :value="scope.row.expandStatus"/>
+        </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">
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="更新人" align="center" prop="updateBy" />
+      <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -104,7 +129,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -116,15 +141,33 @@
     <!-- 添加或修改扩容申请对话框 -->
     <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="空间ID" prop="spaceId">
+          <el-input v-model="form.spaceId" placeholder="请输入空间ID" />
+        </el-form-item>
+        <el-form-item label="空间名称" prop="spaceName">
+          <el-input v-model="form.spaceName" placeholder="请输入空间名称" />
+        </el-form-item>
         <el-form-item label="当前容量" prop="currentCap">
           <el-input v-model="form.currentCap" placeholder="请输入当前容量" />
         </el-form-item>
         <el-form-item label="扩充容量" prop="expandCap">
           <el-input v-model="form.expandCap" placeholder="请输入扩充容量" />
         </el-form-item>
+        <el-form-item label="扩容状态" prop="expandStatus">
+          <el-radio-group v-model="form.expandStatus">
+            <el-radio
+              v-for="dict in dict.type.expand_status"
+              :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" type="textarea" placeholder="请输入内容" />
         </el-form-item>
+        <el-form-item label="逻辑删除标志;1/非1" prop="isDel">
+          <el-input v-model="form.isDel" placeholder="请输入逻辑删除标志;1/非1" />
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -139,6 +182,7 @@ import { listExpand, getExpand, delExpand, addExpand, updateExpand } from "@/api
 
 export default {
   name: "Expand",
+  dicts: ['expand_status'],
   data() {
     return {
       // 遮罩层
@@ -163,14 +207,18 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        spaceId: null,
+        spaceName: null,
         currentCap: null,
         expandCap: null,
+        expandStatus: null,
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
+        spaceName: [
+          { required: true, message: "空间名称不能为空", trigger: "blur" }
+        ],
         expandCap: [
           { required: true, message: "扩充容量不能为空", trigger: "blur" }
         ],
@@ -203,6 +251,7 @@ export default {
       this.form = {
         expandId: null,
         spaceId: null,
+        spaceName: null,
         currentCap: null,
         expandCap: null,
         expandStatus: null,
@@ -285,4 +334,4 @@ export default {
     }
   }
 };
-</script>
+</script>

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

@@ -15,7 +15,7 @@
 </template>
 
 <script>
-  import vabOnlyOffice from '@/views/tool/onlyoffice.vue'
+  import vabOnlyOffice from '@/views/doc/oo/onlyoffice.vue'
 
   export default {
     name: 'App',

+ 156 - 111
src/views/doc/info/index.vue

@@ -1,80 +1,95 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="文档名称" prop="docName">
-        <el-input v-model="queryParams.docName" placeholder="请输入文档名称" clearable @keyup.enter.native="handleQuery" />
-      </el-form-item>
-      <el-form-item label="文档级别" prop="docLevel">
-        <el-input v-model="queryParams.docLevel" placeholder="请输入文档级别" clearable @keyup.enter.native="handleQuery" />
-      </el-form-item>
-      <el-form-item label="文档年份" prop="createYear">
-        <el-input v-model="queryParams.createYear" 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 :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:info: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:info:edit']">修改</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:info: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:info:export']">导出</el-button>
+    <el-row :gutter="20">
+      <!--目录数据-->
+      <el-col :span="4" :xs="24">
+        <div class="head-container">
+          <el-tree :data="dirList" :props="defaultProps" :expand-on-click-node="false" ref="tree" node-key="id"
+            default-expand-all highlight-current @node-click="handleNodeClick" />
+        </div>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+      <!--文件数据-->
+      <el-col :span="16" :xs=24>
+        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
+          label-width="68px">
+          <el-form-item label="文件名称" prop="docName">
+            <el-input v-model="queryParams.docName" placeholder="请输入文件名称" clearable @keyup.enter.native="handleQuery" />
+          </el-form-item>
+          <el-form-item label="文件级别" prop="docLevel">
+            <el-input v-model="queryParams.docLevel" placeholder="请输入文件级别" clearable
+              @keyup.enter.native="handleQuery" />
+          </el-form-item>
+          <el-form-item label="文件年份" prop="createYear">
+            <el-input v-model="queryParams.createYear" 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 :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:info: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:info:edit']">修改</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:info: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:info:export']">导出</el-button>
+          </el-col>
+          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
 
-    <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="文档ID" align="center" prop="docId" />
-      <el-table-column label="文档名称" align="center" prop="docName" />
-      <el-table-column label="文档级别" align="center" prop="docLevel" />
-      <el-table-column label="文档年份" align="center" prop="createYear" />
-      <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-view" @click="handlePreview(scope.row)">预览</el-button>
-          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
-            v-hasPermi="['doc:info:edit']">修改</el-button>
-          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
-            v-hasPermi="['doc:info:remove']">删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
+        <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
+          <el-table-column type="selection" width="55" align="center" />
+          <el-table-column label="文件名称" align="center" prop="docName" />
+          <el-table-column label="文件大小" align="center" prop="docSize" :formatter="fileSizeData" />
+          <el-table-column label="修改时间" align="center" prop="updateTime" />
+          <el-table-column label="文件级别" align="center" prop="docLevel" />
+          <el-table-column label="文件年份" align="center" prop="createYear" />
+          <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-view" @click="handlePreview(scope.row)">分享</el-button>
+              <el-button size="mini" type="text" icon="el-icon-view" @click="handlePreview(scope.row)">下载</el-button>
+              <el-button size="mini" type="text" icon="el-icon-view" @click="handlePreview(scope.row)">预览</el-button>
+              <el-button size="mini" type="text" icon="el-icon-view" @click="handleEdit(scope.row)">在线编辑</el-button>
+              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
+                v-hasPermi="['doc:info:edit']">修改</el-button>
+              <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
+                v-hasPermi="['doc:info: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" />
+        <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+          @pagination="getList" />
 
-    <!-- 添加或修改文档基本信息对话框 -->
+      </el-col>
+    </el-row>
+    <!-- 添加或修改文件基本信息对话框 -->
     <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="docName">
-          <el-input v-model="form.docName" placeholder="请输入文档名称" />
-        </el-form-item>
-        <el-form-item label="文档描述">
-          <editor v-model="form.docDesc" :min-height="192" />
-        </el-form-item>
-        <el-form-item label="文档存储路径" prop="docPath">
-          <!-- <el-input v-model="form.docPath" placeholder="请输入文档路径" /> -->
+        <el-form-item label="" prop="docPath">
+          <!-- <el-input v-model="form.docPath" placeholder="请输入文件路径" /> -->
           <file-upload v-model="form.docPath" />
         </el-form-item>
-        <el-form-item label="文档级别" prop="docLevel">
-          <el-input v-model="form.docLevel" placeholder="请输入文档级别" />
+        <el-form-item label="文件名称" prop="docName">
+          <el-input v-model="form.docName" placeholder="请输入文件名称" />
+        </el-form-item>
+        <el-form-item label="文件描述">
+          <el-input v-model="form.docDesc" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="文档年份" prop="createYear">
-          <el-input v-model="form.createYear" placeholder="请输入文档创建年份" />
+        <el-form-item label="文件级别" prop="docLevel">
+          <el-input v-model="form.docLevel" placeholder="请输入文件级别" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -82,9 +97,6 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
-    <div v-if='show' class='qualityManual-container-office'>
-      <vab-only-office :option='option' />
-    </div>
   </div>
 </template>
 
@@ -96,14 +108,23 @@
     addInfo,
     updateInfo
   } from "@/api/doc/info";
+  import {
+    listDir,
+    getDir,
+    delDir,
+    addDir,
+    updateDir,
+    personalList
+  } from "@/api/doc/dir";
 
-  import vabOnlyOffice from '@/views/tool/onlyoffice.vue';
+  import Treeselect from "@riophae/vue-treeselect";
+  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
   export default {
+    name: "Info",
     components: {
-      vabOnlyOffice
+      Treeselect
     },
-    name: "Info",
     data() {
       return {
         // 遮罩层
@@ -118,8 +139,10 @@
         showSearch: true,
         // 总条数
         total: 0,
-        // 文基本信息表格数据
+        // 文基本信息表格数据
         infoList: [],
+        dirId: undefined, //目录ID
+        dirList: undefined,
         // 弹出层标题
         title: "",
         // 是否显示弹出层
@@ -134,58 +157,63 @@
         },
         // 表单参数
         form: {},
+        defaultProps: {
+          children: "children",
+          label: "dirName",
+          id: "dirId"
+        },
         // 表单校验
         rules: {
           docName: [{
             required: true,
-            message: "文档名称不能为空",
+            message: "文名称不能为空",
             trigger: "blur"
           }],
           createYear: [{
             required: true,
-            message: "文档创建年份;文档创建年份,分表用不能为空",
+            message: "文件创建年份;文件创建年份,分表用不能为空",
             trigger: "blur"
           }],
-        },
-        option: {
-          key: '', //key 使用文档ID+年份
-          url: '', //在线文档地址
-          isEdit: '', //是否允许编辑
-          fileType: '', //文件扩展名
-          title: '', //文件标题
-          user: {
-            id: null, //用户ID
-            name: '' //用户姓名
-          },
-          editUrl: '' //回调地址
-        },
-        show: true //是否显示
+        }
       }
     },
     created() {
-      this.getList();
+      this.dirTree();
     },
     methods: {
+      // 节点单击事件
+      handleNodeClick(data) {
+        this.dirId = data.dirId;
+        this.queryParams.dirId = this.dirId;
+        this.queryParams.searchValue = this.spaceId;
+        this.handleQuery();
+      },
+      //预览
       handlePreview(row) {
-        console.log(row);
-        //获取当前登录用户名:this.$store.state.user.name
-        //获取当前登录用户ID:this.$store.state.user.uid
-        //获取当前登录用户昵称:this.$store.state.user.uname
-        this.show = true;
-        // getAction('/file/selectById', { id: this.id }).then(res => {
-        this.option.isEdit = true;
-        this.option.url = row.docPath;
-        //'http://192.168.1.26:9300/statics/2023/04/03/产品研发会议纪要20230314_20230403170635A001.doc';
-        this.option.title = row.docName; //'测试word';
-        this.option.fileType = row.docType;
+        row.isEdit = false;
+        this.$tab.openPage("文件[" + row.docName + "]预览", '/doc/oo-edit/index/' + row.docId, row);
+      },
+      //在线编辑
+      handleEdit(row) {
+        row.isEdit = true;
+        this.$tab.openPage("文件[" + row.docName + "]在线编辑", '/doc/oo-edit/index/' + row.docId, row);
+      },
+      //先获取左边目录树,拿到目录ID和spaceId才能查询
+      dirTree() {
+        this.loading = true;
+        personalList().then(response => {
+          this.dirId = response.data[0].dirId;
+          this.spaceId = response.data[0].spaceId;
+          this.dirList = this.handleTree(response.data, "dirId");
 
-        this.option.user = {
-          id: this.$store.state.user.uid,
-          name: this.$store.state.user.uname
-        };
-        this.option.editUrl = 'http://192.168.1.26:8080/doc/only-office/callback?id='+row.docId+"&year="+row.createYear
+          this.queryParams.dirId = this.dirId;
+          this.queryParams.searchValue = this.spaceId;
+          this.getList();
+
+          this.loading = false;
+        });
       },
-      /** 查询文基本信息列表 */
+      /** 查询文基本信息列表 */
       getList() {
         this.loading = true;
         listInfo(this.queryParams).then(response => {
@@ -203,6 +231,7 @@
       reset() {
         this.form = {
           docId: null,
+          dirId: this.dirId,
           docName: null,
           docType: null,
           docSize: null,
@@ -219,7 +248,8 @@
           updateBy: null,
           updateTime: null,
           remark: null,
-          isDel: null
+          isDel: null,
+          searchValue: this.spaceId
         };
         this.resetForm("form");
       },
@@ -231,6 +261,8 @@
       /** 重置按钮操作 */
       resetQuery() {
         this.resetForm("queryForm");
+        this.queryParams.dirId = this.dirId;
+        this.queryParams.searchValue = this.spaceId;
         this.handleQuery();
       },
       // 多选框选中数据
@@ -243,7 +275,7 @@
       handleAdd() {
         this.reset();
         this.open = true;
-        this.title = "添加文基本信息";
+        this.title = "添加文基本信息";
       },
       /** 修改按钮操作 */
       handleUpdate(row) {
@@ -252,7 +284,7 @@
         getInfo(docId, row.createYear).then(response => {
           this.form = response.data;
           this.open = true;
-          this.title = "修改文基本信息";
+          this.title = "修改文基本信息";
         });
       },
       /** 提交按钮 */
@@ -278,7 +310,7 @@
       /** 删除按钮操作 */
       handleDelete(row) {
         const docIds = row.docId || this.ids;
-        this.$modal.confirm('是否确认删除文基本信息编号为"' + docIds + '"的数据项?').then(function() {
+        this.$modal.confirm('是否确认删除文基本信息编号为"' + docIds + '"的数据项?').then(function() {
           return delInfo(docIds);
         }).then(() => {
           this.getList();
@@ -290,6 +322,19 @@
         this.download('doc/info/export', {
           ...this.queryParams
         }, `info_${new Date().getTime()}.xlsx`)
+      },
+      /**格式化文件大小数据*/
+      fileSizeData(row, col, value) {
+        const KB = 1;
+        const MB = KB * 1024;
+        const GB = MB * 1024;
+        if (value < MB) {
+          return `${(value / KB).toFixed(2)} KB`;
+        } else if (value < GB) {
+          return `${(value / MB).toFixed(2)} MB`;
+        } else {
+          return `${(value / GB).toFixed(2)} GB`;
+        }
       }
     }
   };

+ 90 - 0
src/views/doc/oo/edit.vue

@@ -0,0 +1,90 @@
+<template>
+  <div v-if='show' class='qualityManual-container-office'>
+    <vab-only-office :option='option' />
+  </div>
+</template>
+
+<script>
+  import vabOnlyOffice from '@/views/doc/oo/onlyoffice.vue'
+
+  export default {
+    name: 'OoEdit',
+    components: {
+      vabOnlyOffice
+    },
+    data() {
+      return {
+        //参考vabOnlyOffice组件参数配置
+        option: {
+          key: '',
+          url: '', //在线文档地址
+          isEdit: '', //是否允许编辑
+          fileType: '', //文件扩展名
+          title: '', //文件标题
+          user: {
+            id: null, //用户ID
+            name: '' //用户姓名
+          },
+          editUrl: '' //回调地址
+        },
+        show: true //是否显示
+      }
+    },
+    created() {
+      this.getFile();
+    },
+    methods: {
+      getFile() {
+        //获取当前登录用户名:this.$store.state.user.name
+        //获取当前登录用户ID:this.$store.state.user.uid
+        //获取当前登录用户昵称:this.$store.state.user.uname
+        let row = this.$route.query;
+        let isEdit = row.isEdit == 'true';
+        this.show = true;
+        // getAction('/file/selectById', { id: this.id }).then(res => {
+        this.option.isEdit = isEdit;
+        this.option.url = row.docPath;
+        //'http://192.168.1.26:9300/statics/2023/04/03/产品研发会议纪要20230314_20230403170635A001.doc';
+        this.option.title = row.docName; //'测试word';
+        this.option.fileType = row.docType;
+
+        this.option.user = {
+          id: this.$store.state.user.uid,
+          name: this.$store.state.user.uname
+        };
+        this.option.editUrl = 'http://192.168.1.26:8080/doc/only-office/callback?id=' + row.docId +
+          "&year=" + row.createYear + "&name=" + this.$store.state.user.name;
+      },
+      close() {
+        this.show = false
+      }
+    }
+  }
+</script>
+
+<style>
+  html,
+  body {
+    height: '900px';
+  }
+
+  #app {
+    font-family: Avenir, Helvetica, Arial, sans-serif;
+    -webkit-font-smoothing: antialiased;
+    -moz-osx-font-smoothing: grayscale;
+    text-align: center;
+    color: #2c3e50;
+    height: '900px';
+
+  }
+
+  .qualityManual-container {
+    padding: 0 !important;
+    height: '900px';
+  }
+
+  .qualityManual-container-office {
+    width: 100%;
+    height: '900px';
+  }
+</style>

+ 0 - 0
src/views/tool/onlyoffice.vue → src/views/doc/oo/onlyoffice.vue


+ 6 - 6
src/views/doc/space/index.vue

@@ -11,10 +11,10 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
+     <!-- <el-col :span="1.5">
         <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
           v-hasPermi="['doc:space:add']">新增</el-button>
-      </el-col>
+      </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:space:edit']">修改</el-button>
@@ -32,10 +32,10 @@
 
     <el-table v-loading="loading" :data="spaceList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="空间ID" align="center" prop="spaceId" />
+      <!-- <el-table-column label="空间ID" align="center" prop="spaceId" /> -->
       <el-table-column label="空间名称" align="center" prop="spaceName" />
-      <el-table-column label="空间容量" align="center" prop="spaceCap" />
-      <el-table-column label="已使用容量" align="center" prop="usedCap" />
+      <el-table-column label="空间容量(GB)" align="center" prop="spaceCap" />
+      <el-table-column label="已使用容量(TB)" align="center" prop="usedCap" />
       <el-table-column label="可用容量" align="center" prop="avlCap" />
       <el-table-column label="文件数量" align="center" prop="fileNum" />
       <el-table-column label="默认文件级别" align="center" prop="defaultLevel" />
@@ -262,4 +262,4 @@
       }
     }
   };
-</script>
+</script>