fix(功能用例): 修改详情tab切换bug

This commit is contained in:
xinxin.wu 2024-02-22 10:57:47 +08:00 committed by Craftsman
parent 4ecefaa8f6
commit 9072523eb5
7 changed files with 32 additions and 23 deletions

View File

@ -15,6 +15,7 @@
:mask-closable="true"
:edit-name="true"
show-full-screen
unmount-on-close
@loaded="loadedCase"
>
<template #titleLeft>
@ -102,7 +103,7 @@
<template #first>
<div class="leftWrapper">
<div class="header h-[50px]">
<a-menu mode="horizontal" :default-selected-keys="[activeTab]" @menu-item-click="clickMenu">
<a-menu mode="horizontal" :default-selected-keys="[activeTab || 'detail']" @menu-item-click="clickMenu">
<a-menu-item key="detail">{{ t('caseManagement.featureCase.detail') }} </a-menu-item>
<a-menu-item v-for="tab of tabSetting" :key="tab.key">
<div class="flex items-center">
@ -274,7 +275,6 @@
const userId = computed(() => userStore.userInfo.id);
const appStore = useAppStore();
provide('caseId', props.detailId);
const currentProjectId = computed(() => appStore.currentProjectId);
@ -536,6 +536,7 @@
() => props.visible,
(val) => {
if (val) {
activeTab.value = 'detail';
showDrawerVisible.value = val;
}
}
@ -600,8 +601,11 @@
);
onMounted(() => {
settingDrawerRef.value.getTabModule();
if (activeTab.value) {
settingDrawerRef.value.getTabModule();
}
});
provide('activeTab', activeTab.value);
</script>
<style scoped lang="less">

View File

@ -115,7 +115,9 @@
}, 100);
onBeforeMount(() => {
initData();
if (props.caseId) {
initData();
}
});
</script>

View File

@ -14,7 +14,8 @@
</template>
<template #type> </template>
<template #operation="{ record }">
<MsRemoveButton
<!-- TODO 这一版本不上 -->
<!-- <MsRemoveButton
position="br"
:title="
t('caseManagement.featureCase.confirmRecoverChangeHistoryTitle', { name: characterLimit(record.name) })
@ -24,7 +25,7 @@
"
:loading="recoverLoading"
@ok="recoverHandler(record)"
/>
/> -->
<MsButton @click="saveAsHandler(record)">{{ t('caseManagement.featureCase.saveAsVersion') }}</MsButton>
</template>
</ms-base-table>
@ -230,7 +231,9 @@
onBeforeMount(() => {
doCheckIsTip();
initData();
if (props.caseId) {
initData();
}
});
</script>

View File

@ -84,7 +84,6 @@
export type types = 'preposition' | 'postPosition';
const currentProjectId = computed(() => appStore.currentProjectId);
const showType = ref<types>('preposition');
const { t } = useI18n();
const keyword = ref<string>('');
@ -202,7 +201,9 @@
);
onMounted(() => {
initData();
if (props.caseId) {
initData();
}
});
</script>

View File

@ -13,7 +13,7 @@ export default {
'caseManagement.featureCase.rename': 'rename',
'caseManagement.featureCase.recycle': 'Recycle',
'caseManagement.featureCase.versionPlaceholder': 'The default is the latest version',
'caseManagement.featureCase.searchByNameAndId': 'Search by ID or name',
'caseManagement.featureCase.searchByNameAndId': 'Search by ID, name, or tag',
'caseManagement.featureCase.filter': 'filter',
'caseManagement.featureCase.setFilterCondition': 'Set filters',
'caseManagement.featureCase.followingCondition': 'Conform to the following',
@ -252,5 +252,5 @@ export default {
'caseManagement.featureCase.defectSource': 'defect Source',
'caseManagement.featureCase.sortSuccess': 'Sort successfully',
'caseManagement.featureCase.zentao': 'zentao',
'caseManagement.featureCase.searchPlaceholder': 'Search by ID or name',
'caseManagement.featureCase.searchPlaceholder': 'Search by ID, name, or tag',
};

View File

@ -13,7 +13,7 @@ export default {
'caseManagement.featureCase.rename': '重命名',
'caseManagement.featureCase.recycle': '回收站',
'caseManagement.featureCase.versionPlaceholder': '默认为最新版本',
'caseManagement.featureCase.searchByNameAndId': '通过 ID 或名称搜索',
'caseManagement.featureCase.searchByNameAndId': '通过ID、名称或标签搜索',
'caseManagement.featureCase.filter': '筛选',
'caseManagement.featureCase.setFilterCondition': '设置筛选条件',
'caseManagement.featureCase.followingCondition': '符合以下',
@ -247,5 +247,5 @@ export default {
'caseManagement.featureCase.defectSource': '缺陷来源',
'caseManagement.featureCase.sortSuccess': '排序成功',
'caseManagement.featureCase.zentao': '禅道',
'caseManagement.featureCase.searchPlaceholder': '通过ID或名称搜索',
'caseManagement.featureCase.searchPlaceholder': '通过ID、名称或标签搜索',
};

View File

@ -51,8 +51,13 @@
<span>{{ t(ExecutionMethodsLabel[record.triggerMode]) }}</span>
</template>
<template #operation="{ record }">
<MsButton class="!mr-0" @click="stop(record)">{{ t('project.taskCenter.stop') }}</MsButton>
<a-divider direction="vertical" />
<MsButton
v-if="['PENDING', 'RUNNING', 'RERUNNING'].includes(record.status)"
class="!mr-0"
@click="stop(record)"
>{{ t('project.taskCenter.stop') }}</MsButton
>
<a-divider v-if="['PENDING', 'RUNNING', 'RERUNNING'].includes(record.status)" direction="vertical" />
<MsButton class="!mr-0" @click="execution(record)">{{ t('project.taskCenter.execution') }}</MsButton>
<MsButton class="!mr-0">{{ t('project.taskCenter.viewReport') }}</MsButton>
</template>
@ -149,11 +154,6 @@
dataIndex: 'status',
slotName: 'status',
titleSlotName: 'statusFilter',
// filterConfig: {
// filterSlotName: 'status', // slotName
// multiple: true, //
// options: filterOptions.value,
// },
showInTable: true,
width: 150,
showDrag: true,
@ -163,7 +163,6 @@
dataIndex: 'triggerMode',
slotName: 'triggerMode',
showInTable: true,
isTag: true,
width: 150,
showDrag: true,
},
@ -194,7 +193,7 @@
title: 'common.operation',
slotName: 'operation',
dataIndex: 'operation',
width: 120,
width: 200,
fixed: 'right',
},
];
@ -209,7 +208,6 @@
showSetting: false,
selectable: true,
heightUsed: 300,
enableDrag: true,
showSelectAll: true,
}
);
@ -218,6 +216,7 @@
setLoadListParams({
keyword: keyword.value,
moduleType: props.moduleType,
filter: { status: statusListFilters.value },
});
loadList();
}