2 커밋 65a4d8f113 ... 5c5eb07383

작성자 SHA1 메시지 날짜
  yxc 5c5eb07383 更改个人和分组存储空间的扩容 2 년 전
  yxc 86c58e5bfa 分组空间和个人空间扩容样式更改 2 년 전

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

@@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
-import java.util.Set;
 
 /**
  * 分组Controller
@@ -35,11 +34,6 @@ public class DocGroupController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo list(DocGroup docGroup) {
         startPage();
-        Set<String> roles = SecurityUtils.getLoginUser().getRoles();
-        if (!roles.contains("public.manager") && !roles.contains("admin")) {
-            docGroup.setGroupManager(SecurityUtils.getUserId());
-        }
-
         List<DocGroup> list = docGroupService.selectDocGroupList(docGroup);
         return getDataTable(list);
     }

+ 9 - 0
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocGroupUserController.java

@@ -35,6 +35,7 @@ public class DocGroupUserController extends BaseController {
     /**
      * 查询分组成员列表
      */
+    @RequiresPermissions("doc:groupUser:list")
     @GetMapping("/list")
     public TableDataInfo list(DocGroupUser docGroupUser) {
         startPage();
@@ -48,6 +49,7 @@ public class DocGroupUserController extends BaseController {
     /**
      * 查询未分配成员列表
      */
+    @RequiresPermissions("doc:groupUser:list")
     @GetMapping("/unallocatedList")
     public TableDataInfo unallocatedList(DocGroupUser docGroupUser) {
         startPage();
@@ -58,6 +60,7 @@ public class DocGroupUserController extends BaseController {
     /**
      * 分配分组成员
      */
+    @RequiresPermissions("doc:groupUser:list")
     @Log(title = "分组成员", businessType = BusinessType.GRANT)
     @PutMapping("/selectAll")
     public AjaxResult selectGroupUserAll(Long groupId, Long[] userIds) {
@@ -67,6 +70,7 @@ public class DocGroupUserController extends BaseController {
     /**
      * 批量取消授权用户
      */
+    @RequiresPermissions("doc:groupUser:list")
     @Log(title = "分组成员", businessType = BusinessType.GRANT)
     @PutMapping("/cancelAll")
     public AjaxResult cancelGroupUserAll(Long groupId, Long[] userIds) {
@@ -77,6 +81,7 @@ public class DocGroupUserController extends BaseController {
     /**
      * 导出分组成员列表
      */
+    @RequiresPermissions("doc:groupUser:export")
     @Log(title = "分组成员", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, DocGroupUser docGroupUser) {
@@ -88,6 +93,7 @@ public class DocGroupUserController extends BaseController {
     /**
      * 获取分组成员详细信息
      */
+    @RequiresPermissions("doc:groupUser:query")
     @GetMapping(value = "/{groupId}")
     public AjaxResult getInfo(@PathVariable("groupId") Long groupId) {
         return success(docGroupUserService.selectDocGroupUserByGroupId(groupId));
@@ -96,6 +102,7 @@ public class DocGroupUserController extends BaseController {
     /**
      * 新增分组成员
      */
+    @RequiresPermissions("doc:groupUser:add")
     @Log(title = "分组成员", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody DocGroupUser docGroupUser) {
@@ -105,6 +112,7 @@ public class DocGroupUserController extends BaseController {
     /**
      * 修改分组成员
      */
+    @RequiresPermissions("doc:groupUser:edit")
     @Log(title = "分组成员", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody DocGroupUser docGroupUser) {
@@ -114,6 +122,7 @@ public class DocGroupUserController extends BaseController {
     /**
      * 删除分组成员
      */
+    @RequiresPermissions("doc:groupUser:remove")
     @Log(title = "分组成员", businessType = BusinessType.DELETE)
     @DeleteMapping("/{groupIds}")
     public AjaxResult remove(@PathVariable Long[] groupIds) {

+ 0 - 14
lzga-modules/lzga-doc/src/main/java/com/jjt/doc/controller/DocInfoController.java

@@ -1,12 +1,10 @@
 package com.jjt.doc.controller;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.io.IOException;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 
-import com.jjt.common.core.utils.DateUtils;
 import com.jjt.common.security.utils.SecurityUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -74,18 +72,6 @@ public class DocInfoController extends BaseController {
     }
 
     /**
-     * 获取文档基本信息详细信息
-     */
-    @GetMapping(value = "/years")
-    public AjaxResult getYears() {
-        List<Integer> list = new ArrayList<>();
-        for (int i = 2023; i <= DateUtils.getCurrentYear(); i++) {
-            list.add(i);
-        }
-        return success(list);
-    }
-
-    /**
      * 新增文档基本信息
      */
 //    @RequiresPermissions("doc:info:add")

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

@@ -52,7 +52,7 @@ public class DocLevelController extends BaseController {
     /**
      * 导出文档级别列表
      */
-//    @RequiresPermissions("doc:level:export")
+    @RequiresPermissions("doc:level:export")
     @Log(title = "文档级别", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, DocLevel docLevel) {
@@ -64,7 +64,7 @@ public class DocLevelController extends BaseController {
     /**
      * 获取文档级别详细信息
      */
-//    @RequiresPermissions("doc:level:query")
+    @RequiresPermissions("doc:level:query")
     @GetMapping(value = "/{levelId}")
     public AjaxResult getInfo(@PathVariable("levelId") Long levelId) {
         return success(docLevelService.selectDocLevelByLevelId(levelId));
@@ -73,7 +73,7 @@ public class DocLevelController extends BaseController {
     /**
      * 新增文档级别
      */
-//    @RequiresPermissions("doc:level:add")
+    @RequiresPermissions("doc:level:add")
     @Log(title = "文档级别", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody DocLevel docLevel) {
@@ -84,7 +84,7 @@ public class DocLevelController extends BaseController {
     /**
      * 修改文档级别
      */
-//    @RequiresPermissions("doc:level:edit")
+    @RequiresPermissions("doc:level:edit")
     @Log(title = "文档级别", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody DocLevel docLevel) {
@@ -95,7 +95,7 @@ public class DocLevelController extends BaseController {
     /**
      * 删除文档级别
      */
-//    @RequiresPermissions("doc:level:remove")
+    @RequiresPermissions("doc:level:remove")
     @Log(title = "文档级别", businessType = BusinessType.DELETE)
     @DeleteMapping("/{levelIds}")
     public AjaxResult remove(@PathVariable Long[] levelIds) {

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

@@ -44,7 +44,7 @@ public class DocSpaceExpandController extends BaseController {
     /**
      * 查询扩容申请列表
      */
-//    @RequiresPermissions("doc:expand:list")
+    @RequiresPermissions("doc:expand:list")
     @GetMapping("/list")
     public TableDataInfo list(DocSpaceExpand docSpaceExpand) {
         startPage();
@@ -55,7 +55,7 @@ public class DocSpaceExpandController extends BaseController {
     /**
      * 导出扩容申请列表
      */
-//    @RequiresPermissions("doc:expand:export")
+    @RequiresPermissions("doc:expand:export")
     @Log(title = "扩容申请", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, DocSpaceExpand docSpaceExpand) {
@@ -67,7 +67,7 @@ public class DocSpaceExpandController extends BaseController {
     /**
      * 获取扩容申请详细信息
      */
-//    @RequiresPermissions("doc:expand:query")
+    @RequiresPermissions("doc:expand:query")
     @GetMapping(value = "/{expandId}")
     public AjaxResult getInfo(@PathVariable("expandId") Long expandId) {
         return success(docSpaceExpandService.selectDocSpaceExpandByExpandId(expandId));
@@ -87,7 +87,7 @@ public class DocSpaceExpandController extends BaseController {
     /**
      * 修改扩容申请
      */
-//    @RequiresPermissions("doc:expand:edit")
+    @RequiresPermissions("doc:expand:edit")
     @Log(title = "扩容申请", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody DocSpaceExpand docSpaceExpand) {
@@ -97,7 +97,7 @@ public class DocSpaceExpandController extends BaseController {
     /**
      * 同意扩容
      */
-//    @RequiresPermissions("doc:expand:edit")
+    @RequiresPermissions("doc:expand:edit")
     @Log(title = "扩容申请", businessType = BusinessType.UPDATE)
     @GetMapping("/yes/{expandId}")
     public AjaxResult yes(@PathVariable("expandId") Long expandId) {
@@ -120,7 +120,7 @@ public class DocSpaceExpandController extends BaseController {
     /**
      * 修改扩容申请
      */
-//    @RequiresPermissions("doc:expand:edit")
+    @RequiresPermissions("doc:expand:edit")
     @Log(title = "扩容申请", businessType = BusinessType.UPDATE)
     @GetMapping("/no/{expandId}")
     public AjaxResult no(@PathVariable("expandId") Long expandId) {
@@ -132,7 +132,7 @@ public class DocSpaceExpandController extends BaseController {
     /**
      * 删除扩容申请
      */
-//    @RequiresPermissions("doc:expand:remove")
+    @RequiresPermissions("doc:expand:remove")
     @Log(title = "扩容申请", businessType = BusinessType.DELETE)
     @DeleteMapping("/{expandIds}")
     public AjaxResult remove(@PathVariable Long[] expandIds) {

+ 27 - 42
lzga-modules/lzga-doc/src/main/resources/mapper/doc/DocSpaceExpandMapper.xml

@@ -1,56 +1,43 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jjt.doc.mapper.DocSpaceExpandMapper">
-
+    
     <resultMap type="DocSpaceExpand" id="DocSpaceExpandResult">
-        <result property="expandId" column="EXPAND_ID"/>
-        <result property="spaceId" column="SPACE_ID"/>
-        <result property="spaceName" column="SPACE_NAME"/>
-        <result property="currentCap" column="CURRENT_CAP"/>
-        <result property="expandCap" column="EXPAND_CAP"/>
-        <result property="expandStatus" column="EXPAND_STATUS"/>
-        <result property="createBy" column="CREATE_BY"/>
-        <result property="createTime" column="CREATE_TIME"/>
-        <result property="updateBy" column="UPDATE_BY"/>
-        <result property="updateTime" column="UPDATE_TIME"/>
-        <result property="remark" column="REMARK"/>
-        <result property="isDel" column="IS_DEL"/>
+        <result property="expandId"    column="EXPAND_ID"    />
+        <result property="spaceId"    column="SPACE_ID"    />
+        <result property="spaceName"    column="SPACE_NAME"    />
+        <result property="currentCap"    column="CURRENT_CAP"    />
+        <result property="expandCap"    column="EXPAND_CAP"    />
+        <result property="expandStatus"    column="EXPAND_STATUS"    />
+        <result property="createBy"    column="CREATE_BY"    />
+        <result property="createTime"    column="CREATE_TIME"    />
+        <result property="updateBy"    column="UPDATE_BY"    />
+        <result property="updateTime"    column="UPDATE_TIME"    />
+        <result property="remark"    column="REMARK"    />
+        <result property="isDel"    column="IS_DEL"    />
     </resultMap>
 
     <sql id="selectDocSpaceExpandVo">
-        select EXPAND_ID,
-               SPACE_ID,
-               SPACE_NAME,
-               CURRENT_CAP,
-               EXPAND_CAP,
-               EXPAND_STATUS,
-               CREATE_BY,
-               CREATE_TIME,
-               UPDATE_BY,
-               UPDATE_TIME,
-               REMARK,
-               IS_DEL
-        from doc_space_expand
+        select EXPAND_ID, SPACE_ID, SPACE_NAME, CURRENT_CAP, EXPAND_CAP, EXPAND_STATUS, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK, IS_DEL from doc_space_expand
     </sql>
 
     <select id="selectDocSpaceExpandList" parameterType="DocSpaceExpand" resultMap="DocSpaceExpandResult">
         <include refid="selectDocSpaceExpandVo"/>
-        <where>
-            <if test="spaceId != null  and spaceId != ''">and SPACE_ID=#{spaceId}</if>
-            <if test="spaceName != null  and spaceName != ''">and SPACE_NAME like concat('%', #{spaceName}, '%')</if>
-            <if test="currentCap != null ">and CURRENT_CAP = #{currentCap}</if>
-            <if test="expandCap != null ">and EXPAND_CAP = #{expandCap}</if>
-            <if test="expandStatus != null  and expandStatus != ''">and EXPAND_STATUS = #{expandStatus}</if>
+        <where>  
+            <if test="spaceName != null  and spaceName != ''"> and SPACE_NAME like concat('%', #{spaceName}, '%')</if>
+            <if test="currentCap != null "> and CURRENT_CAP = #{currentCap}</if>
+            <if test="expandCap != null "> and EXPAND_CAP = #{expandCap}</if>
+            <if test="expandStatus != null  and expandStatus != ''"> and EXPAND_STATUS = #{expandStatus}</if>
         </where>
     </select>
-
+    
     <select id="selectDocSpaceExpandByExpandId" parameterType="Long" resultMap="DocSpaceExpandResult">
         <include refid="selectDocSpaceExpandVo"/>
         where EXPAND_ID = #{expandId}
     </select>
-
+        
     <insert id="insertDocSpaceExpand" parameterType="DocSpaceExpand" useGeneratedKeys="true" keyProperty="expandId">
         insert into doc_space_expand
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -65,7 +52,7 @@
             <if test="updateTime != null">UPDATE_TIME,</if>
             <if test="remark != null and remark != ''">REMARK,</if>
             <if test="isDel != null">IS_DEL,</if>
-        </trim>
+         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="spaceId != null">#{spaceId},</if>
             <if test="spaceName != null and spaceName != ''">#{spaceName},</if>
@@ -78,7 +65,7 @@
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null and remark != ''">#{remark},</if>
             <if test="isDel != null">#{isDel},</if>
-        </trim>
+         </trim>
     </insert>
 
     <update id="updateDocSpaceExpand" parameterType="DocSpaceExpand">
@@ -100,13 +87,11 @@
     </update>
 
     <delete id="deleteDocSpaceExpandByExpandId" parameterType="Long">
-        delete
-        from doc_space_expand
-        where EXPAND_ID = #{expandId}
+        delete from doc_space_expand where EXPAND_ID = #{expandId}
     </delete>
 
     <delete id="deleteDocSpaceExpandByExpandIds" parameterType="String">
-        delete from doc_space_expand where EXPAND_ID in
+        delete from doc_space_expand where EXPAND_ID in 
         <foreach item="expandId" collection="array" open="(" separator="," close=")">
             #{expandId}
         </foreach>

+ 2 - 2
lzga-modules/lzga-system/src/main/java/com/jjt/system/controller/SysUserController.java

@@ -72,7 +72,7 @@ public class SysUserController extends BaseController {
     /**
      * 获取用户列表
      */
-//    @RequiresPermissions("system:user:list")
+    @RequiresPermissions("system:user:list")
     @GetMapping("/list")
     public TableDataInfo list(SysUser user) {
         startPage();
@@ -322,7 +322,7 @@ public class SysUserController extends BaseController {
     /**
      * 获取部门树列表
      */
-//    @RequiresPermissions("system:user:list")
+    @RequiresPermissions("system:user:list")
     @GetMapping("/deptTree")
     public AjaxResult deptTree(SysDept dept) {
         return success(deptService.selectDeptTreeList(dept));

+ 1 - 14
lzga-ui/src/api/doc/info.js

@@ -8,13 +8,6 @@ export function listInfo(query) {
     params: query
   })
 }
-// 查询文档基本信息列表
-export function getYears() {
-  return request({
-    url: '/doc/info/years',
-    method: 'get'
-  })
-}
 
 // 查询文档基本信息详细
 export function getInfo(docId, createYear) {
@@ -48,10 +41,4 @@ export function delInfo(docId) {
     url: '/doc/info/' + docId,
     method: 'delete'
   })
-}
-
-
-export const officeType = ['doc', 'docm', 'docx', 'dot', 'dotm', 'dotx', 'epub', 'fodt', 'htm', 'html', 'mht', 'odt',
-  'ott', 'pdf', 'rtf', 'txt', 'djvu', 'xps', 'csv', 'fods', 'ods', 'ots', 'xls', 'xlsm', 'xlsx', 'xlt', 'xltm',
-  'xltx', 'fodp', 'odp', 'otp', 'pot', 'potm', 'potx', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx'
-]
+}

+ 169 - 185
lzga-ui/src/components/FileUpload/index.vue

@@ -1,8 +1,19 @@
 <template>
   <div class="upload-file">
-    <el-upload multiple :action="uploadFileUrl" :before-upload="handleBeforeUpload" :file-list="fileList" :limit="limit"
-      :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="false"
-      :headers="headers" class="upload-file-uploader" ref="fileUpload">
+    <el-upload
+      multiple
+      :action="uploadFileUrl"
+      :before-upload="handleBeforeUpload"
+      :file-list="fileList"
+      :limit="limit"
+      :on-error="handleUploadError"
+      :on-exceed="handleExceed"
+      :on-success="handleUploadSuccess"
+      :show-file-list="false"
+      :headers="headers"
+      class="upload-file-uploader"
+      ref="fileUpload"
+    >
       <!-- 上传按钮 -->
       <el-button size="mini" type="primary">选取文件</el-button>
       <!-- 上传提示 -->
@@ -29,202 +40,175 @@
 </template>
 
 <script>
-  import {
-    getToken
-  } from "@/utils/auth";
+import { getToken } from "@/utils/auth";
 
-  export default {
-    name: "FileUpload",
-    props: {
-      // 值
-      value: [String, Object, Array],
-      // 数量限制
-      limit: {
-        type: Number,
-        default: 1,
-      },
-      // 大小限制(MB)
-      fileSize: {
-        type: Number,
-        default: 1024,
-      },
-      // 文件类型, 例如['png', 'jpg', 'jpeg']
-      fileType: {
-        type: Array,
-        default: () => ["doc", "docx", "xls", "xlsx", "ppt", "txt", "pdf", "gz"],
-      },
-      // 是否显示提示
-      isShowTip: {
-        type: Boolean,
-        default: true
-      },
-      residueNum: {
-        type: String,
-        default: null
-      }
+export default {
+  name: "FileUpload",
+  props: {
+    // 值
+    value: [String, Object, Array],
+    // 数量限制
+    limit: {
+      type: Number,
+      default: 5,
     },
-    data() {
-      return {
-        number: 0,
-        uploadList: [],
-        uploadFileUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传文件服务器地址
-        headers: {
-          Authorization: "Bearer " + getToken()
-        },
-        fileList: []
-      }
+    // 大小限制(MB)
+    fileSize: {
+      type: Number,
+      default: 1024,
     },
-    watch: {
-      value: {
-        handler(val) {
-          if (val) {
-            let temp = 1;
-            // 首先将值转为数组
-            const list = Array.isArray(val) ? val : this.value.split(',');
-            // 然后将数组转为对象数组
-            this.fileList = list.map(item => {
-              if (typeof item === "string") {
-                item = {
-                  name: item,
-                  url: item
-                }
-              }
-              item.uid = item.uid || new Date().getTime() + temp++;
-              return item
-            })
-          } else {
-            this.fileList = []
-            return []
-          }
-        },
-        deep: true,
-        immediate: true
-      }
-    },
-    computed: {
-      // 是否显示提示
-      showTip() {
-        return this.isShowTip && (this.fileType || this.fileSize);
-      },
+    // 文件类型, 例如['png', 'jpg', 'jpeg']
+    fileType: {
+      type: Array,
+      default: () => ["doc","docx", "xls","xlsx", "ppt", "txt", "pdf","gz"],
     },
-    methods: {
-      // 上传前校检格式和大小
-      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;
-        //   }
-        // }
-        // console.log((this.residueNum * 1024).toFixed(2), 'residue')
-
-        let size2mb = file.size / 1024 / 1024;
-        //将文件大小转换为MB。
-        //校验空间
-        if (this.residueNum) {
-          if (size2mb > this.residueNum) {
-            this.$modal.msgError(`存储空间容量剩余 ${this.residueNum} MB!,请联系管理员申请扩容后再次上传。`);
-            return false;
-          }
-        }
-
-        // 校检文件大小
-        if (this.fileSize) {
-          const isLt = size2mb < this.fileSize;
-          if (!isLt) {
-            this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
-            return false;
-          }
-        }
-        this.$modal.loading("正在上传文件,请稍候...");
-        this.number++;
-        return true;
-      },
-      // 文件个数超出
-      handleExceed() {
-        this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
-      },
-      // 上传失败
-      handleUploadError(err) {
-        this.$modal.msgError("上传文件失败,请重试");
-        this.$modal.closeLoading()
+    // 是否显示提示
+    isShowTip: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data() {
+    return {
+      number: 0,
+      uploadList: [],
+      uploadFileUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传文件服务器地址
+      headers: {
+        Authorization: "Bearer " + getToken(),
       },
-      // 上传成功回调
-      handleUploadSuccess(res, file) {
-        if (res.code === 200) {
-          this.uploadList.push({
-            name: res.data.url,
-            url: res.data.url
+      fileList: [],
+    };
+  },
+  watch: {
+    value: {
+      handler(val) {
+        if (val) {
+          let temp = 1;
+          // 首先将值转为数组
+          const list = Array.isArray(val) ? val : this.value.split(',');
+          // 然后将数组转为对象数组
+          this.fileList = list.map(item => {
+            if (typeof item === "string") {
+              item = { name: item, url: item };
+            }
+            item.uid = item.uid || new Date().getTime() + temp++;
+            return item;
           });
-          this.uploadedSuccessfully();
-        } else {
-          this.number--;
-          this.$modal.closeLoading();
-          this.$modal.msgError(res.msg);
-          this.$refs.fileUpload.handleRemove(file);
-          this.uploadedSuccessfully();
-        }
-      },
-      // 删除文件
-      handleDelete(index) {
-        this.fileList.splice(index, 1);
-        this.$emit("input", this.listToString(this.fileList));
-      },
-      // 上传结束处理
-      uploadedSuccessfully() {
-        if (this.number > 0 && this.uploadList.length === this.number) {
-          this.fileList = this.fileList.concat(this.uploadList);
-          this.uploadList = [];
-          this.number = 0;
-          this.$emit("input", this.listToString(this.fileList));
-          this.$modal.closeLoading();
-        }
-      },
-      // 获取文件名称
-      getFileName(name) {
-        if (name.lastIndexOf("/") > -1) {
-          return name.slice(name.lastIndexOf("/") + 1);
         } else {
-          return "";
+          this.fileList = [];
+          return [];
         }
       },
-      // 对象转成指定字符串分隔
-      listToString(list, separator) {
-        let strs = "";
-        separator = separator || ",";
-        for (let i in list) {
-          strs += list[i].url + separator;
+      deep: true,
+      immediate: true
+    }
+  },
+  computed: {
+    // 是否显示提示
+    showTip() {
+      return this.isShowTip && (this.fileType || this.fileSize);
+    },
+  },
+  methods: {
+    // 上传前校检格式和大小
+    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.fileSize) {
+        const isLt = file.size / 1024 / 1024 < this.fileSize;
+        if (!isLt) {
+          this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
+          return false;
         }
-        return strs != '' ? strs.substr(0, strs.length - 1) : '';
       }
+      this.$modal.loading("正在上传文件,请稍候...");
+      this.number++;
+      return true;
+    },
+    // 文件个数超出
+    handleExceed() {
+      this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
+    },
+    // 上传失败
+    handleUploadError(err) {
+      this.$modal.msgError("上传文件失败,请重试");
+      this.$modal.closeLoading()
+    },
+    // 上传成功回调
+    handleUploadSuccess(res, file) {
+      if (res.code === 200) {
+        this.uploadList.push({ name: res.data.url, url: res.data.url });
+        this.uploadedSuccessfully();
+      } else {
+        this.number--;
+        this.$modal.closeLoading();
+        this.$modal.msgError(res.msg);
+        this.$refs.fileUpload.handleRemove(file);
+        this.uploadedSuccessfully();
+      }
+    },
+    // 删除文件
+    handleDelete(index) {
+      this.fileList.splice(index, 1);
+      this.$emit("input", this.listToString(this.fileList));
+    },
+    // 上传结束处理
+    uploadedSuccessfully() {
+      if (this.number > 0 && this.uploadList.length === this.number) {
+        this.fileList = this.fileList.concat(this.uploadList);
+        this.uploadList = [];
+        this.number = 0;
+        this.$emit("input", this.listToString(this.fileList));
+        this.$modal.closeLoading();
+      }
+    },
+    // 获取文件名称
+    getFileName(name) {
+      if (name.lastIndexOf("/") > -1) {
+        return name.slice(name.lastIndexOf("/") + 1);
+      } else {
+        return "";
+      }
+    },
+    // 对象转成指定字符串分隔
+    listToString(list, separator) {
+      let strs = "";
+      separator = separator || ",";
+      for (let i in list) {
+        strs += list[i].url + separator;
+      }
+      return strs != '' ? strs.substr(0, strs.length - 1) : '';
     }
   }
+};
 </script>
 
 <style scoped lang="scss">
-  .upload-file-uploader {
-    margin-bottom: 5px;
-  }
-
-  .upload-file-list .el-upload-list__item {
-    border: 1px solid #e4e7ed;
-    line-height: 2;
-    margin-bottom: 10px;
-    position: relative;
-  }
-
-  .upload-file-list .ele-upload-list__item-content {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    color: inherit;
-  }
-
-  .ele-upload-list__item-content-action .el-link {
-    margin-right: 10px;
-  }
+.upload-file-uploader {
+  margin-bottom: 5px;
+}
+.upload-file-list .el-upload-list__item {
+  border: 1px solid #e4e7ed;
+  line-height: 2;
+  margin-bottom: 10px;
+  position: relative;
+}
+.upload-file-list .ele-upload-list__item-content {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  color: inherit;
+}
+.ele-upload-list__item-content-action .el-link {
+  margin-right: 10px;
+}
 </style>

+ 6 - 1
lzga-ui/src/views1/Personal/Space/SpaceView.vue

@@ -616,5 +616,10 @@
 
   ::v-deep .vue-treeselect__option.vue-treeselect__option--highlight {
     background: #01D1FF3B;
-  }
+
+}
+::v-deep .el-dialog .el-input {
+    width: calc(100vw * (200 / 1920)) !important;
+}
+
 </style>

+ 12 - 8
lzga-ui/src/views1/Personal/Storagespace/Groupspace.vue

@@ -627,12 +627,16 @@
 
   ::v-deep .vue-treeselect__option.vue-treeselect__option--highlight {
     background: #01D1FF3B;
-  }
+}
+//返回按钮
+::v-deep .el-button--warning.is-plain {
+  background-color: #002a5cff;
+  border: none;
+  color: #1890ff;
+}
+
+::v-deep .el-dialog .el-input {
+    width: calc(100vw * (200 / 1920)) !important;
+}
+</style>
 
-  //返回按钮
-  ::v-deep .el-button--warning.is-plain {
-    background-color: #002a5cff;
-    border: none;
-    color: #1890ff;
-  }
-</style>