浏览代码

个人文档模块的标签更新

yxc 2 年之前
父节点
当前提交
d2d601fc74
共有 22 个文件被更改,包括 1348 次插入46 次删除
  1. 2 2
      lzga-api/lzga-api-system/src/main/java/com/jjt/system/api/factory/RemoteConfigFallbackFactory.java
  2. 45 5
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocDirController.java
  3. 13 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocGroupController.java
  4. 90 22
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocSpaceController.java
  5. 0 1
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocSpaceExpandController.java
  6. 35 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/enums/DocOfType.java
  7. 27 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/enums/RolesEnum.java
  8. 8 0
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocGroupMapper.java
  9. 17 9
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocGroupService.java
  10. 13 1
      lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocGroupServiceImpl.java
  11. 9 0
      lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocGroupMapper.xml
  12. 1 1
      lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocInfoMapper.xml
  13. 1 0
      lzga-modules/lzga-doc/src/test/java/Test.java
  14. 22 1
      lzga-ui/src/api/doc/dir.js
  15. 9 1
      lzga-ui/src/api/doc/group.js
  16. 21 0
      lzga-ui/src/api/doc/space.js
  17. 15 1
      lzga-ui/src/router/index.js
  18. 275 0
      lzga-ui/src/views/doc/dir/deptSpace.vue
  19. 334 0
      lzga-ui/src/views/doc/dir/groupSpace.vue
  20. 134 0
      lzga-ui/src/views/doc/dir/groupSpaceSelect.vue
  21. 275 0
      lzga-ui/src/views/doc/dir/publicSpace.vue
  22. 2 2
      lzga-ui/vue.config.js

+ 2 - 2
lzga-api/lzga-api-system/src/main/java/com/jjt/system/api/factory/RemoteConfigFallbackFactory.java

@@ -21,7 +21,7 @@ public class RemoteConfigFallbackFactory implements FallbackFactory<RemoteConfig
 
     @Override
     public RemoteConfigService create(Throwable throwable) {
-        log.error("用户服务调用失败:{}", throwable.getMessage());
-        return (configKey, source) -> R.fail("获取用户失败:" + throwable.getMessage());
+        log.error("配置服务调用失败:{}", throwable.getMessage());
+        return (configKey, source) -> R.fail("获取配置失败:" + throwable.getMessage());
     }
 }

+ 45 - 5
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocDirController.java

@@ -7,8 +7,12 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 
 import com.jjt.common.core.constant.SecurityConstants;
+import com.jjt.common.core.domain.R;
 import com.jjt.common.security.utils.SecurityUtils;
+import com.jjt.doc.domain.DocGroup;
 import com.jjt.doc.domain.DocSpace;
