chore: profile config

This commit is contained in:
jialin
2026-01-30 18:48:55 +08:00
parent 8f2eea70f6
commit 1a2e82f079
27 changed files with 730 additions and 231 deletions
@@ -0,0 +1,28 @@
import { exportJsonToExcel } from '@/utils/excel-reader';
const useExportData = (params: { columns: any[] }) => {
const { columns } = params;
const colIndexMap = columns.reduce(
(map, col) => {
if (col.dataIndex !== 'operations') {
map[col.dataIndex] = col.title;
}
return map;
},
{} as Record<string, any>
);
const exportData = (dataList: any[]) => {
const fileName = `benchmark.xlsx`;
exportJsonToExcel({
jsonData: dataList || [],
fileName: fileName,
fields: Object.keys(colIndexMap),
fieldLabels: colIndexMap,
formatMap: {}
});
};
return { exportData };
};
export default useExportData;