update:导出优化
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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, () => {
|
||||
|
||||
@@ -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, () => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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`);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user