+import com.jjt.doc.enums.DocOfType;
+import com.jjt.doc.service.IDocGroupService;
 import com.jjt.doc.service.IDocSpaceService;
 import com.jjt.system.api.RemoteConfigService;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -43,6 +47,8 @@ public class DocDirController extends BaseController {
     private IDocSpaceService docSpaceService;
     @Resource
     private RemoteConfigService remoteConfigService;
+    @Resource
+    private IDocGroupService groupService;
 
     /**
      * 查询目录信息列表
@@ -63,16 +69,50 @@ public class DocDirController extends BaseController {
         //1.先查询个人空间,如果没有则创建
         DocSpace docSpace = new DocSpace();
         docSpace.setOwner(SecurityUtils.getUserId());
-        docSpace.setSpaceType("3");
+        docSpace.setSpaceType(DocOfType.PERSONAL.getValue());
         List<DocSpace> spaceList = docSpaceService.selectDocSpaceList(docSpace);
         if (spaceList.size() == 0) {
             //初始化用户空间
             //个人空间
-            docSpace.setSpaceType("3");
-            docSpace.setOwner(SecurityUtils.getUserId());
             docSpace.setSpaceName("\"" + SecurityUtils.getLoginUser().getSysUser().getNickName() + "\"的个人空间");
-            String defaultCap = remoteConfigService.selectConfigByKey("user.default.cap", SecurityConstants.INNER).getData();
-            BigDecimal cap = new BigDecimal(defaultCap);
+            R<String> defaultCap = remoteConfigService.selectConfigByKey("user.default.cap", SecurityConstants.INNER);
+            BigDecimal cap = new BigDecimal(defaultCap.getMsg());
+            docSpace.setSpaceCap(cap);
+            docSpace.setCreateBy(SecurityUtils.getUsername());
+            docSpaceService.insertDocSpace(docSpace);
+        } else {
+            docSpace = spaceList.get(0);
+        }
+        //2.查询顶层目录,如果没有则创建
+        DocDir docDir = new DocDir();
+        docDir.setSpaceId(docSpace.getSpaceId());
+        List<DocDir> list = docDirService.selectDocDirList(docDir);
+        if (list.size() == 0) {
+            docDir.setDirName(docSpace.getSpaceName());
+            docDir.setParentId(0L);
+            docDirService.insertDocDir(docDir);
+
+            list = docDirService.selectDocDirList(docDir);
+        }
+        return success(list);
+    }
+
+    /**
+     * 查询分组空间的目录
+     */
+    @GetMapping("/list/group/{groupId}")
+    public AjaxResult groupList(@PathVariable("groupId") Long groupId) {
+        //1.先查询分组空间,如果没有则创建
+        DocSpace docSpace = new DocSpace();
+        docSpace.setOwner(groupId);
+        docSpace.setSpaceType(DocOfType.GROUP.getValue());
+        List<DocSpace> spaceList = docSpaceService.selectDocSpaceList(docSpace);
+        if (spaceList.size() == 0) {
+            DocGroup docGroup = groupService.selectDocGroupByGroupId(groupId);
+            //初始化分组空间
+            docSpace.setSpaceName("\"" + docGroup.getGroupName() + "\"的分组空间");
+            R<String> defaultCap = remoteConfigService.selectConfigByKey("group.default.cap", SecurityConstants.INNER);
+            BigDecimal cap = new BigDecimal(defaultCap.getMsg());
             docSpace.setSpaceCap(cap);
             docSpace.setCreateBy(SecurityUtils.getUsername());
             docSpaceService.insertDocSpace(docSpace);

+ 13 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocGroupController.java

@@ -7,6 +7,7 @@ import com.jjt.common.core.web.page.TableDataInfo;
 import com.jjt.common.log.annotation.Log;
 import com.jjt.common.log.enums.BusinessType;
 import com.jjt.common.security.annotation.RequiresPermissions;
+import com.jjt.common.security.utils.SecurityUtils;
 import com.jjt.doc.domain.DocGroup;
 import com.jjt.doc.service.IDocGroupService;
 import org.springframework.web.bind.annotation.*;
@@ -39,6 +40,18 @@ public class DocGroupController extends BaseController {
     }
 
     /**
+     * 查询分组列表
+     */
+//    @RequiresPermissions("doc:group:select")
+    @GetMapping("/select")
+    public TableDataInfo select(DocGroup docGroup) {
+        startPage();
+        docGroup.setGroupManager(SecurityUtils.getUserId());
+        List<DocGroup> list = docGroupService.getGroupByUid(docGroup);
+        return getDataTable(list);
+    }
+
+    /**
      * 导出分组列表
      */
     @RequiresPermissions("doc:group:export")

+ 90 - 22
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocSpaceController.java

@@ -1,31 +1,25 @@
 package com.jjt.doc.controller;
 
-import java.util.List;
-import java.io.IOException;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-
-import com.jjt.common.security.annotation.InnerAuth;
-import com.jjt.common.security.utils.SecurityUtils;
-import com.jjt.doc.domain.DocSpaceExpand;
-import com.jjt.doc.service.IDocSpaceExpandService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.jjt.common.core.utils.poi.ExcelUtil;
+import com.jjt.common.core.web.controller.BaseController;
+import com.jjt.common.core.web.domain.AjaxResult;
+import com.jjt.common.core.web.page.TableDataInfo;
 import com.jjt.common.log.annotation.Log;
 import com.jjt.common.log.enums.BusinessType;
+import com.jjt.common.security.annotation.InnerAuth;
 import com.jjt.common.security.annotation.RequiresPermissions;
+import com.jjt.common.security.utils.SecurityUtils;
 import com.jjt.doc.domain.DocSpace;
+import com.jjt.doc.domain.DocSpaceExpand;
+import com.jjt.doc.enums.DocOfType;
+import com.jjt.doc.service.IDocGroupService;
+import com.jjt.doc.service.IDocSpaceExpandService;
 import com.jjt.doc.service.IDocSpaceService;
-import com.jjt.common.core.web.controller.BaseController;
-import com.jjt.common.core.web.domain.AjaxResult;
-import com.jjt.common.core.utils.poi.ExcelUtil;
-import com.jjt.common.core.web.page.TableDataInfo;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
  * 存储空间Controller
@@ -40,6 +34,8 @@ public class DocSpaceController extends BaseController {
     private IDocSpaceService docSpaceService;
     @Resource
     private IDocSpaceExpandService expandService;
+    @Resource
+    private IDocGroupService groupService;
 
     /**
      * 查询存储空间列表
@@ -81,7 +77,79 @@ public class DocSpaceController extends BaseController {
         Long uid = SecurityUtils.getUserId();
         DocSpace docSpace = new DocSpace();
         docSpace.setOwner(uid);
-        docSpace.setSpaceType("3");
+        docSpace.setSpaceType(DocOfType.PERSONAL.getValue());
+        List<DocSpace> list = docSpaceService.selectDocSpaceList(docSpace);
+        docSpace = list.get(0);
+        //查询是否有已申请扩容未审批的记录
+        DocSpaceExpand expand = new DocSpaceExpand();
+        expand.setSpaceId(docSpace.getSpaceId());
+        expand.setExpandStatus("1");
+        List expandList = expandService.selectDocSpaceExpandList(expand);
+        if (expandList.size() > 0) {
+            docSpace.setIsApply("1");
+        } else {
+            docSpace.setIsApply("0");
+        }
+        return success(docSpace);
+    }
+
+    /**
+     * 获取公共存储空间信息
+     */
+    @GetMapping(value = "/public")
+    public AjaxResult getPublicSpace() {
+        Long uid = SecurityUtils.getUserId();
+        DocSpace docSpace = new DocSpace();
+        docSpace.setOwner(uid);
+        docSpace.setSpaceType(DocOfType.PUBLIC.getValue());
+        List<DocSpace> list = docSpaceService.selectDocSpaceList(docSpace);
+        docSpace = list.get(0);
+        //查询是否有已申请扩容未审批的记录
+        DocSpaceExpand expand = new DocSpaceExpand();
+        expand.setSpaceId(docSpace.getSpaceId());
+        expand.setExpandStatus("1");
+        List expandList = expandService.selectDocSpaceExpandList(expand);
+        if (expandList.size() > 0) {
+            docSpace.setIsApply("1");
+        } else {
+            docSpace.setIsApply("0");
+        }
+        return success(docSpace);
+    }
+
+    /**
+     * 获取部门存储空间信息
+     */
+    @GetMapping(value = "/dept")
+    public AjaxResult getDeptSpace() {
+        Long uid = SecurityUtils.getUserId();
+        DocSpace docSpace = new DocSpace();
+        docSpace.setOwner(uid);
+        docSpace.setSpaceType(DocOfType.DEPT.getValue());
+        List<DocSpace> list = docSpaceService.selectDocSpaceList(docSpace);
+        docSpace = list.get(0);
+        //查询是否有已申请扩容未审批的记录
+        DocSpaceExpand expand = new DocSpaceExpand();
+        expand.setSpaceId(docSpace.getSpaceId());
+        expand.setExpandStatus("1");
+        List expandList = expandService.selectDocSpaceExpandList(expand);
+        if (expandList.size() > 0) {
+            docSpace.setIsApply("1");
+        } else {
+            docSpace.setIsApply("0");
+        }
+        return success(docSpace);
+    }
+
+    /**
+     * 获取分组存储空间信息
+     */
+    @GetMapping(value = "/group/{groupId}")
+    public AjaxResult getGroupSpace(Long groupId) {
+        Long uid = SecurityUtils.getUserId();
+        DocSpace docSpace = new DocSpace();
+        docSpace.setOwner(groupId);
+        docSpace.setSpaceType(DocOfType.GROUP.getValue());
         List<DocSpace> list = docSpaceService.selectDocSpaceList(docSpace);
         docSpace = list.get(0);
         //查询是否有已申请扩容未审批的记录

+ 0 - 1
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocSpaceExpandController.java

@@ -76,7 +76,6 @@ public class DocSpaceExpandController extends BaseController {
     /**
      * 新增扩容申请
      */
-    @RequiresPermissions("doc:expand:add")
     @Log(title = "扩容申请", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody DocSpaceExpand docSpaceExpand) {

+ 35 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/enums/DocOfType.java

@@ -0,0 +1,35 @@
+package com.jjt.doc.enums;
+
+/**
+ * 文档归属类别
+ *
+ * @author wukai
+ */
+public enum DocOfType {
+    /**
+     * 公共
+     */
+    PUBLIC("1"),
+    /**
+     * 部门
+     */
+    DEPT("2"),
+    /**
+     * 个人
+     */
+    PERSONAL("3"),
+    /**
+     * 分组
+     */
+    GROUP("4");
+
+    private String value;
+
+    DocOfType(String value) {
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+}

+ 27 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/enums/RolesEnum.java

@@ -0,0 +1,27 @@
+package com.jjt.doc.enums;
+
+/**
+ * 文档归属类别
+ *
+ * @author wukai
+ */
+public enum RolesEnum {
+    /**
+     * 分组管理员
+     */
+    GROUP_MANAGER("group.manager"),
+    /**
+     * 分组成员
+     */
+    GROUP_USER("group.user");
+
+    private String value;
+
+    RolesEnum(String value) {
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+}

+ 8 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/mapper/DocGroupMapper.java

@@ -59,4 +59,12 @@ public interface DocGroupMapper extends BaseMapper<DocGroup> {
      * @return 结果
      */
     public int deleteDocGroupByGroupIds(Long[] groupIds);
+
+    /**
+     * 根据用户ID获取分组信息
+     *
+     * @param docGroup 用户ID
+     * @return
+     */
+    List<DocGroup> getGroupByUid(DocGroup docGroup);
 }

+ 17 - 9
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/IDocGroupService.java

@@ -1,19 +1,19 @@
 package com.jjt.doc.service;
 
 import java.util.List;
+
 import com.jjt.doc.domain.DocGroup;
 
 /**
  * 分组Service接口
- * 
+ *
  * @author wukai
  * @date 2023-04-20
  */
-public interface IDocGroupService 
-{
+public interface IDocGroupService {
     /**
      * 查询分组
-     * 
+     *
      * @param groupId 分组主键
      * @return 分组
      */
@@ -21,7 +21,7 @@ public interface IDocGroupService
 
     /**
      * 查询分组列表
-     * 
+     *
      * @param docGroup 分组
      * @return 分组集合
      */
@@ -29,7 +29,7 @@ public interface IDocGroupService
 
     /**
      * 新增分组
-     * 
+     *
      * @param docGroup 分组
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface IDocGroupService
 
     /**
      * 修改分组
-     * 
+     *
      * @param docGroup 分组
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface IDocGroupService
 
     /**
      * 批量删除分组
-     * 
+     *
      * @param groupIds 需要删除的分组主键集合
      * @return 结果
      */
@@ -53,9 +53,17 @@ public interface IDocGroupService
 
     /**
      * 删除分组信息
-     * 
+     *
      * @param groupId 分组主键
      * @return 结果
      */
     public int deleteDocGroupByGroupId(Long groupId);
+
+    /**
+     * 根据用户ID获取分组信息
+     *
+     * @param docGroup
+     * @return
+     */
+    public List<DocGroup> getGroupByUid(DocGroup docGroup);
 }

+ 13 - 1
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/service/impl/DocGroupServiceImpl.java

@@ -5,6 +5,7 @@ import com.jjt.common.core.utils.DateUtils;
 import com.jjt.doc.domain.DocGroup;
 import com.jjt.doc.domain.DocSysRole;
 import com.jjt.doc.domain.DocSysUserRole;
+import com.jjt.doc.enums.RolesEnum;
 import com.jjt.doc.mapper.DocGroupMapper;
 import com.jjt.doc.mapper.DocSysRoleMapper;
 import com.jjt.doc.mapper.DocSysUserRoleMapper;
@@ -72,7 +73,7 @@ public class DocGroupServiceImpl implements IDocGroupService {
     private void groupManagerRole() {
         //查询分组管理员角色
         QueryWrapper<DocSysRole> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("role_key", "group.manager");
+        queryWrapper.eq("role_key", RolesEnum.GROUP_MANAGER.getValue());
         DocSysRole role = roleMapper.selectOne(queryWrapper);
         userRoleMapper.clearGroupManagerRole(role.getRoleId());
         userRoleMapper.insertGroupManagerRole(role.getRoleId());
@@ -117,4 +118,15 @@ public class DocGroupServiceImpl implements IDocGroupService {
         groupManagerRole();
         return r;
     }
+
+    /**
+     * 根据用户ID获取分组信息
+     *
+     * @param docGroup 用户ID
+     * @return
+     */
+    @Override
+    public List<DocGroup> getGroupByUid(DocGroup docGroup) {
+        return docGroupMapper.getGroupByUid(docGroup);
+    }
 }

+ 9 - 0
lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocGroupMapper.xml

@@ -49,6 +49,15 @@
         <include refid="selectDocGroupVo"/>
         where GROUP_ID = #{groupId}
     </select>
+    <select id="getGroupByUid" parameterType="DocGroup" resultType="com.jjt.doc.domain.DocGroup">
+        <include refid="selectDocGroupVo"/>
+        <where>
+            is_del!='1' and GROUP_MANAGER = #{groupManager}
+            <if test="groupManagerName != null  and groupManagerName != ''">and GROUP_MANAGER_NAME like concat('%',
+                #{groupManagerName}, '%')
+            </if>
+        </where>
+    </select>
 
     <insert id="insertDocGroup" parameterType="DocGroup" useGeneratedKeys="true" keyProperty="groupId">
         insert into doc_group

+ 1 - 1
lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocInfoMapper.xml

@@ -100,7 +100,7 @@
             <if test="updateTime != null ">and UPDATE_TIME = #{updateTime}</if>
             <if test="remark != null  and remark != ''">and REMARK = #{remark}</if>
             <if test="isDel != null  and isDel != ''">and IS_DEL = #{isDel}</if>
-            <if test="params.tagId!=null and params.tagId!=''">and doc_id in(select doc_id from DOC_TAG_RELA where
+            <if test="params.tagId!=null and params.tagId!=''">and a.doc_id in(select doc_id from DOC_TAG_RELA where
                 tag_id=#{params.tagId})
             </if>
         </where>

+ 1 - 0
lzga-modules/lzga-doc/src/test/java/Test.java

@@ -13,6 +13,7 @@ public class Test {
             String line = null;
             while ((line = in.readLine()) != null) {
                 line = in.readLine();
+                result += line;
                 System.out.println("返回值:" + line);
             }
 

+ 22 - 1
lzga-ui/src/api/doc/dir.js

@@ -15,6 +15,27 @@ export function personalList() {
     method: 'get',
   })
 }
+// 查询目录信息列表
+export function publicList() {
+  return request({
+    url: '/doc/dir/list/public',
+    method: 'get',
+  })
+}
+// 查询目录信息列表
+export function deptList() {
+  return request({
+    url: '/doc/dir/list/dept',
+    method: 'get',
+  })
+}
+// 查询目录信息列表
+export function groupList(groupId) {
+  return request({
+    url: '/doc/dir/list/group/' + groupId,
+    method: 'get',
+  })
+}
 
 // 查询目录信息详细
 export function getDir(dirId) {
@@ -48,4 +69,4 @@ export function delDir(dirId) {
     url: '/doc/dir/' + dirId,
     method: 'delete'
   })
-}
+}

+ 9 - 1
lzga-ui/src/api/doc/group.js

@@ -8,6 +8,14 @@ export function listGroup(query) {
     params: query
   })
 }
+// 查询分组列表
+export function selectGroup(query) {
+  return request({
+    url: '/doc/group/select',
+    method: 'get',
+    params: query
+  })
+}
 
 // 查询分组详细
 export function getGroup(groupId) {
@@ -41,4 +49,4 @@ export function delGroup(groupId) {
     url: '/doc/group/' + groupId,
     method: 'delete'
   })
-}
+}

+ 21 - 0
lzga-ui/src/api/doc/space.js

@@ -49,4 +49,25 @@ export function getPersonalSpace() {
     url: '/doc/space/personal',
     method: 'get'
   })
+}
+// 查询公共存储空间
+export function getPublicSpace() {
+  return request({
+    url: '/doc/space/public',
+    method: 'get'
+  })
+}
+// 查询部门存储空间
+export function getDeptSpace() {
+  return request({
+    url: '/doc/space/dept',
+    method: 'get'
+  })
+}
+// 查询分组存储空间
+export function getGroupSpace(groupId) {
+  return request({
+    url: '/doc/space/group/' + groupId,
+    method: 'get'
+  })
 }

+ 15 - 1
lzga-ui/src/router/index.js

@@ -321,6 +321,20 @@ export const dynamicRoutes = [{
     }
   }]
 }, {
+  path: '/doc/group-space/',
+  component: Layout,
+  hidden: true,
+  permissions: ['doc:groupSpace'],
+  children: [{
+    path: 'space/:groupId(\\d+)',
+    component: () => import('@/views/doc/dir/groupSpace'),
+    name: 'GroupSpace',
+    meta: {
+      title: '分组空间',
+      activeMenu: '/doc/groupSpace'
+    }
+  }]
+}, {
   path: '/doc/share-user/',
   component: Layout,
   hidden: true,
@@ -348,4 +362,4 @@ export default new Router({
     y: 0
   }),
   routes: constantRoutes
-})
+})

