From 51f5e7e51bfda14c0c5a887b12366fb9bb353e01 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 18 Mar 2024 17:11:23 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=8C=82=E8=BD=BD?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=E9=87=8C=E5=8F=B3=E9=94=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 5041d68..5a40857 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -3250,10 +3250,9 @@ export default { this.preliminaryRowData(row); }, setMenusByPermission(file) { - const indicesToDelete = [7, 5, 4, 3, 2, 1]; - for(let i of indicesToDelete) { - this.menus.splice(i, 1); - } + const reservations = ['open', 'download'] + // 删除this.menus中不要的菜单, 仅保留reservations中的菜单 + this.menus = this.menus.filter(item => reservations.includes(item.operation)) if (file.operationPermissionList && file.operationPermissionList.length > 0) { if (file.operationPermissionList.indexOf('PUT') > -1) { this.menus.splice(this.menus.length - 1, 0, { iconClass: "menu-rename", label: "重命名", operation: "rename" })