diff --git a/src/components/SearchDialog/index.vue b/src/components/SearchDialog/index.vue index 2bc9fb0..e685d51 100644 --- a/src/components/SearchDialog/index.vue +++ b/src/components/SearchDialog/index.vue @@ -1,146 +1,469 @@ diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 50b7f0b..50e5534 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -152,7 +152,7 @@ slot="reference" :name="''" @click.native="upload" - style="margin-right: 5px" + style="margin-right: 10px" > @@ -161,16 +161,24 @@ ref="searchInput" placeholder="搜索" v-model="searchFileName" - :clearable="true" @keyup.enter.native="searchFileEnter(searchFileName)" @focus="setInputFocus" @input="searchFileEnter(searchFileName)" @blur="setInputBlur()" @clear="searchFileEnter(searchFileName)" > - - - +
- -
@@ -1155,6 +1161,8 @@ export default { debounceSearch: null,// 搜索防抖 debounceGetFileList: null,// 获取文件列表防抖 searchDialogVisible: false, + filterOption: {}, // 搜索选项 + hasSearchFilterOption: false, // 是否有搜索选项 fileUsername: '', // 一般用于挂载文件 } }, @@ -1175,6 +1183,16 @@ export default { return '名称' } }, + searchOptionBtnClass() { + if (this.hasSearchFilterOption) { + return 'search-option-btn search-option-btn-active' + } else { + return 'search-option-btn' + } + }, + cmdKey() { + return navigator.platform.startsWith('Mac') ? '⌘' : 'Ctrl' + }, fileClipboard() { return store.getters.fileClipboard }, @@ -1493,12 +1511,10 @@ export default { event.stopPropagation() } // ctrl + P / cmd + P - // if (isCmd && keyCode === 80) { - // if (!this.inputting && this.editingIndex === -1) { - // this.searchDialogVisible = true - // event.preventDefault() - // event.stopPropagation() - // } + // if (isCmd && keyCode === 80 && !checkPreviewVisible && !this.inputting) { + // this.searchDialogVisible = true + // event.preventDefault() + // event.stopPropagation() // } }, keyup(event) { @@ -1628,11 +1644,10 @@ export default { }, // 画矩形选区 darwRectangle() { - let scrollDiv = document.querySelector('.el-table__body-wrapper') + let scrollDiv = this.$refs.fileListTableContainer.querySelector('.el-table__body-wrapper') if (this.grid) { - scrollDiv = document.querySelector('.van-grid') + scrollDiv = this.$refs.gridDiv.querySelector('.van-grid') } - // 添加scroll事件 scrollDiv.onscroll = e => { this.tableBodyScroll(null, e) @@ -2918,10 +2933,15 @@ export default { tagId: this.$route.query.tagId, isFolder: this.queryCondition.isFolder, isFavorite: this.queryCondition.isFavorite, - queryFileType: this.queryFileType, + queryFileType: this.filterOption.type || this.queryFileType, pageIndex: this.pagination.pageIndex, pageSize: this.pagination.pageSize, showFolderSize: localStorage.getItem('showFolderSize'), + type: this.filterOption.type, + queryModifyStart: this.filterOption.modifyStart, + queryModifyEnd: this.filterOption.modifyEnd, + querySizeMin: this.filterOption.sizeMin, + querySizeMax: this.filterOption.sizeMax, }).then(res => { this.loadData(res, onLoad) this.listModeSearch = true @@ -4455,7 +4475,26 @@ export default { this.fileHandler = {} this.specifyPreviewer = 'office' }, + searchFilterChange(filterOption) { + this.filterOption = filterOption + let hasSearchFilterOption = false + if (filterOption.type !== 'all' && filterOption.type !== null) { + hasSearchFilterOption = true + } + if (filterOption.modifyStart !== null && filterOption.modifyEnd !== null) { + hasSearchFilterOption = true + } + if (filterOption.sizeMin !== null && filterOption.sizeMax !== null) { + hasSearchFilterOption = true + } + this.hasSearchFilterOption = hasSearchFilterOption + + this.debounceSearch(this.searchFileName, false) + }, checkPreviewVisible() { + if (this.searchDialogVisible) { + return true + } if (this.iframePreviewVisible) { return true } @@ -4718,4 +4757,14 @@ export default { margin-top: 5px; } +.search-option-btn { + padding: 8px; +} + +.search-option-btn-active { + padding: 8px; + background: #409EFF; + color: #fff; +} + diff --git a/src/styles/index.scss b/src/styles/index.scss index b61433b..6cd004b 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -16,6 +16,77 @@ body { border-width: 0; } } + +.time-filter-dropdown { + min-width: 280px; + padding: 15px; + + .time-picker-container { + padding: 5px; + } + + .time-presets { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-bottom: 15px; + + .el-button { + margin: 0; + padding: 4px 8px; + font-size: 12px; + flex: 1 0 calc(33% - 8px); + } + } + + .custom-date-range { + margin-top: 10px; + border-top: 1px solid #ebeef5; + padding-top: 10px; + + .date-range-title { + margin: 0 0 10px; + font-size: 12px; + color: #606266; + } + + .modern-date-picker { + width: 100%; + } + } +} + +.size-filter-dropdown { + min-width: 280px; + padding: 15px; + + .size-slider-container { + padding: 5px; + } + + .size-slider-labels { + display: flex; + justify-content: space-between; + margin-bottom: 10px; + color: #606266; + font-size: 12px; + } + + .size-slider-presets { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 15px; + justify-content: space-between; + + .el-button { + margin: 0; + padding: 4px 8px; + font-size: 12px; + } + } +} + >>>::-webkit-scrollbar { /*滚动条整体样式*/ width: 12px;