perf: 优化收藏页和标签页的右键菜单
perf: 优化收藏页和标签页的路径跳转
This commit is contained in:
parent
1d979b907e
commit
65d202990d
@ -19,7 +19,7 @@
|
||||
></svg-icon>
|
||||
{{ item.label }}
|
||||
</v-contextmenu-item>
|
||||
<v-contextmenu-submenu v-if="item.child" :title="item.label">
|
||||
<v-contextmenu-submenu v-if="item.child" :disabled="item.homeDisable && (!path || path.length < 2)" :title="item.label">
|
||||
<!-- 二级菜单 -->
|
||||
<div v-for="itemSecond of item.child" :key="itemSecond.operation">
|
||||
<v-contextmenu-item
|
||||
@ -2268,7 +2268,9 @@ export default {
|
||||
goBack() {
|
||||
if (this.pathList.length <= 1) {
|
||||
const queryTagId = this.$route.query.tagId ? `&tagId=${this.$route.query.tagId}` : ''
|
||||
this.$router.push(`/?vmode=${this.vmode}&path=${encodeURI(this.path)}${queryTagId}`);
|
||||
const keyword = this.$route.query.keyword ? `&keyword=${this.$route.query.keyword}` : ''
|
||||
const basePath = this.getBasePath()
|
||||
this.$router.push(`/?vmode=${this.vmode}&path=${encodeURI(this.path)}${queryTagId}${basePath}${keyword}`);
|
||||
return;
|
||||
}
|
||||
this.lastLink();
|
||||
@ -2309,10 +2311,12 @@ export default {
|
||||
|
||||
if (!unPushLink) {
|
||||
const queryTagId = this.$route.query.tagId ? `&tagId=${this.$route.query.tagId}` : ''
|
||||
const basePath = this.getBasePath()
|
||||
const keyword = this.$route.query.keyword ? `&keyword=${this.$route.query.keyword}` : ''
|
||||
if (!this.$route.query.path) {
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${encodeURI(this.path)}${queryFolder ? '&folder='+queryFolder : ''}${queryTagId}`);
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${encodeURI(this.path)}${queryFolder ? '&folder='+queryFolder : ''}${queryTagId}${basePath}${keyword}`);
|
||||
} else {
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${encodeURI(this.path)}${queryFolder ? '&folder='+queryFolder : ''}${queryTagId}`);
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${encodeURI(this.path)}${queryFolder ? '&folder='+queryFolder : ''}${queryTagId}${basePath}${keyword}`);
|
||||
}
|
||||
}
|
||||
if (!unRefresh) {
|
||||
@ -2321,6 +2325,13 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
getBasePath() {
|
||||
let basePath = this.$route.query.basePath ? `&basePath=${this.$route.query.basePath}` : ''
|
||||
if (!this.path || this.path.length < 2) {
|
||||
return ''
|
||||
}
|
||||
return basePath
|
||||
},
|
||||
// 新建文档
|
||||
newDocument() {
|
||||
window.open(`/setting/website/manager-articles?operation=new`, "_blank");
|
||||
@ -2541,7 +2552,9 @@ export default {
|
||||
}
|
||||
this.editingIndex = -1;
|
||||
const queryTagId = this.$route.query.tagId ? `&tagId=${this.$route.query.tagId}` : ''
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${this.path}${this.$route.query.folder ? '&folder='+this.$route.query.folder : ''}${queryTagId}`);
|
||||
const basePath = this.getBasePath()
|
||||
const keyword = this.$route.query.keyword ? `&keyword=${this.$route.query.keyword}` : ''
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${this.path}${this.$route.query.folder ? '&folder='+this.$route.query.folder : ''}${queryTagId}${basePath}${keyword}`);
|
||||
// 改变拖拽目标
|
||||
this.rowDrop();
|
||||
// 画矩形选取
|
||||
@ -2713,9 +2726,10 @@ export default {
|
||||
this.pathList.push(item1);
|
||||
}
|
||||
const queryTagId = this.$route.query.tagId ? `&tagId=${this.$route.query.tagId}` : ''
|
||||
const basePath = this.getBasePath()
|
||||
const keyword = key ? `&keyword=${key}` : ''
|
||||
const path = this.path ? encodeURI(this.path) : "/";
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${path}${keyword}${queryTagId}`);
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${path}${keyword}${queryTagId}${basePath}`);
|
||||
api.searchFile({
|
||||
userId: this.$store.state.user.userId,
|
||||
username: this.$store.state.user.name,
|
||||
@ -4049,6 +4063,7 @@ export default {
|
||||
if (row.isFolder) {
|
||||
this.editingIndex = -1;
|
||||
const queryTagId = this.$route.query.tagId ? `&tagId=${this.$route.query.tagId}` : ''
|
||||
const keyword = this.$route.query.keyword ? `&keyword=${this.$route.query.keyword}` : ''
|
||||
// 打开文件夹
|
||||
if (this.listModeSearch) {
|
||||
const item = {};
|
||||
@ -4057,12 +4072,12 @@ export default {
|
||||
item["row"] = row;
|
||||
this.pathList.push(item);
|
||||
this.pagination.pageIndex = 1;
|
||||
const keyword = this.$route.query.keyword ? `&keyword=${this.$route.query.keyword}` : ''
|
||||
const folder = row.id ? `&folder=${row.id}` : ''
|
||||
this.$router.push(`?vmode=${this.vmode}${keyword}${folder}${queryTagId}`);
|
||||
this.$router.push(`?vmode=${this.vmode}${keyword}${folder}${queryTagId}${basePath}`);
|
||||
this.searchFileAndOpenDir(row);
|
||||
} else {
|
||||
let notHomePage = this.$route.path.length > 1
|
||||
console.log('notHomePage', notHomePage, 'this.basePath.length', this.basePath.length)
|
||||
if (notHomePage && this.basePath.length === 1) {
|
||||
this.basePath = row.path
|
||||
}
|
||||
@ -4083,7 +4098,8 @@ export default {
|
||||
if (row.mountFileId) {
|
||||
localStorage.setItem(this.path, row.mountFileId)
|
||||
}
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${path}${row.mountFileId ? '&folder='+row.mountFileId : ''}${queryTagId}${this.basePath.length > 1 ? '&basePath='+this.basePath : ''}`);
|
||||
const basePath = this.basePath.length > 1 ? '&basePath='+this.basePath : ''
|
||||
this.$router.push(`?vmode=${this.vmode}&path=${path}${row.mountFileId ? '&folder='+row.mountFileId : ''}${queryTagId}${basePath}${keyword}`);
|
||||
this.openDir(row);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
:singleMenusEdit="singleMenusEdit"
|
||||
:multipleMenus="multipleMenus"
|
||||
:multipleRightMenus="multipleRightMenus"
|
||||
:contextMenus="contextMenus"
|
||||
>
|
||||
</show-file>
|
||||
</div>
|
||||
@ -29,6 +30,35 @@
|
||||
queryCondition: {
|
||||
isFavorite: true
|
||||
},
|
||||
contextMenus: [
|
||||
{ label: '查看', operation: 'viewMode' ,child: [
|
||||
{ iconClass: this.grid?'':'menu-point', label: '列表', operation: 'vmode-list'},
|
||||
{ iconClass: this.grid?'menu-point':'', label: '缩略图', operation: 'vmode-grid'},
|
||||
{ label: '显示文件夹大小', operation: 'show-folder-size'},
|
||||
]
|
||||
},
|
||||
{ label: '排列方式', operation: 'arrangement' ,child: [
|
||||
{ label: '名称', operation: 'orderName', orderProp: 'name'},
|
||||
{ label: '大小', operation: 'orderSize', orderProp: 'size'},
|
||||
{ label: '日期', operation: 'orderUpdateDate', orderProp: 'updateDate'},
|
||||
]
|
||||
},
|
||||
{ label: '刷新', operation: 'refresh'},
|
||||
{ divider: true, operation: 'divider' },
|
||||
{ label: '新建', operation: 'create' , homeDisable: true ,child: [
|
||||
{ label: '文件夹', operation: 'createFolder', iconClass: 'folder'},
|
||||
{ divider: true, operation: 'divider' },
|
||||
{ label: '文本', operation: 'createTextFile', iconClass: 'file-txt'},
|
||||
{ label: '思维导图', operation: 'createMinderFile', iconClass: 'file-mind'},
|
||||
{ label: '流程图', operation: 'createDrawioFile', iconClass: 'file-drawio'},
|
||||
{ label: 'Word', operation: 'createWordFile', iconClass: 'file-word'},
|
||||
{ label: 'Excel', operation: 'createExcelFile', iconClass: 'file-excel'},
|
||||
{ label: 'PPT', operation: 'createPPTFile', iconClass: 'file-ppt'},
|
||||
]
|
||||
},
|
||||
{ divider: true, operation: 'divider' },
|
||||
{ label: '写文章', operation: 'createMarkdownFile'},
|
||||
],
|
||||
singleMenus: [
|
||||
{ iconClass: 'menu-open', label: '打开', operation: 'open' },
|
||||
{ iconClass: 'share', label: '分享', operation: 'share' },
|
||||
|
||||
@ -29,6 +29,7 @@ export default {
|
||||
{ label: '查看', operation: 'viewMode' ,child: [
|
||||
{ iconClass: this.grid?'':'menu-point', label: '列表', operation: 'vmode-list'},
|
||||
{ iconClass: this.grid?'menu-point':'', label: '缩略图', operation: 'vmode-grid'},
|
||||
{ label: '显示文件夹大小', operation: 'show-folder-size'},
|
||||
]
|
||||
},
|
||||
{ label: '排列方式', operation: 'arrangement' ,child: [
|
||||
@ -39,7 +40,7 @@ export default {
|
||||
},
|
||||
{ label: '刷新', operation: 'refresh'},
|
||||
{ divider: true, operation: 'divider' },
|
||||
{ label: '新建', operation: 'create' ,child: [
|
||||
{ label: '新建', operation: 'create' , homeDisable: true, child: [
|
||||
{ label: '文件夹', operation: 'createFolder', iconClass: 'folder'},
|
||||
{ divider: true, operation: 'divider' },
|
||||
{ label: '文本', operation: 'createTextFile', iconClass: 'file-txt'},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user