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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@ export default {
'caseManagement.featureCase.rename': 'rename', 'caseManagement.featureCase.rename': 'rename',
'caseManagement.featureCase.recycle': 'Recycle', 'caseManagement.featureCase.recycle': 'Recycle',
'caseManagement.featureCase.versionPlaceholder': 'The default is the latest version', '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.filter': 'filter',
'caseManagement.featureCase.setFilterCondition': 'Set filters', 'caseManagement.featureCase.setFilterCondition': 'Set filters',
'caseManagement.featureCase.followingCondition': 'Conform to the following', 'caseManagement.featureCase.followingCondition': 'Conform to the following',
@ -252,5 +252,5 @@ export default {
'caseManagement.featureCase.defectSource': 'defect Source', 'caseManagement.featureCase.defectSource': 'defect Source',
'caseManagement.featureCase.sortSuccess': 'Sort successfully', 'caseManagement.featureCase.sortSuccess': 'Sort successfully',
'caseManagement.featureCase.zentao': 'zentao', '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.rename': '重命名',
'caseManagement.featureCase.recycle': '回收站', 'caseManagement.featureCase.recycle': '回收站',
'caseManagement.featureCase.versionPlaceholder': '默认为最新版本', 'caseManagement.featureCase.versionPlaceholder': '默认为最新版本',
'caseManagement.featureCase.searchByNameAndId': '通过 ID 或名称搜索', 'caseManagement.featureCase.searchByNameAndId': '通过ID、名称或标签搜索',
'caseManagement.featureCase.filter': '筛选', 'caseManagement.featureCase.filter': '筛选',
'caseManagement.featureCase.setFilterCondition': '设置筛选条件', 'caseManagement.featureCase.setFilterCondition': '设置筛选条件',
'caseManagement.featureCase.followingCondition': '符合以下', 'caseManagement.featureCase.followingCondition': '符合以下',
@ -247,5 +247,5 @@ export default {
'caseManagement.featureCase.defectSource': '缺陷来源', 'caseManagement.featureCase.defectSource': '缺陷来源',
'caseManagement.featureCase.sortSuccess': '排序成功', 'caseManagement.featureCase.sortSuccess': '排序成功',
'caseManagement.featureCase.zentao': '禅道', 'caseManagement.featureCase.zentao': '禅道',
'caseManagement.featureCase.searchPlaceholder': '通过ID或名称搜索', 'caseManagement.featureCase.searchPlaceholder': '通过ID、名称或标签搜索',
}; };

View File

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