fix: 修复任务中心参数问题&关联用例调整
This commit is contained in:
parent
9d2a050983
commit
8a8e584886
|
@ -113,7 +113,7 @@
|
|||
</a-tooltip>
|
||||
</template>
|
||||
<template #caseLevel="{ record }">
|
||||
<caseLevel :case-level="getCaseLevel(record)" />
|
||||
<caseLevel v-if="getCaseLevel(record)" :case-level="getCaseLevel(record)" />
|
||||
</template>
|
||||
</ms-base-table>
|
||||
<div class="footer">
|
||||
|
@ -175,24 +175,30 @@
|
|||
const appStore = useAppStore();
|
||||
const { t } = useI18n();
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
projectId?: string; // 项目id
|
||||
caseId?: string; // 用例id 用例评审那边不需要传递
|
||||
getModulesFunc: (params: TableQueryParams) => Promise<ModuleTreeNode[]>; // 获取模块树请求
|
||||
modulesParams?: Record<string, any>; // 获取模块树请求
|
||||
getTableFunc: (params: TableQueryParams) => Promise<CommonList<CaseManagementTable>>; // 获取表请求函数
|
||||
tableParams?: TableQueryParams; // 查询表格的额外的参数
|
||||
okButtonDisabled?: boolean; // 确认按钮是否禁用
|
||||
currentSelectCase: string | number | Record<string, any> | undefined; // 当前选中的用例类型
|
||||
moduleOptions?: { label: string; value: string }[]; // 功能模块对应用例下拉
|
||||
confirmLoading: boolean;
|
||||
associatedIds: string[]; // 已关联用例id集合用于去重已关联
|
||||
hasNotAssociatedIds?: string[];
|
||||
type: RequestModuleEnum[keyof RequestModuleEnum];
|
||||
moduleCountParams?: TableQueryParams; // 获取模块树数量额外的参数
|
||||
hideProjectSelect?: boolean; // 是否隐藏项目选择
|
||||
}>();
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
visible: boolean;
|
||||
projectId?: string; // 项目id
|
||||
caseId?: string; // 用例id 用例评审那边不需要传递
|
||||
getModulesFunc: (params: TableQueryParams) => Promise<ModuleTreeNode[]>; // 获取模块树请求
|
||||
modulesParams?: Record<string, any>; // 获取模块树请求
|
||||
getTableFunc: (params: TableQueryParams) => Promise<CommonList<CaseManagementTable>>; // 获取表请求函数
|
||||
tableParams?: TableQueryParams; // 查询表格的额外的参数
|
||||
okButtonDisabled?: boolean; // 确认按钮是否禁用
|
||||
currentSelectCase: string | number | Record<string, any> | undefined; // 当前选中的用例类型
|
||||
moduleOptions?: { label: string; value: string }[]; // 功能模块对应用例下拉
|
||||
confirmLoading: boolean;
|
||||
associatedIds: string[]; // 已关联用例id集合用于去重已关联
|
||||
hasNotAssociatedIds?: string[];
|
||||
type: RequestModuleEnum[keyof RequestModuleEnum];
|
||||
moduleCountParams?: TableQueryParams; // 获取模块树数量额外的参数
|
||||
hideProjectSelect?: boolean; // 是否隐藏项目选择
|
||||
isHiddenCaseLevel?: boolean;
|
||||
}>(),
|
||||
{
|
||||
isHiddenCaseLevel: false,
|
||||
}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', val: boolean): void;
|
||||
|
@ -318,6 +324,20 @@
|
|||
const keyword = ref('');
|
||||
const version = ref('');
|
||||
|
||||
function getCaseLevelColumn() {
|
||||
if (!props.isHiddenCaseLevel) {
|
||||
return [
|
||||
{
|
||||
title: 'ms.case.associate.caseLevel',
|
||||
dataIndex: 'caseLevel',
|
||||
slotName: 'caseLevel',
|
||||
width: 90,
|
||||
},
|
||||
];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
const columns: MsTableColumn = [
|
||||
{
|
||||
title: 'ID',
|
||||
|
@ -342,12 +362,7 @@
|
|||
showTooltip: true,
|
||||
width: 250,
|
||||
},
|
||||
{
|
||||
title: 'ms.case.associate.caseLevel',
|
||||
dataIndex: 'caseLevel',
|
||||
slotName: 'caseLevel',
|
||||
width: 90,
|
||||
},
|
||||
...getCaseLevelColumn(),
|
||||
{
|
||||
title: 'ms.case.associate.tags',
|
||||
dataIndex: 'tags',
|
||||
|
@ -355,6 +370,10 @@
|
|||
},
|
||||
];
|
||||
|
||||
watchEffect(() => {
|
||||
getCaseLevelColumn();
|
||||
});
|
||||
|
||||
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector, setTableSelected } = useTable(
|
||||
props.getTableFunc,
|
||||
{
|
||||
|
@ -379,8 +398,13 @@
|
|||
);
|
||||
|
||||
// 用例等级
|
||||
// TODO: 这个版本用例和接口以及场景不存在用例等级 不展示等级内容
|
||||
function getCaseLevel(record: CaseManagementTable) {
|
||||
return (record.customFields.find((item: any) => item.name === '用例等级')?.value as CaseLevel) || 'P1';
|
||||
if (record.customFields && record.customFields.length) {
|
||||
const caseItem = record.customFields.find((item: any) => item.fieldName === '用例等级' && item.internal);
|
||||
return caseItem?.options.find((item: any) => item.value === caseItem?.defaultValue).text;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const searchParams = ref<TableQueryParams>({
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
:case-id="props.bugId"
|
||||
:associated-ids="associatedIds"
|
||||
:type="RequestModuleEnum.BUG_MANAGEMENT"
|
||||
:is-hidden-case-level="true"
|
||||
@close="emit('close')"
|
||||
@save="saveHandler"
|
||||
>
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
:case-id="props.caseId"
|
||||
:associated-ids="associatedIds"
|
||||
:type="RequestModuleEnum.API_CASE"
|
||||
:is-hidden-case-level="true"
|
||||
@close="emit('close')"
|
||||
@save="saveHandler"
|
||||
>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="wrapper mb-6 flex justify-between">
|
||||
<span class="font-medium text-[var(--color-text-000)]">{{ t('project.basicInfo.basicInfo') }}</span>
|
||||
<a-button
|
||||
v-if="!projectDetail?.deleted"
|
||||
v-show="!projectDetail?.deleted"
|
||||
v-permission="['PROJECT_BASE_INFO:READ+UPDATE']"
|
||||
type="outline"
|
||||
@click="editHandler"
|
||||
|
@ -19,12 +19,9 @@
|
|||
<span class="one-line-text mr-1 max-w-[300px] font-medium text-[var(--color-text-000)]">{{
|
||||
projectDetail?.name
|
||||
}}</span>
|
||||
<span
|
||||
v-if="!projectDetail?.deleted && projectDetail?.enable"
|
||||
class="button mr-1"
|
||||
:class="[projectDetail?.enable ? 'enable-button' : 'delete-button']"
|
||||
>{{ projectDetail?.enable ? t('project.basicInfo.enable') : t('project.basicInfo.enable') }}</span
|
||||
>
|
||||
<span class="button mr-1" :class="[projectDetail?.deleted ? 'delete-button' : 'enable-button']">{{
|
||||
projectDetail?.deleted ? t('project.basicInfo.deleted') : t('project.basicInfo.enable')
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="one-line-text text-xs text-[--color-text-4]">{{ projectDetail?.description }}</div>
|
||||
</div>
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
<template>
|
||||
<div class="flex flex-row items-center">
|
||||
<div class="text-[var(--color-text-1)]"> {{ t('project.menu.management') }}</div>
|
||||
|
||||
<div>
|
||||
<MsIcon
|
||||
class="ml-[4px] text-[var(--color-text-4)] hover:text-[rgb(var(--primary-5))]"
|
||||
type="icon-icon-maybe_outlined"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<MsBaseTable
|
||||
ref="tableRef"
|
||||
|
|
|
@ -500,7 +500,7 @@
|
|||
function batchStopRealTask() {
|
||||
openModal({
|
||||
type: 'warning',
|
||||
title: t('project.taskCenter.batchStopTask', { num: batchParams.value.selectIds.length }),
|
||||
title: t('project.taskCenter.batchStopTask', { num: batchParams.value.currentSelectCount }),
|
||||
content: t('project.taskCenter.stopTaskContent'),
|
||||
okText: t('project.taskCenter.confirmStop'),
|
||||
cancelText: t('common.cancel'),
|
||||
|
@ -509,11 +509,12 @@
|
|||
},
|
||||
onBeforeOk: async () => {
|
||||
try {
|
||||
const { selectIds, selectAll } = batchParams.value;
|
||||
const { selectIds, selectAll, excludeIds } = batchParams.value;
|
||||
await loadRealMap.value[props.group].batchStop({
|
||||
moduleType: props.moduleType,
|
||||
selectIds: selectAll ? [] : selectIds,
|
||||
selectAll,
|
||||
selectIds: selectIds || [],
|
||||
selectAll: !!selectAll,
|
||||
excludeIds: excludeIds || [],
|
||||
condition: {
|
||||
keyword: keyword.value,
|
||||
filter: {
|
||||
|
|
|
@ -488,7 +488,7 @@
|
|||
function batchEnableTask() {
|
||||
openModal({
|
||||
type: 'warning',
|
||||
title: t('project.taskCenter.batchEnableTask', { num: batchParams.value.selectIds.length }),
|
||||
title: t('project.taskCenter.batchEnableTask', { num: batchParams.value.currentSelectCount }),
|
||||
content: t('project.taskCenter.batchEnableTaskContent'),
|
||||
okText: t('project.taskCenter.confirmEnable'),
|
||||
cancelText: t('common.cancel'),
|
||||
|
@ -499,8 +499,8 @@
|
|||
try {
|
||||
const { selectIds, selectAll, excludeIds } = batchParams.value;
|
||||
await loadRealMap.value[props.group].batchEnable({
|
||||
selectIds: selectAll ? [] : selectIds,
|
||||
selectAll,
|
||||
selectIds: selectIds || [],
|
||||
selectAll: !!selectAll,
|
||||
scheduleTagType: props.moduleType,
|
||||
excludeIds,
|
||||
condition: {
|
||||
|
@ -526,7 +526,7 @@
|
|||
function batchDisableTask() {
|
||||
openModal({
|
||||
type: 'warning',
|
||||
title: t('project.taskCenter.batchDisableTask', { num: batchParams.value.selectIds.length }),
|
||||
title: t('project.taskCenter.batchDisableTask', { num: batchParams.value.currentSelectCount }),
|
||||
content: t('project.taskCenter.batchDisableTaskContent'),
|
||||
okText: t('project.taskCenter.confirmDisable'),
|
||||
cancelText: t('common.cancel'),
|
||||
|
@ -535,10 +535,11 @@
|
|||
},
|
||||
onBeforeOk: async () => {
|
||||
try {
|
||||
const { selectIds, selectAll } = batchParams.value;
|
||||
const { selectIds, selectAll, excludeIds } = batchParams.value;
|
||||
await loadRealMap.value[props.group].batchDisable({
|
||||
selectIds: selectAll ? [] : selectIds,
|
||||
selectAll,
|
||||
selectIds: selectIds || [],
|
||||
selectAll: !!selectAll,
|
||||
excludeIds: excludeIds || [],
|
||||
scheduleTagType: props.moduleType,
|
||||
condition: {
|
||||
keyword: keyword.value,
|
||||
|
|
Loading…
Reference in New Issue