新增待办信息

This commit is contained in:
2025-12-20 18:21:54 +08:00
parent ba7bcc3da9
commit ae42fe87ed
45 changed files with 1644 additions and 2383 deletions

View File

@@ -45,4 +45,22 @@ public class MyFileUtils {
logger.error(e.getMessage());
}
}
public static String getIcon(String ext) {
switch (ext) {
case "doc", "docx":
return "icons/file-word-line.svg";
case "xls", "xlsx":
return "icons/file-excel-line.svg";
case "ppt", "pptx":
return "icons/file-ppt-line.svg";
case "pdf":
return "icons/file-pdf-line.svg";
case "zip", "gz":
return "icons/folder-zip-line.svg";
default:
return "icons/file-text-line.svg";
}
}
}

View File

@@ -0,0 +1,34 @@
package com.jeesite.modules.app.utils;
import com.jeesite.modules.biz.entity.BizFolders;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class MyUtils {
public static Map<String, Object> convertToTreeNode(BizFolders folder, String parentName) {
Map<String, Object> node = new HashMap<>();
node.put("folderId", folder.getFolderId());
node.put("folderName", folder.getFolderName());
node.put("parentId", folder.getParentId());
node.put("parentName", parentName);
node.put("userName", folder.getUserName());
node.put("loginCode", folder.getLoginCode());
node.put("children", new ArrayList<>());
return node;
}
public static Map<String, Object> convertToTreeNode(BizFolders folder, boolean isDisabled) {
Map<String, Object> node = new HashMap<>();
node.put("id", folder.getFolderId()); // folderId → id
node.put("name", folder.getFolderName()); // folderName → name
node.put("children", new ArrayList<>()); // 初始化children空数组
if (isDisabled) {
node.put("disabled", true);
}
return node;
}
}

View File

@@ -2,6 +2,7 @@ package com.jeesite.modules.biz.entity;
import java.io.Serializable;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -25,91 +26,95 @@ import java.io.Serial;
/**
* 文件信息Entity
*
* @author gaoxq
* @version 2025-12-18
*/
@EqualsAndHashCode(callSuper = true)
@Table(name="biz_myfiles", alias="a", label="文件信息信息", columns={
@Column(name="create_time", attrName="createTime", label="记录时间", isUpdate=false, isUpdateForce=true),
@Column(name="id", attrName="tid", label="文件标识", isPK=true),
@Column(name="file_name", attrName="fileName", label="原始名称", queryType=QueryType.LIKE),
@Column(name="file_path", attrName="filePath", label="存储路径", isQuery=false),
@Column(name="file_hash", attrName="fileHash", label="文件MD5"),
@Column(name="file_size", attrName="fileSize", label="文件大小", isQuery=false),
@Column(name="file_ext", attrName="fileExt", label="文件扩展名", isQuery=false),
@Column(name="mime_type", attrName="mimeType", label="文件类型", isQuery=false),
@Column(name="folder_id", attrName="folderId", label="文件夹标识"),
@Column(name="user_name", attrName="userName", label="用户姓名", isUpdate=false, isQuery=false),
@Column(name="login_code", attrName="loginCode", label="用户名称", isUpdate=false),
@Column(name="download_count", attrName="downloadCount", label="下载次数", isUpdate=false, isQuery=false, isUpdateForce=true),
@Column(name="view_count", attrName="viewCount", label="查看次数", isUpdate=false, isQuery=false, isUpdateForce=true),
@Column(name="expire_time", attrName="expireTime", label="过期时间", isQuery=false, isUpdateForce=true),
@Column(name="is_delete", attrName="isDelete", label="是否删除", isUpdateForce=true),
@Column(name="update_time", attrName="updateTime", label="更新时间", isQuery=false, isUpdateForce=true),
}, orderBy="a.create_time DESC"
@Table(name = "biz_myfiles", alias = "a", label = "文件信息信息", columns = {
@Column(name = "create_time", attrName = "createTime", label = "记录时间", isUpdate = false, isUpdateForce = true),
@Column(name = "id", attrName = "id", label = "文件标识", isPK = true),
@Column(name = "file_name", attrName = "fileName", label = "原始名称", queryType = QueryType.LIKE),
@Column(name = "file_path", attrName = "filePath", label = "存储路径", isQuery = false),
@Column(name = "file_hash", attrName = "fileHash", label = "文件MD5"),
@Column(name = "file_size", attrName = "fileSize", label = "文件大小", isQuery = false),
@Column(name = "file_ext", attrName = "fileExt", label = "文件扩展名", isQuery = false),
@Column(name = "mime_type", attrName = "mimeType", label = "文件类型", isQuery = false),
@Column(name = "folder_id", attrName = "folderId", label = "文件夹标识"),
@Column(name = "user_name", attrName = "userName", label = "用户姓名", isUpdate = false, isQuery = false),
@Column(name = "login_code", attrName = "loginCode", label = "用户名称", isUpdate = false),
@Column(name = "download_count", attrName = "downloadCount", label = "下载次数", isUpdate = false, isQuery = false, isUpdateForce = true),
@Column(name = "view_count", attrName = "viewCount", label = "查看次数", isUpdate = false, isQuery = false, isUpdateForce = true),
@Column(name = "expire_time", attrName = "expireTime", label = "过期时间", isQuery = false, isUpdateForce = true),
@Column(name = "is_delete", attrName = "isDelete", label = "是否删除", isUpdateForce = true),
@Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true),
@Column(name = "svg_icon", attrName = "svgIcon", label = "文件夹标识"),
}, orderBy = "a.create_time DESC"
)
@Data
public class BizMyfiles extends DataEntity<BizMyfiles> implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Date createTime; // 记录时间
private Long tid; // 文件标识
private String fileName; // 原始名称
private String filePath; // 存储路径
private String fileHash; // 文件MD5
private String fileSize; // 文件大小
private String fileExt; // 文件扩展名
private String mimeType; // 文件类型
private String folderId; // 文件夹标识
private String userName; // 用户姓名
private String loginCode; // 用户名称
private Integer downloadCount; // 下载次数
private Integer viewCount; // 查看次数
private Date expireTime; // 过期时间
private Integer isDelete; // 是否删除
private Date updateTime; // 更新时间
@ExcelFields({
@ExcelField(title="记录时间", attrName="createTime", align=Align.CENTER, sort=10, dataFormat="yyyy-MM-dd hh:mm"),
@ExcelField(title="文件标识", attrName="tid", align=Align.CENTER, sort=20),
@ExcelField(title="原始名称", attrName="fileName", align=Align.CENTER, sort=30),
@ExcelField(title="存储路径", attrName="filePath", align=Align.CENTER, sort=40),
@ExcelField(title="文件MD5", attrName="fileHash", align=Align.CENTER, sort=50),
@ExcelField(title="文件大小", attrName="fileSize", align=Align.CENTER, sort=60),
@ExcelField(title="文件扩展名", attrName="fileExt", align=Align.CENTER, sort=70),
@ExcelField(title="文件类型", attrName="mimeType", align=Align.CENTER, sort=80),
@ExcelField(title="文件夹标识", attrName="folderId", align=Align.CENTER, sort=90),
@ExcelField(title="用户姓名", attrName="userName", align=Align.CENTER, sort=100),
@ExcelField(title="用户名称", attrName="loginCode", align=Align.CENTER, sort=110),
@ExcelField(title="下载次数", attrName="downloadCount", align=Align.CENTER, sort=120),
@ExcelField(title="查看次数", attrName="viewCount", align=Align.CENTER, sort=130),
@ExcelField(title="过期时间", attrName="expireTime", align=Align.CENTER, sort=140, dataFormat="yyyy-MM-dd hh:mm"),
@ExcelField(title="是否删除", attrName="isDelete", dictType="sys_yes_no", align=Align.CENTER, sort=150),
@ExcelField(title="更新时间", attrName="updateTime", align=Align.CENTER, sort=160, dataFormat="yyyy-MM-dd hh:mm"),
})
public BizMyfiles() {
this(null);
}
public BizMyfiles(String id){
super(id);
}
public Date getCreateTime_gte() {
return sqlMap.getWhere().getValue("create_time", QueryType.GTE);
}
@Serial
private static final long serialVersionUID = 1L;
private Date createTime; // 记录时间
private String id; // 文件标识
private String fileName; // 原始名称
private String filePath; // 存储路径
private String fileHash; // 文件MD5
private String fileSize; // 文件大小
private String fileExt; // 文件扩展名
private String mimeType; // 文件类型
private String folderId; // 文件夹标识
private String userName; // 用户姓名
private String loginCode; // 用户名称
private Integer downloadCount; // 下载次数
private Integer viewCount; // 查看次数
private Date expireTime; // 过期时间
private Integer isDelete; // 是否删除
private Date updateTime; // 更新时间
private String svgIcon; //文件图标
public void setCreateTime_gte(Date createTime) {
sqlMap.getWhere().and("create_time", QueryType.GTE, createTime);
}
public Date getCreateTime_lte() {
return sqlMap.getWhere().getValue("create_time", QueryType.LTE);
}
@ExcelFields({
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
@ExcelField(title = "文件标识", attrName = "id", align = Align.CENTER, sort = 20),
@ExcelField(title = "原始名称", attrName = "fileName", align = Align.CENTER, sort = 30),
@ExcelField(title = "存储路径", attrName = "filePath", align = Align.CENTER, sort = 40),
@ExcelField(title = "文件MD5", attrName = "fileHash", align = Align.CENTER, sort = 50),
@ExcelField(title = "文件大小", attrName = "fileSize", align = Align.CENTER, sort = 60),
@ExcelField(title = "文件扩展名", attrName = "fileExt", align = Align.CENTER, sort = 70),
@ExcelField(title = "文件类型", attrName = "mimeType", align = Align.CENTER, sort = 80),
@ExcelField(title = "文件夹标识", attrName = "folderId", align = Align.CENTER, sort = 90),
@ExcelField(title = "用户姓名", attrName = "userName", align = Align.CENTER, sort = 100),
@ExcelField(title = "用户名称", attrName = "loginCode", align = Align.CENTER, sort = 110),
@ExcelField(title = "下载次数", attrName = "downloadCount", align = Align.CENTER, sort = 120),
@ExcelField(title = "查看次数", attrName = "viewCount", align = Align.CENTER, sort = 130),
@ExcelField(title = "过期时间", attrName = "expireTime", align = Align.CENTER, sort = 140, dataFormat = "yyyy-MM-dd hh:mm"),
@ExcelField(title = "是否删除", attrName = "isDelete", dictType = "sys_yes_no", align = Align.CENTER, sort = 150),
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 160, dataFormat = "yyyy-MM-dd hh:mm"),
})
public BizMyfiles() {
this(null);
}
public BizMyfiles(String id) {
super(id);
}
public Date getCreateTime_gte() {
return sqlMap.getWhere().getValue("create_time", QueryType.GTE);
}
public void setCreateTime_gte(Date createTime) {
sqlMap.getWhere().and("create_time", QueryType.GTE, createTime);
}
public Date getCreateTime_lte() {
return sqlMap.getWhere().getValue("create_time", QueryType.LTE);
}
public void setCreateTime_lte(Date createTime) {
sqlMap.getWhere().and("create_time", QueryType.LTE, createTime);
}
public void setCreateTime_lte(Date createTime) {
sqlMap.getWhere().and("create_time", QueryType.LTE, createTime);
}
}

