From 193bbe90ae5b67ff3378a4dbbc291a1c3ff113ac Mon Sep 17 00:00:00 2001 From: zhonghua Date: Tue, 17 Mar 2026 15:53:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B5=84=E6=BA=90=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=BC=98=E5=8C=96=20-=20=E7=9B=B4=E4=BC=A0=E3=80=81We?= =?UTF-8?q?bOffice=E9=A2=84=E8=A7=88=E3=80=81=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 资源上传改为 OSS 直传,支持进度与取消 - Office 文档(PDF/PPT/Word/Excel)使用 WebOffice 在线预览 - 后端 ResourceItemResponse 补充 title/fileType/filePath/fileSize/tags/library - 后端 getStats 返回 totalLibraries/totalItems/itemsByLibraryType - 前后端字段对齐:libraryType、name/type 兼容 - 修复 tags 反序列化、name 必填、主键冲突问题 - 新增 V16 迁移修复 resource_item AUTO_INCREMENT Made-with: Cursor --- reading-platform-frontend/src/api/file.ts | 3 + reading-platform-frontend/src/api/resource.ts | 2 +- reading-platform-frontend/src/components.d.ts | 7 + .../admin/resources/ResourceListView.vue | 274 ++++++++++-------- .../src/views/office/WebOffice.vue | 6 +- .../src/views/office/webOffice.ts | 19 ++ .../common/mapper/ResourceItemMapper.java | 5 + .../admin/AdminResourceController.java | 50 +++- .../request/ResourceItemCreateRequest.java | 6 +- .../request/ResourceItemUpdateRequest.java | 6 +- .../request/ResourceLibraryCreateRequest.java | 2 + .../dto/response/ResourceItemResponse.java | 46 +-- .../dto/response/ResourceLibraryResponse.java | 2 + .../service/ResourceLibraryService.java | 32 +- .../V16__fix_resource_item_auto_increment.sql | 8 + 15 files changed, 317 insertions(+), 151 deletions(-) create mode 100644 reading-platform-java/src/main/resources/db/migration/V16__fix_resource_item_auto_increment.sql diff --git a/reading-platform-frontend/src/api/file.ts b/reading-platform-frontend/src/api/file.ts index 4856642..3aab427 100644 --- a/reading-platform-frontend/src/api/file.ts +++ b/reading-platform-frontend/src/api/file.ts @@ -174,6 +174,7 @@ export const fileApi = { | "ppt" | "poster" | "document" + | "resource" | "other", options?: { onProgress?: (percent: number) => void; @@ -235,6 +236,7 @@ export const FILE_TYPES = { PPT: "ppt", POSTER: "poster", DOCUMENT: "document", + RESOURCE: "resource", OTHER: "other", } as const; @@ -249,6 +251,7 @@ export const FILE_SIZE_LIMITS = { PPT: 300 * 1024 * 1024, // 300MB POSTER: 10 * 1024 * 1024, // 10MB DOCUMENT: 300 * 1024 * 1024, // 300MB + RESOURCE: 100 * 1024 * 1024, // 100MB(资源库单文件限制) OTHER: 300 * 1024 * 1024, // 300MB } as const; diff --git a/reading-platform-frontend/src/api/resource.ts b/reading-platform-frontend/src/api/resource.ts index 79e07b7..39ba2a0 100644 --- a/reading-platform-frontend/src/api/resource.ts +++ b/reading-platform-frontend/src/api/resource.ts @@ -128,7 +128,7 @@ export const deleteResourceItem = (id: number) => http.delete(`/v1/admin/resources/items/${id}`); export const batchDeleteResourceItems = (ids: number[]) => - http.post<{ message: string }>('/v1/admin/resources/items/batch-delete', { ids }); + http.post<{ message: string }>('/v1/admin/resources/items/batch-delete', ids); // ==================== 统计数据 ==================== diff --git a/reading-platform-frontend/src/components.d.ts b/reading-platform-frontend/src/components.d.ts index 23753e9..03a884c 100644 --- a/reading-platform-frontend/src/components.d.ts +++ b/reading-platform-frontend/src/components.d.ts @@ -11,8 +11,10 @@ declare module 'vue' { AAvatar: typeof import('ant-design-vue/es')['Avatar'] ABadge: typeof import('ant-design-vue/es')['Badge'] AButton: typeof import('ant-design-vue/es')['Button'] + AButtonGroup: typeof import('ant-design-vue/es')['ButtonGroup'] ACard: typeof import('ant-design-vue/es')['Card'] ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] + ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup'] ACol: typeof import('ant-design-vue/es')['Col'] ADatePicker: typeof import('ant-design-vue/es')['DatePicker'] ADescriptions: typeof import('ant-design-vue/es')['Descriptions'] @@ -23,6 +25,8 @@ declare module 'vue' { AEmpty: typeof import('ant-design-vue/es')['Empty'] AForm: typeof import('ant-design-vue/es')['Form'] AFormItem: typeof import('ant-design-vue/es')['FormItem'] + AImage: typeof import('ant-design-vue/es')['Image'] + AImagePreviewGroup: typeof import('ant-design-vue/es')['ImagePreviewGroup'] AInput: typeof import('ant-design-vue/es')['Input'] AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] AInputPassword: typeof import('ant-design-vue/es')['InputPassword'] @@ -48,11 +52,14 @@ declare module 'vue' { ARate: typeof import('ant-design-vue/es')['Rate'] ARow: typeof import('ant-design-vue/es')['Row'] ASelect: typeof import('ant-design-vue/es')['Select'] + ASelectOptGroup: typeof import('ant-design-vue/es')['SelectOptGroup'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASkeleton: typeof import('ant-design-vue/es')['Skeleton'] ASpace: typeof import('ant-design-vue/es')['Space'] ASpin: typeof import('ant-design-vue/es')['Spin'] AStatistic: typeof import('ant-design-vue/es')['Statistic'] + AStep: typeof import('ant-design-vue/es')['Step'] + ASteps: typeof import('ant-design-vue/es')['Steps'] ASubMenu: typeof import('ant-design-vue/es')['SubMenu'] ASwitch: typeof import('ant-design-vue/es')['Switch'] ATable: typeof import('ant-design-vue/es')['Table'] diff --git a/reading-platform-frontend/src/views/admin/resources/ResourceListView.vue b/reading-platform-frontend/src/views/admin/resources/ResourceListView.vue index cc0abd0..9ab95b2 100644 --- a/reading-platform-frontend/src/views/admin/resources/ResourceListView.vue +++ b/reading-platform-frontend/src/views/admin/resources/ResourceListView.vue @@ -1,37 +1,42 @@