fix(系统设置): 修改组织管理模板启用模板显示bug
This commit is contained in:
parent
2af3240e2d
commit
0e635a3252
|
@ -199,12 +199,21 @@ export function initFormCreate(customFields: CustomAttributes[], permission: str
|
||||||
const optionsIds = optionsValue.map((e: any) => e.value);
|
const optionsIds = optionsValue.map((e: any) => e.value);
|
||||||
currentDefaultValue = (optionsIds || []).filter((e: any) => tempValue.includes(e));
|
currentDefaultValue = (optionsIds || []).filter((e: any) => tempValue.includes(e));
|
||||||
} else if (memberType.includes(item.type)) {
|
} else if (memberType.includes(item.type)) {
|
||||||
|
// @desc 上来为空成员且不包含默认值成员
|
||||||
if (Array.isArray(item.defaultValue) && !item.defaultValue.includes('CREATE_USER')) {
|
if (Array.isArray(item.defaultValue) && !item.defaultValue.includes('CREATE_USER')) {
|
||||||
currentDefaultValue = item.type === 'MEMBER' ? '' : [];
|
currentDefaultValue = item.type === 'MEMBER' ? '' : [];
|
||||||
|
// @desc 包含默认值成员
|
||||||
} else if (item.defaultValue.includes('CREATE_USER')) {
|
} else if (item.defaultValue.includes('CREATE_USER')) {
|
||||||
currentDefaultValue = item.type === 'MEMBER' ? '' : [];
|
currentDefaultValue = item.type === 'MEMBER' ? '' : [];
|
||||||
} else {
|
} else {
|
||||||
currentDefaultValue = item.type === 'MEMBER' ? item.defaultValue : JSON.parse(item.defaultValue);
|
// @desc 如果默认原本的成员被系统移除则过滤掉该用户不展示
|
||||||
|
const optionsIds = optionsValue.map((e: any) => e.value);
|
||||||
|
if (item.type === 'MULTIPLE_MEMBER') {
|
||||||
|
const tempValue = JSON.parse(item.defaultValue);
|
||||||
|
currentDefaultValue = (optionsIds || []).filter((e: any) => tempValue.includes(e));
|
||||||
|
} else {
|
||||||
|
currentDefaultValue = (optionsIds || []).find((e: any) => item.defaultValue === e) || '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (multipleInputType.includes(item.type)) {
|
} else if (multipleInputType.includes(item.type)) {
|
||||||
currentDefaultValue = Array.isArray(item.defaultValue) ? item.defaultValue : JSON.parse(item.defaultValue);
|
currentDefaultValue = Array.isArray(item.defaultValue) ? item.defaultValue : JSON.parse(item.defaultValue);
|
||||||
|
|
|
@ -336,7 +336,7 @@
|
||||||
selectAll: !!selectAll,
|
selectAll: !!selectAll,
|
||||||
excludeIds: excludeIds || [],
|
excludeIds: excludeIds || [],
|
||||||
selectIds: selectedIds || [],
|
selectIds: selectedIds || [],
|
||||||
roleIds: roleIds.value ? [roleIds.value] : [],
|
roleIds: target,
|
||||||
condition: {
|
condition: {
|
||||||
keyword: keyword.value,
|
keyword: keyword.value,
|
||||||
filter: {
|
filter: {
|
||||||
|
|
|
@ -315,7 +315,7 @@
|
||||||
dataIndex: 'operation',
|
dataIndex: 'operation',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
showDrag: false,
|
showDrag: false,
|
||||||
width: hasOperationPermission.value ? 180 : 100,
|
width: 180,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -8,38 +8,40 @@
|
||||||
<div class="template-operation">
|
<div class="template-operation">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<span class="font-medium">{{ props.cardItem.name }}</span>
|
<span class="font-medium">{{ props.cardItem.name }}</span>
|
||||||
<span v-if="!isEnableProject" class="enable">{{ t('system.orgTemplate.enabledTemplates') }}</span>
|
<span v-if="isEnableProject" class="enable">{{ t('system.orgTemplate.enabledTemplates') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex min-w-[300px] flex-nowrap items-center">
|
<div class="flex min-w-[300px] flex-nowrap items-center">
|
||||||
|
<!-- 字段设置 -->
|
||||||
<span class="operation hover:text-[rgb(var(--primary-5))]">
|
<span class="operation hover:text-[rgb(var(--primary-5))]">
|
||||||
<span @click="fieldSetting">{{ t('system.orgTemplate.fieldSetting') }}</span>
|
<span @click="fieldSetting">{{ t('system.orgTemplate.fieldSetting') }}</span>
|
||||||
<a-divider direction="vertical" />
|
<a-divider direction="vertical" />
|
||||||
</span>
|
</span>
|
||||||
|
<!-- 模板列表 -->
|
||||||
<span class="operation hover:text-[rgb(var(--primary-5))]">
|
<span class="operation hover:text-[rgb(var(--primary-5))]">
|
||||||
<span @click="templateManagement">{{ t('system.orgTemplate.TemplateManagementList') }}</span>
|
<span @click="templateManagement">{{ t('system.orgTemplate.TemplateManagementList') }}</span>
|
||||||
<a-divider
|
<a-divider v-if="isShow" direction="vertical" />
|
||||||
v-if="hasEnablePermission && isEnableProject && props.cardItem.key === 'BUG'"
|
|
||||||
direction="vertical"
|
|
||||||
/>
|
|
||||||
</span>
|
</span>
|
||||||
|
<!-- 工作流 -->
|
||||||
<span v-if="props.cardItem.key === 'BUG'" class="operation hover:text-[rgb(var(--primary-5))]">
|
<span v-if="props.cardItem.key === 'BUG'" class="operation hover:text-[rgb(var(--primary-5))]">
|
||||||
<a-divider
|
|
||||||
v-if="!(hasEnablePermission && isEnableProject) && props.cardItem.key === 'BUG'"
|
|
||||||
direction="vertical"
|
|
||||||
/>
|
|
||||||
<span @click="workflowSetup">{{ t('system.orgTemplate.workflowSetup') }}</span>
|
<span @click="workflowSetup">{{ t('system.orgTemplate.workflowSetup') }}</span>
|
||||||
<a-divider
|
<a-divider
|
||||||
v-if="hasEnablePermission && props.mode === 'organization' && isEnableProject"
|
v-if="
|
||||||
|
hasEnablePermission &&
|
||||||
|
props.mode === 'organization' &&
|
||||||
|
!isEnableProject &&
|
||||||
|
props.cardItem.key === 'BUG'
|
||||||
|
"
|
||||||
v-permission="['ORGANIZATION_TEMPLATE:READ+ENABLE']"
|
v-permission="['ORGANIZATION_TEMPLATE:READ+ENABLE']"
|
||||||
direction="vertical"
|
direction="vertical"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
<!-- 启用项目模板 只有组织可以启用 -->
|
||||||
<span
|
<span
|
||||||
v-if="hasEnablePermission && props.mode === 'organization' && isEnableProject"
|
v-if="hasEnablePermission && props.mode === 'organization' && !isEnableProject"
|
||||||
class="rounded p-[2px] hover:bg-[rgb(var(--primary-9))]"
|
class="rounded p-[2px] hover:bg-[rgb(var(--primary-9))]"
|
||||||
>
|
>
|
||||||
<MsTableMoreAction :list="moreActions" @select="handleMoreActionSelect"
|
<MsTableMoreAction :list="moreActions" @select="handleMoreActionSelect" />
|
||||||
/></span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -130,9 +132,7 @@
|
||||||
|
|
||||||
// 先判断项目是否是开启
|
// 先判断项目是否是开启
|
||||||
const isEnableProject = computed(() => {
|
const isEnableProject = computed(() => {
|
||||||
return props.mode === 'organization'
|
return templateStore.projectStatus[props.cardItem.key];
|
||||||
? templateStore.ordStatus[props.cardItem.key]
|
|
||||||
: templateStore.projectStatus[props.cardItem.key];
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const moreActions = ref<ActionsItem[]>([
|
const moreActions = ref<ActionsItem[]>([
|
||||||
|
@ -214,6 +214,13 @@
|
||||||
|
|
||||||
const hasEnablePermission = computed(() => hasAnyPermission(['ORGANIZATION_TEMPLATE:READ+ENABLE']));
|
const hasEnablePermission = computed(() => hasAnyPermission(['ORGANIZATION_TEMPLATE:READ+ENABLE']));
|
||||||
|
|
||||||
|
const isShow = computed(() => {
|
||||||
|
if (props.cardItem.key === 'BUG') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return !hasEnablePermission.value ? false : !isEnableProject.value;
|
||||||
|
});
|
||||||
|
|
||||||
function cancelHandler() {
|
function cancelHandler() {
|
||||||
showEnableVisible.value = false;
|
showEnableVisible.value = false;
|
||||||
validateKeyWord.value = '';
|
validateKeyWord.value = '';
|
||||||
|
|
Loading…
Reference in New Issue