View File

@@ -1,9 +1,13 @@
package com.jeesite.modules.biz.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.jeesite.modules.app.dao.file.FolderItem;
import com.jeesite.modules.app.utils.MyUtils;
import com.jeesite.modules.app.utils.vDate;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -86,8 +90,9 @@ public class BizFoldersController extends BaseController {
@PostMapping(value = "save")
@ResponseBody
public String save(@Validated BizFolders bizFolders) {
bizFolders.setUpdateTime(vDate.getUpdateTime(bizFolders.getIsNewRecord()));
bizFoldersService.save(bizFolders);
return renderResult(Global.TRUE, text("保存文件夹信息成功!"));
return renderResult(Global.TRUE, text("操作文件夹成功!"));
}
/**
@@ -136,29 +141,114 @@ public class BizFoldersController extends BaseController {
@ResponseBody
public String delete(BizFolders bizFolders) {
bizFoldersService.delete(bizFolders);
return renderResult(Global.TRUE, text("删除文件夹信息成功!"));
return renderResult(Global.TRUE, text("删除文件夹成功!"));
}
@RequestMapping(value = "listAll")
@ResponseBody
public List<BizFolders> listAll(BizFolders bizFolders) {
return bizFoldersService.findList(bizFolders);
List<BizFolders> originalList = bizFoldersService.findList(bizFolders);
List<BizFolders> newList = new ArrayList<>();
BizFolders fixedFolder = new BizFolders();
fixedFolder.setFolderId("0");
fixedFolder.setFolderName("根目录");
newList.add(fixedFolder);
newList.addAll(originalList);
return newList;
}
@RequestMapping(value = "foldersAll")
@ResponseBody
public List<FolderItem> foldersAll(BizFolders bizFolders) {
List<FolderItem> folderItems = new ArrayList<>();
List<BizFolders> foldersList = bizFoldersService.findList(bizFolders);
for (BizFolders folder : foldersList) {
if (folder.getParentId().equals("0")) {
BizFolders childFolder = new BizFolders();
childFolder.setParentId(folder.getFolderId());
List<BizFolders> childFolders = bizFoldersService.findList(childFolder);
folderItems.add(new FolderItem(folder.getFolderId(), folder.getFolderName(), false, "folder", childFolders));
public List<Map<String, Object>> foldersAll(BizFolders bizFolders) {
List<Map<String, Object>> treeData = new ArrayList<>();
Map<String, Object> rootNode = new HashMap<>();
rootNode.put("id", "0");
rootNode.put("name", "根目录");
rootNode.put("disabled", false);
rootNode.put("children", new ArrayList<>());
bizFolders.setParentId("0");
bizFolders.setIsDeleted(0);
List<BizFolders> firstLevelFolders = bizFoldersService.findList(bizFolders);
List<Map<String, Object>> firstNodeList = new ArrayList<>();
for (BizFolders firstFolder : firstLevelFolders) {
Map<String, Object> firstNode = MyUtils.convertToTreeNode(firstFolder, "根目录");
BizFolders secondQuery = new BizFolders();
secondQuery.setParentId(firstFolder.getFolderId());
secondQuery.setIsDeleted(0);
List<BizFolders> secondLevelFolders = bizFoldersService.findList(secondQuery);
List<Map<String, Object>> secondNodeList = new ArrayList<>();
for (BizFolders secondFolder : secondLevelFolders) {
Map<String, Object> secondNode = MyUtils.convertToTreeNode(secondFolder, firstFolder.getFolderName());
BizFolders thirdQuery = new BizFolders();
thirdQuery.setParentId(secondFolder.getFolderId());
thirdQuery.setIsDeleted(0);
List<BizFolders> thirdLevelFolders = bizFoldersService.findList(thirdQuery);
List<Map<String, Object>> thirdNodeList = new ArrayList<>();
for (BizFolders thirdFolder : thirdLevelFolders) {
Map<String, Object> thirdNode = MyUtils.convertToTreeNode(thirdFolder, secondFolder.getFolderName());
BizFolders fourthQuery = new BizFolders();
fourthQuery.setParentId(thirdFolder.getFolderId());
fourthQuery.setIsDeleted(0);
List<BizFolders> fourthLevelFolders = bizFoldersService.findList(fourthQuery);
List<Map<String, Object>> fourthNodeList = new ArrayList<>();
for (BizFolders fourthFolder : fourthLevelFolders) {
Map<String, Object> fourthNode = MyUtils.convertToTreeNode(fourthFolder, thirdFolder.getFolderName());
fourthNodeList.add(fourthNode);
}
thirdNode.put("children", fourthNodeList);
thirdNodeList.add(thirdNode);
}
secondNode.put("children", thirdNodeList);
secondNodeList.add(secondNode);
}
firstNode.put("children", secondNodeList);
firstNodeList.add(firstNode);
}
return folderItems;
rootNode.put("children", firstNodeList);
treeData.add(rootNode);
return treeData;
}
@RequestMapping(value = "treeData")
@ResponseBody
public List<Map<String, Object>> treeFoldersData(BizFolders bizFolders) {
List<Map<String, Object>> treeData = new ArrayList<>();
Map<String, Object> rootNode = new HashMap<>();
rootNode.put("id", "0");
rootNode.put("name", "根目录");
rootNode.put("disabled", false);
rootNode.put("children", new ArrayList<>());
bizFolders.setParentId("0");
bizFolders.setIsDeleted(0);
List<BizFolders> firstLevelFolders = bizFoldersService.findList(bizFolders);
List<Map<String, Object>> firstNodeList = new ArrayList<>();
for (BizFolders firstFolder : firstLevelFolders) {
Map<String, Object> firstNode = MyUtils.convertToTreeNode(firstFolder, false);
BizFolders secondQuery = new BizFolders();
secondQuery.setParentId(firstFolder.getFolderId());
secondQuery.setIsDeleted(0);
List<BizFolders> secondLevelFolders = bizFoldersService.findList(secondQuery);
List<Map<String, Object>> secondNodeList = new ArrayList<>();
for (BizFolders secondFolder : secondLevelFolders) {
Map<String, Object> secondNode = MyUtils.convertToTreeNode(secondFolder, false);
BizFolders thirdQuery = new BizFolders();
thirdQuery.setParentId(secondFolder.getFolderId());
thirdQuery.setIsDeleted(0);
List<BizFolders> thirdLevelFolders = bizFoldersService.findList(thirdQuery);
List<Map<String, Object>> thirdNodeList = new ArrayList<>();
for (BizFolders thirdFolder : thirdLevelFolders) {
Map<String, Object> thirdNode = MyUtils.convertToTreeNode(thirdFolder, false);
thirdNodeList.add(thirdNode);
}
secondNode.put("children", thirdNodeList);
secondNodeList.add(secondNode);
}
firstNode.put("children", secondNodeList);
firstNodeList.add(firstNode);
}
rootNode.put("children", firstNodeList);
treeData.add(rootNode);
return treeData;
}
}

View File

@@ -4,8 +4,10 @@ import java.util.Date;
import java.util.List;
import cn.hutool.core.net.multipart.UploadFile;
import com.jeesite.modules.app.utils.FileDownloadUtils;
import com.jeesite.modules.app.utils.MyFileUtils;
import com.jeesite.modules.app.utils.vId;
import com.jeesite.modules.biz.entity.BizMailAttachments;
import com.jeesite.modules.file.entity.FileUpload;
import com.jeesite.modules.file.utils.FileUploadUtils;
import jakarta.servlet.http.HttpServletRequest;
@@ -96,13 +98,14 @@ public class BizMyfilesController extends BaseController {
List<FileUpload> fileList = FileUploadUtils.findFileUpload(bizMyfiles.getId(), "bizMyfiles_file");
for (FileUpload fileUpload : fileList) {
bizMyfiles.setCreateTime(new Date());
bizMyfiles.setTid(vId.getLongId());
bizMyfiles.setId(vId.getCid());
bizMyfiles.setFileName(fileUpload.getFileName());
bizMyfiles.setFilePath(FILE_PATH + fileUpload.getFileUrl());
bizMyfiles.setFileHash(fileUpload.getFileEntity().getFileMd5());
bizMyfiles.setFileSize(MyFileUtils.formatFileSize(fileUpload.getFileEntity().getFileSize(), 2));
bizMyfiles.setFileExt(fileUpload.getFileEntity().getFileExtension());
bizMyfiles.setMimeType(fileUpload.getFileEntity().getFileContentType());
bizMyfiles.setSvgIcon(MyFileUtils.getIcon(fileUpload.getFileEntity().getFileExtension()));
bizMyfilesService.save(bizMyfiles);
}
return renderResult(Global.TRUE, text("保存文件信息成功!"));
@@ -154,7 +157,7 @@ public class BizMyfilesController extends BaseController {
@ResponseBody
public String delete(BizMyfiles bizMyfiles) {
bizMyfilesService.delete(bizMyfiles);
return renderResult(Global.TRUE, text("删除文件信息成功!"));
return renderResult(Global.TRUE, text("删除文件成功!"));
}
@RequestMapping(value = "listAll")
@@ -163,4 +166,15 @@ public class BizMyfilesController extends BaseController {
return bizMyfilesService.findList(bizMyfiles);
}
@PostMapping(value = "downloadFile")
public void downloadFile(BizMyfiles bizMyfiles, HttpServletResponse response) {
try {
BizMyfiles myfiles = bizMyfilesService.get(bizMyfiles);
FileDownloadUtils.downloadFile(myfiles.getFilePath(), myfiles.getFileName(), response);
} catch (Exception e) {
System.out.print(e.getMessage());
}
}
}

View File

@@ -30,7 +30,7 @@ server:
tomcat:
uri-encoding: UTF-8
# 表单请求数据的最大大小
max-http-form-post-size: 20MB
max-http-form-post-size: 200MB
# 客户端发送请求参数个数限制
max-parameter-count: 10000
# 文件上传的表单请求参数个数限制
@@ -110,7 +110,7 @@ spring:
# 事务超时时间单位秒30分钟spring boot 3
transaction:
default-timeout: 30m
default-timeout: 120m
# 日志配置fatal、error、warn、info、debug
logging:
@@ -705,15 +705,18 @@ error:
# 文件上传
file:
enabled: true
# # 文件上传根路径设置路径中不允许包含“userfiles”在指定目录中系统会自动创建userfiles目录如果不设置默认为contextPath路径
baseDir: /ogsapp/files
maxFileSize: '500*1024*1024'
isFileStreamDown: true
#
# # 上传文件的相对路径支持yyyy、MM、dd、HH、mm、ss、E、bizType、corpCode、userCode、userType、userCache中的key
# uploadPath: '{yyyy}{MM}/'
# uploadPath: '{yyyy}{MM}/'
#
# # 上传单个文件最大字节500M在这之上还有 > Tomcat限制 > Nginx限制此设置会覆盖 spring.http.multipart.maxFileSize 设置
# maxFileSize: '500*1024*1024'
# maxFileSize: '500*1024*1024'
#
# # 设置允许上传的文件后缀(全局设置)
# imageAllowSuffixes: .gif,.bmp,.jpeg,.jpg,.ico,.png,.tif,.tiff,.webp,

View File

@@ -9,13 +9,14 @@ import { BasicModel, Page } from '@jeesite/core/api/model/baseModel';
import { UploadApiResult } from '@jeesite/core/api/sys/upload';
import { UploadFileParams } from '@jeesite/types/axios';
import { AxiosProgressEvent } from 'axios';
import { TreeDataModel, TreeModel, Page } from '@jeesite/core/api/model/baseModel';
const { ctxPath, adminPath } = useGlobSetting();
export interface BizFolders extends BasicModel<BizFolders> {
createTime?: string; // 记录时间
folderId?: string; // 文件夹标识
folderName: string; // 文件夹名称
folderName?: string; // 文件夹名称
parentId?: string; // 父文件夹
userName: string; // 用户姓名
loginCode: string; // 用户名称
@@ -24,15 +25,13 @@ export interface BizFolders extends BasicModel<BizFolders> {
description?: string; // 文件夹描述
}
export interface FolderItem {
id: string;
name: string;
expanded: boolean;
children: Array<{
folderId: string;
folderName: string;
type: 'folder' | 'file';
}>;
export interface BizFolders extends TreeModel<BizFolders> {
folderId?: string; // 文件夹标识
folderName?: string; // 文件夹名称
parentId?: string; // 父文件夹
userName: string; // 用户姓名
loginCode: string; // 用户名称
}
export const bizFoldersList = (params?: BizFolders | any) =>
@@ -67,3 +66,9 @@ export const bizFoldersImportData = (
export const bizFoldersDelete = (params?: BizFolders | any) =>
defHttp.get<BizFolders>({ url: adminPath + '/biz/folders/delete', params });
export const bizFolderTreeData = (params?: any) =>
defHttp.get<TreeDataModel[]>({ url: adminPath + '/biz/folders/treeData', params });
export const bizFoldersAllData = (params?: any) =>
defHttp.get<TreeDataModel[]>({ url: adminPath + '/biz/folders/foldersAll', params });

View File

@@ -28,6 +28,7 @@ export interface BizMyfiles extends BasicModel<BizMyfiles> {
expireTime?: string; // 过期时间
isDelete?: number; // 是否删除
updateTime?: string; // 更新时间
svgIcon?: string; //文件图标
}
export const bizMyfilesList = (params?: BizMyfiles | any) =>

View File

@@ -1,139 +0,0 @@
<!--
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<BasicDrawer
v-bind="$attrs"
:showFooter="true"
:okAuth="'biz:folders:edit'"
@register="registerDrawer"
@ok="handleSubmit"
width="70%"
>
<template #title>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<BasicForm @register="registerForm" />
</BasicDrawer>
</template>
<script lang="ts" setup name="ViewsBizFoldersForm">
import { ref, unref, computed } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
import { BizFolders, bizFoldersSave, bizFoldersForm } from '@jeesite/biz/api/biz/folders';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('biz.folders');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<BizFolders>({} as BizFolders);
const getTitle = computed(() => ({
icon: meta.icon || 'i-ant-design:book-outlined',
value: record.value.isNewRecord ? t('新增文件夹信息') : t('编辑文件夹信息'),
}));
const inputFormSchemas: FormSchema<BizFolders>[] = [
{
label: t('文件夹名称'),
field: 'folderName',
component: 'Input',
componentProps: {
maxlength: 255,
},
required: true,
},
{
label: t('父文件夹'),
field: 'parentId',
component: 'Input',
componentProps: {
maxlength: 52,
},
},
{
label: t('用户姓名'),
field: 'userName',
component: 'Input',
componentProps: {
maxlength: 32,
},
required: true,
},
{
label: t('用户名称'),
field: 'loginCode',
component: 'Input',
componentProps: {
maxlength: 32,
},
required: true,
},
{
label: t('是否删除'),
field: 'isDeleted',
component: 'Select',
componentProps: {
dictType: 'sys_yes_no',
allowClear: true,
},
required: true,
},
{
label: t('文件夹描述'),
field: 'description',
component: 'InputTextArea',
componentProps: {
maxlength: 500,
},
colProps: { md: 24, lg: 24 },
},
];
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<BizFolders>({
labelWidth: 120,
schemas: inputFormSchemas,
baseColProps: { md: 24, lg: 12 },
});
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
setDrawerProps({ loading: true });
await resetFields();
const res = await bizFoldersForm(data);
record.value = (res.bizFolders || {}) as BizFolders;
record.value.__t = new Date().getTime();
await setFieldsValue(record.value);
setDrawerProps({ loading: false });
});
async function handleSubmit() {
try {
const data = await validate();
setDrawerProps({ confirmLoading: true });
const params: any = {
isNewRecord: record.value.isNewRecord,
folderId: record.value.folderId || data.folderId,
};
// console.log('submit', params, data, record);
const res = await bizFoldersSave(params, data);
showMessage(res.message);
setTimeout(closeDrawer);
emit('success', data);
} catch (error: any) {
if (error && error.errorFields) {
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
} finally {
setDrawerProps({ confirmLoading: false });
}
}
</script>

View File

@@ -1,103 +0,0 @@
<!--
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<BasicModal
v-bind="$attrs"
:title="t('导入文件夹信息')"
:okText="t('导入')"
@register="registerModal"
@ok="handleSubmit"
:minHeight="120"
:width="400"
>
<Upload accept=".xls,.xlsx" :file-list="fileList" :before-upload="beforeUpload" @remove="handleRemove">
<a-button> <Icon icon="ant-design:upload-outlined" /> {{ t('选择文件') }} </a-button>
<span class="ml-4">{{ uploadInfo }}</span>
</Upload>
<div class="ml-4 mt-4">
{{ t('提示仅允许导入“xls”或“xlsx”格式文件') }}
</div>
<div class="mt-4">
<a-button @click="handleDownloadTemplate()" type="text">
<Icon icon="i-fa:file-excel-o" />
{{ t('下载模板') }}
</a-button>
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { Upload } from 'ant-design-vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { downloadByUrl } from '@jeesite/core/utils/file/download';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
import { bizFoldersImportData } from '@jeesite/biz/api/biz/folders';
import { FileType } from 'ant-design-vue/es/upload/interface';
import { AxiosProgressEvent } from 'axios';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('biz.folders');
const { showMessage, showMessageModal } = useMessage();
const fileList = ref<FileType[]>([]);
const uploadInfo = ref('');
const beforeUpload = (file: FileType) => {
fileList.value = [file];
return false;
};
const handleRemove = () => {
fileList.value = [];
};
const [registerModal, { setModalProps, closeModal }] = useModalInner(() => {
fileList.value = [];
uploadInfo.value = '';
});
async function handleDownloadTemplate() {
const { ctxAdminPath } = useGlobSetting();
downloadByUrl({ url: ctxAdminPath + '/biz/folders/importTemplate' });
}
function onUploadProgress(progressEvent: AxiosProgressEvent) {
const complete = ((progressEvent.loaded / (progressEvent.total || 1)) * 100) | 0;
if (complete != 100) {
uploadInfo.value = t('正在导入,请稍候') + ' ' + complete + '%...';
} else {
uploadInfo.value = '';
}
}
async function handleSubmit() {
try {
if (fileList.value.length == 0) {
showMessage(t('请选择要导入的数据文件'));
return;
}
setModalProps({ confirmLoading: true });
const params = {
file: fileList.value[0],
};
const { data } = await bizFoldersImportData(params, onUploadProgress);
showMessageModal({ content: data.message });
setTimeout(closeModal);
emit('success');
} catch (error: any) {
if (error && error.errorFields) {
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

View File

@@ -1,258 +0,0 @@
<!--
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<div>
<BasicTable @register="registerTable">
<template #tableTitle>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<template #toolbar>
<a-button type="default" :loading="loading" @click="handleExport()">
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
</a-button>
<a-button type="default" @click="handleImport()">
<Icon icon="i-ant-design:import-outlined" /> {{ t('导入') }}
</a-button>
<a-button type="primary" @click="handleForm({})" v-auth="'biz:folders:edit'">
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
</a-button>
</template>
<template #firstColumn="{ record }">
<a @click="handleForm({ folderId: record.folderId })" :title="record.createTime">
{{ record.createTime }}
</a>
</template>
</BasicTable>
<InputForm @register="registerDrawer" @success="handleSuccess" />
<FormImport @register="registerImportModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup name="ViewsBizFoldersList">
import { onMounted, ref, unref } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { downloadByUrl } from '@jeesite/core/utils/file/download';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
import { BizFolders, bizFoldersList } from '@jeesite/biz/api/biz/folders';
import { bizFoldersDelete, bizFoldersListData } from '@jeesite/biz/api/biz/folders';
import { useDrawer } from '@jeesite/core/components/Drawer';
import { useModal } from '@jeesite/core/components/Modal';
import { FormProps } from '@jeesite/core/components/Form';
import InputForm from './form.vue';
import FormImport from './formImport.vue';
const { t } = useI18n('biz.folders');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<BizFolders>({} as BizFolders);
const getTitle = {
icon: meta.icon || 'i-ant-design:book-outlined',
value: meta.title || t('文件夹信息管理'),
};
const loading = ref(false);
const searchForm: FormProps<BizFolders> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('记录时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('文件夹名称'),
field: 'folderName',
component: 'Input',
},
{
label: t('父文件夹'),
field: 'parentId',
component: 'Input',
},
{
label: t('用户名称'),
field: 'loginCode',
component: 'Input',
},
{
label: t('是否删除'),
field: 'isDeleted',
component: 'Select',
componentProps: {
dictType: 'sys_yes_no',
allowClear: true,
},
},
{
label: t('文件夹描述'),
field: 'description',
component: 'Input',
},
],
};
const tableColumns: BasicColumn<BizFolders>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 230,
align: 'left',
slot: 'firstColumn',
},
{
title: t('文件夹名称'),
dataIndex: 'folderName',
key: 'a.folder_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('父文件夹'),
dataIndex: 'parentId',
key: 'a.parent_id',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('用户姓名'),
dataIndex: 'userName',
key: 'a.user_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('用户名称'),
dataIndex: 'loginCode',
key: 'a.login_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('是否删除'),
dataIndex: 'isDeleted',
key: 'a.is_deleted',
sorter: true,
width: 130,
align: 'center',
dictType: 'sys_yes_no',
},
{
title: t('文件夹描述'),
dataIndex: 'description',
key: 'a.description',
sorter: true,
width: 130,
align: 'left',
},
];
const actionColumn: BasicColumn<BizFolders> = {
width: 160,
actions: (record: BizFolders) => [
{
icon: 'i-clarity:note-edit-line',
title: t('编辑文件夹信息'),
onClick: handleForm.bind(this, { folderId: record.folderId }),
auth: 'biz:folders:edit',
},
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
title: t('删除文件夹信息'),
popConfirm: {
title: t('是否确认删除文件夹信息'),
confirm: handleDelete.bind(this, record),
},
auth: 'biz:folders:edit',
},
],
};
const [registerTable, { reload, getForm }] = useTable<BizFolders>({
api: bizFoldersListData,
beforeFetch: (params) => {
return params;
},
columns: tableColumns,
actionColumn: actionColumn,
formConfig: searchForm,
showTableSetting: true,
useSearchForm: true,
canResize: true,
});
onMounted(async () => {
const res = await bizFoldersList();
record.value = (res.bizFolders || {}) as BizFolders;
await getForm().setFieldsValue(record.value);
});
const [registerDrawer, { openDrawer }] = useDrawer();
function handleForm(record: Recordable) {
openDrawer(true, record);
}
async function handleExport() {
loading.value = true;
const { ctxAdminPath } = useGlobSetting();
await downloadByUrl({
url: ctxAdminPath + '/biz/folders/exportData',
params: getForm().getFieldsValue(),
});
loading.value = false;
}
const [registerImportModal, { openModal: importModal }] = useModal();
function handleImport() {
importModal(true, {});
}
async function handleDelete(record: Recordable) {
const params = { folderId: record.folderId };
const res = await bizFoldersDelete(params);
showMessage(res.message);
await handleSuccess(record);
}
async function handleSuccess(record: Recordable) {
await reload({ record });
}
</script>

View File

@@ -1,151 +0,0 @@
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
import { bizFoldersListData } from '@jeesite/biz/api/biz/folders';
const { t } = useI18n('biz.folders');
const modalProps = {
title: t('文件夹信息选择'),
};
const searchForm: FormProps<BizFolders> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('记录时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('文件夹名称'),
field: 'folderName',
component: 'Input',
},
{
label: t('父文件夹'),
field: 'parentId',
component: 'Input',
},
{
label: t('用户名称'),
field: 'loginCode',
component: 'Input',
},
{
label: t('是否删除'),
field: 'isDeleted',
component: 'Select',
componentProps: {
dictType: 'sys_yes_no',
allowClear: true,
},
},
{
label: t('文件夹描述'),
field: 'description',
component: 'Input',
},
],
};
const tableColumns: BasicColumn<BizFolders>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 230,
align: 'left',
slot: 'firstColumn',
},
{
title: t('文件夹名称'),
dataIndex: 'folderName',
key: 'a.folder_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('父文件夹'),
dataIndex: 'parentId',
key: 'a.parent_id',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('用户姓名'),
dataIndex: 'userName',
key: 'a.user_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('用户名称'),
dataIndex: 'loginCode',
key: 'a.login_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('是否删除'),
dataIndex: 'isDeleted',
key: 'a.is_deleted',
sorter: true,
width: 130,
align: 'center',
dictType: 'sys_yes_no',
},
{
title: t('文件夹描述'),
dataIndex: 'description',
key: 'a.description',
sorter: true,
width: 130,
align: 'left',
},
];
const tableProps: BasicTableProps = {
api: bizFoldersListData,
beforeFetch: (params) => {
params['isAll'] = true;
return params;
},
columns: tableColumns,
formConfig: searchForm,
rowKey: 'folderId',
};
export default {
modalProps,
tableProps,
itemCode: 'folderId',
itemName: 'folderId',
isShowCode: false,
};

View File

@@ -1,182 +0,0 @@
<!--
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<BasicDrawer
v-bind="$attrs"
:showFooter="true"
:okAuth="'biz:myfiles:edit'"
@register="registerDrawer"
@ok="handleSubmit"
width="70%"
>
<template #title>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<BasicForm @register="registerForm" />
</BasicDrawer>
</template>
<script lang="ts" setup name="ViewsBizMyfilesForm">
import { ref, unref, computed } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
import { BizMyfiles, bizMyfilesSave, bizMyfilesForm } from '@jeesite/biz/api/biz/myfiles';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('biz.myfiles');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<BizMyfiles>({} as BizMyfiles);
const getTitle = computed(() => ({
icon: meta.icon || 'i-ant-design:book-outlined',
value: record.value.isNewRecord ? t('新增文件信息') : t('编辑文件信息'),
}));
const inputFormSchemas: FormSchema<BizMyfiles>[] = [
{
label: t('原始名称'),
field: 'fileName',
component: 'Input',
componentProps: {
maxlength: 255,
},
required: true,
},
{
label: t('文件大小'),
field: 'fileSize',
component: 'Input',
componentProps: {
maxlength: 18,
},
required: true,
},
{
label: t('文件扩展名'),
field: 'fileExt',
component: 'Input',
componentProps: {
maxlength: 50,
},
},
{
label: t('文件类型'),
field: 'mimeType',
component: 'Input',
componentProps: {
maxlength: 100,
},
},
{
label: t('文件夹标识'),
field: 'folderId',
component: 'Input',
componentProps: {
maxlength: 52,
},
},
{
label: t('下载次数'),
field: 'downloadCount',
component: 'Input',
componentProps: {
maxlength: 8,
},
},
{
label: t('查看次数'),
field: 'viewCount',
component: 'Input',
componentProps: {
maxlength: 8,
},
},
{
label: t('过期时间'),
field: 'expireTime',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('是否删除'),
field: 'isDelete',
component: 'Select',
componentProps: {
dictType: 'sys_yes_no',
allowClear: true,
},
},
{
label: t('更新时间'),
field: 'updateTime',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('附件上传'),
field: 'dataMap',
component: 'Upload',
componentProps: {
loadTime: computed(() => record.value.__t),
bizKey: computed(() => record.value.id),
bizType: 'bizMyfiles_file',
uploadType: 'all',
},
colProps: { md: 24, lg: 24 },
},
];
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<BizMyfiles>({
labelWidth: 120,
schemas: inputFormSchemas,
baseColProps: { md: 24, lg: 12 },
});
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
setDrawerProps({ loading: true });
await resetFields();
const res = await bizMyfilesForm(data);
record.value = (res.bizMyfiles || {}) as BizMyfiles;
record.value.__t = new Date().getTime();
await setFieldsValue(record.value);
setDrawerProps({ loading: false });
});
async function handleSubmit() {
try {
const data = await validate();
setDrawerProps({ confirmLoading: true });
const params: any = {
isNewRecord: record.value.isNewRecord,
tid: record.value.tid || data.tid,
};
// console.log('submit', params, data, record);
const res = await bizMyfilesSave(params, data);
showMessage(res.message);
setTimeout(closeDrawer);
emit('success', data);
} catch (error: any) {
if (error && error.errorFields) {
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
} finally {
setDrawerProps({ confirmLoading: false });
}
}
</script>

View File

@@ -1,103 +0,0 @@
<!--
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<BasicModal
v-bind="$attrs"
:title="t('导入文件信息')"
:okText="t('导入')"
@register="registerModal"
@ok="handleSubmit"
:minHeight="120"
:width="400"
>
<Upload accept=".xls,.xlsx" :file-list="fileList" :before-upload="beforeUpload" @remove="handleRemove">
<a-button> <Icon icon="ant-design:upload-outlined" /> {{ t('选择文件') }} </a-button>
<span class="ml-4">{{ uploadInfo }}</span>
</Upload>
<div class="ml-4 mt-4">
{{ t('提示仅允许导入“xls”或“xlsx”格式文件') }}
</div>
<div class="mt-4">
<a-button @click="handleDownloadTemplate()" type="text">
<Icon icon="i-fa:file-excel-o" />
{{ t('下载模板') }}
</a-button>
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { Upload } from 'ant-design-vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { downloadByUrl } from '@jeesite/core/utils/file/download';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
import { bizMyfilesImportData } from '@jeesite/biz/api/biz/myfiles';
import { FileType } from 'ant-design-vue/es/upload/interface';
import { AxiosProgressEvent } from 'axios';
const emit = defineEmits(['success', 'register']);
const { t } = useI18n('biz.myfiles');
const { showMessage, showMessageModal } = useMessage();
const fileList = ref<FileType[]>([]);
const uploadInfo = ref('');
const beforeUpload = (file: FileType) => {
fileList.value = [file];
return false;
};
const handleRemove = () => {
fileList.value = [];
};
const [registerModal, { setModalProps, closeModal }] = useModalInner(() => {
fileList.value = [];
uploadInfo.value = '';
});
async function handleDownloadTemplate() {
const { ctxAdminPath } = useGlobSetting();
downloadByUrl({ url: ctxAdminPath + '/biz/myfiles/importTemplate' });
}
function onUploadProgress(progressEvent: AxiosProgressEvent) {
const complete = ((progressEvent.loaded / (progressEvent.total || 1)) * 100) | 0;
if (complete != 100) {
uploadInfo.value = t('正在导入,请稍候') + ' ' + complete + '%...';
} else {
uploadInfo.value = '';
}
}
async function handleSubmit() {
try {
if (fileList.value.length == 0) {
showMessage(t('请选择要导入的数据文件'));
return;
}
setModalProps({ confirmLoading: true });
const params = {
file: fileList.value[0],
};
const { data } = await bizMyfilesImportData(params, onUploadProgress);
showMessageModal({ content: data.message });
setTimeout(closeModal);
emit('success');
} catch (error: any) {
if (error && error.errorFields) {
showMessage(error.message || t('common.validateError'));
}
console.log('error', error);
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

View File

@@ -1,314 +0,0 @@
<!--
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
* @author gaoxq
-->
<template>
<div>
<BasicTable @register="registerTable">
<template #tableTitle>
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span>
</template>
<template #toolbar>
<a-button type="default" :loading="loading" @click="handleExport()">
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
</a-button>
<a-button type="default" @click="handleImport()">
<Icon icon="i-ant-design:import-outlined" /> {{ t('导入') }}
</a-button>
<a-button type="primary" @click="handleForm({})" v-auth="'biz:myfiles:edit'">
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
</a-button>
</template>
<template #firstColumn="{ record }">
<a @click="handleForm({ tid: record.tid })" :title="record.createTime">
{{ record.createTime }}
</a>
</template>
</BasicTable>
<InputForm @register="registerDrawer" @success="handleSuccess" />
<FormImport @register="registerImportModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup name="ViewsBizMyfilesList">
import { onMounted, ref, unref } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { useGlobSetting } from '@jeesite/core/hooks/setting';
import { downloadByUrl } from '@jeesite/core/utils/file/download';
import { router } from '@jeesite/core/router';
import { Icon } from '@jeesite/core/components/Icon';
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
import { BizMyfiles, bizMyfilesList } from '@jeesite/biz/api/biz/myfiles';
import { bizMyfilesDelete, bizMyfilesListData } from '@jeesite/biz/api/biz/myfiles';
import { useDrawer } from '@jeesite/core/components/Drawer';
import { useModal } from '@jeesite/core/components/Modal';
import { FormProps } from '@jeesite/core/components/Form';
import InputForm from './form.vue';
import FormImport from './formImport.vue';
const { t } = useI18n('biz.myfiles');
const { showMessage } = useMessage();
const { meta } = unref(router.currentRoute);
const record = ref<BizMyfiles>({} as BizMyfiles);
const getTitle = {
icon: meta.icon || 'i-ant-design:book-outlined',
value: meta.title || t('文件信息管理'),
};
const loading = ref(false);
const searchForm: FormProps<BizMyfiles> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('记录时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('原始名称'),
field: 'fileName',
component: 'Input',
},
{
label: t('文件MD5'),
field: 'fileHash',
component: 'Input',
},
{
label: t('文件夹标识'),
field: 'folderId',
component: 'Input',
},
{
label: t('用户名称'),
field: 'loginCode',
component: 'Input',
},
{
label: t('是否删除'),
field: 'isDelete',
component: 'Select',
componentProps: {
dictType: 'sys_yes_no',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<BizMyfiles>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 230,
align: 'left',
slot: 'firstColumn',
},
{
title: t('原始名称'),
dataIndex: 'fileName',
key: 'a.file_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('存储路径'),
dataIndex: 'filePath',
key: 'a.file_path',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('文件MD5'),
dataIndex: 'fileHash',
key: 'a.file_hash',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('文件大小'),
dataIndex: 'fileSize',
key: 'a.file_size',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('文件扩展名'),
dataIndex: 'fileExt',
key: 'a.file_ext',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('文件类型'),
dataIndex: 'mimeType',
key: 'a.mime_type',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('文件夹标识'),
dataIndex: 'folderId',
key: 'a.folder_id',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('用户姓名'),
dataIndex: 'userName',
key: 'a.user_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('用户名称'),
dataIndex: 'loginCode',
key: 'a.login_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('下载次数'),
dataIndex: 'downloadCount',
key: 'a.download_count',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('查看次数'),
dataIndex: 'viewCount',
key: 'a.view_count',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('过期时间'),
dataIndex: 'expireTime',
key: 'a.expire_time',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('是否删除'),
dataIndex: 'isDelete',
key: 'a.is_delete',
sorter: true,
width: 130,
align: 'center',
dictType: 'sys_yes_no',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 130,
align: 'center',
},
];
const actionColumn: BasicColumn<BizMyfiles> = {
width: 160,
actions: (record: BizMyfiles) => [
{
icon: 'i-clarity:note-edit-line',
title: t('编辑文件信息'),
onClick: handleForm.bind(this, { tid: record.tid }),
auth: 'biz:myfiles:edit',
},
{
icon: 'i-ant-design:delete-outlined',
color: 'error',
title: t('删除文件信息'),
popConfirm: {
title: t('是否确认删除文件信息'),
confirm: handleDelete.bind(this, record),
},
auth: 'biz:myfiles:edit',
},
],
};
const [registerTable, { reload, getForm }] = useTable<BizMyfiles>({
api: bizMyfilesListData,
beforeFetch: (params) => {
return params;
},
columns: tableColumns,
actionColumn: actionColumn,
formConfig: searchForm,
showTableSetting: true,
useSearchForm: true,
canResize: true,
});
onMounted(async () => {
const res = await bizMyfilesList();
record.value = (res.bizMyfiles || {}) as BizMyfiles;
await getForm().setFieldsValue(record.value);
});
const [registerDrawer, { openDrawer }] = useDrawer();
function handleForm(record: Recordable) {
openDrawer(true, record);
}
async function handleExport() {
loading.value = true;
const { ctxAdminPath } = useGlobSetting();
await downloadByUrl({
url: ctxAdminPath + '/biz/myfiles/exportData',
params: getForm().getFieldsValue(),
});
loading.value = false;
}
const [registerImportModal, { openModal: importModal }] = useModal();
function handleImport() {
importModal(true, {});
}
async function handleDelete(record: Recordable) {
const params = { tid: record.tid };
const res = await bizMyfilesDelete(params);
showMessage(res.message);
await handleSuccess(record);
}
async function handleSuccess(record: Recordable) {
await reload({ record });
}
</script>

View File

@@ -1,207 +0,0 @@
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
import { bizMyfilesListData } from '@jeesite/biz/api/biz/myfiles';
const { t } = useI18n('biz.myfiles');
const modalProps = {
title: t('文件信息选择'),
};
const searchForm: FormProps<BizMyfiles> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('记录时间起'),
field: 'createTime_gte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('记录时间止'),
field: 'createTime_lte',
component: 'DatePicker',
componentProps: {
format: 'YYYY-MM-DD HH:mm',
showTime: { format: 'HH:mm' },
},
},
{
label: t('原始名称'),
field: 'fileName',
component: 'Input',
},
{
label: t('文件MD5'),
field: 'fileHash',
component: 'Input',
},
{
label: t('文件夹标识'),
field: 'folderId',
component: 'Input',
},
{
label: t('用户名称'),
field: 'loginCode',
component: 'Input',
},
{
label: t('是否删除'),
field: 'isDelete',
component: 'Select',
componentProps: {
dictType: 'sys_yes_no',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<BizMyfiles>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 230,
align: 'left',
slot: 'firstColumn',
},
{
title: t('原始名称'),
dataIndex: 'fileName',
key: 'a.file_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('存储路径'),
dataIndex: 'filePath',
key: 'a.file_path',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('文件MD5'),
dataIndex: 'fileHash',
key: 'a.file_hash',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('文件大小'),
dataIndex: 'fileSize',
key: 'a.file_size',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('文件扩展名'),
dataIndex: 'fileExt',
key: 'a.file_ext',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('文件类型'),
dataIndex: 'mimeType',
key: 'a.mime_type',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('文件夹标识'),
dataIndex: 'folderId',
key: 'a.folder_id',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('用户姓名'),
dataIndex: 'userName',
key: 'a.user_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('用户名称'),
dataIndex: 'loginCode',
key: 'a.login_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('下载次数'),
dataIndex: 'downloadCount',
key: 'a.download_count',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('查看次数'),
dataIndex: 'viewCount',
key: 'a.view_count',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('过期时间'),
dataIndex: 'expireTime',
key: 'a.expire_time',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('是否删除'),
dataIndex: 'isDelete',
key: 'a.is_delete',
sorter: true,
width: 130,
align: 'center',
dictType: 'sys_yes_no',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 130,
align: 'center',
},
];
const tableProps: BasicTableProps = {
api: bizMyfilesListData,
beforeFetch: (params) => {
params['isAll'] = true;
return params;
},
columns: tableColumns,
formConfig: searchForm,
rowKey: 'tid',
};
export default {
modalProps,
tableProps,
itemCode: 'tid',
itemName: 'tid',
isShowCode: false,
};

View File

@@ -1,15 +1,6 @@
<template>
<Card title="常用应用" class="common-app-card">
<div class="app-list">
<!-- 新增的文件管理项 -->
<div class="app-item">
<a-button type="link" size="small" @click="goToFileManager" class="app-btn">
<img :src="FileImg" class="app-icon" />
</a-button>
<span class="app-text">文件管理</span>
</div>
<!-- 原有应用列表 -->
<div class="app-item" v-for="(app, index) in appList" :key="index">
<a-button type="link" size="small" @click="goToMorePage(app)" class="app-btn">
<img :src="app.iconClass" class="app-icon" />
@@ -51,10 +42,6 @@ const goToMorePage = (app : BizQuickLogin) => {
router.push(app.homepageUrl);
};
const goToFileManager = () => {
router.push('/desktop/myfiles');
};
onMounted(() => {
const timer = setTimeout(() => {
fetchAppList();

View File

@@ -1,42 +0,0 @@
<template>
<BasicModal
v-bind="$attrs"
@register="register"
title="新建文件夹"
width="40%"
@cancel="handleCancel"
>
</BasicModal>
</template>
<script lang="ts">
import { defineComponent, ref, onMounted, onUnmounted } from 'vue';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
export default defineComponent({
components: { BasicModal },
emits: ['modalClose'],
setup(props, { emit }) {
const { createMessage } = useMessage();
// 模态框注册
const [register, { closeModal }] = useModalInner(async (data: any) => {
});
const handleCancel = () => {
emit('modalClose');
};
return {
register,
closeModal,
handleCancel,
};
},
});
</script>
<style>
</style>

View File

@@ -1,709 +0,0 @@
<template>
<div class="file-manager-container">
<div class="sidebar">
<div class="search-box-fixed">
<a-input
v-model:value="folderSearchText"
placeholder="文件夹搜索框"
class="folder-search-input"
allow-clear
/>
</div>
<div class="tree-scroll-container">
<div class="tree-container">
<div
class="tree-node folder-node"
v-for="(folder, index) in filteredFolderList"
:key="folder.id || index"
@click="toggleFolder(folder)"
@dblclick="doubleClickFolder(folder)"
:class="{ active: folder.expanded }"
>
<div class="folder-info">
<span class="folder-icon">
<Icon
:icon="folder.expanded
? 'ant-design:folder-open-filled'
: 'ant-design:folder-outlined'"
:color="folder.expanded ? '#FF9800' : '#FFB74D'"
/>
</span>
<span class="folder-name">{{ folder.name }}</span>
</div>
<span class="tree-toggle">
<Icon
:icon="folder.expanded ? 'simple-line-icons:arrow-down' : 'simple-line-icons:arrow-right'"
style="margin-right: 4px;"
/>
</span>
<!-- 子节点容器自动展开匹配子项的父级 -->
<div class="tree-children" v-if="folder.expanded">
<div
class="tree-node file-node"
v-for="(child, idx) in filterChildren(folder.children, folderSearchText)"
:key="child.id || idx"
@click.stop="handleChildClick(child)"
>
<span class="file-icon">
<Icon
icon="simple-line-icons:folder"
class="icon-size"
/>
</span>
<span class="file-name">{{ child.folderName }}</span>
</div>
</div>
</div>
<!-- 无匹配结果提示 -->
<div v-if="folderSearchText && filteredFolderList.length === 0" class="no-result">
<span>未找到匹配的文件夹</span>
</div>
</div>
</div>
</div>
<div class="main-content">
<div class="header-bar">
<a-input-search
v-model:value="fileSearchText"
placeholder="文件搜索框"
class="file-search-input"
enter-button
@search="onSearch"
/>
<div class="header-btn-group">
<a-button type="default" class="header-btn" @click="openfolderModal(true, ParamsFolders)"><Icon icon="ant-design:folder-add-outlined" />新建文件夹</a-button>
<a-button type="primary" class="header-btn" @click="openUploadModal(true, ParamsFolders)" :disabled="UploadFile"><Icon icon="ant-design:cloud-upload-outlined" />上传文件</a-button>
</div>
</div>
<div class="file-list-wrapper">
<div class="file-list">
<Card
v-for="(file, index) in fileList"
:key="index"
class="file-card"
:hoverable="true"
>
<div class="card-inner-content">
<div class="file-card-header">
<div class="file-name-wrap">
<span class="file-card-icon"><Icon icon="i-svg:moon" size="24" /></span>
<span class="file-card-name" :title="file.fileName">{{ file.fileName }}</span>
</div>
<span class="file-card-size">{{ file.fileSize }}</span>
</div>
<div class="card-divider"></div>
<div class="file-card-actions">
<a-button type="link" size="small" ><Icon icon="ant-design:branches-outlined"/>共享</a-button>
<a-button type="link" size="small" ><Icon icon="ant-design:cloud-download-outlined"/>下载</a-button>
<a-button type="error" size="small" danger><Icon icon="ant-design:delete-filled"/>删除</a-button>
</div>
</div>
</Card>
</div>
</div>
</div>
</div>
<UploadModal @register="uploadregister" @modalClose="getFileList({ params: ParamsFolders})"/>
<FolderModal @register="folderregister" />
</template>
<script setup lang="ts">
import { ref, onMounted, computed, watch } from 'vue';
import { message } from 'ant-design-vue';
import { Input, Card } from 'ant-design-vue';
import { Icon } from '@jeesite/core/components/Icon';
import { useModal } from '@jeesite/core/components/Modal';
import UploadModal from './components/upload.vue';
import FolderModal from './components/folder.vue';
import { FolderItem, bizFolderItemAll } from '@jeesite/biz/api/biz/folders';
import { BizMyfiles, bizMyfilesListAll } from '@jeesite/biz/api/biz/myfiles';
import { useUserStore } from '@jeesite/core/store/modules/user';
const userStore = useUserStore();
const userinfo = computed(() => userStore.getUserInfo);
const [uploadregister, { openModal: openUploadModal }] = useModal();
const [folderregister, { openModal: openfolderModal }] = useModal();
interface ChildFolder {
id?: number | string;
folderName: string;
type: 'folder' | 'file';
children?: ChildFolder[]; // 支持多级子文件夹
}
let UploadFile = true;
const ParamsFolders = ref();
const folderSearchText = ref<string>('');
const fileSearchText = ref<string>('');
const folderList = ref<FolderItem[]>([]);
const fileList = ref<BizMyfiles[]>([]);
const bindParentReferences = (folders: FolderItem[], _parent: FolderItem | null = null) => {
folders.forEach(folder => {
if (folder.children && folder.children.length) {
bindParentReferences(folder.children as unknown as FolderItem[], folder);
}
});
};
// 递归展开所有父级文件夹
const expandAllParents = (node: FolderItem | ChildFolder) => {
let currentNode: any = node;
while (currentNode.parent) {
currentNode.parent.expanded = true;
currentNode = currentNode.parent;
}
};
// 搜索匹配并展开父级
const searchAndExpandParents = (keyword: string) => {
if (!keyword.trim()) return;
const traverseFolders = (folders: FolderItem[]) => {
folders.forEach(folder => {
// 检查当前文件夹是否匹配
const currentMatch = folder.name.toLowerCase().includes(keyword.toLowerCase());
if (currentMatch) expandAllParents(folder);
// 递归检查子文件夹
if (folder.children && folder.children.length) {
folder.children.forEach(child => {
const childMatch = child.folderName.toLowerCase().includes(keyword.toLowerCase());
if (childMatch) {
folder.expanded = true; // 展开当前父级
expandAllParents(folder); // 展开所有祖先
}
});
}
});
};
traverseFolders(folderList.value);
};
const filteredFolderList = computed(() => {
const keyword = folderSearchText.value.toLowerCase().trim();
if (!keyword) return folderList.value;
const filterFolders = (folders: FolderItem[]): FolderItem[] => {
return folders.filter(folder => {
const currentMatch = folder.name.toLowerCase().includes(keyword);
let childrenMatch = false;
if (folder.children && folder.children.length) {
childrenMatch = folder.children.some(child =>
child.folderName.toLowerCase().includes(keyword)
);
}
return currentMatch || childrenMatch;
});
};
return filterFolders(folderList.value);
});
// 过滤子文件夹
const filterChildren = (children: ChildFolder[] = [], keyword: string) => {
if (!keyword.trim()) return children;
return children.filter(child =>
child.folderName.toLowerCase().includes(keyword.toLowerCase().trim())
);
};
// 监听搜索框变化,触发搜索和展开
watch(folderSearchText, (newVal) => {
// 清空搜索时重置展开状态
if (!newVal.trim()) {
folderList.value.forEach(folder => folder.expanded = false);
return;
}
searchAndExpandParents(newVal);
});
const getDataList = async (params: {}) => {
try {
const reqParams = {
... params,
loginCode :userinfo.value.loginCode,
}
const result = await bizFolderItemAll(reqParams);
const folders = (result || []) as FolderItem[];
folders.forEach(folder => {
folder.expanded = false;
});
bindParentReferences(folders); // 绑定父级引用
folderList.value = folders;
getFileList({});
} catch (error) {
console.error('获取文件夹信息失败:', error);
folderList.value = [];
}
};
const getFileList = async (params: {}) => {
try {
const reqParams = {
... params,
folderId: ParamsFolders?.value?.folderId || '',
loginCode :userinfo.value.loginCode,
}
const result = await bizMyfilesListAll(reqParams);
fileList.value = result || [];
} catch (error) {
console.error('获取文件信息失败:', error);
fileList.value = [];
}
};
const onSearch = (searchValue: string) => {
UploadFile = true;
ParamsFolders.value = {};
const params = {
fileName: searchValue,
}
getFileList(params);
};
const toggleFolder = async (targetFolder: FolderItem) => {
if (targetFolder.expanded) {
targetFolder.expanded = false;
return;
}
try {
if ('loading' in targetFolder) targetFolder.loading = true;
folderList.value.forEach(folder => {
if (folder !== targetFolder) folder.expanded = false;
});
targetFolder.expanded = true;
} catch (error) {
console.error('加载文件夹数据失败:', error);
targetFolder.expanded = false;
} finally {
if ('loading' in targetFolder) targetFolder.loading = false;
}
};
const handleChildClick = (child: ChildFolder) => {
UploadFile = false;
ParamsFolders.value = child;
const params = {
folderId: child.id,
userName: userinfo.value.userName,
loginCode :userinfo.value.loginCode,
}
getFileList(params);
};
const doubleClickFolder = (targetFolder: FolderItem) => {
message.info(`正在打开「${targetFolder.name}」文件夹`);
};
// 监听搜索文本变化,触发展开
watch(folderSearchText, () => {
if (folderSearchText.value.trim()) searchAndExpandParents(folderSearchText.value);
});
onMounted(() => {
getDataList({});
});
</script>
<style scoped>
/* 基础布局 */
.file-manager-container {
display: flex;
width: 100%;
height: calc(100vh - 120px);
background: #f0f8ff;
overflow: hidden;
box-sizing: border-box;
}
.sidebar {
width: 220px;
background: transparent;
border-right: 1px solid #e8f4f8;
padding: 0;
box-sizing: border-box;
height: 100%;
display: flex;
flex-direction: column;
flex-shrink: 0;
}
.search-box-fixed {
padding: 16px;
border-bottom: 1px solid #e8f4f8;
background: #f0f8ff;
z-index: 10;
}
.folder-search-input {
width: 100%;
border: 1px solid #b3d9f2;
border-radius: 4px;
}
/* 无匹配结果样式 */
.no-result {
padding: 16px;
text-align: center;
color: #668799;
font-size: 13px;
}
/* 优化 tree-scroll-container 样式 */
.tree-scroll-container {
flex: 1;
overflow-y: auto;
padding: 8px 0;
scrollbar-width: thin;
scrollbar-color: #b3d9f2 #f0f8ff;
scroll-behavior: smooth;
contain: layout paint;
}
.tree-scroll-container::-webkit-scrollbar {
width: 8px;
}
.tree-scroll-container::-webkit-scrollbar-track {
background: #f0f8ff;
border-radius: 4px;
}
.tree-scroll-container::-webkit-scrollbar-thumb {
background-color: #b3d9f2;
border-radius: 4px;
border: 2px solid #f0f8ff;
}
.tree-scroll-container:hover::-webkit-scrollbar-thumb {
background-color: #91c8ee;
}
.tree-container {
width: 100%;
padding: 0 8px;
}
.folder-node {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 6px;
cursor: pointer;
border-radius: 4px;
margin: 4px 0;
flex-wrap: wrap;
border-bottom: 1px solid #e8f4f8;
transition: background-color 0.2s ease;
}
.folder-node.active,
.folder-node:hover {
background: #e8f4f8;
}
.folder-node.active {
background-color: #f5fafe;
border-left: 3px solid #1890ff;
padding-left: 3px;
}
.folder-info {
display: flex;
align-items: center;
flex: 1;
overflow: hidden;
}
.folder-node:last-child {
border-bottom: none;
}
.file-node {
display: flex;
align-items: center;
padding: 6px 4px;
cursor: pointer;
border-radius: 4px;
margin: 2px 0;
border-bottom: 1px dashed #e8f4f8;
transition: background-color 0.2s ease;
}
.file-node:last-child {
border-bottom: none;
}
.file-node:hover {
background: #f5fafe;
}
.tree-toggle {
display: inline-block;
width: 18px;
height: 18px;
text-align: center;
font-size: 12px;
color: #1890ff;
font-weight: bold;
user-select: none;
flex-shrink: 0;
transition: transform 0.2s ease;
}
.folder-icon, .file-icon {
margin: 0 6px;
font-size: 14px;
flex-shrink: 0;
color: #1890ff;
transition: color 0.2s ease;
}
.folder-node.active .folder-icon,
.folder-node:hover .folder-icon {
color: #096dd9;
}
.file-icon {
color: #668799;
}
.folder-name, .file-name {
font-size: 13px;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
}
.tree-children {
margin-left: 24px;
margin-top: 2px;
width: 100%;
padding-bottom: 4px;
animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(2px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.main-content {
flex: 1;
padding: 16px;
box-sizing: border-box;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.header-bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 20px;
width: 100%;
flex-shrink: 0;
}
.file-search-input {
flex: 1;
min-width: 0;
}
.header-btn-group {
display: flex;
gap: 12px;
}
.header-btn {
white-space: nowrap;
}
.file-list-wrapper {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: thin;
scrollbar-color: #b3d9f2 #f0f8ff;
border-radius: 8px;
border: 1px solid #e8f4f8;
padding: 8px;
box-sizing: border-box;
}
.file-list-wrapper::-webkit-scrollbar {
width: 8px;
}
.file-list-wrapper::-webkit-scrollbar-track {
background: #f0f8ff;
border-radius: 4px;
}
.file-list-wrapper::-webkit-scrollbar-thumb {
background-color: #b3d9f2;
border-radius: 4px;
border: 2px solid #f0f8ff;
}
.file-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 16px;
padding: 8px;
width: 100%;
box-sizing: border-box;
}
.file-card {
background: #e8f4f8;
border: 1px solid #b3d9f2;
border-radius: 8px;
transition: all 0.2s ease;
box-sizing: border-box;
height: 100px;
padding: 0;
overflow: hidden;
}
.card-inner-content {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
padding: 0 4px;
}
.file-card:hover {
box-shadow: 0 2px 4px rgba(24, 144, 255, 0.1);
transform: translateY(-2px);
}
.file-card-header {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding-top: 2px;
padding-bottom: 4px;
flex-shrink: 0;
}
.file-name-wrap {
display: flex;
align-items: center;
flex: 1;
overflow: hidden;
}
.file-card-icon {
font-size: 18px;
margin-right: 8px;
flex-shrink: 0;
}
.file-card-name {
font-weight: 500;
color: #1890ff;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: calc(100% - 40px);
cursor: default;
}
.file-card-size {
font-size: 12px;
color: #668799;
font-weight: 400;
flex-shrink: 0;
margin-left: 8px;
white-space: nowrap;
}
.card-divider {
width: 100%;
height: 1px;
background-color: #b3d9f2;
opacity: 0.5;
margin: 0 0 4px 0;
flex-shrink: 0;
}
.file-card-actions {
display: flex;
gap: 4px;
margin-top: auto;
margin-bottom: 2px;
justify-content: flex-end;
flex-shrink: 0;
}
.file-card-actions button {
color: #1890ff;
padding: 0;
height: auto;
font-size: 12px;
display: flex;
align-items: center;
gap: 4px;
line-height: 1;
}
:deep(.file-card-actions .ant-btn-dangerous) {
color: #ff4d4f;
}
:deep(.ant-tooltip-inner) {
background-color: #fff;
color: #333;
border: 1px solid #b3d9f2;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
max-width: 200px;
}
@media (max-width: 1400px) {
.file-list {
grid-template-columns: repeat(3, 1fr);
}
}
@media (max-width: 1200px) {
.file-list {
grid-template-columns: repeat(2, 1fr);
}
.file-card {
height: 90px;
}
}
@media (max-width: 768px) {
.file-list {
grid-template-columns: 1fr;
}
.file-card {
height: 100px;
}
}
* {
box-sizing: border-box;
}
</style>

View File

@@ -0,0 +1,134 @@
<template>
<BasicModal
v-bind="$attrs"
@register="register"
title="创建目录"
width="60%"
@cancel="handleCancel"
@ok="handleSubmit"
>
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts">
import { defineComponent, ref, computed, onMounted, onUnmounted } from 'vue';
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
import { FolderItem, BizFolders, bizFoldersListAll, bizFoldersSave, bizFolderTreeData } from '@jeesite/biz/api/biz/folders';
import { useUserStore } from '@jeesite/core/store/modules/user';
const userStore = useUserStore();
const userinfo = computed(() => userStore.getUserInfo);
export default defineComponent({
components: { BasicModal, BasicForm },
emits: ['modalClose'],
setup(props, { emit }) {
const { showMessage } = useMessage();
const { t } = useI18n('biz.myfiles');
const record = ref<BizFolders>({} as BizFolders);
const inputFormSchemas: FormSchema<BizFolders>[] = [
{
label: t('上级目录'),
field: 'parentId',
component: 'TreeSelect',
componentProps: {
api: bizFolderTreeData,
params: { loginCode: userinfo.value.loginCode },
allowClear: true,
},
required: true,
},
{
label: t('目录名称'),
field: 'folderName',
component: 'Input',
componentProps: {
maxlength: 52,
},
required: true,
},
{
label: t('用户编码'),
field: 'loginCode',
component: 'Input',
defaultValue: userinfo.value.loginCode,
componentProps: {
maxlength: 52,
},
required: true,
dynamicDisabled: true,
},
{
label: t('用户名称'),
field: 'userName',
component: 'Input',
defaultValue: userinfo.value.userName,
componentProps: {
maxlength: 52,
},
required: true,
dynamicDisabled: true,
},
];
// 表单注册核心逻辑
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<BizFolders>({
labelWidth: 120,
schemas: inputFormSchemas,
baseColProps: { md: 24, lg: 12 },
});
const { createMessage } = useMessage();
const [register, { setModalProps, closeModal }] = useModalInner(async (data: any) => {
setModalProps({ loading: true });
await resetFields();
record.value = (data || {}) as BizFolders;
record.value.__t = new Date().getTime();
await setFieldsValue(record.value);
setModalProps({ loading: false });
});
async function handleSubmit() {
try {
setModalProps({ confirmLoading: true });
const data = await validate();
const params: any = {
isNewRecord: true,
id : Date.now(),
};
const res = await bizFoldersSave(params, data);
showMessage(res.message);
handleCancel();
} catch (error: any) {
console.error('创建目录失败:', error);
} finally {
setModalProps({ confirmLoading: false });
}
}
// 取消按钮逻辑
const handleCancel = () => {
resetFields();
emit('modalClose');
closeModal();
};
return {
register,
closeModal,
handleCancel,
registerForm,
inputFormSchemas,
handleSubmit,
};
},
});
</script>
<style>
</style>

View File

@@ -19,7 +19,7 @@
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
import { BizMyfiles, bizMyfilesSave, bizMyfilesForm } from '@jeesite/biz/api/biz/myfiles';
import { FolderItem, bizFoldersListAll } from '@jeesite/biz/api/biz/folders';
import { bizFoldersListAll } from '@jeesite/biz/api/biz/folders';
export default defineComponent({
components: { BasicModal, BasicForm },
@@ -37,7 +37,6 @@
component: 'Select',
componentProps: {
api: bizFoldersListAll,
params: { parentId : '0' },
fieldNames: { label: 'folderName', value: 'folderId' },
immediate: true,
allowClear: true,
@@ -45,20 +44,20 @@
required: true,
dynamicDisabled: true,
},
{
label: t('目录名称'),
field: 'folderId',
component: 'Select',
componentProps: {
api: bizFoldersListAll,
params: {},
fieldNames: { label: 'folderName', value: 'folderId' },
immediate: true,
allowClear: true,
},
{
label: t('目录名称'),
field: 'folderId',
component: 'Select',
componentProps: {
api: bizFoldersListAll,
params: {},
fieldNames: { label: 'folderName', value: 'folderId' },
immediate: true,
allowClear: true,
},
required: true,
dynamicDisabled: true,
},
},
{
label: t('用户编码'),
field: 'loginCode',
@@ -79,20 +78,20 @@
required: true,
dynamicDisabled: true,
},
{
label: t('上传文件'),
field: 'dataMap',
component: 'Upload',
componentProps: {
loadTime: computed(() => record.value.__t),
bizKey: computed(() => record.value.id),
bizType: 'bizMyfiles_file',
uploadType: 'all',
},
{
label: t('上传文件'),
field: 'dataMap',
component: 'Upload',
componentProps: {
loadTime: computed(() => record.value.__t),
bizKey: computed(() => record.value.id),
bizType: 'bizMyfiles_file',
uploadType: 'all',
},
required: true,
colProps: { md: 24, lg: 24 },
},
];
},
];
//
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<BizMyfiles>({
@@ -104,32 +103,32 @@
const { createMessage } = useMessage();
const [register, { setModalProps, closeModal }] = useModalInner(async (data: any) => {
setModalProps({ loading: true });
await resetFields();
record.value = (data || {}) as BizMyfiles;
record.value.__t = new Date().getTime();
setModalProps({ loading: true });
await resetFields();
record.value = (data || {}) as BizMyfiles;
record.value.__t = new Date().getTime();
if (data) {
await setFieldsValue(record.value);
await setFieldsValue(record.value);
}
setModalProps({ loading: false });
setModalProps({ loading: false });
});
async function handleSubmit() {
try {
setModalProps({ confirmLoading: true });
const data = await validate();
setModalProps({ confirmLoading: true });
const params: any = {
isNewRecord: true,
tid : Date.now(),
id : Date.now(),
};
const res = await bizMyfilesSave(params, data);
showMessage(res.message);
handleCancel();
const res = await bizMyfilesSave(params, data);
showMessage(res.message);
handleCancel();
} catch (error: any) {
console.error('上传文件保存失败:', error);
} finally {
setModalProps({ confirmLoading: false });
}
setModalProps({ confirmLoading: false });
}
}
//
@@ -145,7 +144,7 @@
handleCancel,
registerForm,
inputFormSchemas,
handleSubmit,
handleSubmit,
};
},
});

