浏览代码

问卷表、进度表、开项表新增审计文档管理(关联同一个code的附件)

wangggziwen 10 月之前
父节点
当前提交
89d7db1b7e

+ 143 - 0
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TFileController.java

@@ -0,0 +1,143 @@
+package com.ruoyi.web.controller.rc;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.rc.domain.TFile;
+import com.ruoyi.rc.service.ITFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 附件Controller
+ *
+ * @author jiang
+ * @date 2023-10-16
+ */
+@RestController
+@RequestMapping("/file/file")
+public class TFileController extends BaseController {
+    @Autowired
+    private ITFileService tFileService;
+
+    /**
+     * 查询附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:list')")
+    @GetMapping("/list")
+    public AjaxResult list(TFile tFile) {
+        if (StringUtils.isEmpty(tFile.getLinkName())) {
+            return AjaxResult.success(new ArrayList<TFile>());
+        }
+        List<TFile> list = tFileService.selectTFileList(tFile);
+        return AjaxResult.success(list);
+    }
+
+
+    /**
+     * 获取附件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tFileService.selectTFileById(id));
+    }
+
+    /**
+     * 新增附件
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:add')")
+    @Log(title = "附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TFile tFile) {
+        return toAjax(tFileService.insertTFile(tFile));
+    }
+
+    /**
+     * 修改附件
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:edit')")
+    @Log(title = "附件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TFile tFile) {
+        return toAjax(tFileService.updateTFile(tFile));
+    }
+
+    /**
+     * 删除附件
+     */
+    @PreAuthorize("@ss.hasPermi('file:file:remove')")
+    @Log(title = "附件", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tFileService.deleteTFileByIds(ids));
+    }
+
+
+    @PostMapping("/uploadFile")
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file,
+                                 @RequestParam(value = "linkId", required = false) Long linkId,
+                                 @RequestParam(value = "linkName", required = false) String linkName,
+                                 @RequestParam(value = "pId", required = false) Long pId) throws IOException {
+        if (!file.isEmpty()) {
+            String avatar = FileUploadUtils.upload(RuoYiConfig.getUploadPath(), file);
+            TFile tFile = new TFile();
+            tFile.setFileName(file.getOriginalFilename());
+            tFile.setFileUrl(avatar);
+            switch (Objects.requireNonNull(file.getOriginalFilename()).substring(
+                    file.getOriginalFilename().lastIndexOf(".") + 1)) {
+                case "jpg":
+                case "png":
+                case "gif":
+                case "bmp":
+                case "jpeg":
+                case "jpe":
+                    tFile.setType("6");
+                    break;
+                case "xls":
+                case "xlsx":
+                    tFile.setType("1");
+                    break;
+                case "ppt":
+                case "pptx":
+                    tFile.setType("2");
+                    break;
+                case "doc":
+                case "docx":
+                    tFile.setType("3");
+                    break;
+                case "pdf":
+                    tFile.setType("4");
+                    break;
+                case "txt":
+                    tFile.setType("5");
+                    break;
+
+            }
+            tFile.setpId(pId);
+            tFile.setFileSize(String.valueOf(new BigDecimal(file.getSize()).
+                    divide(BigDecimal.valueOf(1024), 2, RoundingMode.HALF_DOWN)));
+            tFile.setUploader(getNickname());
+            tFile.setUploadDate(new Date());
+            tFile.setLinkId(linkId);
+            tFile.setLinkName(linkName);
+            tFileService.insertTFile(tFile);
+            return AjaxResult.success(avatar);
+        }
+        return AjaxResult.error("上传异常,请联系管理员");
+    }
+}

+ 186 - 0
rc-buisness/src/main/java/com/ruoyi/rc/domain/TFile.java

