feat: 表单编辑按钮权限
This commit is contained in:
@ -1018,11 +1018,16 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
router.push({
|
||||
path: '/form/${lowerClassName}/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}',
|
||||
canEdit: canEdit()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 判断是否显示编辑按钮编辑
|
||||
function canEdit() {
|
||||
return filterButtonAuth([{"code":"view"}]).length
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
${
|
||||
@ -1347,7 +1352,8 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
router.push({
|
||||
path: '/form/${lowerClassName}/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}',
|
||||
canEdit: canEdit()
|
||||
}
|
||||
});`
|
||||
: `
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user