View File

@@ -11,6 +11,9 @@
<TabPane key="3" tab="字典管理">
<TableInfo />
</TabPane>
<TabPane key="4" tab="文件管理">
<MyfileInfo />
</TabPane>
</Tabs>
</div>
</template>
@@ -22,6 +25,7 @@
import Calendar from './components/calendar/list.vue';
import TableInfo from './components/tableInfo/list.vue';
import ItemsInfo from './components/listItem/list.vue';
import MyfileInfo from './components/myfiles/index.vue';
const activeKey = ref('1');
</script>

View File

@@ -3,5 +3,4 @@ export default {
about: 'About',
workbench: 'Workbench',
analysis: 'Analysis',
files:'files'
};

View File

@@ -3,5 +3,4 @@ export default {
workbench: '我的工作',
analysis: '首页',
about: '关于我们',
files: '文件管理'
};

View File

@@ -43,16 +43,6 @@ const desktop: AppRouteModule = {
hideMenu: true,
},
},
{
path: 'myfiles',
name: 'MyfilePage',
component: () => import('@jeesite/core/layouts/views/desktop/myfiles/index.vue'),
meta: {
title: t('routes.dashboard.files'),
icon: 'i-ant-design:tag-outlined',
hideMenu: true,
},
},
],
};

View File

