From 42f3689066ccb07795861e6dad4ac2e62c9020e5 Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 16 Jul 2024 16:25:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/file-image/index.vue | 7 ++ .../src/components/upload-dialog/index.vue | 95 ++++++++++--------- src/renderer/src/utils/resourceDict.js | 65 +++++++++++++ src/renderer/src/utils/ruoyi.js | 12 +++ .../resource/container/create-resoure.vue | 80 ---------------- .../views/resource/container/resoure-list.vue | 55 ++++++++--- .../resource/container/resoure-search.vue | 63 ++++-------- src/renderer/src/views/resource/index.vue | 60 ++++++++++-- src/renderer/src/views/resource/store.js | 58 ++--------- 9 files changed, 251 insertions(+), 244 deletions(-) create mode 100644 src/renderer/src/utils/resourceDict.js delete mode 100644 src/renderer/src/views/resource/container/create-resoure.vue diff --git a/src/renderer/src/components/file-image/index.vue b/src/renderer/src/components/file-image/index.vue index 575e957..4dc3732 100644 --- a/src/renderer/src/components/file-image/index.vue +++ b/src/renderer/src/components/file-image/index.vue @@ -29,6 +29,13 @@ const getFileTypeIcon = () => { docx: 'icon-word', mp4: 'icon-video', mov: 'icon-mov', + avi: 'icon-avi', + jpeg: 'icon-jpeg', + jpg: 'icon-jpg', + png: 'icon-png', + gif: 'icon-gif', + txt: 'icon-txt', + rar: 'icon-rar', } return '#' + iconObj[name] diff --git a/src/renderer/src/components/upload-dialog/index.vue b/src/renderer/src/components/upload-dialog/index.vue index 96dd952..ea64fd6 100644 --- a/src/renderer/src/components/upload-dialog/index.vue +++ b/src/renderer/src/components/upload-dialog/index.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/src/renderer/src/views/resource/index.vue b/src/renderer/src/views/resource/index.vue index daa9515..88913a7 100644 --- a/src/renderer/src/views/resource/index.vue +++ b/src/renderer/src/views/resource/index.vue @@ -1,31 +1,42 @@ diff --git a/src/renderer/src/views/resource/store.js b/src/renderer/src/views/resource/store.js index 6c8d753..2fcc36c 100644 --- a/src/renderer/src/views/resource/store.js +++ b/src/renderer/src/views/resource/store.js @@ -1,61 +1,24 @@ import { defineStore } from 'pinia' import { getSmarttalkPage } from '@/api/file/index' +import { tabs, resourceType, resourceFormat } from '@/utils/resourceDict' -const tabs = [ +const resourceTypeList = [ { - text: '平台资源', - value: '平台' - }, - { - text: '校本资源', - value: '校本' - } -] - -const typeList = [ - { - text: '全部', + label: '全部', value: '' }, - { - text: '素材', - value: '素材' - }, - - { - text: '课件', - value: '课件' - }, - - { - text: '教案', - value: '教案' - } + ...resourceType ] -// 资源格式 -const formatList = [ +const resourceFormatList = [ { label: '资源格式', value: '' }, - { - label: 'word', - value: 'word' - }, - { - label: 'ppt', - value: 'ppt' - }, - { - label: 'mp3', - value: 'mp3' - }, - { - label: 'mp4', - value: 'mp4' - } + ...resourceFormat ] + + const structQuery = { pageNum: 1, pageSize: 10 @@ -64,8 +27,8 @@ const structQuery = { export default defineStore('resource', { state: () => ({ tabs, - typeList, - formatList, + resourceTypeList, + resourceFormatList, curFormat: -1, searchKey: '', @@ -94,7 +57,6 @@ export default defineStore('resource', { getSmarttalkPage(this.query).then((res) => { this.result.total = res.total this.result.list = res.rows - }) } finally { this.loading = false