From 48794d4e21d17f75490434c32a357f32bd63a679 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Tue, 2 Aug 2022 16:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/base/store/process.ts | 12 +++++++++++- src/modules/base/views/menu.vue | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/modules/base/store/process.ts b/src/modules/base/store/process.ts index 527c7fa..3f52a30 100644 --- a/src/modules/base/store/process.ts +++ b/src/modules/base/store/process.ts @@ -40,11 +40,21 @@ export const useProcessStore = defineStore("process", function () { list.value = []; } + // 设置标题 + function setTitle(title: string) { + const item = list.value.find((e) => e.active); + + if (item) { + item.meta.label = title; + } + } + return { list, add, remove, set, - clear + clear, + setTitle }; }); diff --git a/src/modules/base/views/menu.vue b/src/modules/base/views/menu.vue index 2de679a..10d7276 100644 --- a/src/modules/base/views/menu.vue +++ b/src/modules/base/views/menu.vue @@ -123,7 +123,7 @@ const Table = useTable({ (row) => { return { label: "新增", - hidden: row.type == 2, + hidden: !(row.type != 2 && service.base.sys.user._permission.add), callback(done) { append(row); done(); @@ -135,7 +135,7 @@ const Table = useTable({ (row) => { return { label: "添加权限", - hidden: row.type != 1, + hidden: !(row.type == 1 && service.base.sys.user._permission.add), callback(done) { addPermission(row); done();