From 6b103af57e22510ad1c79e3acf0ac158800bcabe Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 19 Apr 2025 15:18:56 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=E6=90=9C=E7=B4=A2=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=8F=AF=E6=90=9C=E7=B4=A2=E6=8C=82=E8=BD=BD=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchDialog/index.vue | 469 ---------------------- src/components/SearchOption/index.vue | 545 ++++++++++++++++++++++++++ src/components/ShowFile/ShowFile.vue | 141 ++++--- src/utils/file-config.js | 16 +- 4 files changed, 642 insertions(+), 529 deletions(-) delete mode 100644 src/components/SearchDialog/index.vue create mode 100644 src/components/SearchOption/index.vue diff --git a/src/components/SearchDialog/index.vue b/src/components/SearchDialog/index.vue deleted file mode 100644 index e685d51..0000000 --- a/src/components/SearchDialog/index.vue +++ /dev/null @@ -1,469 +0,0 @@ - - - - - diff --git a/src/components/SearchOption/index.vue b/src/components/SearchOption/index.vue new file mode 100644 index 0000000..66c813c --- /dev/null +++ b/src/components/SearchOption/index.vue @@ -0,0 +1,545 @@ + + + + + diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 50e5534..9266032 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -157,27 +157,40 @@ - diff --git a/src/styles/custom-ui.scss b/src/styles/custom-ui.scss new file mode 100644 index 0000000..889caaf --- /dev/null +++ b/src/styles/custom-ui.scss @@ -0,0 +1,31 @@ +>>> .el-checkbox { + + &:hover { + background-color: #f5f7fa; + border-radius: 6px; + } + + .el-checkbox__inner { + background-color: #f0f0f0; /* 浅灰色背景 */ + border-color: #dcdcdc; /* 浅灰色边框 */ + border-radius: 4px; /* 圆角 */ + } + + .el-checkbox__input.is-checked .el-checkbox__inner { + background-color: #a0a0a0; /* 深灰色背景 */ + border-color: #a0a0a0; /* 深灰色边框 */ + } + + .el-checkbox__input.is-checked .el-checkbox__inner::after { + border-color: #ffffff; /* 白色勾号 */ + } + + .el-checkbox__inner:hover { + //border-color: #b0b0b0; /* hover 时边框颜色 */ + cursor: pointer; + } + + .el-checkbox__input.is-checked+.el-checkbox__label { + color: #606266; + } +} From ebbe6c64a973b40e9226fb06eb50e634d5980202 Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 27 Apr 2025 14:21:31 +0800 Subject: [PATCH 3/7] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E4=B8=8B=E8=BD=BD=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/file-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/file-config.js b/src/utils/file-config.js index b61e8bb..fa8c0f0 100644 --- a/src/utils/file-config.js +++ b/src/utils/file-config.js @@ -34,7 +34,7 @@ export default { fileUrl = fileUrl.replaceAll('#', '%23') fileUrl = fileUrl.replaceAll(/%5C/g, '/') - if (file.userId !== store.getters.userId) { + if (file.userId !== store.getters.userId && !shareToken) { return `${baseUrl}/pre-file/${file.id}/${encodeURI(file.name)}?jmal-token=${token}&name=${username}` } From 4de190a1064ea368aa18ab295a16d10b0d13274a Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 27 Apr 2025 15:07:50 +0800 Subject: [PATCH 4/7] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=8C=82?= =?UTF-8?q?=E8=BD=BD=E6=96=87=E4=BB=B6=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/preview/FileDetails.vue | 5 +++-- src/utils/file-config.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/preview/FileDetails.vue b/src/components/preview/FileDetails.vue index 6486603..7ee47fa 100644 --- a/src/components/preview/FileDetails.vue +++ b/src/components/preview/FileDetails.vue @@ -198,10 +198,11 @@ export default { this.filepath = this.getLocalPath(this.file.path) this.pathUrl = `/?path=${this.filepath}&highlight=${this.file.name}` this.getIsSync() - if (this.fileUsername) { + const isMountFile = this.fileUsername || this.file.userId !== this.$store.getters.userId ? this.file.userId : undefined + if (isMountFile) { fileApi.getMountFileInfo({ fileId: this.file.id, - fileUsername: this.fileUsername + fileUserId: this.file.userId, }).then((res) => { const path = this.getLocalPath(res.data.path) this.filepath = path diff --git a/src/utils/file-config.js b/src/utils/file-config.js index fa8c0f0..3916038 100644 --- a/src/utils/file-config.js +++ b/src/utils/file-config.js @@ -34,7 +34,7 @@ export default { fileUrl = fileUrl.replaceAll('#', '%23') fileUrl = fileUrl.replaceAll(/%5C/g, '/') - if (file.userId !== store.getters.userId && !shareToken) { + if (file.userId !== store.getters.userId && token && !shareToken) { return `${baseUrl}/pre-file/${file.id}/${encodeURI(file.name)}?jmal-token=${token}&name=${username}` } From a0993eaf0f212ecf6539b5cdca2daf7a0611ff5e Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 27 Apr 2025 17:30:26 +0800 Subject: [PATCH 5/7] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E9=A1=B5=E7=9A=84=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchOption/index.vue | 15 ++++++++++----- src/components/ShowFile/ShowFile.vue | 7 ++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/SearchOption/index.vue b/src/components/SearchOption/index.vue index 1d9e7b8..29312cf 100644 --- a/src/components/SearchOption/index.vue +++ b/src/components/SearchOption/index.vue @@ -3,7 +3,7 @@
- 搜索: + 搜索 {{searchScope}}: {{ keyword }}
@@ -122,7 +122,7 @@
-
+
路径: {{ searchPath }} @@ -210,6 +210,14 @@ export default { } }, computed: { + searchScope() { + const queryTagId = this.$route.query.tagId + const path = this.$route.query.path; + if (queryTagId && path === '/') { + return '(当前标签)' + } + return '' + }, hasSearchConditions() { return this.fileType !== 'all' || this.timeRange || this.hasSizeRange || this.searchMount || this.searchOverall }, @@ -255,7 +263,6 @@ export default { }, watch: { filterOption(newValue) { - console.log('filterOption changed', newValue) } }, methods: { @@ -279,7 +286,6 @@ export default { clearFilterOption() { this.filterOption = this.emptyFilterOption - console.log('clearFilterOption') this.setFilterOption(this.filterOption) }, @@ -311,7 +317,6 @@ export default { this.searchOverall = !!filterOption.searchOverall // 更新过滤条件 - console.log('setFilterOption') this.updateFilterOption() }, diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index ecd540b..68e568b 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -90,7 +90,7 @@
{ this.searchHistoryList = res.data || [] - console.log('clearSearchHistory1', this.searchHistoryList) cb(this.searchHistoryList) }).catch(error => { console.error("Error fetching search history:", error) From 007475bce6b244ce5eee4abf0513cae88350ffd7 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 28 Apr 2025 14:22:11 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=8C=82?= =?UTF-8?q?=E8=BD=BD=E6=96=87=E4=BB=B6=E8=8F=9C=E5=8D=95(=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=88=97=E5=87=BA=E6=89=80=E6=9C=89=E6=8C=82=E8=BD=BD?= =?UTF-8?q?=E6=96=87=E4=BB=B6),=20=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchOption/index.vue | 40 +++++++++++++++++-- src/components/ShowFile/ShowFile.vue | 7 +++- src/views/fileType/audio.vue | 3 +- src/views/fileType/document.vue | 3 +- src/views/fileType/image.vue | 3 +- src/views/fileType/video.vue | 3 +- src/views/mount/index.vue | 56 +++++++++++++++++++++++++++ src/views/recently/index.vue | 3 +- src/views/setting/sys/menuManager.vue | 3 ++ 9 files changed, 110 insertions(+), 11 deletions(-) create mode 100644 src/views/mount/index.vue diff --git a/src/components/SearchOption/index.vue b/src/components/SearchOption/index.vue index 29312cf..c28d1c1 100644 --- a/src/components/SearchOption/index.vue +++ b/src/components/SearchOption/index.vue @@ -3,7 +3,14 @@
- 搜索 {{searchScope}}: + + 搜索 + + + + + : + {{ keyword }}
@@ -189,6 +196,10 @@ export default { type: Object, default: function() {} }, + queryCondition: { + type: Object, + default: function() {} + }, searchPath: { type: String, default: '/' @@ -212,9 +223,30 @@ export default { computed: { searchScope() { const queryTagId = this.$route.query.tagId - const path = this.$route.query.path; - if (queryTagId && path === '/') { - return '(当前标签)' + const isRootPath = this.$route.query.path === '/'; + if (queryTagId && isRootPath) { + return '搜索范围: 仅包含标签文件, 不含子文件' + } + if (this.queryCondition.isMount && isRootPath) { + return '搜索范围: 挂载目录里的所有文件, 不含挂载目录本身' + } + if (this.queryCondition.isFavorite && isRootPath) { + return '搜索范围: 仅包含收藏文件, 不含子文件' + } + if (this.queryCondition.audio && isRootPath) { + return '搜索范围: 仅包含音频文件' + } + if (this.queryCondition.video && isRootPath) { + return '搜索范围: 仅包含视频文件' + } + if (this.queryCondition.document && isRootPath) { + return '搜索范围: 仅包含文档文件' + } + if (this.queryCondition.image && isRootPath) { + return '搜索范围: 仅包含图片文件' + } + if (this.queryCondition.recently && isRootPath) { + return '搜索范围: 仅包含文件, 不含目录' } return '' }, diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 68e568b..6024e09 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -186,6 +186,7 @@ :has-search-conditions-param.sync="hasSearchFilterOption" :keyword.sync="searchFileName" :filter-option-param.sync="filterOption" + :query-condition="queryCondition" :search-path="currentDirectory" :search-result-count="pagination['total']" @filter-change="searchFilterChange" > @@ -979,7 +980,7 @@ export default { queryCondition: { type: Object, default: function() { - return { isFolder: null } + return { isFolder: null, isMount: null } }, }, singleMenus: { @@ -2966,6 +2967,7 @@ export default { this.vmode }&path=${path}${keyword}${searchOpenFolder}${queryTagId}${basePath}${folder}` ) + api.searchFile({ userId: this.$store.state.user.userId, username: this.$store.state.user.name, @@ -2987,6 +2989,7 @@ export default { querySizeMin: this.filterOption.sizeMin, querySizeMax: this.filterOption.sizeMax, searchMount: this.filterOption.searchMount, + isMount: this.queryCondition.isMount, searchOverall: this.filterOption.searchOverall, }).then(res => { this.loadData(res, onLoad) @@ -3083,6 +3086,7 @@ export default { order: this.sortable.order, isFolder: this.queryCondition.isFolder, isFavorite: this.queryCondition.isFavorite, + isMount: this.queryCondition.isMount, isTrash: this.queryCondition.isTrash, tagId: this.queryCondition.tagId, queryCondition: this.queryCondition, @@ -3546,7 +3550,6 @@ export default { }, // 鼠标右击 rowContextmenu(row) { - console.log('rowContextmenu', row, row.userId, this.$store.getters.userId) if (this.selectFile) { return } diff --git a/src/views/fileType/audio.vue b/src/views/fileType/audio.vue index 1e8b3ca..69efe44 100644 --- a/src/views/fileType/audio.vue +++ b/src/views/fileType/audio.vue @@ -26,7 +26,8 @@ export default { prop: 'updateDate', order: 'descending' }, queryCondition: { - isFolder:false + isFolder:false, + audio: true }, contextMenus: [ { label: '查看', operation: 'viewMode' ,child: [ diff --git a/src/views/fileType/document.vue b/src/views/fileType/document.vue index ad0d1f6..346691a 100644 --- a/src/views/fileType/document.vue +++ b/src/views/fileType/document.vue @@ -26,7 +26,8 @@ export default { prop: 'updateDate', order: 'descending' }, queryCondition: { - isFolder: false + isFolder: false, + document: true }, contextMenus: [ { label: '查看', operation: 'viewMode' ,child: [ diff --git a/src/views/fileType/image.vue b/src/views/fileType/image.vue index 3ba22a7..1f520e4 100644 --- a/src/views/fileType/image.vue +++ b/src/views/fileType/image.vue @@ -25,7 +25,8 @@ export default { prop: 'updateDate', order: 'descending' }, queryCondition: { - isFolder: false + isFolder: false, + image: true }, contextMenus: [ { label: '查看', operation: 'viewMode' ,child: [ diff --git a/src/views/fileType/video.vue b/src/views/fileType/video.vue index d50bfbd..625edcf 100644 --- a/src/views/fileType/video.vue +++ b/src/views/fileType/video.vue @@ -26,7 +26,8 @@ export default { prop: 'updateDate', order: 'descending' }, queryCondition: { - isFolder: false + isFolder: false, + video: true }, contextMenus: [ { label: '查看', operation: 'viewMode' ,child: [ diff --git a/src/views/mount/index.vue b/src/views/mount/index.vue new file mode 100644 index 0000000..9447104 --- /dev/null +++ b/src/views/mount/index.vue @@ -0,0 +1,56 @@ + + + + + + diff --git a/src/views/recently/index.vue b/src/views/recently/index.vue index 4db3e41..a6ddea0 100644 --- a/src/views/recently/index.vue +++ b/src/views/recently/index.vue @@ -24,7 +24,8 @@ prop: 'uploadDate', order: 'descending' }, queryCondition: { - isFolder:false + isFolder: false, + recently: true }, contextMenus: [ { label: '查看', operation: 'viewMode' ,child: [ diff --git a/src/views/setting/sys/menuManager.vue b/src/views/setting/sys/menuManager.vue index cc56f41..70f081e 100644 --- a/src/views/setting/sys/menuManager.vue +++ b/src/views/setting/sys/menuManager.vue @@ -392,4 +392,7 @@ export default { >>>.box-card { max-width: 1440px; } +>>> .el-table .cell.el-tooltip { + display: flex; +} From 5a12e800c03cd31f30c0a89e14f3161d0bf825a6 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 28 Apr 2025 14:38:09 +0800 Subject: [PATCH 7/7] =?UTF-8?q?refactor(api):=20=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E6=90=9C=E7=B4=A2=E5=8E=86=E5=8F=B2=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=20API=20=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/file-api.js | 4 ++-- src/components/ShowFile/ShowFile.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/file-api.js b/src/api/file-api.js index e6c881a..3e8a270 100644 --- a/src/api/file-api.js +++ b/src/api/file-api.js @@ -138,7 +138,7 @@ export default { }) }, // 最近搜索记录🔍 - recentlySearchHistory: function(params) { + getRecentlySearchHistory: function(params) { return request({ url: '/search/recentlySearchHistory', method: 'get', @@ -146,7 +146,7 @@ export default { }) }, // 删除搜索记录🔍 - deleteSearchHistory: function(params) { + removeSearchHistory: function(params) { return request({ url: '/search/deleteSearchHistory', method: 'delete', diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 6024e09..58851a9 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -4550,7 +4550,7 @@ export default { cb([]) return } - api.recentlySearchHistory({keyword: queryString}).then(res => { + api.getRecentlySearchHistory({keyword: queryString}).then(res => { this.searchHistoryList = res.data || [] cb(this.searchHistoryList) }).catch(error => { @@ -4569,7 +4569,7 @@ export default { event.stopPropagation(); event.preventDefault(); const idToDelete = itemToDelete.id - api.deleteSearchHistory({id: idToDelete}).then(() => { + api.removeSearchHistory({id: idToDelete}).then(() => { const index = this.searchHistoryList.findIndex(item => item.id === idToDelete) this.searchHistoryList.splice(index, 1) })