|
@@ -2,7 +2,7 @@
|
|
|
<template>
|
|
|
<div class="left-folder" v-loading="loading">
|
|
|
<el-scrollbar style="height: 100%">
|
|
|
- <el-row style="padding: 16px 12px 6px;">
|
|
|
+ <el-row style="padding: 16px 12px 6px">
|
|
|
<span style="font-size: 12px; color: #646c73">文件夹</span>
|
|
|
<i class="el-icon-plus add-folder-icon" title="添加文件夹" @click="handleShowAddFolder"></i>
|
|
|
</el-row>
|
|
@@ -14,6 +14,7 @@
|
|
|
size="small"
|
|
|
clearable
|
|
|
v-model="folderName"
|
|
|
+ maxlength="10"
|
|
|
@keyup.native.enter="handleClickAddFolder"
|
|
|
placeholder="请输入文件夹名称"
|
|
|
></el-input>
|
|
@@ -47,7 +48,12 @@
|
|
|
title="撤销"
|
|
|
@click.stop="handleRevokeUpdateFolder(folder)"
|
|
|
></i>
|
|
|
- <i v-show="folder.showInput" class="iconfont icon-icondone confirm-icon" title="确认" @click.stop="handleUpdateFolderName(folder)"></i>
|
|
|
+ <i
|
|
|
+ v-show="folder.showInput"
|
|
|
+ class="iconfont icon-icondone confirm-icon"
|
|
|
+ title="确认"
|
|
|
+ @click.stop="handleUpdateFolderName(folder)"
|
|
|
+ ></i>
|
|
|
</li>
|
|
|
<!-- 右键菜单部分 -->
|
|
|
<ul v-show="visible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
|
|
@@ -89,8 +95,8 @@ export default {
|
|
|
const params = {
|
|
|
pageNumber: 1,
|
|
|
pageSize: 1000,
|
|
|
- orders: "name asc, createTime desc"
|
|
|
- }
|
|
|
+ orders: "name asc, createTime desc",
|
|
|
+ };
|
|
|
const res = await folderQuery(params);
|
|
|
this.folderData = res.content.map((folder) => {
|
|
|
folder.updateName = folder.name;
|
|
@@ -228,16 +234,21 @@ export default {
|
|
|
}).then(async () => {
|
|
|
const res = await folderDelete([{ id: this.rightClickFolder.id }]);
|
|
|
if (res.result === "success") {
|
|
|
- const index = this.folderData.findIndex((item) => { return item.id === this.rightClickFolder.id; })
|
|
|
+ const index = this.folderData.findIndex((item) => {
|
|
|
+ return item.id === this.rightClickFolder.id;
|
|
|
+ });
|
|
|
this.folderData.splice(index, 1);
|
|
|
/**
|
|
|
* 删除文件夹后选中文件夹判断
|
|
|
*/
|
|
|
- if (this.folderData[index]) {// 如果删除的文件夹后面有文件夹则选中
|
|
|
- this.handleCheckFolder(this.folderData[index].id)
|
|
|
- } else if (this.folderData[index - 1]) {// 如果删除的文件夹后面没有前面有则选中前一个文件夹
|
|
|
- this.handleCheckFolder(this.folderData[index - 1].id)
|
|
|
- } else {// 如果都没有则文件夹列表为空
|
|
|
+ if (this.folderData[index]) {
|
|
|
+ // 如果删除的文件夹后面有文件夹则选中
|
|
|
+ this.handleCheckFolder(this.folderData[index].id);
|
|
|
+ } else if (this.folderData[index - 1]) {
|
|
|
+ // 如果删除的文件夹后面没有前面有则选中前一个文件夹
|
|
|
+ this.handleCheckFolder(this.folderData[index - 1].id);
|
|
|
+ } else {
|
|
|
+ // 如果都没有则文件夹列表为空
|
|
|
this.handleCheckFolder();
|
|
|
}
|
|
|
this.$message.success("删除成功!");
|
|
@@ -304,7 +315,7 @@ export default {
|
|
|
}
|
|
|
.revoke-icon {
|
|
|
cursor: pointer;
|
|
|
- color: #646C73;
|
|
|
+ color: #646c73;
|
|
|
margin-left: 5px;
|
|
|
}
|
|
|
.confirm-icon {
|