@@ -10,7 +10,6 @@ VITE_PROXY = [["/js","http://127.0.0.1:8980/js",false]]
# 是否删除 console 调试信息
VITE_DROP_CONSOLE = false
# 访问接口的根路径例如https://vue.jeesite.com建议为空
VITE_GLOB_API_URL =
# 访问接口的前缀,在根路径之后

View File

@@ -14,7 +14,6 @@ VITE_BUILD_COMPRESS = 'none'
# 是否删除源文件时使用压缩,默认为 false
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
# 访问接口的根路径例如https://vue.jeesite.com建议为空
VITE_GLOB_API_URL =
# 访问接口的前缀,在根路径之后

View File

@@ -17,7 +17,6 @@ VITE_BUILD_COMPRESS = 'none'
# 是否删除源文件时使用压缩,默认为 false
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
# 访问接口的根路径例如https://vue.jeesite.com建议为空
VITE_GLOB_API_URL =
# 访问接口的前缀,在根路径之后

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M21 9.5V12.5C21 14.9853 16.9706 17 12 17C7.02944 17 3 14.9853 3 12.5V9.5C3 11.9853 7.02944 14 12 14C16.9706 14 21 11.9853 21 9.5ZM3 14.5C3 16.9853 7.02944 19 12 19C16.9706 19 21 16.9853 21 14.5V17.5C21 19.9853 16.9706 22 12 22C7.02944 22 3 19.9853 3 17.5V14.5ZM12 12C7.02944 12 3 9.98528 3 7.5C3 5.01472 7.02944 3 12 3C16.9706 3 21 5.01472 21 7.5C21 9.98528 16.9706 12 12 12Z"></path></svg>

