cosey 0.2.9 → 0.2.10
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.
|
@@ -290,6 +290,8 @@ declare const _Table: {
|
|
|
290
290
|
reload: () => void;
|
|
291
291
|
expandAll: () => void;
|
|
292
292
|
collapseAll: () => void;
|
|
293
|
+
getFetchParams: () => Record<string, any>;
|
|
294
|
+
getFullFetchParams: () => Record<string, any>;
|
|
293
295
|
submit: () => Promise<any>;
|
|
294
296
|
validate: (callback?: import("element-plus").FormValidateCallback) => import("element-plus").FormValidationResult;
|
|
295
297
|
validateField: (props?: import("@vueuse/core").Arrayable<import("element-plus").FormItemProp>, callback?: import("element-plus").FormValidateCallback) => import("element-plus").FormValidationResult;
|
|
@@ -654,6 +656,8 @@ declare const _Table: {
|
|
|
654
656
|
reload: () => void;
|
|
655
657
|
expandAll: () => void;
|
|
656
658
|
collapseAll: () => void;
|
|
659
|
+
getFetchParams: () => Record<string, any>;
|
|
660
|
+
getFullFetchParams: () => Record<string, any>;
|
|
657
661
|
submit: () => Promise<any>;
|
|
658
662
|
validate: (callback?: import("element-plus").FormValidateCallback) => import("element-plus").FormValidationResult;
|
|
659
663
|
validateField: (props?: import("@vueuse/core").Arrayable<import("element-plus").FormItemProp>, callback?: import("element-plus").FormValidateCallback) => import("element-plus").FormValidationResult;
|
|
@@ -857,6 +861,8 @@ declare const _Table: {
|
|
|
857
861
|
reload: () => void;
|
|
858
862
|
expandAll: () => void;
|
|
859
863
|
collapseAll: () => void;
|
|
864
|
+
getFetchParams: () => Record<string, any>;
|
|
865
|
+
getFullFetchParams: () => Record<string, any>;
|
|
860
866
|
submit: () => Promise<any>;
|
|
861
867
|
validate: (callback?: import("element-plus").FormValidateCallback) => import("element-plus").FormValidationResult;
|
|
862
868
|
validateField: (props?: import("@vueuse/core").Arrayable<import("element-plus").FormItemProp>, callback?: import("element-plus").FormValidateCallback) => import("element-plus").FormValidationResult;
|
|
@@ -155,6 +155,8 @@ export interface TableCustomExpose {
|
|
|
155
155
|
reload: () => void;
|
|
156
156
|
expandAll: () => void;
|
|
157
157
|
collapseAll: () => void;
|
|
158
|
+
getFetchParams: () => Record<string, any>;
|
|
159
|
+
getFullFetchParams: () => Record<string, any>;
|
|
158
160
|
}
|
|
159
161
|
export type TableExpose = TableCustomExpose & TableQueryExpose & {
|
|
160
162
|
clearSelection: () => void;
|
|
@@ -133,6 +133,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
133
133
|
reload: () => void;
|
|
134
134
|
expandAll: () => void;
|
|
135
135
|
collapseAll: () => void;
|
|
136
|
+
getFetchParams: () => Record<string, any>;
|
|
137
|
+
getFullFetchParams: () => Record<string, any>;
|
|
136
138
|
submit: () => Promise<any>;
|
|
137
139
|
validate: (callback?: import("element-plus").FormValidateCallback) => import("element-plus").FormValidationResult;
|
|
138
140
|
validateField: (props?: import("@vueuse/core").Arrayable<import("element-plus").FormItemProp>, callback?: import("element-plus").FormValidateCallback) => import("element-plus").FormValidationResult;
|
|
@@ -106,19 +106,24 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
106
106
|
setRenderedColumns();
|
|
107
107
|
};
|
|
108
108
|
const tableData = ref(props.data || []);
|
|
109
|
-
const {
|
|
110
|
-
|
|
111
|
-
execute
|
|
112
|
-
} = useFetch(() => {
|
|
113
|
-
let params = {
|
|
114
|
-
[tableKeys.page]: page.value,
|
|
115
|
-
[tableKeys.pageSize]: pageSize.value,
|
|
109
|
+
const getFetchParams = () => {
|
|
110
|
+
const params = {
|
|
116
111
|
...orderParams,
|
|
117
112
|
...filterEmptyFormValue(tableQueryRef.value?.getFieldsValue() || {})
|
|
118
113
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
return props.beforeFetch?.(params) || params;
|
|
115
|
+
};
|
|
116
|
+
const getFullFetchParams = () => {
|
|
117
|
+
return {
|
|
118
|
+
[tableKeys.page]: page.value,
|
|
119
|
+
[tableKeys.pageSize]: pageSize.value,
|
|
120
|
+
...getFetchParams()
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const {
|
|
124
|
+
isFetching,
|
|
125
|
+
execute
|
|
126
|
+
} = useFetch(() => props.api?.(getFullFetchParams()), {
|
|
122
127
|
immediate: false,
|
|
123
128
|
onSuccess(res) {
|
|
124
129
|
res = props.afterFetch?.(res) || res;
|
|
@@ -214,7 +219,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
214
219
|
const expose = createMergedExpose(tableExposeKeys, () => elTableRef.value, {
|
|
215
220
|
reload,
|
|
216
221
|
expandAll,
|
|
217
|
-
collapseAll
|
|
222
|
+
collapseAll,
|
|
223
|
+
getFetchParams,
|
|
224
|
+
getFullFetchParams
|
|
218
225
|
}, () => tableQueryRef.value);
|
|
219
226
|
watch(() => props.getExpose, () => {
|
|
220
227
|
props.getExpose?.(expose);
|