@aplus-frontend/ui 0.4.34 → 0.5.0-beta.0
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.
- package/es/index.mjs +14 -12
- package/es/src/ap-grid/constants.d.ts +9 -0
- package/es/src/ap-grid/constants.mjs +12 -0
- package/es/src/ap-grid/hooks/use-inner-params.d.ts +10 -0
- package/es/src/ap-grid/hooks/use-inner-params.mjs +41 -0
- package/es/src/ap-grid/hooks/use-render-columns.d.ts +6 -0
- package/es/src/ap-grid/hooks/use-render-columns.mjs +29 -0
- package/es/src/ap-grid/index.d.ts +3 -0
- package/es/src/ap-grid/index.mjs +2 -0
- package/es/src/ap-grid/index.vue.mjs +399 -0
- package/es/src/ap-grid/index.vue2.mjs +4 -0
- package/es/src/ap-grid/interface.d.ts +279 -0
- package/es/src/ap-grid/interface.mjs +1 -0
- package/es/src/ap-grid/style/css.d.ts +0 -0
- package/es/src/ap-grid/style/css.js +1 -0
- package/es/src/ap-grid/style/index.d.ts +0 -0
- package/es/src/ap-grid/style/index.js +1 -0
- package/es/src/ap-grid/utils/col.d.ts +20 -0
- package/es/src/ap-grid/utils/col.mjs +106 -0
- package/es/src/ap-grid/utils/renderer.d.ts +3 -0
- package/es/src/ap-grid/utils/renderer.mjs +21 -0
- package/es/src/ap-grid/utils/table.d.ts +13 -0
- package/es/src/ap-grid/utils/table.mjs +64 -0
- package/es/src/ap-table/ap-table.vue.d.ts +2 -0
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +38 -38
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +9 -9
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +21 -21
- package/es/src/ap-table/components/setting/utils.d.ts +15 -3
- package/es/src/ap-table/components/setting/utils.mjs +49 -38
- package/es/src/ap-table/context.d.ts +2 -1
- package/es/src/ap-table/context.mjs +8 -7
- package/es/src/ap-table/hooks/use-table-column-state.mjs +79 -70
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +8 -2
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +43 -40
- package/es/src/ap-table/hooks/use-table-row-selection.d.ts +12 -0
- package/es/src/ap-table/hooks/use-table-row-selection.mjs +41 -27
- package/es/src/ap-table/interface.d.ts +4 -0
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +2 -0
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +2 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +2 -0
- package/es/src/business/ap-table-modal/index.d.ts +8 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +4 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +2 -0
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +244 -241
- package/es/src/path-map.mjs +2 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-grid/constants.d.ts +9 -0
- package/lib/src/ap-grid/constants.js +1 -0
- package/lib/src/ap-grid/hooks/use-inner-params.d.ts +10 -0
- package/lib/src/ap-grid/hooks/use-inner-params.js +1 -0
- package/lib/src/ap-grid/hooks/use-render-columns.d.ts +6 -0
- package/lib/src/ap-grid/hooks/use-render-columns.js +1 -0
- package/lib/src/ap-grid/index.d.ts +3 -0
- package/lib/src/ap-grid/index.js +1 -0
- package/lib/src/ap-grid/index.vue.js +1 -0
- package/lib/src/ap-grid/index.vue2.js +1 -0
- package/lib/src/ap-grid/interface.d.ts +279 -0
- package/lib/src/ap-grid/interface.js +1 -0
- package/lib/src/ap-grid/style/css.cjs +1 -0
- package/lib/src/ap-grid/style/css.d.ts +0 -0
- package/lib/src/ap-grid/style/index.cjs +1 -0
- package/lib/src/ap-grid/style/index.d.ts +0 -0
- package/lib/src/ap-grid/utils/col.d.ts +20 -0
- package/lib/src/ap-grid/utils/col.js +1 -0
- package/lib/src/ap-grid/utils/renderer.d.ts +3 -0
- package/lib/src/ap-grid/utils/renderer.js +1 -0
- package/lib/src/ap-grid/utils/table.d.ts +13 -0
- package/lib/src/ap-grid/utils/table.js +1 -0
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/utils.d.ts +15 -3
- package/lib/src/ap-table/components/setting/utils.js +1 -1
- package/lib/src/ap-table/context.d.ts +2 -1
- package/lib/src/ap-table/context.js +1 -1
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +8 -2
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/hooks/use-table-row-selection.d.ts +12 -0
- package/lib/src/ap-table/hooks/use-table-row-selection.js +1 -1
- package/lib/src/ap-table/interface.d.ts +4 -0
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +2 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +2 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +2 -0
- package/lib/src/business/ap-table-modal/index.d.ts +8 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +4 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +2 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/package.json +3 -1
- package/theme/ap-grid/index.css +302 -0
- package/theme/ap-grid/index.less +65 -0
- package/theme/index.css +51 -0
- package/theme/index.less +1 -0
package/es/index.mjs
CHANGED
|
@@ -113,12 +113,13 @@ import { default as Nt } from "./src/scroll-view/index.vue.mjs";
|
|
|
113
113
|
import { default as wt } from "./src/portal/index.vue.mjs";
|
|
114
114
|
import { default as Bt } from "./src/full-screen/index.vue.mjs";
|
|
115
115
|
import { default as Kt } from "./src/resize-observer/index.vue.mjs";
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
116
|
+
import { default as Ut } from "./src/ap-grid/index.vue.mjs";
|
|
117
|
+
import { useMessage as Vt } from "./src/hooks/useMessage.mjs";
|
|
118
|
+
import { useControllableValue as _t } from "./src/hooks/useControllableValue.mjs";
|
|
119
|
+
import { useManualRef as $t } from "./src/hooks/useManualRef.mjs";
|
|
120
|
+
import { useThrottleRef as qt } from "./src/hooks/useThrottleRef.mjs";
|
|
121
|
+
import { useFullScreen as Qt } from "./src/hooks/useFullScreen.mjs";
|
|
122
|
+
import { useResize as Yt } from "./src/hooks/useResize.mjs";
|
|
122
123
|
const a = {
|
|
123
124
|
install: (r) => {
|
|
124
125
|
for (const t in o) {
|
|
@@ -188,6 +189,7 @@ export {
|
|
|
188
189
|
ge as ApFormProvider,
|
|
189
190
|
de as ApFormSearchForm,
|
|
190
191
|
ce as ApFormSet,
|
|
192
|
+
Ut as ApGrid,
|
|
191
193
|
at as ApGroupSearch,
|
|
192
194
|
hr as ApImage,
|
|
193
195
|
ho as ApInfoLayout,
|
|
@@ -254,19 +256,19 @@ export {
|
|
|
254
256
|
l as pathMap,
|
|
255
257
|
F as provideGlobalConfig,
|
|
256
258
|
D as translate,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
+
_t as useControllableValue,
|
|
260
|
+
Qt as useFullScreen,
|
|
259
261
|
R as useGetDerivedNamespace,
|
|
260
262
|
I as useGlobalConfig,
|
|
261
263
|
g as useLocale,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
+
$t as useManualRef,
|
|
265
|
+
Vt as useMessage,
|
|
264
266
|
M as useNamespace,
|
|
265
267
|
Wr as usePageListApTable,
|
|
266
|
-
|
|
268
|
+
Yt as useResize,
|
|
267
269
|
or as useTableModal,
|
|
268
270
|
ct as useTablePaging,
|
|
269
271
|
Hr as useTableRefresh,
|
|
270
272
|
tr as useTableSelectModal,
|
|
271
|
-
|
|
273
|
+
qt as useThrottleRef
|
|
272
274
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApGridProps } from '../interface';
|
|
2
|
+
import { VxeTableEvents } from 'vxe-table';
|
|
3
|
+
/**
|
|
4
|
+
* 用于管理内部生成的查询参数(排序/筛选/分页等)
|
|
5
|
+
*/
|
|
6
|
+
export declare const useInnerParams: <RecordType>(tableChangeCallback: ApGridProps["onChange"]) => {
|
|
7
|
+
sortChangeEvent: VxeTableEvents.SortChange<RecordType>;
|
|
8
|
+
filterChangeEvent: VxeTableEvents.FilterChange<RecordType>;
|
|
9
|
+
paginationChangeEvent: (page: number, pageSize: number) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DEFAULT_PAGE_SIZE as g, DEFAULT_CURRENT as E } from "../../ap-table/hooks/use-table-paging-ng.mjs";
|
|
2
|
+
const a = {
|
|
3
|
+
asc: "ascend",
|
|
4
|
+
desc: "descend"
|
|
5
|
+
}, v = (o) => {
|
|
6
|
+
const t = {};
|
|
7
|
+
let c = {};
|
|
8
|
+
const s = {
|
|
9
|
+
current: E,
|
|
10
|
+
pageSize: g
|
|
11
|
+
};
|
|
12
|
+
function i(n) {
|
|
13
|
+
o == null || o(s, c, t, {
|
|
14
|
+
currentDataSource: [],
|
|
15
|
+
action: n
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
sortChangeEvent: ({
|
|
20
|
+
field: n,
|
|
21
|
+
order: e,
|
|
22
|
+
column: r
|
|
23
|
+
}) => {
|
|
24
|
+
t.column = r, t.order = e ? a[e] : null, t.field = n, i("sort");
|
|
25
|
+
},
|
|
26
|
+
filterChangeEvent: ({
|
|
27
|
+
filterList: n
|
|
28
|
+
}) => {
|
|
29
|
+
const e = {};
|
|
30
|
+
for (const r of n)
|
|
31
|
+
e[r.field] = r.values;
|
|
32
|
+
c = e, i("filter");
|
|
33
|
+
},
|
|
34
|
+
paginationChangeEvent: (n, e) => {
|
|
35
|
+
s.current = n, s.pageSize = e, i("paginate");
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
v as useInnerParams
|
|
41
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { ApGridColumnType } from '../interface';
|
|
3
|
+
export declare const useRenderColumns: <RecordType>(columns: Ref<ApGridColumnType<RecordType>[]>) => {
|
|
4
|
+
renderConfig: ComputedRef<import("vue/jsx-runtime").JSX.Element[]>;
|
|
5
|
+
updateSignal: Ref<number, number>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ref as a, watch as u, computed as m, unref as p } from "vue";
|
|
2
|
+
import { useToken as i } from "@aplus-frontend/antdv/es/theme/internal";
|
|
3
|
+
import "../../config-provider/index.mjs";
|
|
4
|
+
import { renderWithColumns as l } from "../utils/renderer.mjs";
|
|
5
|
+
import { useNamespace as s } from "../../config-provider/hooks/use-namespace.mjs";
|
|
6
|
+
import { useGlobalConfig as f } from "../../config-provider/hooks/use-global-config.mjs";
|
|
7
|
+
const w = (e) => {
|
|
8
|
+
const [, o] = i(), { be: t } = s("ap-grid"), n = f("valueTypeMap"), r = a(Date.now());
|
|
9
|
+
return u(
|
|
10
|
+
() => e.value,
|
|
11
|
+
() => {
|
|
12
|
+
r.value = Date.now();
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
deep: !0
|
|
16
|
+
}
|
|
17
|
+
), {
|
|
18
|
+
renderConfig: m(() => l(
|
|
19
|
+
e.value,
|
|
20
|
+
o.value.colorPrimary,
|
|
21
|
+
t("table-header", "title"),
|
|
22
|
+
p(n)
|
|
23
|
+
)),
|
|
24
|
+
updateSignal: r
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
w as useRenderColumns
|
|
29
|
+
};
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { defineComponent as ye, getCurrentInstance as Se, useSlots as we, ref as w, computed as l, unref as a, watchEffect as ve, watch as $, createElementBlock as v, openBlock as s, normalizeClass as b, createCommentVNode as R, createElementVNode as H, normalizeStyle as U, createVNode as be, mergeProps as c, createSlots as q, withCtx as f, Fragment as M, renderList as P, createBlock as u, resolveDynamicComponent as E, renderSlot as N, normalizeProps as Re, guardReactiveProps as xe } from "vue";
|
|
2
|
+
import { VxeTable as Fe, VxeColumn as G } from "vxe-table";
|
|
3
|
+
import ke from "vxe-pc-ui";
|
|
4
|
+
import "/Users/limoer/www/aplus/aplus-ui/node_modules/.pnpm/vxe-table@4.10.14_vue@3.5.13_typescript@5.7.3_/node_modules/vxe-table/lib/style.css";
|
|
5
|
+
import "/Users/limoer/www/aplus/aplus-ui/node_modules/.pnpm/vxe-pc-ui@4.3.95_vue@3.5.13_typescript@5.7.3_/node_modules/vxe-pc-ui/lib/style.css";
|
|
6
|
+
import { isUndefined as x, omit as Be } from "lodash-unified";
|
|
7
|
+
import { ApForm as Ie } from "../ap-form/index.mjs";
|
|
8
|
+
import "../config-provider/index.mjs";
|
|
9
|
+
import { noRenderAsFormItemValueList as Pe } from "../ap-table/constants.mjs";
|
|
10
|
+
import { getColumnOrder as X, updateFormProps as Ee, getFieldProps as Ne, getSearchFormItemRenderNode as ze, recursionApColumns as J } from "../ap-table/utils.mjs";
|
|
11
|
+
import { useTablePaging as Te } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
12
|
+
import { Pagination as Ve } from "@aplus-frontend/antdv";
|
|
13
|
+
import { useInnerParams as _e } from "./hooks/use-inner-params.mjs";
|
|
14
|
+
import { toVxeProps as Ae, getRowExpandProps as Oe, getRowSelectionProps as Le } from "./utils/table.mjs";
|
|
15
|
+
import De from "../ap-table/hooks/use-table-row-selection.mjs";
|
|
16
|
+
import { useProvideApTable as Ke } from "../ap-table/context.mjs";
|
|
17
|
+
import { sizeReverseMap as je, sizeMap as We } from "./constants.mjs";
|
|
18
|
+
import { useRenderColumns as $e } from "./hooks/use-render-columns.mjs";
|
|
19
|
+
import { useToken as He } from "@aplus-frontend/antdv/es/theme/internal";
|
|
20
|
+
import { useNamespace as Ue } from "../config-provider/hooks/use-namespace.mjs";
|
|
21
|
+
import { useGlobalConfig as qe } from "../config-provider/hooks/use-global-config.mjs";
|
|
22
|
+
const ga = /* @__PURE__ */ ye({
|
|
23
|
+
name: "ApGrid",
|
|
24
|
+
__name: "index",
|
|
25
|
+
props: {
|
|
26
|
+
dropdownPrefixCls: {},
|
|
27
|
+
loading: {
|
|
28
|
+
type: [Boolean, Object],
|
|
29
|
+
default: void 0
|
|
30
|
+
},
|
|
31
|
+
bordered: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: !1
|
|
34
|
+
},
|
|
35
|
+
locale: {},
|
|
36
|
+
onChange: {},
|
|
37
|
+
onResizeColumn: {},
|
|
38
|
+
getPopupContainer: {},
|
|
39
|
+
scroll: {},
|
|
40
|
+
sortDirections: {
|
|
41
|
+
default: () => ["ascend", "descend"]
|
|
42
|
+
},
|
|
43
|
+
showSorterTooltip: {
|
|
44
|
+
type: [Boolean, Object],
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
prefixCls: {},
|
|
48
|
+
tableLayout: {},
|
|
49
|
+
title: {},
|
|
50
|
+
id: {},
|
|
51
|
+
showHeader: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !0
|
|
54
|
+
},
|
|
55
|
+
components: {},
|
|
56
|
+
customRow: {},
|
|
57
|
+
customHeaderRow: {},
|
|
58
|
+
direction: {},
|
|
59
|
+
expandFixed: {
|
|
60
|
+
type: [String, Boolean],
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
expandColumnWidth: {},
|
|
64
|
+
expandedRowKeys: {},
|
|
65
|
+
defaultExpandedRowKeys: {},
|
|
66
|
+
expandedRowRender: {},
|
|
67
|
+
expandRowByClick: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: !1
|
|
70
|
+
},
|
|
71
|
+
expandIcon: {},
|
|
72
|
+
onExpand: {},
|
|
73
|
+
onExpandedRowsChange: {},
|
|
74
|
+
defaultExpandAllRows: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !1
|
|
77
|
+
},
|
|
78
|
+
indentSize: {
|
|
79
|
+
default: 15
|
|
80
|
+
},
|
|
81
|
+
expandIconColumnIndex: {},
|
|
82
|
+
showExpandColumn: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: !0
|
|
85
|
+
},
|
|
86
|
+
expandedRowClassName: {},
|
|
87
|
+
childrenColumnName: {
|
|
88
|
+
default: "children"
|
|
89
|
+
},
|
|
90
|
+
rowExpandable: {},
|
|
91
|
+
sticky: {
|
|
92
|
+
type: [Boolean, Object]
|
|
93
|
+
},
|
|
94
|
+
transformCellText: {},
|
|
95
|
+
rowClassName: {},
|
|
96
|
+
stripe: {
|
|
97
|
+
type: Boolean
|
|
98
|
+
},
|
|
99
|
+
headerRowClassName: {},
|
|
100
|
+
footerRowClassName: {},
|
|
101
|
+
cellClassName: {},
|
|
102
|
+
headerCellClassName: {},
|
|
103
|
+
footerCellClassName: {},
|
|
104
|
+
rowStyle: {},
|
|
105
|
+
headerRowStyle: {},
|
|
106
|
+
footerRowStyle: {},
|
|
107
|
+
cellStyle: {},
|
|
108
|
+
headerCellStyle: {},
|
|
109
|
+
footerCellStyle: {},
|
|
110
|
+
height: {},
|
|
111
|
+
minHeight: {},
|
|
112
|
+
maxHeight: {},
|
|
113
|
+
mergeCells: {},
|
|
114
|
+
mergeFooterItems: {},
|
|
115
|
+
cellConfig: {},
|
|
116
|
+
columns: {},
|
|
117
|
+
rowSelection: {
|
|
118
|
+
type: Boolean
|
|
119
|
+
},
|
|
120
|
+
card: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: !1
|
|
123
|
+
},
|
|
124
|
+
params: {},
|
|
125
|
+
request: {},
|
|
126
|
+
defaultData: {},
|
|
127
|
+
dataSource: {},
|
|
128
|
+
onLoadingChange: {},
|
|
129
|
+
searchForm: {
|
|
130
|
+
type: [Boolean, Object],
|
|
131
|
+
default: void 0
|
|
132
|
+
},
|
|
133
|
+
beforeSearchSubmit: {},
|
|
134
|
+
pagination: {
|
|
135
|
+
type: [Boolean, Object],
|
|
136
|
+
default: void 0
|
|
137
|
+
},
|
|
138
|
+
searchFormWrapperStyle: {},
|
|
139
|
+
tableWrapperStyle: {},
|
|
140
|
+
manual: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: !1
|
|
143
|
+
},
|
|
144
|
+
size: {
|
|
145
|
+
default: "medium"
|
|
146
|
+
},
|
|
147
|
+
adaptive: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
default: !1
|
|
150
|
+
},
|
|
151
|
+
columnResizable: {
|
|
152
|
+
type: [Boolean, Object],
|
|
153
|
+
default: !1
|
|
154
|
+
},
|
|
155
|
+
rowKey: {
|
|
156
|
+
default: "key"
|
|
157
|
+
},
|
|
158
|
+
footer: {},
|
|
159
|
+
virtual: {
|
|
160
|
+
type: [Boolean, Object],
|
|
161
|
+
default: void 0
|
|
162
|
+
},
|
|
163
|
+
expandable: {}
|
|
164
|
+
},
|
|
165
|
+
setup(Q, {
|
|
166
|
+
expose: Y
|
|
167
|
+
}) {
|
|
168
|
+
var W;
|
|
169
|
+
const m = (W = Se()) == null ? void 0 : W.appContext.app;
|
|
170
|
+
m && !m.__VXE_PC_UI_INSTALLED__ && (m.use(ke), m.__VXE_PC_UI_INSTALLED__ = !0);
|
|
171
|
+
const z = we(), o = Q, {
|
|
172
|
+
e: F,
|
|
173
|
+
b: g,
|
|
174
|
+
be: Z
|
|
175
|
+
} = Ue("ap-grid"), ee = qe("valueTypeMap"), d = w([]), T = w([]), h = w(), k = w(o.size), [, ae] = He(), {
|
|
176
|
+
renderConfig: oe,
|
|
177
|
+
updateSignal: te
|
|
178
|
+
} = $e(d);
|
|
179
|
+
let V = 0;
|
|
180
|
+
const _ = l(() => {
|
|
181
|
+
var e, n, r;
|
|
182
|
+
return V++, ((r = (n = (e = o.columns) == null ? void 0 : e.filter((t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !Pe.includes(t.valueType))) == null ? void 0 : n.sort((t, i) => {
|
|
183
|
+
let p = X(t.order);
|
|
184
|
+
return X(i.order) - p;
|
|
185
|
+
})) == null ? void 0 : r.map((t) => {
|
|
186
|
+
const i = Ee(t, Ne(t.fieldProps, {})), p = {
|
|
187
|
+
...t,
|
|
188
|
+
fieldProps: {
|
|
189
|
+
label: t.title,
|
|
190
|
+
name: t.dataIndex,
|
|
191
|
+
...i || {},
|
|
192
|
+
_signal: V
|
|
193
|
+
},
|
|
194
|
+
renderNode: void 0
|
|
195
|
+
};
|
|
196
|
+
return p.renderNode = ze(p, a(ee)), p;
|
|
197
|
+
})) || [];
|
|
198
|
+
}), re = l(() => [g(), o.card ? null : g("wrapper")].filter(Boolean)), A = l(() => J(a(d), (e) => {
|
|
199
|
+
if (e.sorter === !0)
|
|
200
|
+
return e.key || e.dataIndex;
|
|
201
|
+
}).filter(Boolean)), O = l(() => J(a(d), (e) => {
|
|
202
|
+
if (e.filters && !e.onFilter)
|
|
203
|
+
return e.key || e.dataIndex;
|
|
204
|
+
}).filter(Boolean)), {
|
|
205
|
+
formRef: B,
|
|
206
|
+
submit: L,
|
|
207
|
+
reset: D,
|
|
208
|
+
refresh: ne,
|
|
209
|
+
data: C,
|
|
210
|
+
tableProps: le,
|
|
211
|
+
setDataSource: se,
|
|
212
|
+
handleTableChange: de
|
|
213
|
+
} = Te({
|
|
214
|
+
async request(e) {
|
|
215
|
+
var r;
|
|
216
|
+
if (!S.value.preserveSelectedRowKeys && x(o.dataSource) && I(), !x(o.dataSource)) {
|
|
217
|
+
const t = e.pageSize * (e.current - 1);
|
|
218
|
+
return {
|
|
219
|
+
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(t, t + e.pageSize)) || [],
|
|
220
|
+
total: o.dataSource.length || 0
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const n = await ((r = o.request) == null ? void 0 : r.call(o, e));
|
|
224
|
+
return {
|
|
225
|
+
data: (n == null ? void 0 : n.data) || [],
|
|
226
|
+
total: (n == null ? void 0 : n.total) || 0
|
|
227
|
+
};
|
|
228
|
+
},
|
|
229
|
+
namespace: "ap-grid",
|
|
230
|
+
filterFields: O,
|
|
231
|
+
sortFields: A,
|
|
232
|
+
defaultParams: o.params,
|
|
233
|
+
defaultData: o.defaultData,
|
|
234
|
+
manual: o.manual,
|
|
235
|
+
formatParams: o.beforeSearchSubmit,
|
|
236
|
+
pagination: o.pagination
|
|
237
|
+
}), {
|
|
238
|
+
sortChangeEvent: ie,
|
|
239
|
+
filterChangeEvent: ue,
|
|
240
|
+
paginationChangeEvent: ce
|
|
241
|
+
} = _e(de);
|
|
242
|
+
Ke({
|
|
243
|
+
columns: l(() => d.value),
|
|
244
|
+
columnsBackup: l(() => T.value),
|
|
245
|
+
size: l(() => We[k.value]),
|
|
246
|
+
updateColumns(e) {
|
|
247
|
+
d.value = e;
|
|
248
|
+
},
|
|
249
|
+
updateSize(e) {
|
|
250
|
+
k.value = je[e];
|
|
251
|
+
},
|
|
252
|
+
renderConfig: l(() => ({
|
|
253
|
+
className: Z("table-header", "title"),
|
|
254
|
+
color: ae.value.colorPrimary
|
|
255
|
+
}))
|
|
256
|
+
});
|
|
257
|
+
const K = l(() => d.value.some((e) => e.fixed === "left" || e.fixed === !0) ? "left" : void 0), pe = l(() => x(o.dataSource) ? C.records : o.dataSource), {
|
|
258
|
+
selectedRows: y,
|
|
259
|
+
rowSelection: S,
|
|
260
|
+
...fe
|
|
261
|
+
} = De({
|
|
262
|
+
...o.rowSelection === !0 ? {} : o.rowSelection,
|
|
263
|
+
dataSource: pe,
|
|
264
|
+
rowKey: o.rowKey
|
|
265
|
+
}), j = () => {
|
|
266
|
+
const e = h.value;
|
|
267
|
+
e && (y.value = [...e.getCheckboxReserveRecords(), ...e.getCheckboxRecords()]);
|
|
268
|
+
}, me = () => {
|
|
269
|
+
const e = h.value;
|
|
270
|
+
e && (y.value = [e.getRadioRecord()]);
|
|
271
|
+
};
|
|
272
|
+
function ge() {
|
|
273
|
+
var e;
|
|
274
|
+
return ((e = o.columns) == null ? void 0 : e.filter((n) => !n.hideInTable)) || [];
|
|
275
|
+
}
|
|
276
|
+
function he(e) {
|
|
277
|
+
var n, r, t;
|
|
278
|
+
(t = (r = (n = B.value) == null ? void 0 : n.apForm) == null ? void 0 : r.setFieldsValue) == null || t.call(r, e);
|
|
279
|
+
}
|
|
280
|
+
function Ce(e = !1) {
|
|
281
|
+
var r, t, i;
|
|
282
|
+
const n = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
283
|
+
return (i = (t = (r = B.value) == null ? void 0 : r.apForm) == null ? void 0 : t[n]) == null ? void 0 : i.call(t, !0);
|
|
284
|
+
}
|
|
285
|
+
function I() {
|
|
286
|
+
fe.clearAll();
|
|
287
|
+
const e = h.value;
|
|
288
|
+
e && (S.value.type === "radio" ? (e.clearRadioRow(), e.clearRadioReserve()) : (e.clearCheckboxRow(), e.clearCheckboxReserve()));
|
|
289
|
+
}
|
|
290
|
+
return ve(() => {
|
|
291
|
+
const e = ge();
|
|
292
|
+
d.value = e, T.value = e;
|
|
293
|
+
}), $(() => o.dataSource, (e) => {
|
|
294
|
+
se(e);
|
|
295
|
+
}, {
|
|
296
|
+
immediate: !0
|
|
297
|
+
}), $(() => a(C).loading, (e) => {
|
|
298
|
+
var n;
|
|
299
|
+
(n = o.onLoadingChange) == null || n.call(o, e);
|
|
300
|
+
}), Y({
|
|
301
|
+
submit: L,
|
|
302
|
+
reset: D,
|
|
303
|
+
refresh: ne,
|
|
304
|
+
setSearchFormValues: he,
|
|
305
|
+
getSearchFormValues: Ce,
|
|
306
|
+
getShowColumns: () => a(d),
|
|
307
|
+
rowSelection: {
|
|
308
|
+
selectedRows: l(() => y.value),
|
|
309
|
+
clearAll: I
|
|
310
|
+
}
|
|
311
|
+
}), (e, n) => (s(), v("div", {
|
|
312
|
+
class: b(re.value)
|
|
313
|
+
}, [a(x)(e.dataSource) && e.searchForm !== !1 && _.value.length > 0 ? (s(), v("div", {
|
|
314
|
+
key: 0,
|
|
315
|
+
class: b(e.card ? a(F)("search-wrapper") : null),
|
|
316
|
+
style: U(e.searchFormWrapperStyle)
|
|
317
|
+
}, [be(a(Ie).SearchForm, c(e.searchForm || {}, {
|
|
318
|
+
ref_key: "formRef",
|
|
319
|
+
ref: B,
|
|
320
|
+
"custom-reset": "",
|
|
321
|
+
"submit-loading": !1,
|
|
322
|
+
onSubmit: a(L),
|
|
323
|
+
onReset: a(D)
|
|
324
|
+
}), q({
|
|
325
|
+
default: f(() => [(s(!0), v(M, null, P(_.value, (r) => (s(), u(E(r.renderNode.Comp), c({
|
|
326
|
+
key: r.dataIndex,
|
|
327
|
+
item: r,
|
|
328
|
+
ref_for: !0
|
|
329
|
+
}, r.fieldProps || {}, {
|
|
330
|
+
span: r.span,
|
|
331
|
+
"custom-render": r.renderNode.render
|
|
332
|
+
}), null, 16, ["item", "span", "custom-render"]))), 128))]),
|
|
333
|
+
_: 2
|
|
334
|
+
}, [z.searchFormExtra ? {
|
|
335
|
+
name: "extra",
|
|
336
|
+
fn: f(() => [N(e.$slots, "searchFormExtra")]),
|
|
337
|
+
key: "0"
|
|
338
|
+
} : void 0]), 1040, ["onSubmit", "onReset"])], 6)) : R("", !0), H("div", {
|
|
339
|
+
class: b([a(F)("table-wrapper"), e.card ? a(F)("table-wrapper-card") : null]),
|
|
340
|
+
style: U(e.tableWrapperStyle)
|
|
341
|
+
}, [H("div", {
|
|
342
|
+
class: b(a(g)("header-wrapper"))
|
|
343
|
+
}, [N(e.$slots, "title", {
|
|
344
|
+
selectedRows: a(y),
|
|
345
|
+
selectedRowKeys: a(S).selectedRowKeys,
|
|
346
|
+
shownColumns: d.value,
|
|
347
|
+
clearAll: I
|
|
348
|
+
})], 2), (s(), u(a(Fe), c(a(Ae)(o), {
|
|
349
|
+
ref_key: "tableRef",
|
|
350
|
+
ref: h,
|
|
351
|
+
key: a(te),
|
|
352
|
+
data: a(C).records,
|
|
353
|
+
"sort-config": {
|
|
354
|
+
remote: A.value.length > 0
|
|
355
|
+
},
|
|
356
|
+
"filter-config": {
|
|
357
|
+
remote: O.value.length > 0
|
|
358
|
+
},
|
|
359
|
+
loading: a(C).loading,
|
|
360
|
+
"row-config": {
|
|
361
|
+
isHover: !0,
|
|
362
|
+
keyField: o.rowKey
|
|
363
|
+
},
|
|
364
|
+
size: k.value,
|
|
365
|
+
onSortChange: a(ie),
|
|
366
|
+
onFilterChange: a(ue),
|
|
367
|
+
onCheckboxChange: j,
|
|
368
|
+
onCheckboxAll: j,
|
|
369
|
+
onRadioChange: me
|
|
370
|
+
}), q({
|
|
371
|
+
default: f(() => [o.expandable ? (s(), u(a(G), c({
|
|
372
|
+
key: 0
|
|
373
|
+
}, a(Oe)(e.expandable), {
|
|
374
|
+
fixed: K.value
|
|
375
|
+
}), {
|
|
376
|
+
content: f((r) => [(s(), u(E(o.expandable.renderContent(r))))]),
|
|
377
|
+
_: 1
|
|
378
|
+
}, 16, ["fixed"])) : R("", !0), o.rowSelection ? (s(), u(a(G), c({
|
|
379
|
+
key: 1
|
|
380
|
+
}, a(Le)(a(S)), {
|
|
381
|
+
fixed: K.value
|
|
382
|
+
}), null, 16, ["fixed"])) : R("", !0), (s(!0), v(M, null, P(a(oe), (r) => (s(), u(E(r), {
|
|
383
|
+
key: r.props.colId
|
|
384
|
+
}))), 128))]),
|
|
385
|
+
_: 2
|
|
386
|
+
}, [P(a(Be)(z, ["searchFormExtra"]), (r, t) => ({
|
|
387
|
+
name: t,
|
|
388
|
+
fn: f((i) => [N(e.$slots, t, Re(xe(i || {})))])
|
|
389
|
+
}))]), 1040, ["data", "sort-config", "filter-config", "loading", "row-config", "size", "onSortChange", "onFilterChange"])), e.pagination !== !1 ? (s(), u(a(Ve), c({
|
|
390
|
+
key: 0,
|
|
391
|
+
class: a(g)("pagination")
|
|
392
|
+
}, a(le).pagination, {
|
|
393
|
+
onChange: a(ce)
|
|
394
|
+
}), null, 16, ["class", "onChange"])) : R("", !0)], 6)], 2));
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
export {
|
|
398
|
+
ga as default
|
|
399
|
+
};
|