After

Width:  |  Height:  |  Size: 479 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 12.5C5 12.8134 5.46101 13.3584 6.53047 13.8931C7.91405 14.5849 9.87677 15 12 15C14.1232 15 16.0859 14.5849 17.4695 13.8931C18.539 13.3584 19 12.8134 19 12.5V10.3287C17.35 11.3482 14.8273 12 12 12C9.17273 12 6.64996 11.3482 5 10.3287V12.5ZM19 15.3287C17.35 16.3482 14.8273 17 12 17C9.17273 17 6.64996 16.3482 5 15.3287V17.5C5 17.8134 5.46101 18.3584 6.53047 18.8931C7.91405 19.5849 9.87677 20 12 20C14.1232 20 16.0859 19.5849 17.4695 18.8931C18.539 18.3584 19 17.8134 19 17.5V15.3287ZM3 17.5V7.5C3 5.01472 7.02944 3 12 3C16.9706 3 21 5.01472 21 7.5V17.5C21 19.9853 16.9706 22 12 22C7.02944 22 3 19.9853 3 17.5ZM12 10C14.1232 10 16.0859 9.58492 17.4695 8.89313C18.539 8.3584 19 7.81342 19 7.5C19 7.18658 18.539 6.6416 17.4695 6.10687C16.0859 5.41508 14.1232 5 12 5C9.87677 5 7.91405 5.41508 6.53047 6.10687C5.46101 6.6416 5 7.18658 5 7.5C5 7.81342 5.46101 8.3584 6.53047 8.89313C7.91405 9.58492 9.87677 10 12 10Z"></path></svg>

