Files
qhmes/jeecgboot-vue3/src/views/xslmes/approval/integration/useTraceTable.ts
2026-06-09 17:52:33 +08:00

17 lines
685 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { useTable } from '/@/components/Table';
import type { BasicTableProps } from '/@/components/Table';
import { traceColumns } from './traceColumns';
/**
* 替换 useTable不经过 useListPage 的特殊场景):自动追加审批痕迹列(默认隐藏)。
* 普通列表页已由 useListPage 统一注入,无需使用本函数。
*/
export function useTraceTable(tableProps: BasicTableProps) {
const columns = tableProps.columns as any[] | undefined;
const alreadyHasTrace = columns?.some((c) => c.dataIndex === 'traceProofreadBy');
return useTable({
...tableProps,
columns: alreadyHasTrace ? columns : [...(columns ?? []), ...traceColumns],
});
}