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