feat(功能用例): 脑图根据表格字段排序

This commit is contained in:
baiqi 2024-11-04 11:00:16 +08:00 committed by Craftsman
parent 52b93b0b1d
commit 275703f0c9
3 changed files with 15 additions and 1 deletions

View File

@ -199,7 +199,12 @@ export function saveCaseMinder(data: FeatureCaseMinderUpdateParams) {
}
// 获取脑图
export function getCaseMinder(data: { projectId: string; moduleId: string; current: number }) {
export function getCaseMinder(data: {
projectId: string;
moduleId: string;
current: number;
sort?: Record<string, any>;
}) {
return MSR.post<CommonList<MinderJsonNode>>({ url: `${GetCaseMinderUrl}`, data });
}

View File

@ -141,6 +141,7 @@
moduleId: string;
moduleName: string;
modulesCount: Record<string, number>; //
tableSorter: Record<string, any>;
}>();
const emit = defineEmits<{
(e: 'save'): void;
@ -445,6 +446,7 @@
projectId: appStore.currentProjectId,
moduleId: data.id,
current: 1,
sort: props.tableSorter,
});
const fakeNode = node.children?.find((e) => e.data?.id === 'fakeNode'); //
if (fakeNode) {

View File

@ -64,6 +64,7 @@
@change="changeHandler"
@cell-click="handleCellClick"
@filter-change="filterChange"
@sorter-change="handleSorterChange"
>
<template #num="{ record }">
<span type="text" class="one-line-text cursor-pointer px-0 text-[rgb(var(--primary-5))]">
@ -239,6 +240,7 @@
:module-id="props.activeFolder"
:modules-count="modulesCount"
:module-name="props.moduleName"
:table-sorter="tableSorter"
@save="handleMinderSave"
/>
<MsDrawer v-model:visible="visible" :width="480" :mask="false">
@ -1809,6 +1811,11 @@
emitTableParams();
}
const tableSorter = ref<Record<string, string>>({});
function handleSorterChange(sorter: { [key: string]: string }) {
tableSorter.value = sorter;
}
async function mountedLoad() {
await initFilter();
await initData();