feat: 表单编辑按钮权限
This commit is contained in:
@ -1018,11 +1018,16 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
router.push({
|
router.push({
|
||||||
path: '/form/${lowerClassName}/' + record.id + '/viewForm',
|
path: '/form/${lowerClassName}/' + record.id + '/viewForm',
|
||||||
query: {
|
query: {
|
||||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
formPath: '${model.outputConfig.outputValue}/${lowerClassName}',
|
||||||
|
canEdit: canEdit()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 判断是否显示编辑按钮编辑
|
||||||
|
function canEdit() {
|
||||||
|
return filterButtonAuth([{"code":"view"}]).length
|
||||||
|
}
|
||||||
|
|
||||||
function buttonClick(code) {
|
function buttonClick(code) {
|
||||||
${
|
${
|
||||||
@ -1347,7 +1352,8 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
router.push({
|
router.push({
|
||||||
path: '/form/${lowerClassName}/' + record.id + '/viewForm',
|
path: '/form/${lowerClassName}/' + record.id + '/viewForm',
|
||||||
query: {
|
query: {
|
||||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}'
|
formPath: '${model.outputConfig.outputValue}/${lowerClassName}',
|
||||||
|
canEdit: canEdit()
|
||||||
}
|
}
|
||||||
});`
|
});`
|
||||||
: `
|
: `
|
||||||
|
|||||||
@ -8,13 +8,13 @@
|
|||||||
</slot>
|
</slot>
|
||||||
关闭
|
关闭
|
||||||
</a-button>
|
</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">
|
<slot name="icon">
|
||||||
<edit-outlined />
|
<edit-outlined />
|
||||||
</slot>
|
</slot>
|
||||||
编辑
|
编辑
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="primary" @click="handleSubmit" v-else>
|
<a-button type="primary" @click="handleSubmit" v-else-if="showEdit">
|
||||||
<slot name="icon">
|
<slot name="icon">
|
||||||
<check-circle-outlined />
|
<check-circle-outlined />
|
||||||
</slot>
|
</slot>
|
||||||
@ -45,7 +45,8 @@ const { bus, FORM_LIST_MODIFIED } = useEventBus();
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { currentRoute } = router;
|
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 pathArr = formPath.split('/');
|
||||||
|
|
||||||
const tabStore = useMultipleTabStore();
|
const tabStore = useMultipleTabStore();
|
||||||
|
|||||||
Reference in New Issue
Block a user