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 }); return MSR.post<CommonList<MinderJsonNode>>({ url: `${GetCaseMinderUrl}`, data });
} }

View File

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

View File

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