feat(测试计划): 测试规划-根节点支持配置运行模式

--story=1015333 --user=吕梦园 【测试计划】完成剩余功能 https://www.tapd.cn/55049933/s/1547478
This commit is contained in:
teukkk 2024-07-12 18:17:27 +08:00 committed by 刘瑞斌
parent edb54ca4f0
commit 5b01adde1c
1 changed files with 30 additions and 42 deletions

View File

@ -37,44 +37,25 @@
<MsIcon type="icon-icon_add_outlined" class="text-[var(--color-text-4)]" /> <MsIcon type="icon-icon_add_outlined" class="text-[var(--color-text-4)]" />
</MsButton> </MsButton>
</a-tooltip> </a-tooltip>
<a-dropdown <a-tooltip v-if="canShowExecuteMethodMenu && selectNodeExecuteMethod" :content="t('ms.minders.executeMethod')">
v-if="canShowExecuteMethodMenu" <div
v-model:popup-visible="executeMethodMenuVisible" :class="[
class="ms-minder-dropdown" 'flex h-[20px] w-[20px] cursor-pointer items-center justify-center rounded-full text-[12px] font-medium',
:popup-translate="[0, 4]" `${
position="bl" selectNodeExecuteMethod === RunMode.SERIAL
trigger="click" ? 'bg-[rgb(var(--link-1))] text-[rgb(var(--link-5))]'
@select="(val) => handleExecuteMethodMenuSelect(val as RunMode)" : 'bg-[rgb(var(--success-1))] text-[rgb(var(--success-6))]'
> }`,
<a-tooltip :content="t('ms.minders.executeMethod')"> ]"
<MsButton @click="
type="icon" handleExecuteMethodMenuSelect(
class="ms-minder-node-float-menu-icon-button" selectNodeExecuteMethod === RunMode.SERIAL ? RunMode.PARALLEL : RunMode.SERIAL
:class="[executeMethodMenuVisible ? 'ms-minder-node-float-menu-icon-button--focus' : '']" )
> "
<MsIcon type="icon-icon_play-round_filled" class="text-[var(--color-text-4)]" /> >
</MsButton> {{ selectNodeExecuteMethod === RunMode.SERIAL ? t('ms.minders.serial') : t('ms.minders.parallel') }}
</a-tooltip> </div>
<template #content> </a-tooltip>
<div class="mx-[6px] px-[8px] py-[3px] text-[var(--color-text-4)]">
{{ t('ms.minders.executeMethod') }}
</div>
<a-doption :value="RunMode.SERIAL">
<div
class="flex h-[20px] w-[20px] items-center justify-center rounded-full bg-[rgb(var(--link-1))] text-[12px] font-medium text-[rgb(var(--link-5))]"
>
{{ t('ms.minders.serial') }}
</div>
</a-doption>
<a-doption :value="RunMode.PARALLEL">
<div
class="flex h-[20px] w-[20px] items-center justify-center rounded-full bg-[rgb(var(--success-1))] text-[12px] font-medium text-[rgb(var(--success-6))]"
>
{{ t('ms.minders.parallel') }}
</div>
</a-doption>
</template>
</a-dropdown>
<a-tooltip v-if="showConfigMenu" :content="t('common.config')"> <a-tooltip v-if="showConfigMenu" :content="t('common.config')">
<MsButton <MsButton
type="icon" type="icon"
@ -302,7 +283,6 @@
const canShowAddTestPointsMenu = ref(false); const canShowAddTestPointsMenu = ref(false);
const showAssociateCaseMenu = ref(false); const showAssociateCaseMenu = ref(false);
const canShowExecuteMethodMenu = ref(false); const canShowExecuteMethodMenu = ref(false);
const executeMethodMenuVisible = ref(false);
const showConfigMenu = ref(false); const showConfigMenu = ref(false);
const canShowDeleteMenu = ref(false); const canShowDeleteMenu = ref(false);
const extraVisible = ref<boolean>(false); const extraVisible = ref<boolean>(false);
@ -359,12 +339,13 @@
canShowDeleteMenu.value = true; canShowDeleteMenu.value = true;
} }
} else { } else {
canShowFloatMenu.value = false; canShowFloatMenu.value = data.id === 'root';
canShowExecuteMethodMenu.value = false; canShowExecuteMethodMenu.value = data.id === 'root';
showAssociateCaseMenu.value = false; showAssociateCaseMenu.value = false;
showConfigMenu.value = false; showConfigMenu.value = false;
extraVisible.value = false; extraVisible.value = false;
canShowDeleteMenu.value = false; canShowDeleteMenu.value = false;
canShowAddTestPointsMenu.value = false;
} }
} }
@ -467,6 +448,7 @@
// //
const activePlanSet = ref<PlanMinderNode>(); const activePlanSet = ref<PlanMinderNode>();
const selectNodeExecuteMethod = ref<RunMode>(); // /
// / // /
const priorityTextMap: Record<number, string> = { const priorityTextMap: Record<number, string> = {
@ -553,6 +535,7 @@
window.minder.execCommand('priority', priorityMap[val]); window.minder.execCommand('priority', priorityMap[val]);
// DOM // DOM
setCustomPriorityView(priorityTextMap); setCustomPriorityView(priorityTextMap);
selectNodeExecuteMethod.value = val;
const node: PlanMinderNode = window.minder.getSelectedNode(); const node: PlanMinderNode = window.minder.getSelectedNode();
if (configForm.value?.id === node?.data.id) { if (configForm.value?.id === node?.data.id) {
// //
@ -672,6 +655,11 @@
if (checkConfigFormUnsaved()) { if (checkConfigFormUnsaved()) {
return; return;
} }
if (node.data.priority) {
selectNodeExecuteMethod.value = getExecuteMethod(node.data);
} else {
selectNodeExecuteMethod.value = undefined;
}
if (node.data?.level === 3 && node.data?.resource?.[0] === caseCountTag) { if (node.data?.level === 3 && node.data?.resource?.[0] === caseCountTag) {
window.minder.toggleSelect(node); window.minder.toggleSelect(node);
window.minder.selectById(node.parent?.data?.id); window.minder.selectById(node.parent?.data?.id);
@ -826,7 +814,7 @@
* 生成脑图保存的入参 * 生成脑图保存的入参
*/ */
function makeMinderParams(fullJson: MinderJson) { function makeMinderParams(fullJson: MinderJson) {
filterTree(fullJson.root.children, (node, nodeIndex) => { filterTree(fullJson.root, (node, nodeIndex) => {
if (node.data.isNew) { if (node.data.isNew) {
tempMinderParams.value.editList.push({ tempMinderParams.value.editList.push({
...node.data, ...node.data,