After

Width:  |  Height:  |  Size: 1017 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M16 2L21 7V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918C3 2.44405 3.44495 2 3.9934 2H16ZM13.2 12L16 8H13.6L12 10.2857L10.4 8H8L10.8 12L8 16H10.4L12 13.7143L13.6 16H16L13.2 12Z"></path></svg>

After

Width:  |  Height:  |  Size: 319 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M13.2 12L16 16H13.6L12 13.7143L10.4 16H8L10.8 12L8 8H10.4L12 10.2857L13.6 8H15V4H5V20H19V8H16L13.2 12ZM3 2.9918C3 2.44405 3.44749 2 3.9985 2H16L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918Z"></path></svg>

After

Width:  |  Height:  |  Size: 347 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M16 2L21 7V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918C3 2.44405 3.44495 2 3.9934 2H16ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8H8V16H12ZM10 10H12C13.1046 10 14 10.8954 14 12C14 13.1046 13.1046 14 12 14H10V10Z"></path></svg>

After

Width:  |  Height:  |  Size: 373 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 16H8V8H12C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16ZM10 10V14H12C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10H10ZM15 4H5V20H19V8H15V4ZM3 2.9918C3 2.44405 3.44749 2 3.9985 2H16L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918Z"></path></svg>

After

Width:  |  Height:  |  Size: 407 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 2.9918C3 2.44405 3.44749 2 3.9985 2H16L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918ZM5 4V20H19V8H16V14H10V16H8V8H15V4H5ZM10 10V12H14V10H10Z"></path></svg>

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M16 2L21 7V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918C3 2.44405 3.44495 2 3.9934 2H16ZM14 8V12.989L12 11L10.0108 13L10 8H8V16H10L12 14L14 16H16V8H14Z"></path></svg>

