feat: 表单编辑按钮权限

This commit is contained in:
GAOANG
2024-04-25 18:38:00 +08:00
parent b58e013957
commit 600235ba95
2 changed files with 12 additions and 5 deletions

View File

@ -8,13 +8,13 @@
</slot>
关闭
</a-button>
<a-button style="margin-right: 10px" type="primary" @click="editForm" v-if="mode === 'view'">
<a-button style="margin-right: 10px" type="primary" @click="editForm" v-if="mode === 'view' && showEdit">
<slot name="icon">
<edit-outlined />
</slot>
编辑
</a-button>
<a-button type="primary" @click="handleSubmit" v-else>
<a-button type="primary" @click="handleSubmit" v-else-if="showEdit">
<slot name="icon">
<check-circle-outlined />
</slot>
@ -45,7 +45,8 @@ const { bus, FORM_LIST_MODIFIED } = useEventBus();
const router = useRouter();
const { currentRoute } = router;
const { formPath } = currentRoute.value.query;
const { formPath, canEdit } = currentRoute.value.query;
const showEdit = ref(canEdit === '0' ? false : true)
const pathArr = formPath.split('/');
const tabStore = useMultipleTabStore();