fix(系统设置): 模板未开启的字段禁用编辑问题

This commit is contained in:
song-cc-rock 2024-03-29 11:18:34 +08:00 committed by 刘瑞斌
parent e49ac968e8
commit 1ac7e3e458
1 changed files with 16 additions and 2 deletions

View File

@ -52,7 +52,11 @@
/> />
<a-tooltip :content="record.name"> <a-tooltip :content="record.name">
<div <div
class="ellipsis max-w-[200px] cursor-pointer text-[rgb(var(--primary-5))]" class="ellipsis max-w-[200px]"
:class="{
'text-[rgb(var(--primary-5))]': isEnableTemplate,
'cursor-pointer': isEnableTemplate,
}"
@click="showDetail(record)" @click="showDetail(record)"
>{{ record.name }}</div >{{ record.name }}</div
> >
@ -61,7 +65,7 @@
> >
</template> </template>
<template #updateTime="{ record }"> {{ dayjs(record.updateTime).format('YYYY-MM-DD HH:mm:ss') }} </template> <template #updateTime="{ record }"> {{ dayjs(record.updateTime).format('YYYY-MM-DD HH:mm:ss') }} </template>
<template #operation="{ record }"> <template v-if="isEnableTemplate" #operation="{ record }">
<div class="flex flex-row flex-nowrap items-center"> <div class="flex flex-row flex-nowrap items-center">
<MsPopConfirm <MsPopConfirm
type="error" type="error"
@ -221,6 +225,14 @@
} }
}); });
// (/)
const isEnableTemplate = computed(() => {
if (props.mode === 'organization') {
return templateStore.ordStatus[route.query.type as string];
}
return templateStore.projectStatus[route.query.type as string];
});
const hasOperationPermission = computed(() => const hasOperationPermission = computed(() =>
hasAnyPermission([...props.updatePermission, ...props.deletePermission]) hasAnyPermission([...props.updatePermission, ...props.deletePermission])
); );
@ -375,6 +387,8 @@
// //
const showDetail = (record: AddOrUpdateField) => { const showDetail = (record: AddOrUpdateField) => {
if (!isEnableTemplate.value) return;
showDetailVisible.value = true; showDetailVisible.value = true;
let fieldType; let fieldType;
if (record.type === 'MEMBER') { if (record.type === 'MEMBER') {