@@ -0,0 +1,186 @@
+package com.ruoyi.rc.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 附件对象 t_file
+ *
+ * @author jiang
+ * @date 2023-10-16
+ */
+public class TFile extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long id;
+
+    /**
+     * 附件地址
+     */
+    @Excel(name = "附件地址")
+    private String fileUrl;
+
+    /**
+     * 附件名称
+     */
+    @Excel(name = "附件名称")
+    private String fileName;
+
+    /**
+     * 文件大小
+     */
+    @Excel(name = "文件大小")
+    private String fileSize;
+
+    /**
+     * 类型
+     */
+    @Excel(name = "类型")
+    private String type;
+
+    /**
+     * 上传时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date uploadDate;
+
+    /**
+     * 上传人
+     */
+    @Excel(name = "上传人")
+    private String uploader;
+
+    /**
+     * 关联表id
+     */
+    @Excel(name = "关联表id")
+    private Long linkId;
+
+    /**
+     * 关联表名
+     */
+    @Excel(name = "关联表名")
+    private String linkName;
+
+    /**
+     * 删除标识
+     */
+    private String delFlag;
+
+    /**
+     * 上级id
+     */
+    private Long pId;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public String getFileSize() {
+        return fileSize;
+    }
+
+    public void setFileSize(String fileSize) {
+        this.fileSize = fileSize;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public void setUploadDate(Date uploadDate) {
+        this.uploadDate = uploadDate;
+    }
+
+    public Date getUploadDate() {
+        return uploadDate;
+    }
+
+    public void setUploader(String uploader) {
+        this.uploader = uploader;
+    }
+
+    public String getUploader() {
+        return uploader;
+    }
+
+    public void setLinkId(Long linkId) {
+        this.linkId = linkId;
+    }
+
+    public Long getLinkId() {
+        return linkId;
+    }
+
+    public void setLinkName(String linkName) {
+        this.linkName = linkName;
+    }
+
+    public String getLinkName() {
+        return linkName;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public Long getpId() {
+        return pId;
+    }
+
+    public void setpId(Long pId) {
+        this.pId = pId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("fileUrl", getFileUrl())
+                .append("fileName", getFileName())
+                .append("uploadDate", getUploadDate())
+                .append("uploader", getUploader())
+                .append("remark", getRemark())
+                .append("linkId", getLinkId())
+                .append("linkName", getLinkName())
+                .append("delFlag", getDelFlag())
+                .toString();
+    }
+}

+ 63 - 0
rc-buisness/src/main/java/com/ruoyi/rc/mapper/TFileMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.rc.mapper;
+
+
+import com.ruoyi.rc.domain.TFile;
+
+import java.util.List;
+
+/**
+ * 附件Mapper接口
+ * 
+ * @author jiang
+ * @date 2023-10-16
+ */
+public interface TFileMapper 
+{
+    /**
+     * 查询附件
+     * 
+     * @param id 附件主键
+     * @return 附件
+     */
+    public TFile selectTFileById(Long id);
+
+    /**
+     * 查询附件列表
+     * 
+     * @param tFile 附件
+     * @return 附件集合
+     */
+    public List<TFile> selectTFileList(TFile tFile);
+
+    /**
+     * 新增附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    public int insertTFile(TFile tFile);
+
+    /**
+     * 修改附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    public int updateTFile(TFile tFile);
+
+    /**
+     * 删除附件
+     * 
+     * @param id 附件主键
+     * @return 结果
+     */
+    public int deleteTFileById(Long id);
+
+    /**
+     * 批量删除附件
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTFileByIds(Long[] ids);
+}

+ 62 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/ITFileService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.rc.service;
+
+import com.ruoyi.rc.domain.TFile;
+
+import java.util.List;
+
+/**
+ * 附件Service接口
+ * 
+ * @author jiang
+ * @date 2023-10-16
+ */
+public interface ITFileService 
+{
+    /**
+     * 查询附件
+     * 
+     * @param id 附件主键
+     * @return 附件
+     */
+    public TFile selectTFileById(Long id);
+
+    /**
+     * 查询附件列表
+     * 
+     * @param tFile 附件
+     * @return 附件集合
+     */
+    public List<TFile> selectTFileList(TFile tFile);
+
+    /**
+     * 新增附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    public int insertTFile(TFile tFile);
+
+    /**
+     * 修改附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    public int updateTFile(TFile tFile);
+
+    /**
+     * 批量删除附件
+     * 
+     * @param ids 需要删除的附件主键集合
+     * @return 结果
+     */
+    public int deleteTFileByIds(Long[] ids);
+
+    /**
+     * 删除附件信息
+     * 
+     * @param id 附件主键
+     * @return 结果
+     */
+    public int deleteTFileById(Long id);
+}

+ 94 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TFileServiceImpl.java

@@ -0,0 +1,94 @@
+package com.ruoyi.rc.service.impl;
+
+import com.ruoyi.rc.domain.TFile;
+import com.ruoyi.rc.mapper.TFileMapper;
+import com.ruoyi.rc.service.ITFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 附件Service业务层处理
+ * 
+ * @author jiang
+ * @date 2023-10-16
+ */
+@Service
+public class TFileServiceImpl implements ITFileService
+{
+    @Autowired
+    private TFileMapper tFileMapper;
+
+    /**
+     * 查询附件
+     * 
+     * @param id 附件主键
+     * @return 附件
+     */
+    @Override
+    public TFile selectTFileById(Long id)
+    {
+        return tFileMapper.selectTFileById(id);
+    }
+
+    /**
+     * 查询附件列表
+     * 
+     * @param tFile 附件
+     * @return 附件
+     */
+    @Override
+    public List<TFile> selectTFileList(TFile tFile)
+    {
+        return tFileMapper.selectTFileList(tFile);
+    }
+
+    /**
+     * 新增附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    @Override
+    public int insertTFile(TFile tFile)
+    {
+        return tFileMapper.insertTFile(tFile);
+    }
+
+    /**
+     * 修改附件
+     * 
+     * @param tFile 附件
+     * @return 结果
+     */
+    @Override
+    public int updateTFile(TFile tFile)
+    {
+        return tFileMapper.updateTFile(tFile);
+    }
+
+    /**
+     * 批量删除附件
+     * 
+     * @param ids 需要删除的附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTFileByIds(Long[] ids)
+    {
+        return tFileMapper.deleteTFileByIds(ids);
+    }
+
+    /**
+     * 删除附件信息
+     * 
+     * @param id 附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTFileById(Long id)
+    {
+        return tFileMapper.deleteTFileById(id);
+    }
+}

+ 105 - 0
rc-buisness/src/main/resources/mapper/rc/TFileMapper.xml

@@ -0,0 +1,105 @@
+<?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">
+<mapper namespace="com.ruoyi.rc.mapper.TFileMapper">
+
+    <resultMap type="TFile" id="TFileResult">
+        <result property="id"    column="id"    />
+        <result property="fileUrl"    column="file_url"    />
+        <result property="fileName"    column="file_name"    />
+        <result property="fileSize"    column="file_size"    />
+        <result property="type"    column="type"    />
+        <result property="uploadDate"    column="upload_date"    />
+        <result property="uploader"    column="uploader"    />
+        <result property="remark"    column="remark"    />
+        <result property="linkId"    column="link_id"    />
+        <result property="linkName"    column="link_name"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="pId"    column="p_id"    />
+    </resultMap>
+
+    <sql id="selectTFileVo">
+        select id, file_url, file_name, file_size, type, upload_date, uploader, remark, link_id, link_name, del_flag, p_id from t_file
+    </sql>
+
+    <select id="selectTFileList" parameterType="TFile" resultMap="TFileResult">
+        <include refid="selectTFileVo"/>
+        <where>
+            <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
+            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
+            <if test="fileSize != null  and fileSize != ''"> and file_size = #{fileSize}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="uploadDate != null "> and upload_date = #{uploadDate}</if>
+            <if test="uploader != null  and uploader != ''"> and uploader = #{uploader}</if>
+            <if test="linkId != null "> and link_id = #{linkId}</if>
+            <if test="linkName != null  and linkName != ''"> and link_name = #{linkName}</if>
+            <if test="pId != null "> and p_id = #{pId}</if>
+        and del_flag=0
+        </where>
+    </select>
+
+    <select id="selectTFileById" parameterType="Long" resultMap="TFileResult">
+        <include refid="selectTFileVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTFile" parameterType="TFile" useGeneratedKeys="true" keyProperty="id">
+        insert into t_file
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="fileSize != null">file_size,</if>
+            <if test="type != null">type,</if>
+            <if test="uploadDate != null">upload_date,</if>
+            <if test="uploader != null">uploader,</if>
+            <if test="remark != null">remark,</if>
+            <if test="linkId != null">link_id,</if>
+            <if test="linkName != null">link_name,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="pId != null">p_id,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="fileSize != null">#{fileSize},</if>
+            <if test="type != null">#{type},</if>
+            <if test="uploadDate != null">#{uploadDate},</if>
+            <if test="uploader != null">#{uploader},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="linkId != null">#{linkId},</if>
+            <if test="linkName != null">#{linkName},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="pId != null">#{pId},</if>
+        </trim>
+    </insert>
+
+    <update id="updateTFile" parameterType="TFile">
+        update t_file
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="fileSize != null">file_size = #{fileSize},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="uploadDate != null">upload_date = #{uploadDate},</if>
+            <if test="uploader != null">uploader = #{uploader},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="linkId != null">link_id = #{linkId},</if>
+            <if test="linkName != null">link_name = #{linkName},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="pId != null">p_id = #{pId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTFileById" parameterType="Long">
+        delete from t_file where id = #{id}
+    </delete>
+
+    <delete id="deleteTFileByIds" parameterType="String">
+        delete from t_file where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 8 - 0
rc-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java

@@ -199,4 +199,12 @@ public class BaseController
     {
         return getLoginUser().getUsername();
     }
+
+    /**
+     * 获取用户昵称
+     */
+    public String getNickname()
+    {
+        return getLoginUser().getUser().getNickName();
+    }
 }

+ 44 - 0
ruoyi-ui/src/api/rc/file.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询附件列表
+export function listFile(query) {
+  return request({
+    url: '/file/file/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询附件详细
+export function getFile(id) {
+  return request({
+    url: '/file/file/' + id,
+    method: 'get'
+  })
+}
+
+// 新增附件
+export function addFile(data) {
+  return request({
+    url: '/file/file',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改附件
+export function updateFile(data) {
+  return request({
+    url: '/file/file',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除附件
+export function delFile(id) {
+  return request({
+    url: '/file/file/' + id,
+    method: 'delete'
+  })
+}

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/excel_1.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1592733760426" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14956" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M145.6 0C100.8 0 64 36.8 64 81.6v860.8C64 987.2 100.8 1024 145.6 1024h732.8c44.8 0 81.6-36.8 81.6-81.6V324.8L657.6 0h-512z" fill="#45B058" p-id="14957"></path><path d="M374.4 862.4c-3.2 0-6.4-1.6-8-3.2l-59.2-80-60.8 80c-1.6 1.6-4.8 3.2-8 3.2-6.4 0-11.2-4.8-11.2-11.2 0-1.6 0-4.8 1.6-6.4l62.4-81.6-57.6-78.4c-1.6-1.6-3.2-3.2-3.2-6.4 0-4.8 4.8-11.2 11.2-11.2 4.8 0 8 1.6 9.6 4.8l56 73.6 54.4-73.6c1.6-3.2 4.8-4.8 8-4.8 6.4 0 12.8 4.8 12.8 11.2 0 3.2-1.6 4.8-1.6 6.4l-59.2 76.8 62.4 83.2c1.6 1.6 3.2 4.8 3.2 6.4 0 6.4-6.4 11.2-12.8 11.2z m160-1.6H448c-9.6 0-17.6-8-17.6-17.6V678.4c0-6.4 4.8-11.2 12.8-11.2 6.4 0 11.2 4.8 11.2 11.2v161.6h80c6.4 0 11.2 4.8 11.2 9.6 0 6.4-4.8 11.2-11.2 11.2z m112 3.2c-28.8 0-51.2-9.6-67.2-24-3.2-1.6-3.2-4.8-3.2-8 0-6.4 3.2-12.8 11.2-12.8 1.6 0 4.8 1.6 6.4 3.2 12.8 11.2 32 20.8 54.4 20.8 33.6 0 44.8-19.2 44.8-33.6 0-49.6-113.6-22.4-113.6-89.6 0-32 27.2-54.4 65.6-54.4 24 0 46.4 8 60.8 20.8 3.2 1.6 4.8 4.8 4.8 8 0 6.4-4.8 12.8-11.2 12.8-1.6 0-4.8-1.6-6.4-3.2-14.4-11.2-32-16-49.6-16-24 0-40 11.2-40 30.4 0 43.2 113.6 17.6 113.6 89.6 0 27.2-19.2 56-70.4 56z" fill="#FFFFFF" p-id="14958"></path><path d="M960 326.4v16H755.2s-102.4-20.8-99.2-108.8c0 0 3.2 92.8 96 92.8h208z" fill="#349C42" p-id="14959"></path><path d="M656 0v233.6c0 25.6 19.2 92.8 99.2 92.8H960L656 0z" fill="#FFFFFF" p-id="14960"></path></svg>

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/folder.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1592880861908" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3979" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M918.673 883H104.327C82.578 883 65 867.368 65 848.027V276.973C65 257.632 82.578 242 104.327 242h814.346C940.422 242 958 257.632 958 276.973v571.054C958 867.28 940.323 883 918.673 883z" fill="#FFE9B4" p-id="3980"></path><path d="M512 411H65V210.37C65 188.597 82.598 171 104.371 171h305.92c17.4 0 32.71 11.334 37.681 28.036L512 411z" fill="#FFB02C" p-id="3981"></path><path d="M918.673 883H104.327C82.578 883 65 865.42 65 843.668V335.332C65 313.58 82.578 296 104.327 296h814.346C940.422 296 958 313.58 958 335.332v508.336C958 865.32 940.323 883 918.673 883z" fill="#FFCA28" p-id="3982"></path></svg>

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/pdf_1.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1592733790272" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16600" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M145.6 0C100.8 0 64 36.8 64 81.6v860.8C64 987.2 100.8 1024 145.6 1024h732.8c44.8 0 81.6-36.8 81.6-81.6V324.8L657.6 0h-512z" fill="#8C181A" p-id="16601"></path><path d="M960 326.4v16H755.2s-100.8-20.8-97.6-107.2c0 0 3.2 91.2 96 91.2H960z" fill="#6B0D12" p-id="16602"></path><path d="M657.6 0v233.6c0 27.2 17.6 92.8 97.6 92.8H960L657.6 0z" fill="#FFFFFF" p-id="16603"></path><path d="M302.4 784h-52.8v65.6c0 6.4-4.8 11.2-12.8 11.2-6.4 0-11.2-4.8-11.2-11.2V686.4c0-9.6 8-17.6 17.6-17.6h59.2c38.4 0 60.8 27.2 60.8 57.6 0 32-22.4 57.6-60.8 57.6z m-1.6-94.4h-51.2v73.6h51.2c22.4 0 38.4-14.4 38.4-36.8s-16-36.8-38.4-36.8z m166.4 171.2h-48c-9.6 0-17.6-8-17.6-17.6v-156.8c0-9.6 8-17.6 17.6-17.6h48c59.2 0 99.2 41.6 99.2 96s-38.4 96-99.2 96z m0-171.2h-41.6v148.8h41.6c46.4 0 73.6-33.6 73.6-75.2 1.6-40-25.6-73.6-73.6-73.6z m260.8 0h-92.8V752h91.2c6.4 0 9.6 4.8 9.6 11.2s-4.8 9.6-9.6 9.6h-91.2v76.8c0 6.4-4.8 11.2-12.8 11.2-6.4 0-11.2-4.8-11.2-11.2V686.4c0-9.6 8-17.6 17.6-17.6h99.2c6.4 0 9.6 4.8 9.6 11.2 1.6 4.8-3.2 9.6-9.6 9.6z" fill="#FFFFFF" p-id="16604"></path></svg>

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/ppt.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1592733747733" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14112" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M145.6 0C100.8 0 64 36.8 64 81.6v860.8C64 987.2 100.8 1024 145.6 1024h732.8c44.8 0 81.6-36.8 81.6-81.6V324.8L657.6 0h-512z" fill="#E34221" p-id="14113"></path><path d="M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z" fill="#DC3119" p-id="14114"></path><path d="M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z" fill="#FFFFFF" p-id="14115"></path><path d="M304 784h-54.4v67.2c0 6.4-4.8 11.2-11.2 11.2-6.4 0-12.8-4.8-12.8-11.2V686.4c0-9.6 8-17.6 17.6-17.6H304c38.4 0 59.2 25.6 59.2 57.6S340.8 784 304 784z m-3.2-94.4h-51.2v73.6h51.2c22.4 0 38.4-16 38.4-36.8 0-22.4-16-36.8-38.4-36.8zM480 784h-54.4v67.2c0 6.4-4.8 11.2-11.2 11.2-6.4 0-11.2-4.8-11.2-11.2V686.4c0-9.6 6.4-17.6 16-17.6H480c38.4 0 59.2 25.6 59.2 57.6S518.4 784 480 784z m-3.2-94.4h-49.6v73.6h49.6c22.4 0 38.4-16 38.4-36.8 0-22.4-16-36.8-38.4-36.8z m225.6 0h-52.8v161.6c0 6.4-4.8 11.2-11.2 11.2-6.4 0-12.8-4.8-12.8-11.2V689.6h-51.2c-6.4 0-11.2-4.8-11.2-11.2 0-4.8 4.8-9.6 11.2-9.6h128c6.4 0 11.2 4.8 11.2 11.2 0 4.8-4.8 9.6-11.2 9.6z" fill="#FFFFFF" p-id="14116"></path></svg>

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/txt.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1592733441637" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7847" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M832.2 127.9v766H192.7v-766h639.5m0-64H192.7c-35.3 0-64 28.7-64 64v766c0 35.3 28.7 64 64 64h639.5c35.3 0 64-28.7 64-64v-766c0-35.4-28.7-64-64-64z" fill="#A3BDD3" p-id="7848"></path><path d="M261.437 510.503v-32h503.9v32zM261.44 605.397v-32h503.9v32zM400.527 305.69v-32h364.8v32zM261.391 410.546v-32h503.9v32z" fill="#A3BDD3" p-id="7849"></path><path d="M733.039 824.168v-32h97.9v32z" fill="#8C98A6" p-id="7850"></path><path d="M896.2 958.3H456.7v-176c0-35.3 28.7-64 64-64h375.5c35.3 0 64 28.7 64 64v112c0 35.4-28.7 64-64 64z" fill="#8AA9BF" p-id="7851"></path><path d="M640.6 771v20h-46.8v122.8h-23.4V791h-46.8v-20h117zM676.4 771l33.6 50.4 33.6-50.4h28.6L724 840l51.4 73.8h-28.6L710 858.6l-36.8 55.2h-28.6l51-73.8-47.8-69h28.6zM896.4 771v20h-46.8v122.8h-23.4V791h-46.8v-20h117z" fill="#FFFFFF" p-id="7852"></path></svg>

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/word.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1592733775231" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15798" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M145.6 0C100.8 0 64 35.2 64 80v862.4C64 987.2 100.8 1024 145.6 1024h732.8c44.8 0 81.6-36.8 81.6-81.6V324.8L657.6 0h-512z" fill="#14A9DA" p-id="15799"></path><path d="M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z" fill="#0F93D0" p-id="15800"></path><path d="M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z" fill="#FFFFFF" opacity=".5" p-id="15801"></path><path d="M291.2 862.4h-48c-9.6 0-17.6-8-17.6-17.6v-158.4c0-9.6 8-16 17.6-16h48c60.8 0 99.2 41.6 99.2 96s-38.4 96-99.2 96z m0-171.2h-41.6v148.8h41.6c48 0 75.2-33.6 75.2-73.6 0-41.6-27.2-75.2-75.2-75.2z m232 174.4c-57.6 0-96-43.2-96-99.2s38.4-99.2 96-99.2c56 0 94.4 41.6 94.4 99.2 0 56-38.4 99.2-94.4 99.2z m0-177.6c-43.2 0-70.4 33.6-70.4 78.4 0 44.8 27.2 76.8 70.4 76.8 41.6 0 70.4-32 70.4-76.8S564.8 688 523.2 688z m294.4 6.4c1.6 1.6 3.2 4.8 3.2 8 0 6.4-4.8 11.2-11.2 11.2-3.2 0-6.4-1.6-8-3.2-11.2-14.4-30.4-22.4-48-22.4-41.6 0-73.6 32-73.6 78.4 0 44.8 32 76.8 73.6 76.8 17.6 0 35.2-6.4 48-20.8 1.6-3.2 4.8-4.8 8-4.8 6.4 0 11.2 6.4 11.2 12.8 0 3.2-1.6 4.8-3.2 8-14.4 16-35.2 27.2-64 27.2-56 0-99.2-40-99.2-99.2s43.2-99.2 99.2-99.2c28.8 0 49.6 11.2 64 27.2z" fill="#FFFFFF" p-id="15802"></path></svg>

二进制
ruoyi-ui/src/assets/images/white.png


+ 13 - 0
ruoyi-ui/src/router/index.js

@@ -127,6 +127,19 @@ export const constantRoutes = [
       }
     ]
   },
+  {
+    path: '/rc',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'file',
+        component: (resolve) => require(['@/views/rc/file/uploadFile'], resolve),
+        name: 'File',
+        meta: { title: '审计文档' }
+      }
+    ]
+  },
 ]
 
 // 动态路由,基于用户权限动态去加载

+ 437 - 0
ruoyi-ui/src/views/rc/file/uploadFile.vue

@@ -0,0 +1,437 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="文件名" prop="fileName">
+        <el-input
+          v-model="queryParams.fileName"
+          placeholder="请输入文件名"
+          clearable
+          size="small"
+          @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"
+          icon="el-icon-folder-add"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['file:file:add']"
+        >新建文件夹
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-upload2"
+          size="mini"
+          v-hasPermi="['file:file:add']"
+          @click="handleAddFile"
+        >上传文件
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table
+      ref="fileTable"
+      v-loading="loading"
+      :data="fileList"
+      row-key="id"
+      default-expand-all
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+      @row-click="rowClick"
+    >
+      <el-table-column label="文件名" width="500" align="left" prop="fileName" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+
+          <svg-icon style="font-size: 200%;" v-if="scope.row.type == '1'" iconClass="excel_1"/>
+          <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '2'" iconClass="ppt"/>
+          <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '4'" iconClass="pdf_1"/>
+          <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '3'" iconClass="word"/>
+          <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '5'" iconClass="txt"/>
+          <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '0'" iconClass="folder"/>
+          <el-image
+            v-else-if="scope.row.type == '6'"
+            style="border-radius:5px; padding:5px 5px 0 0;width: 30px; height: 30px"
+            :src="getImgUrl(scope.row.fileUrl)"
+            :preview-src-list="[getImgUrl(scope.row.fileUrl)]">
+          </el-image>
+          <svg-icon style="font-size: 200%;" v-else iconClass="unknown"/>
+          <span v-if="scope.row.type == 0">{{ scope.row.fileName }}</span>
+          <a v-else class="link-type" @click="handleFileView(scope.row)">
+            <span>{{ scope.row.fileName }}</span>
+          </a>
+        </template>
+      </el-table-column>
+      <!--      <el-table-column label="类型" width="80" align="center" prop="type">
+              <template slot-scope="scope">
+                <svg-icon style="font-size: 200%;" v-if="scope.row.type == '1'" iconClass="excel_1"/>
+                <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '2'" iconClass="ppt"/>
+                <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '4'" iconClass="pdf_1"/>
+                <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '3'" iconClass="word"/>
+                <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '5'" iconClass="txt"/>
+                <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '0'" iconClass="folder"/>
+                <el-image
+                  v-else-if="scope.row.type == '6'"
+                  style="border-radius:5px; padding:5px 5px 0 0;width: 30px; height: 30px"
+                  :src="getImgUrl(scope.row.fileUrl)"
+                  :preview-src-list="[getImgUrl(scope.row.fileUrl)]">
+                </el-image>
+                <svg-icon style="font-size: 200%;" v-else iconClass="unknown"/>
+              </template>
+            </el-table-column>-->
+
+      <el-table-column label="创建人" align="center" prop="uploader"/>
+      <el-table-column label="创建时间" align="center" prop="uploadDate" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.uploadDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="文件大小(Kb)" width="100" align="center" prop="fileSize"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            v-if="scope.row.type != 0"
+            size="mini"
+            type="text"
+            icon="el-icon-download"
+            @click="handleDownload(scope.row)"
+          >下载
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            v-hasPermi="['file:file:edit']"
+            @click="handleUpdate(scope.row)"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            v-hasPermi="['file:file:remove']"
+            @click="handleDelete(scope.row)"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!--    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"-->
+    <!--               append-to-body>-->
+    <!--      <div style="margin-top: -60px;float: right;margin-right: 40px;">-->
+    <!--        <el-button size="mini" type="text" @click="openPdf">新页面打开PDF</el-button>-->
+    <!--      </div>-->
+    <!--      <div style="margin-top: -30px">-->
+    <!--        <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>-->
+    <!--      </div>-->
+    <!--    </el-dialog>-->
+    <!-- 添加或修改附件对话框 -->
+    <el-dialog :title="doc.title" :visible.sync="doc.open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+
+        <el-form-item label="上级" prop="pId">
+          <treeselect v-model="form.pId" :options="fileOptions" :normalizer="normalizer"
+                      placeholder="请选择文件夹"/>
+        </el-form-item>
+        <el-upload style="text-align: center;"
+                   ref="doc"
+                   :limit="50"
+                   :headers="doc.headers"
+                   :action="doc.url + '?linkId=' + this.$route.query.linkId + '&linkName=' + this.$route.query.linkName + '&pId=' + this.form.pId"
+                   :disabled="doc.isUploading"
+                   :on-progress="handleFileDocProgress"
+                   :on-success="handleFileDocSuccess"
+                   :auto-upload="true"
+                   multiple
+                   drag
+        >
+          <i class="el-icon-upload"></i>
+          <div class="el-upload__text">
+            将文件拖到此处,或
+            <em>点击上传</em>
+          </div>
+        </el-upload>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFile">确 定</el-button>
+        <el-button @click="doc.open = false">返 回</el-button>
+      </div>
+    </el-dialog>
+    <!-- 添加或修改附件对话框 -->
+    <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 v-if="form.type != 1" label="文件夹" prop="fileName">
+          <el-input v-model="form.fileName" placeholder="请输入文件夹名"/>
+        </el-form-item>
+
+        <el-form-item label="上级" prop="pId">
+          <treeselect v-model="form.pId" :options="fileOptions" :normalizer="normalizer" 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 {addFile, delFile, getFile, listFile, updateFile} from "@/api/rc/file";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {getToken} from "@/utils/auth";
+
+export default {
+  name: "uploadFile",
+  components: {
+    Treeselect
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 附件表格数据
+      fileList: [],
+      // 附件树选项
+      fileOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      pId: null,
+      // 查询参数
+      queryParams: {
+        linkId: this.$route.query.linkId,
+        linkName: this.$route.query.linkName,
+        fileName: null,
+        pId: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        id: [
+          {required: true, message: "id不能为空", trigger: "blur"}
+        ],
+      },
+      pdf: {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
+      // 报告附件参数
+      doc: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/file/file/uploadFile",
+        commonfileList: null,
+      },
+    };
+  },
+  created() {
+    console.log(this.$route.query)
+    if (this.$route.query) {
+      this.queryParams.linkId = this.$route.query.linkId
+      this.queryParams.linkName = this.$route.query.linkName
+    }
+    this.getList();
+  },
+  methods: {
+    rowClick(row, column, event) {
+      this.$refs.fileTable.toggleRowExpansion(row);
+    },
+    getImgUrl(url) {
+      return process.env.VUE_APP_BASE_API + url;
+    },
+    /** 查询附件列表 */
+    getList() {
+      this.loading = true;
+      listFile(this.queryParams).then(response => {
+        this.fileList = this.handleTree(response.data, "id", "pId");
+        this.loading = false;
+      });
+    },
+    /** 转换附件数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.fileName,
+        children: node.children
+      };
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      let param = {
+        linkId: this.$route.query.linkId,
+        linkName: this.$route.query.linkName,
+      }
+      param.type = 0
+      listFile(param).then(response => {
+        this.fileOptions = [];
+        const data = {id: 0, fileName: '顶级节点', children: []};
+        data.children = this.handleTree(response.data, "id", "pId");
+        this.fileOptions.push(data);
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        pId: null,
+        fileName: null,
+        fileUrl: null,
+        delFlag: null,
+        remarks: null,
+        fileSize: null,
+        type: null,
+        linkId: this.$route.query.linkId,
+        linkName: this.$route.query.linkName
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.getTreeselect();
+      this.open = true;
+      this.title = "添加附件";
+      this.form.type = '0';
+      this.form.pId = 0;
+    },
+    handleAddFile() {
+      this.reset();
+      this.getTreeselect();
+      this.form.type = '1';
+      this.form.pId = 0;
+      this.doc.open = true;
+      this.$nextTick(() => {
+        this.$refs.doc.clearFiles()
+      })
+      this.doc.title = "添加附件";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.getTreeselect();
+      getFile(row.id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改附件";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateFile(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFile(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    submitFile() {
+      this.doc.open = false;
+      this.getList();
+    },
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      this.$confirm('是否确认删除附件名为"' + row.fileName + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delFile(row.id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      })
+    },
+    //附件上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      // this.$alert(response.msg, '导入结果', {dangerouslyUseHTMLString: true});
+      this.form.id = this.doc.pId;
+      // addFile(this.form)
+      this.$refs.upload.clearFiles();
+      this.getList()
+    },
+    handleFileView(row) {
+      if (row.type == 1 || row.type == 2 || row.type == 3) {
+        this.$router.push({path: '/office/edit', query: {fileId: row.id, ot: 'detail'}});
+      } else {
+        window.open(process.env.VUE_APP_BASE_API + row.fileUrl);
+      }
+    }
+  }
+};
+</script>

+ 8 - 0
ruoyi-ui/src/views/rc/openitem/index.vue

@@ -198,6 +198,11 @@
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" width="200"/>
+      <el-table-column label="审计文档" align="center" width="100" fixed="right">
+        <template slot-scope="scope">
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" circle @click="handleDoc(scope.row , 'audit')"></el-button>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" width="120" fixed="right" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -404,6 +409,9 @@ export default {
     this.getUserList();
   },
   methods: {
+    handleDoc(row , type) {
+      this.$router.push({path: '/rc/file', query: {linkId: row.questionnaireId, linkName: 'questionnaire'}})
+    },
     /** 查询用户列表 */
     getUserList() {
       listAllUser().then(response => {

+ 8 - 0
ruoyi-ui/src/views/rc/progress/index.vue

@@ -157,6 +157,11 @@
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" width="200" />
+      <el-table-column label="审计文档" align="center" width="100" fixed="right">
+        <template slot-scope="scope">
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" circle @click="handleDoc(scope.row , 'audit')"></el-button>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" width="180" fixed="right" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -335,6 +340,9 @@ export default {
     this.getUserList();
   },
   methods: {
+    handleDoc(row , type) {
+      this.$router.push({path: '/rc/file', query: {linkId: row.questionnaireId, linkName: 'questionnaire'}})
+    },
     /** 查询用户列表 */
     getUserList() {
       listAllUser().then(response => {

+ 15 - 8
ruoyi-ui/src/views/rc/questionnaire/index.vue

@@ -146,6 +146,11 @@
           <el-button icon="el-icon-folder" style="color:#6e96fa;" circle @click="handleDoc(scope.row , 'questionnaire-standard')"></el-button>
         </template>
       </el-table-column>
+      <el-table-column label="审计文档" align="center" width="100" fixed="right">
+        <template slot-scope="scope">
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" circle @click="handleDoc(scope.row , 'audit')"></el-button>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" width="120" fixed="right" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -569,15 +574,17 @@ export default {
       var typeName = "";
       if (type === "questionnaire-standard"){
         typeName = "标准附件";
+        this.doc.pType = type
+        this.doc.queryParams.pType = type
+        this.doc.id = row.id;
+        this.doc.title = "标准附件(CODE " + row.code + ")";
+        this.doc.open = true;
+        this.doc.queryParams.pId = row.id
+        this.doc.pId = row.id
+        this.getFileList();
+      } else if (type === 'audit') {
+        this.$router.push({path: '/rc/file', query: {linkId: row.id, linkName: 'questionnaire'}})
       }
-      this.doc.pType = type
-      this.doc.queryParams.pType = type
-      this.doc.id = row.id;
-      this.doc.title = "标准附件(CODE " + row.code + ")";
-      this.doc.open = true;
-      this.doc.queryParams.pId = row.id
-      this.doc.pId = row.id
-      this.getFileList();
     },
     getFileList(){
       allFileList(this.doc.queryParams).then(response => {