@dt-frames/ui 1.0.45 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,7 @@ import { ComputedRef, VNodeChild } from "vue";
|
|
|
3
3
|
import { FormSchema, FormProps } from "../../../forms/src/types/form.type";
|
|
4
4
|
export declare type CrudOptType = {
|
|
5
5
|
t?: string;
|
|
6
|
-
title?: string | ComputedRef;
|
|
6
|
+
title?: string | ComputedRef | Function;
|
|
7
7
|
width?: string | number;
|
|
8
8
|
schemas: FormSchema[];
|
|
9
9
|
footer?: VNodeChild | JSX.Element | ButtonProps[];
|
|
@@ -21,7 +21,7 @@ export declare function useSource(opt: SourceType): {
|
|
|
21
21
|
total: number;
|
|
22
22
|
}>;
|
|
23
23
|
onTableChange: (params: TableParamsType, needSearch?: boolean) => void;
|
|
24
|
-
onDownload: (excelData: DownloadType) => void;
|
|
24
|
+
onDownload: (excelData: DownloadType, extraData?: any[]) => void;
|
|
25
25
|
loading: Ref<boolean>;
|
|
26
26
|
};
|
|
27
27
|
curd: {
|
|
@@ -38,6 +38,6 @@ export declare function useSource(opt: SourceType): {
|
|
|
38
38
|
onDeletes: (ids: any) => void;
|
|
39
39
|
onUpdate: (model: Recordable) => Promise<unknown>;
|
|
40
40
|
onTableChange: (params: TableParamsType, needSearch?: boolean) => void;
|
|
41
|
-
onDownload: (excelData: DownloadType) => void;
|
|
41
|
+
onDownload: (excelData: DownloadType, extraData?: any[]) => void;
|
|
42
42
|
onSearch: (model?: Recordable) => void;
|
|
43
43
|
};
|
package/es/index.js
CHANGED
|
@@ -6841,7 +6841,7 @@ function useFetch(api, baseUrl = "") {
|
|
|
6841
6841
|
};
|
|
6842
6842
|
}
|
|
6843
6843
|
function useDownload(exportUrl, exportName) {
|
|
6844
|
-
function download(excelData) {
|
|
6844
|
+
function download(excelData, extraData = []) {
|
|
6845
6845
|
const { params: searchDTO, type, columns } = excelData;
|
|
6846
6846
|
switch (type) {
|
|
6847
6847
|
case "all":
|
|
@@ -6854,7 +6854,7 @@ function useDownload(exportUrl, exportName) {
|
|
|
6854
6854
|
break;
|
|
6855
6855
|
case "current":
|
|
6856
6856
|
case "select":
|
|
6857
|
-
handleDownloadPage(excelData, unref(exportName));
|
|
6857
|
+
handleDownloadPage(excelData, unref(exportName), extraData);
|
|
6858
6858
|
break;
|
|
6859
6859
|
}
|
|
6860
6860
|
}
|
|
@@ -6880,7 +6880,7 @@ function useDownload(exportUrl, exportName) {
|
|
|
6880
6880
|
return column;
|
|
6881
6881
|
});
|
|
6882
6882
|
}
|
|
6883
|
-
function handleDownloadPage({ columns = [], rows = [] }, exportName2 = "") {
|
|
6883
|
+
function handleDownloadPage({ columns = [], rows = [] }, exportName2 = "", extraData = []) {
|
|
6884
6884
|
const titles = columns.map((it) => it.title);
|
|
6885
6885
|
const content = rows.reduce((total, it) => {
|
|
6886
6886
|
const rowData = columns.map((column) => {
|
|
@@ -6910,7 +6910,7 @@ function useDownload(exportUrl, exportName) {
|
|
|
6910
6910
|
total.push(rowData);
|
|
6911
6911
|
return total;
|
|
6912
6912
|
}, []);
|
|
6913
|
-
export2Excel([titles].concat(content), exportName2);
|
|
6913
|
+
export2Excel([extraData, titles].concat(content), exportName2);
|
|
6914
6914
|
}
|
|
6915
6915
|
function export2Excel(data = [], exportName2 = "") {
|
|
6916
6916
|
const worksheet = xlsx.utils.aoa_to_sheet(data);
|
|
@@ -7074,11 +7074,11 @@ function useSource(opt) {
|
|
|
7074
7074
|
});
|
|
7075
7075
|
}
|
|
7076
7076
|
const { download } = useDownload(apiFul.export, exportName);
|
|
7077
|
-
function onDownload(excelData) {
|
|
7077
|
+
function onDownload(excelData, extraData = []) {
|
|
7078
7078
|
download({
|
|
7079
7079
|
...excelData,
|
|
7080
7080
|
params: baseData
|
|
7081
|
-
});
|
|
7081
|
+
}, extraData);
|
|
7082
7082
|
}
|
|
7083
7083
|
const form = {
|
|
7084
7084
|
onSearch,
|
|
@@ -7224,7 +7224,7 @@ function useCurd(curdOpt) {
|
|
|
7224
7224
|
t
|
|
7225
7225
|
} = useI18n("UI");
|
|
7226
7226
|
const actType = ref(null);
|
|
7227
|
-
const title = computed(() => unref(actType) + unref(curdOpt.title));
|
|
7227
|
+
const title = computed(() => isFunction(curdOpt.title) ? curdOpt.title() : unref(actType) + unref(curdOpt.title));
|
|
7228
7228
|
const DtCurdModal = () => {
|
|
7229
7229
|
return h(createVNode("div", {
|
|
7230
7230
|
"class": "curdModal"
|