+ 275 - 0
lzga-ui/src/views/doc/dir/deptSpace.vue

@@ -0,0 +1,275 @@
+<template>
+  <div class="app-container">
+    <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:dir:add']">新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <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="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)"
+            v-hasPermi="['doc:dir:add']">新增</el-button>
+          <el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-edit"
+            @click="handleUpdate(scope.row)" v-hasPermi="['doc:dir:edit']">修改</el-button>
+          <el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-delete"
+            @click="handleDelete(scope.row)" v-hasPermi="['doc:dir:remove']">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 添加或修改目录信息对话框 -->
+    <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="parentId">
+          <treeselect v-model="form.parentId" :options="dirOptions" :normalizer="normalizer" placeholder="请选择上级目录" />
+        </el-form-item>
+        <el-form-item label="目录名称" prop="dirName">
+          <el-input v-model="form.dirName" placeholder="请输入目录名称" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" 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>
+  </div>
+</template>
+
+<script>
+  import {
+    listDir,
+    getDir,
+    delDir,
+    addDir,
+    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";
+
+  export default {
+    name: "Dir",
+    components: {
+      Treeselect
+    },
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 目录信息表格数据
+        dirList: [],
+        // 目录信息树选项
+        dirOptions: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        openSpace: false,
+        // 是否展开,默认全部展开
+        isExpandAll: true,
+        // 重新渲染表格状态
+        refreshTable: true,
+        // 查询参数
+        queryParams: {
+          parentId: null,
+          dirName: null,
+        },
+        //个人空间数据
+        spaceData: {},
+        // 表单参数
+        form: {},
+        formSpace: {},
+        // 表单校验
+        rules: {
+          dirName: [{
+            required: true,
+            message: "目录名称不能为空",
+            trigger: "blur"
+          }],
+          parentId: [{
+            required: true,
+            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;
+        personalList().then(response => {
+          this.dirList = this.handleTree(response.data, "dirId");
+          this.loading = false;
+        });
+      },
+      /** 转换目录信息数据结构 */
+      normalizer(node) {
+        if (node.children && !node.children.length) {
+          delete node.children;
+        }
+        return {
+          id: node.dirId,
+          label: node.dirName,
+          children: node.children
+        };
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 取消按钮
+      cancelSpace() {
+        this.openSpace = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          dirId: null,
+          spaceId: null,
+          parentId: null,
+          dirName: null,
+          dirPath: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          remark: null,
+          isDel: null
+        };
+        this.resetForm("form");
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      /** 新增按钮操作 */
+      handleAdd(row) {
+        this.reset();
+        // this.getTreeselect();
+        if (row != null && row.dirId) {
+          this.form.parentId = row.dirId;
+          // } else {
+          // 	this.form.parentId = 0;
+        }
+        this.open = true;
+        this.title = "添加目录信息";
+        personalList().then(response => {
+          this.form.spaceId = response.data[0].spaceId;
+          this.dirOptions = this.handleTree(response.data, "dirId");
+        });
+      },
+      /** 展开/折叠操作 */
+      toggleExpandAll() {
+        this.refreshTable = false;
+        this.isExpandAll = !this.isExpandAll;
+        this.$nextTick(() => {
+          this.refreshTable = true;
+        });
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        if (row != null) {
+          this.form.parentId = row.dirId;
+        }
+        getDir(row.dirId).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改目录信息";
+        });
+        personalList().then(response => {
+          this.dirOptions = this.handleTree(response.data, "dirId");
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.dirId != null) {
+              updateDir(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addDir(this.form).then(response => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        this.$modal.confirm('是否确认删除目录信息编号为"' + row.dirId + '"的数据项?').then(function() {
+          return delDir(row.dirId);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      }
+    }
+  };
+</script>

+ 334 - 0
lzga-ui/src/views/doc/dir/groupSpace.vue

@@ -0,0 +1,334 @@
+<template>
+  <div class="app-container">
+    <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:dir:add']"
+          v-hasRole="['group.manager']">新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <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="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)"
+            v-hasPermi="['doc:dir:add']" v-hasRole="['group.manager']">新增</el-button>
+          <el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-edit"
+            @click="handleUpdate(scope.row)" v-hasPermi="['doc:dir:edit']" v-hasRole="['group.manager']">修改</el-button>
+          <el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-delete"
+            @click="handleDelete(scope.row)" v-hasPermi="['doc:dir:remove']"
+            v-hasRole="['group.manager']">删除</el-button>
+        </template>
+      </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">
+        <el-form-item label="上级目录" prop="parentId">
+          <treeselect v-model="form.parentId" :options="dirOptions" :normalizer="normalizer" placeholder="请选择上级目录" />
+        </el-form-item>
+        <el-form-item label="目录名称" prop="dirName">
+          <el-input v-model="form.dirName" placeholder="请输入目录名称" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" 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>
+    <!-- 扩容申请对话框 -->
+    <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>
+
+<script>
+  import {
+    listDir,
+    getDir,
+    delDir,
+    addDir,
+    updateDir,
+    groupList
+  } from "@/api/doc/dir";
+
+  import {
+    getGroupSpace
+  } 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";
+
+  export default {
+    name: "GroupSpace",
+    components: {
+      Treeselect
+    },
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 目录信息表格数据
+        dirList: [],
+        // 目录信息树选项
+        dirOptions: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        openSpace: false,
+        // 是否展开,默认全部展开
+        isExpandAll: true,
+        // 重新渲染表格状态
+        refreshTable: true,
+        // 查询参数
+        queryParams: {
+          parentId: null,
+          dirName: null,
+        },
+        //个人空间数据
+        spaceData: {},
+        // 表单参数
+        form: {},
+        formSpace: {},
+        // 表单校验
+        rules: {
+          dirName: [{
+            required: true,
+            message: "目录名称不能为空",
+            trigger: "blur"
+          }],
+          parentId: [{
+            required: true,
+            message: "上级目录不能为空",
+            trigger: "blur"
+          }],
+        },
+        // 表单校验
+        rulesSpace: {
+          expandCap: [{
+            required: true,
+            message: "扩容容量不能为空",
+            trigger: "blur"
+          }],
+          remark: [{
+            required: true,
+            message: "申请理由不能为空",
+            trigger: "blur"
+          }],
+        }
+      };
+    },
+    created() {
+      console.log(this.$cache.local.get('USERNAME')) // 输出'local value'
+      const groupId = this.$route.params && this.$route.params.groupId;
+      if (groupId) {
+        this.queryParams.groupId = groupId;
+        this.getList();
+      }
+      this.spaceInfo();
+    },
+    methods: {
+      /** 查询个人空间相关信息 */
+      spaceInfo() {
+        this.loading = true;
+        getGroupSpace(this.queryParams.groupId).then(response => {
+          this.spaceData = response.data;
+          this.loading = false;
+        });
+      },
+      /** 查询目录信息列表 */
+      getList() {
+        this.loading = true;
+        groupList(this.queryParams.groupId).then(response => {
+          this.dirList = this.handleTree(response.data, "dirId");
+          this.loading = false;
+        });
+      },
+      /** 转换目录信息数据结构 */
+      normalizer(node) {
+        if (node.children && !node.children.length) {
+          delete node.children;
+        }
+        return {
+          id: node.dirId,
+          label: node.dirName,
+          children: node.children
+        };
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 取消按钮
+      cancelSpace() {
+        this.openSpace = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          dirId: null,
+          spaceId: null,
+          parentId: null,
+          dirName: null,
+          dirPath: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          remark: null,
+          isDel: null
+        };
+        this.resetForm("form");
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      /** 新增按钮操作 */
+      handleAdd(row) {
+        this.reset();
+        // this.getTreeselect();
+        if (row != null && row.dirId) {
+          this.form.parentId = row.dirId;
+          // } else {
+          // 	this.form.parentId = 0;
+        }
+        this.open = true;
+        this.title = "添加目录信息";
+        groupList(this.queryParams.groupId).then(response => {
+          this.form.spaceId = response.data[0].spaceId;
+          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 = "扩容申请";
+        groupList(this.queryParams.groupId).then(response => {
+          this.form.spaceId = response.data[0].spaceId;
+          this.dirOptions = this.handleTree(response.data, "dirId");
+        });
+      },
+      /** 展开/折叠操作 */
+      toggleExpandAll() {
+        this.refreshTable = false;
+        this.isExpandAll = !this.isExpandAll;
+        this.$nextTick(() => {
+          this.refreshTable = true;
+        });
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        if (row != null) {
+          this.form.parentId = row.dirId;
+        }
+        getDir(row.dirId).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改目录信息";
+        });
+        personalList().then(response => {
+          this.dirOptions = this.handleTree(response.data, "dirId");
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.dirId != null) {
+              updateDir(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addDir(this.form).then(response => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      /** 提交按钮 */
+      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() {
+          return delDir(row.dirId);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      }
+    }
+  };
+</script>

+ 134 - 0
lzga-ui/src/views/doc/dir/groupSpaceSelect.vue

@@ -0,0 +1,134 @@
+<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="groupName">
+        <el-input v-model="queryParams.groupName" 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-table v-loading="loading" :data="groupList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="分组名称" align="center" prop="groupName" />
+      <el-table-column label="分组管理员" align="center" prop="groupManagerName" />
+      <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-user" @click="handleGroupSpace(scope.row)">分组空间</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" />
+
+  </div>
+</template>
+
+<script>
+  import {
+    listGroup,
+    selectGroup,
+    getGroup,
+    delGroup,
+    addGroup,
+    updateGroup
+  } from "@/api/doc/group";
+
+  export default {
+    name: "GroupSpaceSelect",
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 分组表格数据
+        groupList: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          groupName: null,
+          groupManager: null,
+          groupManagerName: null,
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {}
+      };
+    },
+    created() {
+      this.getList();
+    },
+    methods: {
+      /** 查询分组列表 */
+      getList() {
+        this.loading = true;
+        selectGroup(this.queryParams).then(response => {
+          this.groupList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          groupId: null,
+          groupName: null,
+          groupManager: null,
+          groupManagerName: null,
+          creater: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          remark: null,
+          isDel: 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
+      },
+      /** 分组空间按钮操作 */
+      handleGroupSpace(row) {
+        const groupId = row.groupId;
+        this.$router.push("/doc/group-space/space/" + groupId);
+      }
+    }
+  };
+</script>

+ 275 - 0
lzga-ui/src/views/doc/dir/publicSpace.vue

@@ -0,0 +1,275 @@
+<template>
+  <div class="app-container">
+    <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:dir:add']">新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <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="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)"
+            v-hasPermi="['doc:dir:add']">新增</el-button>
+          <el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-edit"
+            @click="handleUpdate(scope.row)" v-hasPermi="['doc:dir:edit']">修改</el-button>
+          <el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-delete"
+            @click="handleDelete(scope.row)" v-hasPermi="['doc:dir:remove']">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 添加或修改目录信息对话框 -->
+    <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="parentId">
+          <treeselect v-model="form.parentId" :options="dirOptions" :normalizer="normalizer" placeholder="请选择上级目录" />
+        </el-form-item>
+        <el-form-item label="目录名称" prop="dirName">
+          <el-input v-model="form.dirName" placeholder="请输入目录名称" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" 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>
+  </div>
+</template>
+
+<script>
+  import {
+    listDir,
+    getDir,
+    delDir,
+    addDir,
+    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";
+
+  export default {
+    name: "Dir",
+    components: {
+      Treeselect
+    },
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 目录信息表格数据
+        dirList: [],
+        // 目录信息树选项
+        dirOptions: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        openSpace: false,
+        // 是否展开,默认全部展开
+        isExpandAll: true,
+        // 重新渲染表格状态
+        refreshTable: true,
+        // 查询参数
+        queryParams: {
+          parentId: null,
+          dirName: null,
+        },
+        //个人空间数据
+        spaceData: {},
+        // 表单参数
+        form: {},
+        formSpace: {},
+        // 表单校验
+        rules: {
+          dirName: [{
+            required: true,
+            message: "目录名称不能为空",
+            trigger: "blur"
+          }],
+          parentId: [{
+            required: true,
+            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;
+        personalList().then(response => {
+          this.dirList = this.handleTree(response.data, "dirId");
+          this.loading = false;
+        });
+      },
+      /** 转换目录信息数据结构 */
+      normalizer(node) {
+        if (node.children && !node.children.length) {
+          delete node.children;
+        }
+        return {
+          id: node.dirId,
+          label: node.dirName,
+          children: node.children
+        };
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 取消按钮
+      cancelSpace() {
+        this.openSpace = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          dirId: null,
+          spaceId: null,
+          parentId: null,
+          dirName: null,
+          dirPath: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          remark: null,
+          isDel: null
+        };
+        this.resetForm("form");
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      /** 新增按钮操作 */
+      handleAdd(row) {
+        this.reset();
+        // this.getTreeselect();
+        if (row != null && row.dirId) {
+          this.form.parentId = row.dirId;
+          // } else {
+          // 	this.form.parentId = 0;
+        }
+        this.open = true;
+        this.title = "添加目录信息";
+        personalList().then(response => {
+          this.form.spaceId = response.data[0].spaceId;
+          this.dirOptions = this.handleTree(response.data, "dirId");
+        });
+      },
+      /** 展开/折叠操作 */
+      toggleExpandAll() {
+        this.refreshTable = false;
+        this.isExpandAll = !this.isExpandAll;
+        this.$nextTick(() => {
+          this.refreshTable = true;
+        });
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        if (row != null) {
+          this.form.parentId = row.dirId;
+        }
+        getDir(row.dirId).then(response => {
+          this.form = response.data;
+          this.open = true;
+          this.title = "修改目录信息";
+        });
+        personalList().then(response => {
+          this.dirOptions = this.handleTree(response.data, "dirId");
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.dirId != null) {
+              updateDir(this.form).then(response => {
+                this.$modal.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              addDir(this.form).then(response => {
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      /** 删除按钮操作 */
+      handleDelete(row) {
+        this.$modal.confirm('是否确认删除目录信息编号为"' + row.dirId + '"的数据项?').then(function() {
+          return delDir(row.dirId);
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        }).catch(() => {});
+      }
+    }
+  };
+</script>

+ 2 - 2
lzga-ui/vue.config.js

@@ -35,8 +35,8 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://192.168.188.99:8080`,
-        // target: `http://192.168.1.11:8080`,
+        // target: `http://192.168.188.99:8080`,
+        target: `http://localhost:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''