After

Width:  |  Height:  |  Size: 295 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M16 8V16H14L12 14L10 16H8V8H10V13L12 11L14 13V8H15V4H5V20H19V8H16ZM3 2.9918C3 2.44405 3.44749 2 3.9985 2H16L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918Z"></path></svg>

After

Width:  |  Height:  |  Size: 311 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10 2V4H12V2H20.0066C20.5551 2 21 2.44405 21 2.9918V21.0082C21 21.5447 20.5552 22 20.0066 22H3.9934C3.44495 22 3 21.556 3 21.0082V2.9918C3 2.45531 3.44476 2 3.9934 2H10ZM12 4V6H14V4H12ZM10 6V8H12V6H10ZM12 8V10H14V8H12ZM10 10V12H12V10H10ZM12 12V14H10V17H14V12H12Z"></path></svg>

After

Width:  |  Height:  |  Size: 366 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM14 12V17H10V14H12V12H14ZM12 4H14V6H12V4ZM10 6H12V8H10V6ZM12 8H14V10H12V8ZM10 10H12V12H10V10Z"></path></svg>

After

Width:  |  Height:  |  Size: 335 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M21 5C21.5523 5 22 5.44772 22 6V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H10.4142L12.4142 5H16V7H18V5H21ZM18 13H16V15H14V18H18V13ZM16 11H14V13H16V11ZM18 9H16V11H18V9ZM16 7H14V9H16V7Z"></path></svg>

After

Width:  |  Height:  |  Size: 329 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10.4142 3L12.4142 5H21C21.5523 5 22 5.44772 22 6V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H10.4142ZM18 18H14V15H16V13H14V11H16V9H14V7H11.5858L9.58579 5H4V19H20V7H16V9H18V11H16V13H18V18Z"></path></svg>

After

Width:  |  Height:  |  Size: 333 B