update:导出优化

This commit is contained in:
2025-11-25 17:01:57 +08:00
parent c72261ef2b
commit 7107e83bae
5 changed files with 12 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ localStorage.setItem('USER_INFO_DATA', $wujie?.props?.USER_INFO_DATA || '{"tenan
if ($wujie) {
// 路径跳转
$wujie.bus.$on('ROUTER_CHANGE', (data: any) => {
router.push({
router.replace({
path: data.path.split('/spdm')[1],
query: data.query,
});

View File

@@ -161,6 +161,7 @@ interface Props {
exportApi?: any;
exportFileName?: string;
exportDict?: any;
exportParams?: any;
render?: (data: any, cb: (cbData: any) => void) => void | undefined;
params?: any;
head?: any;
@@ -184,6 +185,7 @@ const props = withDefaults(defineProps<Props>(), {
exportApi: undefined,
exportFileName: '',
exportDict: {},
exportParams: {},
render: undefined,
params: () => {},
head: null,
@@ -410,7 +412,7 @@ const actionClickFun = (row: any, action: any) => {
};
const exportFun = () => {
exportFile(props.exportApi, props.tableName, props.exportFileName, {}, props.exportDict);
exportFile(props.exportApi, props.tableName, props.exportFileName, { ...searchData.value, ...props.exportParams }, props.exportDict);
};
watch(() => props.tableName, () => {

View File

@@ -183,6 +183,7 @@ interface Props {
exportApi?: any;
exportFileName?: string;
exportDict?: any;
exportParams?: any;
params?: any;
head?: any;
searchItems?: any[];
@@ -204,6 +205,7 @@ const props = withDefaults(defineProps<Props>(), {
exportApi: undefined,
exportFileName: '',
exportDict: {},
exportParams: {},
params: () => {},
head: null,
searchItems: () => [] as any[],
@@ -486,7 +488,7 @@ const actionClickFun = (row: any, action: any) => {
};
const exportFun = () => {
exportFile(props.exportApi, props.tableName, props.exportFileName, {}, props.exportDict);
exportFile(props.exportApi, props.tableName, props.exportFileName, props.exportParams, props.exportDict);
};
watch(() => props.tableName, () => {

View File

@@ -205,6 +205,7 @@ const removeFun = (index: any) => {
.name {
flex: 1;
color: var(--el-text-color-primary);
word-break: break-word;
}
.status {
color: var(--el-text-color-secondary);

View File

@@ -192,7 +192,10 @@ export const exportFile = (api: any, tableName: string, fileName: string, params
}
return val;
});
api(listData, `${dayjs().format('YYYYMMDDHHmmss')}_${fileName || tableName}.xlsx`);
api({
exportExcelFormatList: listData,
...params,
}, `${dayjs().format('YYYYMMDDHHmmss')}_${fileName || tableName}.xlsx`);
}
});
};