Merge pull request #309 from jamebal/dev

fix: 修复搜索状态下进入某个文件夹后上传文件位置错误的问题
This commit is contained in:
jmal 2024-11-07 16:25:55 +08:00 committed by GitHub
commit f6a057a254
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 15 deletions

View File

@ -766,10 +766,7 @@
<p>确定删除所选的{{selectFileList.length}}个文件?</p> <p>确定删除所选的{{selectFileList.length}}个文件?</p>
</div> </div>
</div> </div>
<!-- <div class="delete-attention mt-5">--> <!-- <dialog-file-list class="dialog-file-list" :file-list="selectFileList" :image-url="imageUrl" :audio-cover-url="audioCoverUrl"></dialog-file-list>-->
<!-- <el-checkbox v-model="permanentDelete" :disabled="permanentDeleteDisable">永久删除文件(不进入回收站,直接删除)</el-checkbox>-->
<!-- </div>-->
<dialog-file-list :file-list="selectFileList" :image-url="imageUrl" :audio-cover-url="audioCoverUrl"></dialog-file-list>
</el-row> </el-row>
<span slot="footer" class="dialog-footer-delete"> <span slot="footer" class="dialog-footer-delete">
<div> <div>
@ -778,7 +775,7 @@
<div> <div>
<el-button size="small" @click="deleteConfirmVisible = false">取 消</el-button> <el-button size="small" @click="deleteConfirmVisible = false">取 消</el-button>
<el-button v-if="permanentDeleteDisable" type="danger" size="small" @click="sweepDeleteFile" :loading="deleteLoading">彻底删除</el-button> <el-button v-if="permanentDeleteDisable" type="danger" size="small" @click="sweepDeleteFile" :loading="deleteLoading">彻底删除</el-button>
<el-button v-else type="danger" size="small" @click="moveToRecycle" :loading="deleteLoading">移至回收站</el-button> <el-button v-else type="warning" size="small" @click="moveToRecycle" :loading="deleteLoading">移至回收站</el-button>
</div> </div>
</span> </span>
</el-dialog> </el-dialog>
@ -794,7 +791,7 @@
<p>所选目录已存在下列文件</p> <p>所选目录已存在下列文件</p>
</div> </div>
</div> </div>
<dialog-file-list :file-list="existsFileList" :image-url="imageUrl" :audio-cover-url="audioCoverUrl"></dialog-file-list> <dialog-file-list class="dialog-file-list" :file-list="existsFileList" :image-url="imageUrl" :audio-cover-url="audioCoverUrl"></dialog-file-list>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="copyOrMoveConfirmVisible = false">取 消</el-button> <el-button size="small" @click="copyOrMoveConfirmVisible = false">取 消</el-button>
@ -1505,7 +1502,12 @@ export default {
this.fileList[index].updateDate = fileDoc.updateDate this.fileList[index].updateDate = fileDoc.updateDate
} }
} }
const isCurrentPath = (this.path + '/') === fileDoc let thisPath = this.path
if (this.listModeSearchOpenDir) {
const row = this.pathList[this.pathList.length - 1]
thisPath = `${row.row.path}${row.folder}`
}
const isCurrentPath = (thisPath + '/') === fileDoc
if ('deleteFile' === url && (isCurrentPath || this.$route.path.startsWith('/recently'))) { if ('deleteFile' === url && (isCurrentPath || this.$route.path.startsWith('/recently'))) {
this.getFileListEnter() this.getFileListEnter()
} }
@ -1516,18 +1518,18 @@ export default {
if (fileDoc && fileDoc.name) { if (fileDoc && fileDoc.name) {
this.onCreateFilename = fileDoc.name this.onCreateFilename = fileDoc.name
} }
if (!this.path) { if (!thisPath) {
this.path = '' thisPath = ''
} }
if (fileDoc) { if (fileDoc) {
if (fileDoc.$set) { if (fileDoc.$set) {
let path = fileDoc.$set.path let path = fileDoc.$set.path
path = path.replace(/\\/g, '/') path = path.replace(/\\/g, '/')
if (this.path + '/' === path) { if (thisPath + '/' === path) {
this.getFileListEnter() this.getFileListEnter()
} }
} else { } else {
if (this.path + '/' === fileDoc.path) { if (thisPath + '/' === fileDoc.path) {
this.getFileListEnter() this.getFileListEnter()
} }
} }
@ -4630,9 +4632,13 @@ export default {
display: table-cell !important; display: table-cell !important;
} }
} }
.dialog-file-list {
padding: 10px 0;
}
.delete-attention { .delete-attention {
padding: 10px 10px; padding: 10px 10px;
border-radius: 4px; border-radius: 4px;
margin-bottom: 10px;
.el-checkbox { .el-checkbox {
color: #606266; color: #606266;
font-weight: 500; font-weight: 500;

View File

@ -310,7 +310,7 @@ export default {
currentDirectory: this.$route.query.path || '/', currentDirectory: this.$route.query.path || '/',
username: this.$store.state.user.name, username: this.$store.state.user.name,
userId: this.$store.state.user.userId, userId: this.$store.state.user.userId,
folder: this.$route.query.folder folder: this.$route.query.searchOpenFolder || this.$route.query.folder
} }
}, },
isPath(str) { isPath(str) {
@ -400,17 +400,17 @@ export default {
this.uploader.resume() this.uploader.resume()
}) })
}, },
setPageTitle() { setPageTitle(netSpeed) {
if (this.process === -10 || this.process === 100 || this.fileListLength === 0) { if (this.process === -10 || this.process === 100 || this.fileListLength === 0) {
document.title = `${this.$route.meta.title}` document.title = `${this.$route.meta.title}`
} else { } else {
document.title = `${this.process}% | ${this.$route.meta.title}` document.title = `${this.process}% | ${netSpeed}`
} }
}, },
onFileProgress(rootFile, file, chunk) { onFileProgress(rootFile, file, chunk) {
this.netSpeed = formatNetSpeed(file.currentSpeed, false) this.netSpeed = formatNetSpeed(file.currentSpeed, false)
this.process = Math.trunc(window.uploader.progress() * 100) this.process = Math.trunc(window.uploader.progress() * 100)
this.setPageTitle() this.setPageTitle(this.netSpeed)
if (rootFile.isFolder && this.process < 100) { if (rootFile.isFolder && this.process < 100) {
this.statusSet(rootFile.id, 'progress', formatNetSpeed(file.currentSpeed, true)) this.statusSet(rootFile.id, 'progress', formatNetSpeed(file.currentSpeed, true))
} }