From 0498f8a018af2ea842f62ac224730ccdb949b782 Mon Sep 17 00:00:00 2001 From: jiangzhe <244140623@qq.com> Date: Mon, 17 Jun 2024 14:40:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/api/resource/catalogPerson/index.ts | 63 ++ src/api/resource/catalogPerson/types.ts | 105 ++++ src/api/system/oss/index.ts | 18 +- src/components/FileMd5Upload/index.vue | 284 +++++++++ src/components/FileUpload/index.vue | 1 + .../catalogPerson/components/FileList.vue | 545 ++++++++++++++++++ src/views/resource/catalogPerson/index.vue | 315 ++++++++++ src/views/resource/catalogResource/index.vue | 4 +- src/views/resource/catalogTextbook/index.vue | 13 +- .../resourceMgt/catalogTextbookMgt/index.vue | 301 ++++++++-- 11 files changed, 1604 insertions(+), 46 deletions(-) create mode 100644 src/api/resource/catalogPerson/index.ts create mode 100644 src/api/resource/catalogPerson/types.ts create mode 100644 src/components/FileMd5Upload/index.vue create mode 100644 src/views/resource/catalogPerson/components/FileList.vue create mode 100644 src/views/resource/catalogPerson/index.vue diff --git a/package.json b/package.json index 09a2d0b..f5bc28b 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "pinia": "2.1.7", "preact": "10.19.7", "screenfull": "6.0.2", + "spark-md5": "^3.0.2", "vform3-builds": "3.0.10", "vue": "3.4.25", "vue-cropper": "1.1.1", diff --git a/src/api/resource/catalogPerson/index.ts b/src/api/resource/catalogPerson/index.ts new file mode 100644 index 0000000..02a044d --- /dev/null +++ b/src/api/resource/catalogPerson/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { CatalogPersonVO, CatalogPersonForm, CatalogPersonQuery } from '@/api/resource/catalogPerson/types'; + +/** + * 查询目录-我的空间列表 + * @param query + * @returns {*} + */ + +export const listCatalogPerson = (query?: CatalogPersonQuery): AxiosPromise => { + return request({ + url: '/catalog/person/list', + method: 'get', + params: query + }); +}; + +/** + * 查询目录-我的空间详细 + * @param catalogId + */ +export const getCatalogPerson = (catalogId: string | number): AxiosPromise => { + return request({ + url: '/catalog/person/' + catalogId, + method: 'get' + }); +}; + +/** + * 新增目录-我的空间 + * @param data + */ +export const addCatalogPerson = (data: CatalogPersonForm) => { + return request({ + url: '/catalog/person', + method: 'post', + data: data + }); +}; + +/** + * 修改目录-我的空间 + * @param data + */ +export const updateCatalogPerson = (data: CatalogPersonForm) => { + return request({ + url: '/catalog/person', + method: 'put', + data: data + }); +}; + +/** + * 删除目录-我的空间 + * @param catalogId + */ +export const delCatalogPerson = (catalogId: string | number | Array) => { + return request({ + url: '/catalog/person/' + catalogId, + method: 'delete' + }); +}; diff --git a/src/api/resource/catalogPerson/types.ts b/src/api/resource/catalogPerson/types.ts new file mode 100644 index 0000000..f797786 --- /dev/null +++ b/src/api/resource/catalogPerson/types.ts @@ -0,0 +1,105 @@ +export interface CatalogPersonVO { + /** + * 目录id + */ + catalogId: string | number; + + /** + * 用户编号 + */ + userId: string | number; + + /** + * 父目录id + */ + parentId: string | number; + + /** + * 祖级列表 + */ + ancestors: string; + + /** + * 目录名称 + */ + catalogName: string; + + /** + * 显示顺序 + */ + orderNum: number; + + /** + * 子对象 + */ + children: CatalogPersonVO[]; +} + +export interface CatalogPersonForm extends BaseEntity { + /** + * 目录id + */ + catalogId?: string | number; + + /** + * 用户编号 + */ + userId?: string | number; + + /** + * 父目录id + */ + parentId?: string | number; + + /** + * 祖级列表 + */ + ancestors?: string; + + /** + * 目录名称 + */ + catalogName?: string; + + /** + * 显示顺序 + */ + orderNum?: number; + +} + +export interface CatalogPersonQuery { + + /** + * 用户编号 + */ + userId?: string | number; + + /** + * 父目录id + */ + parentId?: string | number; + + /** + * 祖级列表 + */ + ancestors?: string; + + /** + * 目录名称 + */ + catalogName?: string; + + /** + * 显示顺序 + */ + orderNum?: number; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/system/oss/index.ts b/src/api/system/oss/index.ts index 1abddae..f403665 100644 --- a/src/api/system/oss/index.ts +++ b/src/api/system/oss/index.ts @@ -50,10 +50,26 @@ export function listByIds(ossId: string | number): AxiosPromise { }); } +export function getByMd5(md5: string): any { + return request({ + url: '/resource/oss/identifier', + method: 'get', + params: { md5 } + }); +} + // 删除OSS对象存储 export function delOss(ossId: string | number | Array) { return request({ url: '/resource/oss/' + ossId, method: 'delete' }); -} \ No newline at end of file +} + +export const addTextbook = (data: any) => { + return request({ + url: '/file/textbook', + method: 'post', + data: data + }); +}; diff --git a/src/components/FileMd5Upload/index.vue b/src/components/FileMd5Upload/index.vue new file mode 100644 index 0000000..7c50c7f --- /dev/null +++ b/src/components/FileMd5Upload/index.vue @@ -0,0 +1,284 @@ + + + + + diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index cf41c91..01ab248 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -119,6 +119,7 @@ const handleBeforeUpload = (file: any) => { return false; } } + proxy?.$modal.loading('正在上传文件,请稍候...'); number.value++; return true; diff --git a/src/views/resource/catalogPerson/components/FileList.vue b/src/views/resource/catalogPerson/components/FileList.vue new file mode 100644 index 0000000..115ee9f --- /dev/null +++ b/src/views/resource/catalogPerson/components/FileList.vue @@ -0,0 +1,545 @@ + + + + + \ No newline at end of file diff --git a/src/views/resource/catalogPerson/index.vue b/src/views/resource/catalogPerson/index.vue new file mode 100644 index 0000000..aaceedc --- /dev/null +++ b/src/views/resource/catalogPerson/index.vue @@ -0,0 +1,315 @@ + + + + + diff --git a/src/views/resource/catalogResource/index.vue b/src/views/resource/catalogResource/index.vue index 3b8089a..d572888 100644 --- a/src/views/resource/catalogResource/index.vue +++ b/src/views/resource/catalogResource/index.vue @@ -82,10 +82,10 @@ - + + placeholder="请选择" check-strictly /> diff --git a/src/views/resource/catalogTextbook/index.vue b/src/views/resource/catalogTextbook/index.vue index 478896d..05abddc 100644 --- a/src/views/resource/catalogTextbook/index.vue +++ b/src/views/resource/catalogTextbook/index.vue @@ -103,18 +103,21 @@ - + + placeholder="请选择" check-strictly /> - + + + + - - + +