fix(脑图&表格): 测试计划脑图执行方式&表格取消全选
This commit is contained in:
parent
5ee624d593
commit
29ac3d47be
|
@ -340,8 +340,8 @@
|
|||
|
||||
if (data?.level === 1 || data?.level === 2) {
|
||||
canShowFloatMenu.value = true;
|
||||
if (data?.type === PlanMinderCollectionType.FUNCTIONAL) {
|
||||
// 功能用例分类没有执行方式
|
||||
if (data?.type === PlanMinderCollectionType.FUNCTIONAL || (data?.level === 2 && data?.extended === true)) {
|
||||
// 功能用例分类没有执行方式、继承上级配置的测试点节点不显示切换执行方式菜单
|
||||
canShowExecuteMethodMenu.value = false;
|
||||
} else {
|
||||
canShowExecuteMethodMenu.value = true;
|
||||
|
@ -474,7 +474,6 @@
|
|||
// 当前激活的测试点节点
|
||||
const activePlanSet = ref<PlanMinderNode>();
|
||||
|
||||
const currentPriority = ref<RunMode>(RunMode.SERIAL);
|
||||
// 优先级与串行/并行文本映射
|
||||
const priorityTextMap: Record<number, string> = {
|
||||
2: t('ms.minders.serial'),
|
||||
|
@ -493,18 +492,6 @@
|
|||
return data.priority === 2 ? RunMode.SERIAL : RunMode.PARALLEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理执行方式切换
|
||||
* @param val 执行方式
|
||||
*/
|
||||
function handleExecuteMethodMenuSelect(val: RunMode) {
|
||||
currentPriority.value = val;
|
||||
// 对节点执行优先级设置命令
|
||||
window.minder.execCommand('priority', priorityMap[val]);
|
||||
// 手动设置一次脑图的优先级 DOM 内容替换
|
||||
setCustomPriorityView(priorityTextMap);
|
||||
}
|
||||
|
||||
const configFormRef = ref<FormInstance>();
|
||||
const configForm = ref<PlanMinderNodeData>();
|
||||
const resourcePoolOptions = ref<SelectOptionData[]>();
|
||||
|
@ -563,6 +550,22 @@
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理执行方式切换
|
||||
* @param val 执行方式
|
||||
*/
|
||||
function handleExecuteMethodMenuSelect(val: RunMode) {
|
||||
// 对节点执行优先级设置命令
|
||||
window.minder.execCommand('priority', priorityMap[val]);
|
||||
// 手动设置一次脑图的优先级 DOM 内容替换
|
||||
setCustomPriorityView(priorityTextMap);
|
||||
const node: PlanMinderNode = window.minder.getSelectedNode();
|
||||
if (configForm.value?.id === node?.data.id) {
|
||||
// 更新表单的执行方式
|
||||
configForm.value.executeMethod = val;
|
||||
}
|
||||
}
|
||||
|
||||
const currentSelectCase = ref<CaseLinkEnum>(CaseLinkEnum.FUNCTIONAL);
|
||||
const caseAssociateVisible = ref<boolean>(false);
|
||||
|
||||
|
@ -782,7 +785,7 @@
|
|||
/**
|
||||
* 初始化测试规划脑图
|
||||
*/
|
||||
async function initMinder() {
|
||||
async function initMinder(firstInit = false) {
|
||||
try {
|
||||
loading.value = true;
|
||||
const res = await getPlanMinder(props.planId);
|
||||
|
@ -797,6 +800,7 @@
|
|||
return node;
|
||||
});
|
||||
window.minder.importJson(importJson.value);
|
||||
if (firstInit) {
|
||||
window.minder.execCommand('template', Object.keys(window.kityminder.Minder.getTemplateList())[3]);
|
||||
setTimeout(() => {
|
||||
// 初始化脑图完毕后,中心节点移动至左侧边缘
|
||||
|
@ -804,6 +808,7 @@
|
|||
position.x -= position.x - 40;
|
||||
window.minder.getViewDragger().moveTo(position);
|
||||
}, 200);
|
||||
}
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
@ -847,11 +852,11 @@
|
|||
loading.value = true;
|
||||
await editPlanMinder(makeMinderParams(fullJson));
|
||||
Message.success(t('common.saveSuccess'));
|
||||
emit('save');
|
||||
clearSelectedCases();
|
||||
handleConfigCancel();
|
||||
initMinder();
|
||||
callback();
|
||||
emit('save');
|
||||
initMinder(false);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
@ -901,7 +906,7 @@
|
|||
});
|
||||
|
||||
onMounted(() => {
|
||||
initMinder();
|
||||
initMinder(true);
|
||||
nextTick(() => {
|
||||
window.minder.on('contentchange', () => {
|
||||
// 异步执行,否则执行完,还会被重置
|
||||
|
|
|
@ -204,20 +204,24 @@
|
|||
importJson.value = fullJson;
|
||||
}
|
||||
emit('save', data, () => {
|
||||
importJson.value.root.children = mapTree<MinderJsonNode>(importJson.value.root.children || [], (node) => ({
|
||||
importJson.value.root.children = mapTree<MinderJsonNode>(
|
||||
importJson.value.root.children || [],
|
||||
(node, path, level) => ({
|
||||
...node,
|
||||
data: {
|
||||
...node.data,
|
||||
level,
|
||||
isNew: false,
|
||||
changed: false,
|
||||
},
|
||||
}));
|
||||
if (innerImportJson.value.treePath?.length > 1) {
|
||||
switchNode(innerImportJson.value.root.data);
|
||||
} else {
|
||||
innerImportJson.value = importJson.value;
|
||||
window.minder.importJson(importJson.value);
|
||||
}
|
||||
})
|
||||
);
|
||||
// if (innerImportJson.value.treePath?.length > 1) {
|
||||
// switchNode(innerImportJson.value.root.data);
|
||||
// } else {
|
||||
// innerImportJson.value = importJson.value;
|
||||
// window.minder.importJson(importJson.value);
|
||||
// }
|
||||
minderStore.setMinderUnsaved(false);
|
||||
floatMenuVisible.value = false;
|
||||
});
|
||||
|
|
|
@ -1,33 +1,34 @@
|
|||
export default {
|
||||
msTable: {
|
||||
current: 'Select Current Page',
|
||||
all: 'Select All Pages',
|
||||
current: 'Select current page',
|
||||
all: 'Select all pages',
|
||||
cancelAll: 'Deselect all pages',
|
||||
enable: 'Enable',
|
||||
disable: 'Disable',
|
||||
batch: {
|
||||
title: 'Batch Operation',
|
||||
title: 'Batch operation',
|
||||
selected: 'Selected {count} ',
|
||||
export: 'Export',
|
||||
edit: 'Edit',
|
||||
delete: 'Delete',
|
||||
moveTo: 'Move To',
|
||||
copyTo: 'Copy To',
|
||||
related: 'Related Requirements',
|
||||
generateDep: 'Generate Dependency',
|
||||
addPublic: 'Add to Public Case Library',
|
||||
moveTo: 'Move to',
|
||||
copyTo: 'Copy to',
|
||||
related: 'Related requirements',
|
||||
generateDep: 'Generate dependency',
|
||||
addPublic: 'Add to public case library',
|
||||
clear: 'clear',
|
||||
},
|
||||
columnSetting: {
|
||||
default: 'Default',
|
||||
display: 'Table Settings',
|
||||
mode: 'Mode Settings',
|
||||
display: 'Table settings',
|
||||
mode: 'Mode settings',
|
||||
drawer: 'Drawer',
|
||||
newWindow: 'New Window',
|
||||
header: 'Header Settings',
|
||||
resetDefault: 'Undo Changes',
|
||||
newWindow: 'New window',
|
||||
header: 'Header settings',
|
||||
resetDefault: 'Undo changes',
|
||||
nonSort: 'The above properties cannot be sorted',
|
||||
tooltipContentDrawer: 'Drawer: open a new page as a drawer',
|
||||
tooltipContentWindow: 'New Window: open a new page with a new page',
|
||||
tooltipContentWindow: 'New window: open a new page with a new page',
|
||||
pageSize: 'Number of items per page',
|
||||
showSubdirectoryTips: 'Show sub module resource',
|
||||
showSubdirectoryTips1: 'On: Show resources under the module and submodules.',
|
||||
|
@ -38,7 +39,7 @@ export default {
|
|||
modify: 'Modify{name}',
|
||||
nameIsNotNull: 'Name cannot be empty',
|
||||
nameIsExist: '{name} already exists',
|
||||
empty: 'No Content',
|
||||
empty: 'No content',
|
||||
loading: 'Loading, please wait',
|
||||
errorStatus: 'Failed to load data, please',
|
||||
retry: 'Retry',
|
||||
|
|
|
@ -2,6 +2,7 @@ export default {
|
|||
msTable: {
|
||||
current: '全选当前页',
|
||||
all: '全选所有页',
|
||||
cancelAll: '取消全选所有页',
|
||||
enable: '启用',
|
||||
disable: '禁用',
|
||||
batch: {
|
||||
|
|
|
@ -18,7 +18,10 @@
|
|||
</div>
|
||||
<template #content>
|
||||
<a-doption :value="SelectAllEnum.CURRENT">{{ t('msTable.current') }}</a-doption>
|
||||
<a-doption :value="SelectAllEnum.ALL">{{ t('msTable.all') }}</a-doption>
|
||||
<a-doption v-if="selectAllStatus === SelectAllEnum.ALL" :value="SelectAllEnum.CANCEL_ALL">
|
||||
{{ t('msTable.cancelAll') }}
|
||||
</a-doption>
|
||||
<a-doption v-else :value="SelectAllEnum.ALL">{{ t('msTable.all') }}</a-doption>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
|
|
|
@ -452,7 +452,10 @@ export default function useTableProps<T>(
|
|||
// 表格SelectAll change
|
||||
selectAllChange: (v: SelectAllEnum, onlyCurrent: boolean) => {
|
||||
const { data, rowKey, selectorStatus } = propsRes.value;
|
||||
if (v === SelectAllEnum.NONE) {
|
||||
if (v === SelectAllEnum.CANCEL_ALL) {
|
||||
// 清空全选
|
||||
resetSelector(true);
|
||||
} else if (v === SelectAllEnum.NONE) {
|
||||
// 清空选中项
|
||||
resetSelector(false);
|
||||
} else if (v === SelectAllEnum.CURRENT) {
|
||||
|
|
|
@ -109,6 +109,7 @@ export enum SpecialColumnEnum {
|
|||
|
||||
export enum SelectAllEnum {
|
||||
ALL = 'all',
|
||||
CANCEL_ALL = 'cancelAll',
|
||||
CURRENT = 'current',
|
||||
NONE = 'none',
|
||||
}
|
||||
|
|
|
@ -105,28 +105,32 @@
|
|||
<MsCard class="mt-[16px]" :special-height="174" simple has-breadcrumb no-content-padding>
|
||||
<Plan v-if="activeTab === 'plan'" :plan-id="planId" :status="detail.status || 'PREPARED'" @refresh="initDetail" />
|
||||
<FeatureCase
|
||||
v-if="activeTab === 'featureCase'"
|
||||
v-else-if="activeTab === 'featureCase'"
|
||||
ref="featureCaseRef"
|
||||
:tree-type="treeType"
|
||||
:can-edit="detail.status !== 'ARCHIVED'"
|
||||
@refresh="initDetail"
|
||||
/>
|
||||
<BugManagement v-if="activeTab === 'defectList'" :can-edit="detail.status !== 'ARCHIVED'" @refresh="initDetail" />
|
||||
<BugManagement
|
||||
v-else-if="activeTab === 'defectList'"
|
||||
:can-edit="detail.status !== 'ARCHIVED'"
|
||||
@refresh="initDetail"
|
||||
/>
|
||||
<ApiCase
|
||||
v-if="activeTab === 'apiCase'"
|
||||
v-else-if="activeTab === 'apiCase'"
|
||||
ref="apiCaseRef"
|
||||
:tree-type="treeType"
|
||||
:can-edit="detail.status !== 'ARCHIVED'"
|
||||
@refresh="initDetail"
|
||||
/>
|
||||
<ApiScenario
|
||||
v-if="activeTab === 'apiScenario'"
|
||||
v-else-if="activeTab === 'apiScenario'"
|
||||
ref="apiScenarioRef"
|
||||
:tree-type="treeType"
|
||||
:can-edit="detail.status !== 'ARCHIVED'"
|
||||
@refresh="initDetail"
|
||||
/>
|
||||
<ExecuteHistory v-if="activeTab === 'executeHistory'" />
|
||||
<ExecuteHistory v-else-if="activeTab === 'executeHistory'" />
|
||||
</MsCard>
|
||||
<CreateAndEditPlanDrawer
|
||||
v-model:visible="showPlanDrawer"
|
||||
|
|
Loading…
Reference in New Issue