@aplus-frontend/ui 6.26.5 → 6.28.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/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/es/src/ag-grid/hooks/use-columns-def.mjs +29 -29
- package/es/src/ag-grid/hooks/use-columns.d.ts +3 -2
- package/es/src/ag-grid/hooks/use-columns.mjs +16 -12
- package/es/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
- package/es/src/ag-grid/hooks/use-pinned-row.mjs +32 -0
- package/es/src/ag-grid/hooks/use-selection-col-def.d.ts +5 -0
- package/es/src/ag-grid/hooks/use-selection-col-def.mjs +34 -0
- package/es/src/ag-grid/index.vue.mjs +240 -227
- package/es/src/ag-grid/interface.d.ts +10 -7
- package/es/src/ag-grid/theme.mjs +6 -5
- package/es/src/ap-form/ap-form.vue.d.ts +2 -8
- package/es/src/ap-form/ap-form.vue2.mjs +3 -3
- package/es/src/ap-form/hooks/use-watch.mjs +25 -28
- package/es/src/ap-form/interface.d.ts +1 -1
- package/es/src/ap-grid/interface.d.ts +1 -1
- package/es/src/ap-modal/utils/createModal.mjs +14 -14
- package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
- package/es/src/ap-upload/apUpload.vue.mjs +38 -34
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +59 -59
- package/es/src/ap-upload/components/Picture.vue2.mjs +74 -74
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +95 -95
- package/es/src/business/ap-value-select-card/index.vue2.mjs +120 -123
- package/es/src/business/hooks/usePageListAgGrid.d.ts +1 -1
- package/es/src/business/hooks/usePageListAgGrid.mjs +4 -4
- package/es/src/business/hooks/usePageListApGrid.mjs +14 -14
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns.d.ts +3 -2
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
- package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -0
- package/lib/src/ag-grid/hooks/use-selection-col-def.d.ts +5 -0
- package/lib/src/ag-grid/hooks/use-selection-col-def.js +1 -0
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +10 -7
- package/lib/src/ag-grid/theme.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -8
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/hooks/use-watch.js +1 -1
- package/lib/src/ap-form/interface.d.ts +1 -1
- package/lib/src/ap-grid/interface.d.ts +1 -1
- package/lib/src/ap-modal/utils/createModal.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
- package/lib/src/business/hooks/usePageListAgGrid.d.ts +1 -1
- package/lib/src/business/hooks/usePageListAgGrid.js +1 -1
- package/lib/src/business/hooks/usePageListApGrid.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ap-value-select-card/index.css +3 -4
- package/theme/ap-value-select-card/index.less +3 -4
- package/theme/index.css +3 -4
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { Spin as
|
|
5
|
-
import { isUndefined as
|
|
1
|
+
import { defineComponent as We, useSlots as je, ref as b, toRef as B, unref as t, computed as l, nextTick as Le, watch as P, createElementBlock as z, openBlock as h, normalizeStyle as E, normalizeClass as u, createCommentVNode as Q, createElementVNode as v, createVNode as I, mergeProps as V, createSlots as Ge, withCtx as X, Fragment as He, renderList as Ue, createBlock as Y, resolveDynamicComponent as $e, renderSlot as Z, withDirectives as qe, vShow as Je } from "vue";
|
|
2
|
+
import { AgGridVue as Qe } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as Xe, AllCommunityModule as Ye } from "ag-grid-community";
|
|
4
|
+
import { Spin as Ze, Pagination as _e } from "@aplus-frontend/antdv";
|
|
5
|
+
import { isUndefined as C, isFunction as eo } from "lodash-unified";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { ApForm as
|
|
8
|
-
import { recursionApColumns as
|
|
9
|
-
import { useTablePaging as
|
|
10
|
-
import
|
|
11
|
-
import { useProvideSorter as
|
|
12
|
-
import { useProvideApTable as
|
|
13
|
-
import { sizeReverseMap as
|
|
14
|
-
import { useToken as
|
|
15
|
-
import { useTheme as
|
|
16
|
-
import { useColumns as
|
|
17
|
-
import { useColumnsDef as
|
|
18
|
-
import { isDef as
|
|
19
|
-
import { getValidVNodeList as
|
|
20
|
-
import { useSearchForm as
|
|
7
|
+
import { ApForm as oo } from "../ap-form/index.mjs";
|
|
8
|
+
import { recursionApColumns as to } from "../ap-table/utils.mjs";
|
|
9
|
+
import { useTablePaging as ro } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
10
|
+
import ao from "./hooks/use-row-selection.mjs";
|
|
11
|
+
import { useProvideSorter as no } from "./context.mjs";
|
|
12
|
+
import { useProvideApTable as lo } from "../ap-table/context.mjs";
|
|
13
|
+
import { sizeReverseMap as so, sizeMap as io } from "../ap-grid/constants.mjs";
|
|
14
|
+
import { useToken as co } from "@aplus-frontend/antdv/es/theme/internal";
|
|
15
|
+
import { useTheme as uo } from "./theme.mjs";
|
|
16
|
+
import { useColumns as mo } from "./hooks/use-columns.mjs";
|
|
17
|
+
import { useColumnsDef as po } from "./hooks/use-columns-def.mjs";
|
|
18
|
+
import { isDef as fo } from "../utils/index.mjs";
|
|
19
|
+
import { getValidVNodeList as So } from "../utils/slot.mjs";
|
|
20
|
+
import { useSearchForm as go } from "./hooks/use-search-form.mjs";
|
|
21
21
|
import "./components/empty/index.vue.mjs";
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
|
|
22
|
+
import wo from "./hooks/use-virtual-config.mjs";
|
|
23
|
+
import { usePinnedRow as yo } from "./hooks/use-pinned-row.mjs";
|
|
24
|
+
import ho from "./hooks/use-selection-col-def.mjs";
|
|
25
|
+
import { useNamespace as vo } from "../config-provider/hooks/use-namespace.mjs";
|
|
26
|
+
import Co from "./components/empty/index.vue2.mjs";
|
|
27
|
+
const Jo = /* @__PURE__ */ We({
|
|
26
28
|
name: "AgGrid",
|
|
27
29
|
__name: "index",
|
|
28
30
|
props: {
|
|
@@ -92,58 +94,65 @@ const jo = /* @__PURE__ */ Ae({
|
|
|
92
94
|
onScrollEnd: {}
|
|
93
95
|
},
|
|
94
96
|
setup(_, { expose: ee }) {
|
|
95
|
-
|
|
96
|
-
const o = _, A =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
Xe.registerModules([Ye]);
|
|
98
|
+
const o = _, A = je();
|
|
99
|
+
function oe(...e) {
|
|
100
|
+
return e.reduce((r, a) => ({ ...r, ...a }), {});
|
|
101
|
+
}
|
|
102
|
+
const { e: R, b: i, be: te } = vo("ag-grid"), y = b(o.size), re = uo(y, B(o, "rowHeight")), ae = wo(B(o, "virtual")), { rowPinnedGridConfig: ne, getRowPinnedCellClass: le } = yo(
|
|
103
|
+
B(o, "summary")
|
|
104
|
+
), d = b(), [, se] = co();
|
|
105
|
+
let m = !!o.dataSource;
|
|
106
|
+
const N = go(o), { shownColumns: p, columns: M, columnKeys: ie } = mo(o), { defaultColDef: de, columnDefs: ce } = po(
|
|
107
|
+
M,
|
|
108
|
+
o,
|
|
109
|
+
le
|
|
110
|
+
), F = b({});
|
|
111
|
+
no({
|
|
112
|
+
sorter: F,
|
|
104
113
|
setSorter(e) {
|
|
105
|
-
|
|
114
|
+
F.value = e;
|
|
106
115
|
}
|
|
107
116
|
});
|
|
108
|
-
const
|
|
117
|
+
const ue = {
|
|
109
118
|
asc: "ascend",
|
|
110
119
|
desc: "descend"
|
|
111
120
|
};
|
|
112
|
-
function
|
|
113
|
-
const e = d.value.getColumns()?.filter((
|
|
121
|
+
function me() {
|
|
122
|
+
const e = d.value.getColumns()?.filter((s) => s.getSort() !== void 0), r = t(F) || {};
|
|
114
123
|
let a = e?.[0];
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
|
|
124
|
+
const c = Object.keys(r);
|
|
125
|
+
if (c.length && c.every((s) => r[s] === null)) {
|
|
126
|
+
const s = Object.keys(r)[0];
|
|
127
|
+
s && (a = d.value?.getColumn(s));
|
|
119
128
|
}
|
|
120
129
|
if (!a)
|
|
121
130
|
return;
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
column:
|
|
125
|
-
field:
|
|
126
|
-
order:
|
|
131
|
+
const w = a.getColDef(), n = a.getSort();
|
|
132
|
+
W(void 0, void 0, {
|
|
133
|
+
column: w,
|
|
134
|
+
field: w.field,
|
|
135
|
+
order: n ? ue[n] : null
|
|
127
136
|
});
|
|
128
137
|
}
|
|
129
|
-
const
|
|
138
|
+
const pe = l(() => to(t(p), (e) => {
|
|
130
139
|
if (e.sorter === !0)
|
|
131
140
|
return e.key || e.dataIndex;
|
|
132
|
-
}).filter(Boolean)),
|
|
133
|
-
formRef:
|
|
134
|
-
submit:
|
|
135
|
-
reset:
|
|
136
|
-
data:
|
|
137
|
-
tableProps:
|
|
138
|
-
handleTableChangeOptional:
|
|
139
|
-
submitWith:
|
|
140
|
-
refresh:
|
|
141
|
-
getPaging:
|
|
142
|
-
setPaging:
|
|
143
|
-
setDataSource:
|
|
144
|
-
} =
|
|
141
|
+
}).filter(Boolean)), fe = l(() => fo(o.manual) ? o.manual : So(A.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
|
|
142
|
+
formRef: f,
|
|
143
|
+
submit: k,
|
|
144
|
+
reset: x,
|
|
145
|
+
data: S,
|
|
146
|
+
tableProps: O,
|
|
147
|
+
handleTableChangeOptional: W,
|
|
148
|
+
submitWith: j,
|
|
149
|
+
refresh: L,
|
|
150
|
+
getPaging: Se,
|
|
151
|
+
setPaging: ge,
|
|
152
|
+
setDataSource: we
|
|
153
|
+
} = ro({
|
|
145
154
|
async request(e) {
|
|
146
|
-
if (
|
|
155
|
+
if (m = !1, !ve.value && C(o.dataSource) && K(), !C(o.dataSource)) {
|
|
147
156
|
const a = e.pageSize * (e.current - 1);
|
|
148
157
|
return {
|
|
149
158
|
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(a, a + e.pageSize)) || [],
|
|
@@ -158,210 +167,217 @@ const jo = /* @__PURE__ */ Ae({
|
|
|
158
167
|
},
|
|
159
168
|
namespace: "ap-grid",
|
|
160
169
|
filterFields: b([]),
|
|
161
|
-
params:
|
|
170
|
+
params: B(o, "params"),
|
|
162
171
|
defaultData: o.defaultData,
|
|
163
|
-
manual: t(
|
|
172
|
+
manual: t(fe),
|
|
164
173
|
formatParams: o.beforeSearchSubmit,
|
|
165
174
|
pagination: o.pagination,
|
|
166
|
-
sortFields:
|
|
167
|
-
}),
|
|
168
|
-
() =>
|
|
169
|
-
),
|
|
175
|
+
sortFields: pe
|
|
176
|
+
}), ye = ho(o, p), he = l(
|
|
177
|
+
() => C(o.dataSource) ? S.records : o.dataSource
|
|
178
|
+
), ve = l(() => {
|
|
170
179
|
const e = o.rowSelection === !0 ? {} : o.rowSelection;
|
|
171
180
|
return e ? e.preserveSelectedRowKeys !== !1 : !1;
|
|
172
181
|
}), {
|
|
173
|
-
select:
|
|
174
|
-
unSelect:
|
|
175
|
-
selectedRows:
|
|
176
|
-
selectedRowKeys:
|
|
177
|
-
clearAll:
|
|
178
|
-
selectMultiByKeys:
|
|
179
|
-
} =
|
|
182
|
+
select: Ce,
|
|
183
|
+
unSelect: Re,
|
|
184
|
+
selectedRows: T,
|
|
185
|
+
selectedRowKeys: be,
|
|
186
|
+
clearAll: Be,
|
|
187
|
+
selectMultiByKeys: Fe
|
|
188
|
+
} = ao({
|
|
180
189
|
...o.rowSelection === !0 ? {} : o.rowSelection,
|
|
181
|
-
dataSource:
|
|
190
|
+
dataSource: he,
|
|
182
191
|
rowKey: o.rowKey
|
|
183
|
-
}),
|
|
192
|
+
}), ke = {
|
|
184
193
|
checkbox: "multiRow",
|
|
185
194
|
radio: "singleRow"
|
|
186
|
-
},
|
|
195
|
+
}, xe = l(() => {
|
|
187
196
|
if (!o.rowSelection)
|
|
188
197
|
return;
|
|
189
198
|
const { type: e = "checkbox", disabled: r } = o.rowSelection === !0 ? {} : o.rowSelection;
|
|
190
199
|
return {
|
|
191
|
-
mode:
|
|
200
|
+
mode: ke[e],
|
|
192
201
|
isRowSelectable: (a) => r ? !r(a.data) : !0
|
|
193
202
|
};
|
|
194
|
-
}), Re = n(() => {
|
|
195
|
-
if (!o.rowSelection)
|
|
196
|
-
return;
|
|
197
|
-
const e = o.rowSelection === !0 ? {} : o.rowSelection;
|
|
198
|
-
let r = e.fixed;
|
|
199
|
-
return r === void 0 && (r = s.value.some(
|
|
200
|
-
(a) => a.fixed === "left" || a.fixed === !0
|
|
201
|
-
) ? "left" : void 0), {
|
|
202
|
-
sortable: !1,
|
|
203
|
-
resizable: !1,
|
|
204
|
-
width: e.columnWidth || 60,
|
|
205
|
-
pinned: r
|
|
206
|
-
};
|
|
207
203
|
});
|
|
208
|
-
function
|
|
209
|
-
return
|
|
204
|
+
function D(e) {
|
|
205
|
+
return eo(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
210
206
|
}
|
|
211
|
-
const
|
|
207
|
+
const G = ({
|
|
212
208
|
api: e = d.value
|
|
213
209
|
}) => {
|
|
214
210
|
if (!o.rowSelection)
|
|
215
211
|
return;
|
|
216
|
-
const r =
|
|
212
|
+
const r = T.value;
|
|
217
213
|
if (!r.length) {
|
|
218
214
|
setTimeout(() => {
|
|
219
|
-
|
|
215
|
+
m = !0;
|
|
220
216
|
}, 0);
|
|
221
217
|
return;
|
|
222
218
|
}
|
|
223
|
-
|
|
219
|
+
m = !1;
|
|
224
220
|
const a = [];
|
|
225
|
-
e.forEachNode((
|
|
226
|
-
const
|
|
227
|
-
r.find((
|
|
221
|
+
e.forEachNode((c) => {
|
|
222
|
+
const g = c.data, w = D(g);
|
|
223
|
+
r.find((n) => D(n) === w) && a.push(c);
|
|
228
224
|
}), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
|
|
229
|
-
|
|
225
|
+
m = !0;
|
|
230
226
|
}, 0);
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
|
|
227
|
+
}, Te = (e) => {
|
|
228
|
+
m && (e.node.isSelected() ? Ce(e.data) : Re(e.data));
|
|
229
|
+
}, De = () => {
|
|
230
|
+
m = !0;
|
|
231
|
+
}, K = () => {
|
|
232
|
+
Be(), d.value?.deselectAll();
|
|
237
233
|
};
|
|
238
|
-
function
|
|
239
|
-
|
|
240
|
-
|
|
234
|
+
function Ke(e) {
|
|
235
|
+
Fe(e), Le(() => {
|
|
236
|
+
G({});
|
|
241
237
|
});
|
|
242
238
|
}
|
|
243
|
-
function
|
|
239
|
+
function H(e = !1) {
|
|
244
240
|
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
245
|
-
return
|
|
241
|
+
return f.value?.apForm?.[r]?.(!0);
|
|
246
242
|
}
|
|
247
|
-
function
|
|
248
|
-
|
|
243
|
+
function U(e) {
|
|
244
|
+
f.value?.apForm?.setFieldsValue?.(e);
|
|
249
245
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
246
|
+
function $() {
|
|
247
|
+
return f.value?.getSorterItems() || [];
|
|
252
248
|
}
|
|
253
|
-
function
|
|
254
|
-
|
|
249
|
+
function q(e) {
|
|
250
|
+
f.value?.setSorterItems(e);
|
|
255
251
|
}
|
|
256
|
-
function
|
|
257
|
-
|
|
252
|
+
function J() {
|
|
253
|
+
f.value?.resetSorterItems();
|
|
258
254
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
255
|
+
function Pe(e) {
|
|
256
|
+
const r = d.value;
|
|
257
|
+
if (!r)
|
|
258
|
+
return;
|
|
259
|
+
const a = r.getColumnState() || [], c = e.map((n) => n.key ? String(n.key) : n.key).filter(Boolean);
|
|
260
|
+
let g = !1;
|
|
261
|
+
const w = a.map((n) => {
|
|
262
|
+
if (!ie.value.includes(n.colId))
|
|
263
|
+
return n;
|
|
264
|
+
const s = !c.includes(n.colId);
|
|
265
|
+
return !g && s !== n.hide && (g = !0), {
|
|
266
|
+
...n,
|
|
267
|
+
hide: s
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
g && r.applyColumnState({
|
|
271
|
+
state: w,
|
|
272
|
+
applyOrder: !0
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
lo({
|
|
276
|
+
columns: l(() => p.value),
|
|
277
|
+
columnsBackup: l(() => M.value),
|
|
278
|
+
size: l(() => io[y.value]),
|
|
263
279
|
updateColumns(e) {
|
|
264
|
-
|
|
280
|
+
p.value = e, o.onShownColumnsChange?.(e), Pe(e);
|
|
265
281
|
},
|
|
266
282
|
updateSize(e) {
|
|
267
|
-
|
|
283
|
+
y.value = so[e];
|
|
268
284
|
},
|
|
269
|
-
renderConfig:
|
|
270
|
-
className:
|
|
271
|
-
color:
|
|
285
|
+
renderConfig: l(() => ({
|
|
286
|
+
className: te("table-header", "title"),
|
|
287
|
+
color: se.value.colorTextTertiary
|
|
272
288
|
})),
|
|
273
|
-
dataSource:
|
|
274
|
-
getSearchFormValues:
|
|
275
|
-
setSearchFormValues:
|
|
276
|
-
submit:
|
|
277
|
-
submitWith:
|
|
278
|
-
reset:
|
|
279
|
-
refresh:
|
|
280
|
-
getSearchFormSorterItems:
|
|
281
|
-
setSearchFormSorterItems:
|
|
282
|
-
resetSearchFormSorterItems:
|
|
289
|
+
dataSource: l(() => t(S).records),
|
|
290
|
+
getSearchFormValues: H,
|
|
291
|
+
setSearchFormValues: U,
|
|
292
|
+
submit: k,
|
|
293
|
+
submitWith: j,
|
|
294
|
+
reset: x,
|
|
295
|
+
refresh: L,
|
|
296
|
+
getSearchFormSorterItems: $,
|
|
297
|
+
setSearchFormSorterItems: q,
|
|
298
|
+
resetSearchFormSorterItems: J
|
|
283
299
|
});
|
|
284
|
-
const
|
|
285
|
-
() =>
|
|
286
|
-
),
|
|
287
|
-
|
|
288
|
-
o.card ? null :
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
].filter(Boolean)),
|
|
300
|
+
const ze = l(
|
|
301
|
+
() => C(o.loading) ? S.loading : o.loading
|
|
302
|
+
), Ee = l(() => [
|
|
303
|
+
i(),
|
|
304
|
+
o.card ? null : i("wrapper"),
|
|
305
|
+
i("adaptive"),
|
|
306
|
+
i(`size-${y.value}`)
|
|
307
|
+
].filter(Boolean)), Ie = l(() => ({
|
|
292
308
|
height: "100%",
|
|
293
309
|
...o.tableStyle || {}
|
|
294
|
-
})),
|
|
295
|
-
|
|
310
|
+
})), Ve = (e, r) => {
|
|
311
|
+
W({ current: e, pageSize: r });
|
|
296
312
|
};
|
|
297
|
-
function
|
|
313
|
+
function Ae(e) {
|
|
298
314
|
const r = e.data;
|
|
299
|
-
return
|
|
315
|
+
return D(r);
|
|
300
316
|
}
|
|
301
|
-
function
|
|
317
|
+
function Ne(e, r) {
|
|
302
318
|
d.value?.ensureIndexVisible(e, r);
|
|
303
319
|
}
|
|
304
|
-
function
|
|
320
|
+
function Me(e) {
|
|
305
321
|
o.onRowClicked?.(e.data);
|
|
306
322
|
}
|
|
307
|
-
function
|
|
323
|
+
function Oe(e) {
|
|
308
324
|
o.onScrollEnd?.(e.direction);
|
|
309
325
|
}
|
|
310
|
-
return
|
|
326
|
+
return P(
|
|
311
327
|
() => o.dataSource,
|
|
312
328
|
(e) => {
|
|
313
|
-
|
|
329
|
+
we(e);
|
|
314
330
|
},
|
|
315
331
|
{ immediate: !0, deep: !0 }
|
|
316
|
-
),
|
|
332
|
+
), P(
|
|
317
333
|
() => o.size,
|
|
318
334
|
(e) => {
|
|
319
|
-
|
|
335
|
+
y.value = e;
|
|
320
336
|
}
|
|
321
|
-
),
|
|
322
|
-
() => t(
|
|
337
|
+
), P(
|
|
338
|
+
() => t(S).loading,
|
|
323
339
|
(e) => {
|
|
324
340
|
o.onLoadingChange?.(e);
|
|
325
341
|
}
|
|
326
342
|
), ee({
|
|
327
|
-
submit:
|
|
328
|
-
reset:
|
|
329
|
-
refresh:
|
|
330
|
-
submitWith:
|
|
331
|
-
setSearchFormValues:
|
|
332
|
-
getSearchFormValues:
|
|
333
|
-
getShowColumns: () => t(
|
|
343
|
+
submit: k,
|
|
344
|
+
reset: x,
|
|
345
|
+
refresh: L,
|
|
346
|
+
submitWith: j,
|
|
347
|
+
setSearchFormValues: U,
|
|
348
|
+
getSearchFormValues: H,
|
|
349
|
+
getShowColumns: () => t(p),
|
|
334
350
|
rowSelection: {
|
|
335
|
-
selectedRows:
|
|
336
|
-
setSelectedRowKeys:
|
|
337
|
-
clearAll:
|
|
351
|
+
selectedRows: l(() => T.value),
|
|
352
|
+
setSelectedRowKeys: Ke,
|
|
353
|
+
clearAll: K
|
|
338
354
|
},
|
|
339
|
-
scrollToRow:
|
|
340
|
-
getDataSource: () => t(
|
|
341
|
-
getPaging:
|
|
342
|
-
setPaging:
|
|
343
|
-
getSearchFormSorterItems:
|
|
344
|
-
setSearchFormSorterItems:
|
|
345
|
-
resetSearchFormSorterItems:
|
|
346
|
-
}), (e, r) => (
|
|
347
|
-
class:
|
|
355
|
+
scrollToRow: Ne,
|
|
356
|
+
getDataSource: () => t(S.records),
|
|
357
|
+
getPaging: Se,
|
|
358
|
+
setPaging: ge,
|
|
359
|
+
getSearchFormSorterItems: $,
|
|
360
|
+
setSearchFormSorterItems: q,
|
|
361
|
+
resetSearchFormSorterItems: J
|
|
362
|
+
}), (e, r) => (h(), z("div", {
|
|
363
|
+
class: u(Ee.value),
|
|
348
364
|
style: E(e.wrapperStyle)
|
|
349
365
|
}, [
|
|
350
|
-
t(
|
|
366
|
+
t(C)(e.dataSource) && e.searchForm !== !1 && t(N).length > 0 ? (h(), z("div", {
|
|
351
367
|
key: 0,
|
|
352
|
-
class:
|
|
368
|
+
class: u(e.card ? t(R)("search-wrapper") : null),
|
|
353
369
|
style: E(e.searchFormWrapperStyle)
|
|
354
370
|
}, [
|
|
355
|
-
|
|
371
|
+
I(t(oo).SearchForm, V(e.searchForm || {}, {
|
|
356
372
|
ref_key: "formRef",
|
|
357
|
-
ref:
|
|
373
|
+
ref: f,
|
|
358
374
|
"custom-reset": "",
|
|
359
|
-
"submit-loading": t(
|
|
360
|
-
onSubmit: t(
|
|
361
|
-
onReset: t(
|
|
362
|
-
}),
|
|
375
|
+
"submit-loading": t(O).loading,
|
|
376
|
+
onSubmit: t(k),
|
|
377
|
+
onReset: t(x)
|
|
378
|
+
}), Ge({
|
|
363
379
|
default: X(() => [
|
|
364
|
-
(
|
|
380
|
+
(h(!0), z(He, null, Ue(t(N), (a) => (h(), Y($e(a.renderNode), {
|
|
365
381
|
key: a.dataIndex
|
|
366
382
|
}))), 128))
|
|
367
383
|
]),
|
|
@@ -376,68 +392,65 @@ const jo = /* @__PURE__ */ Ae({
|
|
|
376
392
|
} : void 0
|
|
377
393
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
378
394
|
], 6)) : Q("", !0),
|
|
379
|
-
|
|
380
|
-
class:
|
|
395
|
+
v("div", {
|
|
396
|
+
class: u([t(R)("table-wrapper"), e.card ? t(R)("table-wrapper-card") : null]),
|
|
381
397
|
style: E(e.tableWrapperStyle)
|
|
382
398
|
}, [
|
|
383
|
-
|
|
384
|
-
class:
|
|
399
|
+
v("div", {
|
|
400
|
+
class: u(t(i)("header-wrapper"))
|
|
385
401
|
}, [
|
|
386
402
|
Z(e.$slots, "title", {
|
|
387
|
-
selectedRows: t(
|
|
388
|
-
selectedRowKeys: t(
|
|
389
|
-
shownColumns: t(
|
|
390
|
-
clearAll:
|
|
403
|
+
selectedRows: t(T),
|
|
404
|
+
selectedRowKeys: t(be),
|
|
405
|
+
shownColumns: t(p),
|
|
406
|
+
clearAll: K
|
|
391
407
|
})
|
|
392
408
|
], 2),
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
class: i(t(l)("grid-wrapper"))
|
|
409
|
+
v("div", {
|
|
410
|
+
class: u(t(i)("grid-wrapper"))
|
|
396
411
|
}, [
|
|
397
|
-
|
|
398
|
-
style:
|
|
399
|
-
"row-data": t(
|
|
400
|
-
"column-defs": t(
|
|
401
|
-
"default-col-def": t(
|
|
412
|
+
I(t(Qe), V(oe(t(ae), t(ne)), {
|
|
413
|
+
style: Ie.value,
|
|
414
|
+
"row-data": t(S).records,
|
|
415
|
+
"column-defs": t(ce),
|
|
416
|
+
"default-col-def": t(de),
|
|
402
417
|
"suppress-loading-overlay": "",
|
|
403
|
-
"row-selection":
|
|
404
|
-
"selection-column-def":
|
|
405
|
-
"get-row-id":
|
|
406
|
-
|
|
407
|
-
"pinned-bottom-row-data": e.summary?.bottom,
|
|
408
|
-
theme: t(te),
|
|
418
|
+
"row-selection": xe.value,
|
|
419
|
+
"selection-column-def": t(ye),
|
|
420
|
+
"get-row-id": Ae,
|
|
421
|
+
theme: t(re),
|
|
409
422
|
"tooltip-show-delay": 500,
|
|
410
423
|
"enable-browser-tooltips": e.browserTooltips,
|
|
411
424
|
"tooltip-interaction": "",
|
|
412
|
-
"no-rows-overlay-component":
|
|
413
|
-
onSortChanged:
|
|
425
|
+
"no-rows-overlay-component": Co,
|
|
426
|
+
onSortChanged: me,
|
|
414
427
|
onGridReady: r[0] || (r[0] = (a) => d.value = a.api),
|
|
415
|
-
onRowDataUpdated:
|
|
416
|
-
onRowSelected:
|
|
417
|
-
onFirstDataRendered:
|
|
418
|
-
onRowClicked:
|
|
419
|
-
onBodyScrollEnd:
|
|
420
|
-
}), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "
|
|
421
|
-
|
|
422
|
-
class:
|
|
428
|
+
onRowDataUpdated: G,
|
|
429
|
+
onRowSelected: Te,
|
|
430
|
+
onFirstDataRendered: De,
|
|
431
|
+
onRowClicked: Me,
|
|
432
|
+
onBodyScrollEnd: Oe
|
|
433
|
+
}), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "theme", "enable-browser-tooltips"]),
|
|
434
|
+
qe(v("div", {
|
|
435
|
+
class: u(t(R)("table-loading-wrapper"))
|
|
423
436
|
}, [
|
|
424
|
-
|
|
437
|
+
I(t(Ze), { delay: 300 })
|
|
425
438
|
], 2), [
|
|
426
|
-
[
|
|
439
|
+
[Je, ze.value]
|
|
427
440
|
])
|
|
428
441
|
], 2),
|
|
429
|
-
|
|
430
|
-
class:
|
|
442
|
+
v("div", {
|
|
443
|
+
class: u(t(i)("pagination-wrapper"))
|
|
431
444
|
}, [
|
|
432
|
-
e.pagination !== !1 ? (
|
|
445
|
+
e.pagination !== !1 ? (h(), Y(t(_e), V({
|
|
433
446
|
key: 0,
|
|
434
|
-
class: t(
|
|
435
|
-
}, t(
|
|
447
|
+
class: t(i)("pagination")
|
|
448
|
+
}, t(O).pagination, { onChange: Ve }), null, 16, ["class"])) : Q("", !0)
|
|
436
449
|
], 2)
|
|
437
450
|
], 6)
|
|
438
451
|
], 6));
|
|
439
452
|
}
|
|
440
453
|
});
|
|
441
454
|
export {
|
|
442
|
-
|
|
455
|
+
Jo as default
|
|
443
456
|
};
|
|
@@ -4,10 +4,10 @@ import { TableProps } from '@aplus-frontend/antdv';
|
|
|
4
4
|
import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
|
|
5
5
|
import { Recordable } from '../type';
|
|
6
6
|
import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
|
|
7
|
-
import { ColDef, IRowNode, ScrollDirection } from 'ag-grid-community';
|
|
7
|
+
import { ColDef, IRowNode, RowPinnedType, ScrollDirection } from 'ag-grid-community';
|
|
8
8
|
import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
|
|
9
9
|
export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ExtraProColumnType<RecordType>, 'sorter' | 'rowSpan' | 'customCell' | 'customHeaderCell' | 'minWidth' | 'width' | 'maxWidth' | 'className' | 'class' | 'colSpan'> & {
|
|
10
|
-
children?: AgGridColumnType<RecordType, ExtraValueType, ValueType
|
|
10
|
+
children?: AgGridColumnType<RecordType, ExtraValueType, ValueType>[];
|
|
11
11
|
/**
|
|
12
12
|
* 表单项所占据的格子数(1-24格)
|
|
13
13
|
*/
|
|
@@ -111,6 +111,12 @@ export type AgGridVirtualConfig = {
|
|
|
111
111
|
col?: boolean;
|
|
112
112
|
rowBuffer?: number;
|
|
113
113
|
};
|
|
114
|
+
export type AgGridSummaryType<RecordType = any> = {
|
|
115
|
+
top?: RecordType[];
|
|
116
|
+
bottom?: RecordType[];
|
|
117
|
+
cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType) => string | string[]);
|
|
118
|
+
rowClassName?: string | string[] | ((data: RecordType, rowIndex: number, pinned: RowPinnedType) => string | string[]);
|
|
119
|
+
};
|
|
114
120
|
export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky'> & {
|
|
115
121
|
/**
|
|
116
122
|
* 列配置
|
|
@@ -208,12 +214,9 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
208
214
|
columnResizable?: boolean;
|
|
209
215
|
loading?: boolean;
|
|
210
216
|
/**
|
|
211
|
-
*
|
|
217
|
+
* 总结栏配置项
|
|
212
218
|
*/
|
|
213
|
-
summary?:
|
|
214
|
-
top?: RecordType[];
|
|
215
|
-
bottom?: RecordType[];
|
|
216
|
-
};
|
|
219
|
+
summary?: AgGridSummaryType<RecordType>;
|
|
217
220
|
/**
|
|
218
221
|
* 指定每一行占据的高度(大量数据展示时的性能优化)
|
|
219
222
|
*/
|