From 16bd2255351f445c80fd79d22d2761b1de9433ef Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 16 Jul 2024 09:48:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchDialog/index.vue | 61 + src/components/ShowFile/ShowFile.vue | 3873 +++++++++++++------------ 2 files changed, 2011 insertions(+), 1923 deletions(-) create mode 100644 src/components/SearchDialog/index.vue diff --git a/src/components/SearchDialog/index.vue b/src/components/SearchDialog/index.vue new file mode 100644 index 0000000..f7beea1 --- /dev/null +++ b/src/components/SearchDialog/index.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 1ab89e5..38a2523 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -19,7 +19,11 @@ > {{ item.label }} - +
{{ - singleFileType !== "" ? singleFileType : "上传文件" - }} + singleFileType !== '' ? singleFileType : '上传文件' + }}
  • @@ -153,16 +158,17 @@ - + @@ -173,9 +179,12 @@ >
    - - - {{sortName}} + + + {{ sortName }}
    @@ -183,14 +192,14 @@ 名称 @@ -200,14 +209,14 @@ 大小 @@ -217,14 +226,14 @@ 日期 @@ -241,9 +250,15 @@
    - {{this.pagination["total"]}}个结果:  + {{ this.pagination['total'] }}个结果:  获取更多数据... - {{ !finished ? "已加载 " + getSummaries3 : "已全部加载 " + getSummaries3 }} + {{ + !finished + ? '已加载 ' + getSummaries3 + : '已全部加载 ' + getSummaries3 + }}
    @@ -279,6 +294,9 @@
  • @@ -314,8 +332,6 @@ @row-contextmenu="rowContextmenu" @cell-click="cellClick" @row-dblclick="dblclick" - @cell-mouse-enter="cellMouseEnter" - @cell-mouse-leave="cellMouseLeave" @sort-change="sortChange" @table-body-scroll="tableBodyScroll" @select="pinSelect" @@ -372,71 +388,14 @@ v-if="scope.row.ossPlatform" size="small" class="pc list oss-folder" - >{{ scope.row.ossPlatform }} + >{{ scope.row.ossPlatform }}
    - - - - - - - - - -    {{ formatTime(scope.row.agoTime) }}   {{ formatTime(scope.row.agoTime) }} @@ -500,10 +459,8 @@ ref="checkboxGroup" >
    -
    -
    - {{ gridFilename(item) }} -
    +
    + {{ gridFilename(item) }}
    @@ -620,7 +580,7 @@
    document
    @@ -639,67 +599,13 @@ :file="videoPreviewRow" :status.sync="videoPreviewVisible" > - - - -
    - -
    - - - {{ rowContextData.name }} - - - {{ - rowContextData.isFolder ? "文件夹" : rowContextData.contentType - }} - -
    - - {{ rowContextData.music.singer }} - - - {{ "《" + rowContextData.music.album + "》" }} - - - {{ "《" + rowContextData.music.songName + "》" }} - -
    - - {{ rowContextData.w + " x " + rowContextData.h }} - - - - {{formatSize(rowContextData.size)}} - - - {{ - rowContextData.path - }} - - - {{ rowContextData.uploadDate }} - - - {{ rowContextData.updateDate }} - -
    -
    + + + 查看压缩文件 解压到...解压到... 解压到当前目录解压到当前目录 预览预览 @@ -777,40 +683,44 @@ size="small" @click="fileTreeAndNewFolder" :disabled="fileTreeAndNewFolderDisabled" - >  新建文件夹 + >  新建文件夹 移 动移 动 复制复制 解压解压 取 消取 消 - + 取消取消 确定确定 + + + +
    +
    +
    +

    确定删除所选的{{selectDeleteFile.length}}个文件?默认进入回收站

    +
    +
    +
    + 永久删除文件(不进入回收站,直接删除) +
    + +
    +
    +
    +
    + +
    +
    {{file.name}}
    +
    +
    +
    +
    +
    + + 取 消 + 确 定 + +
    + - From b2a56615b205c5e24e93811fa530739976bd432b Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 16 Jul 2024 11:13:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=97=B6=E5=80=99=E6=89=93=E5=BC=80office=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=97=A0=E6=B3=95=E4=BF=9D=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=88=96=E8=80=85=E7=A7=81=E5=AF=86=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E7=9A=84office=E6=96=87=E4=BB=B6=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=B9=B1=E7=A0=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 18 ++++++++++++------ src/store/modules/user.js | 6 ++++++ src/utils/request.js | 7 +++++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 38a2523..c59447e 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -2752,8 +2752,7 @@ export default { this.vmode }&path=${path}${keyword}${searchOpenFolder}${queryTagId}${basePath}${folder}` ) - api - .searchFile({ + api.searchFile({ userId: this.$store.state.user.userId, username: this.$store.state.user.name, keyword: key, @@ -2768,11 +2767,12 @@ export default { pageIndex: this.pagination.pageIndex, pageSize: this.pagination.pageSize, showFolderSize: localStorage.getItem('showFolderSize'), - }) - .then(res => { + }).then(res => { this.loadData(res, onLoad) this.listModeSearch = true this.listModeSearchOpenDir = false + }).catch(() => { + this.tableLoading = false }) } else { if (this.listModeSearch) { @@ -2811,7 +2811,9 @@ export default { this.loadData(res, onLoad) this.listModeSearch = true this.listModeSearchOpenDir = fileId - }) + }).catch(() => { + this.tableLoading = false + }) }, openDir(row, onLoad) { this.beforeLoadData(onLoad) @@ -2828,6 +2830,8 @@ export default { }) .then(res => { this.loadData(res, onLoad) + }).catch(() => { + this.tableLoading = false }) // this.path = row.path + row.name // this.path = this.path.replace(/\\/g, '/') @@ -2867,7 +2871,9 @@ export default { }) .then(res => { this.loadData(res, onLoad) - }) + }).catch(() => { + this.tableLoading = false + }) } }, getQueryPath() { diff --git a/src/store/modules/user.js b/src/store/modules/user.js index c01560e..75c10f0 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -206,6 +206,12 @@ const actions = { }) }, + // update token + setToken({ commit }, jmalToken) { + commit('SET_TOKEN', jmalToken) + console.log('jmalToken', jmalToken) + }, + // remove share token resetShareToken({ commit }) { return new Promise(resolve => { diff --git a/src/utils/request.js b/src/utils/request.js index 6fb59f1..8febd08 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -79,6 +79,10 @@ service.interceptors.response.use( location.reload() }) }) + } else { + store.dispatch('user/resetToken').then(() => { + location.reload() + }) } }, 200) } else { @@ -90,6 +94,9 @@ service.interceptors.response.use( } return Promise.reject() } else { + if (response.headers['jmal-token']) { + store.dispatch('user/setToken', response.headers['jmal-token']) + } let message = '' if (res.message) { message = res.message.toString()