@aplus-frontend/ui 6.33.0 → 6.35.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/components/tooltip/index.vue.d.ts +6 -0
- package/es/src/ag-grid/components/tooltip/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/tooltip/index.vue2.mjs +29 -0
- package/es/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-columns-def.mjs +94 -87
- package/es/src/ag-grid/hooks/use-selection-col-def.mjs +28 -22
- package/es/src/ag-grid/index.vue.mjs +164 -161
- package/es/src/ag-grid/interface.d.ts +5 -1
- package/es/src/ap-download/ap-download.vue.mjs +31 -25
- package/es/src/ap-form/ap-form.vue.d.ts +2 -6
- package/es/src/ap-form/ap-form.vue2.mjs +71 -69
- package/es/src/ap-grid/editable/form-item.vue.mjs +74 -71
- package/es/src/ap-grid/editable/index.vue.mjs +94 -91
- package/es/src/ap-grid/index.vue.mjs +74 -69
- package/es/src/ap-pro-card/components/statistic/index.vue.d.ts +1 -1
- package/es/src/ap-table/ap-table.vue2.mjs +72 -69
- package/es/src/ap-tag/ap-tag-group.vue.mjs +33 -30
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +103 -103
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +21 -18
- package/es/src/business/ap-attachment/ApAttachment.mjs +16 -15
- package/es/src/business/ap-copy/ApCopy.mjs +5 -6
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +176 -175
- package/es/src/business/ap-keep-alive/keeper/ap-view-keeper.mjs +4 -4
- package/es/src/business/ap-label/ApLabel.d.ts +1 -1
- package/es/src/business/ap-label/index.d.ts +3 -3
- package/es/src/business/hooks/usePageListApTable.mjs +10 -9
- package/es/src/editable-table/form-item.vue.mjs +75 -72
- package/es/src/editable-table/hooks/use-get-columns.mjs +35 -34
- package/es/src/editable-table/index.vue.mjs +68 -65
- package/es/src/utils/warning.d.ts +25 -0
- package/es/src/utils/warning.mjs +74 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/tooltip/index.vue.d.ts +6 -0
- package/lib/src/ag-grid/components/tooltip/index.vue.js +1 -0
- package/lib/src/ag-grid/components/tooltip/index.vue2.js +1 -0
- package/lib/src/ag-grid/hooks/use-columns-def.d.ts +1 -0
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-selection-col-def.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +5 -1
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -6
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-pro-card/components/statistic/index.vue.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-copy/ApCopy.js +1 -1
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-keep-alive/keeper/ap-view-keeper.js +1 -1
- package/lib/src/business/ap-label/ApLabel.d.ts +1 -1
- package/lib/src/business/ap-label/index.d.ts +3 -3
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/utils/warning.d.ts +25 -0
- package/lib/src/utils/warning.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ag-grid/index.css +5 -1
- package/theme/ag-grid/index.less +5 -1
- package/theme/index.css +5 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
import { Spin as
|
|
6
|
-
import { isUndefined as F, isFunction as
|
|
1
|
+
import { defineComponent as oo, useSlots as to, ref as I, toRef as T, unref as t, computed as l, nextTick as ro, watch as z, createElementBlock as A, openBlock as b, normalizeStyle as V, normalizeClass as m, createCommentVNode as ae, createElementVNode as B, createVNode as M, mergeProps as O, createSlots as ao, withCtx as ne, Fragment as no, renderList as lo, createBlock as le, resolveDynamicComponent as so, renderSlot as se, withDirectives as io, vShow as uo } from "vue";
|
|
2
|
+
import { AgGridVue as co } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as mo, AllCommunityModule as po } from "ag-grid-community";
|
|
4
|
+
import { mergeProps as fo } from "./utils.mjs";
|
|
5
|
+
import { Spin as go, Pagination as wo } from "@aplus-frontend/antdv";
|
|
6
|
+
import { isUndefined as F, isFunction as G } from "lodash-unified";
|
|
7
7
|
import "../config-provider/index.mjs";
|
|
8
|
-
import { ApForm as
|
|
9
|
-
import { recursionApColumns as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import
|
|
12
|
-
import { useProvideSorter as
|
|
13
|
-
import { useProvideApTable as
|
|
14
|
-
import { DEFAULT_ROW_SELECTION_CONFIG as ie, sizeReverseMap as
|
|
15
|
-
import { useToken as
|
|
16
|
-
import { useTheme as
|
|
17
|
-
import { useColumns as
|
|
18
|
-
import { useColumnsDef as
|
|
19
|
-
import { isDef as
|
|
20
|
-
import { getValidVNodeList as
|
|
21
|
-
import { useSearchForm as
|
|
8
|
+
import { ApForm as So } from "../ap-form/index.mjs";
|
|
9
|
+
import { recursionApColumns as yo } from "../ap-table/utils.mjs";
|
|
10
|
+
import { useTablePaging as Co } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import ho from "./hooks/use-row-selection.mjs";
|
|
12
|
+
import { useProvideSorter as vo } from "./context.mjs";
|
|
13
|
+
import { useProvideApTable as Ro } from "../ap-table/context.mjs";
|
|
14
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as ie, sizeReverseMap as bo, sizeMap as Bo } from "../ap-grid/constants.mjs";
|
|
15
|
+
import { useToken as Fo } from "@aplus-frontend/antdv/es/theme/internal";
|
|
16
|
+
import { useTheme as ko } from "./theme.mjs";
|
|
17
|
+
import { useColumns as xo } from "./hooks/use-columns.mjs";
|
|
18
|
+
import { useColumnsDef as Io } from "./hooks/use-columns-def.mjs";
|
|
19
|
+
import { isDef as To } from "../utils/index.mjs";
|
|
20
|
+
import { getValidVNodeList as No } from "../utils/slot.mjs";
|
|
21
|
+
import { useSearchForm as Do } from "./hooks/use-search-form.mjs";
|
|
22
22
|
import "./components/empty/index.vue.mjs";
|
|
23
|
-
import
|
|
24
|
-
import { usePinnedRow as
|
|
25
|
-
import
|
|
26
|
-
import { useNamespace as
|
|
27
|
-
import { useGlobalConfig as
|
|
28
|
-
import
|
|
29
|
-
const
|
|
23
|
+
import Eo from "./hooks/use-virtual-config.mjs";
|
|
24
|
+
import { usePinnedRow as Ko } from "./hooks/use-pinned-row.mjs";
|
|
25
|
+
import Po from "./hooks/use-selection-col-def.mjs";
|
|
26
|
+
import { useNamespace as zo } from "../config-provider/hooks/use-namespace.mjs";
|
|
27
|
+
import { useGlobalConfig as Ao } from "../config-provider/hooks/use-global-config.mjs";
|
|
28
|
+
import Vo from "./components/empty/index.vue2.mjs";
|
|
29
|
+
const mt = /* @__PURE__ */ oo({
|
|
30
30
|
name: "AgGrid",
|
|
31
31
|
__name: "index",
|
|
32
32
|
props: {
|
|
@@ -100,27 +100,23 @@ const ct = /* @__PURE__ */ eo({
|
|
|
100
100
|
onUpdate: {}
|
|
101
101
|
},
|
|
102
102
|
setup(de, { expose: ue }) {
|
|
103
|
-
|
|
104
|
-
const o = de,
|
|
103
|
+
mo.registerModules([po]);
|
|
104
|
+
const o = de, W = to(), { e: k, b: u, be: ce } = zo("ag-grid"), C = I(o.size), me = ko(C, T(o, "rowHeight")), pe = Eo(T(o, "virtual")), { rowPinnedGridConfig: H, getRowPinnedCellClass: fe } = Ko(
|
|
105
105
|
T(o, "summary")
|
|
106
|
-
), ge =
|
|
106
|
+
), ge = Ao("apGrid"), s = I(), [, we] = Fo();
|
|
107
107
|
let p = !!o.dataSource;
|
|
108
|
-
const L =
|
|
109
|
-
|
|
110
|
-
o,
|
|
111
|
-
fe
|
|
112
|
-
), x = I({});
|
|
113
|
-
ho({
|
|
108
|
+
const L = Do(o), { shownColumns: f, columns: U, columnKeys: Se, getTargetColumnByKey: ye } = xo(o), { defaultColDef: Ce, columnDefs: he, gridWrapperRef: ve } = Io(U, o, fe), x = I({});
|
|
109
|
+
vo({
|
|
114
110
|
sorter: x,
|
|
115
111
|
setSorter(e) {
|
|
116
112
|
x.value = e;
|
|
117
113
|
}
|
|
118
114
|
});
|
|
119
|
-
const
|
|
115
|
+
const Re = {
|
|
120
116
|
asc: "ascend",
|
|
121
117
|
desc: "descend"
|
|
122
118
|
};
|
|
123
|
-
function
|
|
119
|
+
function be() {
|
|
124
120
|
const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(x) || {};
|
|
125
121
|
let a = e?.[0];
|
|
126
122
|
const d = Object.keys(r);
|
|
@@ -130,38 +126,38 @@ const ct = /* @__PURE__ */ eo({
|
|
|
130
126
|
}
|
|
131
127
|
if (!a)
|
|
132
128
|
return;
|
|
133
|
-
const i = a.getColDef(),
|
|
134
|
-
|
|
129
|
+
const i = a.getColDef(), y = a.getSort(), v = ye(i.colId);
|
|
130
|
+
$(void 0, void 0, {
|
|
135
131
|
column: i,
|
|
136
132
|
field: v?.field ?? i.field ?? i.colId,
|
|
137
|
-
order:
|
|
133
|
+
order: y ? Re[y] : null
|
|
138
134
|
});
|
|
139
135
|
}
|
|
140
|
-
const
|
|
136
|
+
const Be = l(() => yo(t(f), (e) => {
|
|
141
137
|
if (e.sorter === !0)
|
|
142
138
|
return e.field ?? e.dataIndex ?? e.key;
|
|
143
|
-
}).filter(Boolean)),
|
|
139
|
+
}).filter(Boolean)), Fe = () => {
|
|
144
140
|
x.value = {};
|
|
145
141
|
const e = s.value;
|
|
146
142
|
if (!e)
|
|
147
143
|
return;
|
|
148
144
|
const r = e.getColumnState()?.map((a) => ({ ...a, sort: null }));
|
|
149
145
|
e.applyColumnState({ state: r });
|
|
150
|
-
},
|
|
146
|
+
}, ke = l(() => To(o.manual) ? o.manual : No(W.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
|
|
151
147
|
formRef: g,
|
|
152
148
|
submit: N,
|
|
153
149
|
reset: D,
|
|
154
150
|
data: w,
|
|
155
|
-
tableProps:
|
|
156
|
-
handleTableChangeOptional:
|
|
157
|
-
submitWith:
|
|
158
|
-
refresh:
|
|
159
|
-
getPaging:
|
|
160
|
-
setPaging:
|
|
161
|
-
setDataSource:
|
|
162
|
-
} =
|
|
151
|
+
tableProps: j,
|
|
152
|
+
handleTableChangeOptional: $,
|
|
153
|
+
submitWith: q,
|
|
154
|
+
refresh: J,
|
|
155
|
+
getPaging: xe,
|
|
156
|
+
setPaging: Ie,
|
|
157
|
+
setDataSource: Te
|
|
158
|
+
} = Co({
|
|
163
159
|
async request(e) {
|
|
164
|
-
if (p = !1,
|
|
160
|
+
if (p = !1, S.value && !S.value.preserveSelectedRowKeys && F(o.dataSource) && P(), !F(o.dataSource)) {
|
|
165
161
|
const a = e.pageSize * (e.current - 1);
|
|
166
162
|
return {
|
|
167
163
|
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(a, a + e.pageSize)) || [],
|
|
@@ -178,51 +174,51 @@ const ct = /* @__PURE__ */ eo({
|
|
|
178
174
|
filterFields: I([]),
|
|
179
175
|
params: T(o, "params"),
|
|
180
176
|
defaultData: o.defaultData,
|
|
181
|
-
manual: t(
|
|
177
|
+
manual: t(ke),
|
|
182
178
|
formatParams: o.beforeSearchSubmit,
|
|
183
179
|
pagination: o.pagination,
|
|
184
|
-
sortFields:
|
|
185
|
-
onClickReset:
|
|
186
|
-
}),
|
|
180
|
+
sortFields: Be,
|
|
181
|
+
onClickReset: Fe
|
|
182
|
+
}), S = l(() => {
|
|
187
183
|
const e = o.rowSelection || ge.value?.rowSelection;
|
|
188
184
|
if (e)
|
|
189
185
|
return e === !0 ? ie : {
|
|
190
186
|
...ie,
|
|
191
187
|
...e
|
|
192
188
|
};
|
|
193
|
-
}),
|
|
189
|
+
}), Ne = Po(o, f), De = l(
|
|
194
190
|
() => F(o.dataSource) ? w.records : o.dataSource
|
|
195
191
|
), {
|
|
196
|
-
select:
|
|
197
|
-
unSelect:
|
|
192
|
+
select: Ee,
|
|
193
|
+
unSelect: Ke,
|
|
198
194
|
selectedRows: E,
|
|
199
|
-
selectedRowKeys:
|
|
200
|
-
clearAll:
|
|
201
|
-
selectMultiByKeys:
|
|
202
|
-
} =
|
|
203
|
-
...
|
|
204
|
-
dataSource:
|
|
195
|
+
selectedRowKeys: Pe,
|
|
196
|
+
clearAll: ze,
|
|
197
|
+
selectMultiByKeys: Ae
|
|
198
|
+
} = ho({
|
|
199
|
+
...S,
|
|
200
|
+
dataSource: De,
|
|
205
201
|
rowKey: o.rowKey
|
|
206
|
-
}),
|
|
202
|
+
}), Ve = {
|
|
207
203
|
checkbox: "multiRow",
|
|
208
204
|
radio: "singleRow"
|
|
209
|
-
},
|
|
210
|
-
const e =
|
|
205
|
+
}, Me = l(() => {
|
|
206
|
+
const e = S.value;
|
|
211
207
|
if (!e)
|
|
212
208
|
return;
|
|
213
209
|
const { type: r = "checkbox", disabled: a } = e;
|
|
214
210
|
return {
|
|
215
|
-
mode:
|
|
211
|
+
mode: Ve[r],
|
|
216
212
|
isRowSelectable: (d) => a ? !a(d.data) : !0
|
|
217
213
|
};
|
|
218
214
|
});
|
|
219
215
|
function K(e) {
|
|
220
|
-
return
|
|
216
|
+
return G(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
221
217
|
}
|
|
222
|
-
const
|
|
218
|
+
const Q = ({
|
|
223
219
|
api: e = s.value
|
|
224
220
|
}) => {
|
|
225
|
-
if (o.onUpdate?.(), !
|
|
221
|
+
if (o.onUpdate?.(), !S.value)
|
|
226
222
|
return;
|
|
227
223
|
const r = E.value;
|
|
228
224
|
if (!r.length) {
|
|
@@ -235,39 +231,44 @@ const ct = /* @__PURE__ */ eo({
|
|
|
235
231
|
const a = [];
|
|
236
232
|
e.forEachNode((d) => {
|
|
237
233
|
const h = d.data, i = K(h);
|
|
238
|
-
r.find((
|
|
234
|
+
r.find((y) => K(y) === i) && a.push(d);
|
|
239
235
|
}), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
|
|
240
236
|
p = !0;
|
|
241
237
|
}, 0);
|
|
242
|
-
},
|
|
243
|
-
p && (e.node.isSelected() ?
|
|
244
|
-
|
|
238
|
+
}, Oe = (e) => {
|
|
239
|
+
p && (e.node.isSelected() ? Ee(e.data) : Ke(e.data), G(S.value?.tooltip) && e.api.refreshCells({
|
|
240
|
+
rowNodes: [e.node],
|
|
241
|
+
// todo: 取消硬编码
|
|
242
|
+
columns: ["ag-Grid-SelectionColumn"],
|
|
243
|
+
force: !0
|
|
244
|
+
}));
|
|
245
|
+
}, Ge = () => {
|
|
245
246
|
p = !0;
|
|
246
247
|
}, P = () => {
|
|
247
|
-
|
|
248
|
+
ze(), s.value?.deselectAll();
|
|
248
249
|
};
|
|
249
|
-
function
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
function We(e) {
|
|
251
|
+
Ae(e), ro(() => {
|
|
252
|
+
Q({});
|
|
252
253
|
});
|
|
253
254
|
}
|
|
254
|
-
function
|
|
255
|
+
function X(e = !1) {
|
|
255
256
|
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
256
257
|
return g.value?.apForm?.[r]?.(!0);
|
|
257
258
|
}
|
|
258
|
-
function
|
|
259
|
+
function Y(e) {
|
|
259
260
|
g.value?.apForm?.setFieldsValue?.(e);
|
|
260
261
|
}
|
|
261
|
-
function
|
|
262
|
+
function Z() {
|
|
262
263
|
return g.value?.getSorterItems() || [];
|
|
263
264
|
}
|
|
264
|
-
function
|
|
265
|
+
function _(e) {
|
|
265
266
|
g.value?.setSorterItems(e);
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
+
function ee() {
|
|
268
269
|
g.value?.resetSorterItems();
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
+
function oe(e) {
|
|
271
272
|
return e && String(e);
|
|
272
273
|
}
|
|
273
274
|
function He(e) {
|
|
@@ -277,50 +278,50 @@ const ct = /* @__PURE__ */ eo({
|
|
|
277
278
|
const a = r.getColumnState() || [], d = e.map((n) => n.key ? String(n.key) : n.key).filter(Boolean), h = a.map((n) => {
|
|
278
279
|
if (!Se.value.includes(n.colId))
|
|
279
280
|
return n;
|
|
280
|
-
const R = !d.includes(n.colId),
|
|
281
|
+
const R = !d.includes(n.colId), te = {
|
|
281
282
|
...n,
|
|
282
283
|
hide: R
|
|
283
|
-
},
|
|
284
|
-
(
|
|
284
|
+
}, re = e.find(
|
|
285
|
+
(eo) => oe(eo.key) === n.colId
|
|
285
286
|
);
|
|
286
|
-
return
|
|
287
|
+
return re && (te.pinned = re.fixed || null), te;
|
|
287
288
|
}), i = new Map(
|
|
288
|
-
e.map((n, R) => [
|
|
289
|
-
),
|
|
289
|
+
e.map((n, R) => [oe(n.key), R])
|
|
290
|
+
), y = h.filter((n) => i.has(n.colId)).sort(
|
|
290
291
|
(n, R) => i.get(n.colId) - i.get(R.colId)
|
|
291
292
|
), v = [];
|
|
292
293
|
let c = 0;
|
|
293
294
|
for (const n of h)
|
|
294
|
-
i.has(n.colId) ? v.push(
|
|
295
|
+
i.has(n.colId) ? v.push(y[c++]) : v.push(n);
|
|
295
296
|
r.applyColumnState({
|
|
296
297
|
state: v,
|
|
297
298
|
applyOrder: !0
|
|
298
299
|
});
|
|
299
300
|
}
|
|
300
|
-
|
|
301
|
+
Ro({
|
|
301
302
|
columns: l(() => f.value),
|
|
302
303
|
columnsBackup: l(() => U.value),
|
|
303
|
-
size: l(() =>
|
|
304
|
+
size: l(() => Bo[C.value]),
|
|
304
305
|
updateColumns(e) {
|
|
305
306
|
f.value = e, o.onShownColumnsChange?.(e), He(e);
|
|
306
307
|
},
|
|
307
308
|
updateSize(e) {
|
|
308
|
-
|
|
309
|
+
C.value = bo[e];
|
|
309
310
|
},
|
|
310
311
|
renderConfig: l(() => ({
|
|
311
312
|
className: ce("table-header", "title"),
|
|
312
313
|
color: we.value.colorTextTertiary
|
|
313
314
|
})),
|
|
314
315
|
dataSource: l(() => t(w).records),
|
|
315
|
-
getSearchFormValues:
|
|
316
|
-
setSearchFormValues:
|
|
316
|
+
getSearchFormValues: X,
|
|
317
|
+
setSearchFormValues: Y,
|
|
317
318
|
submit: N,
|
|
318
|
-
submitWith:
|
|
319
|
+
submitWith: q,
|
|
319
320
|
reset: D,
|
|
320
|
-
refresh:
|
|
321
|
-
getSearchFormSorterItems:
|
|
322
|
-
setSearchFormSorterItems:
|
|
323
|
-
resetSearchFormSorterItems:
|
|
321
|
+
refresh: J,
|
|
322
|
+
getSearchFormSorterItems: Z,
|
|
323
|
+
setSearchFormSorterItems: _,
|
|
324
|
+
resetSearchFormSorterItems: ee
|
|
324
325
|
});
|
|
325
326
|
const Le = l(
|
|
326
327
|
() => F(o.loading) ? w.loading : o.loading
|
|
@@ -328,38 +329,38 @@ const ct = /* @__PURE__ */ eo({
|
|
|
328
329
|
u(),
|
|
329
330
|
o.card ? null : u("wrapper"),
|
|
330
331
|
u("adaptive"),
|
|
331
|
-
u(`size-${
|
|
332
|
-
].filter(Boolean)),
|
|
332
|
+
u(`size-${C.value}`)
|
|
333
|
+
].filter(Boolean)), je = l(() => ({
|
|
333
334
|
height: "100%",
|
|
334
335
|
...o.tableStyle || {}
|
|
335
|
-
})),
|
|
336
|
-
|
|
336
|
+
})), $e = (e, r) => {
|
|
337
|
+
$({ current: e, pageSize: r });
|
|
337
338
|
};
|
|
338
|
-
function
|
|
339
|
+
function qe(e) {
|
|
339
340
|
const r = e.data;
|
|
340
341
|
return K(r);
|
|
341
342
|
}
|
|
342
|
-
function
|
|
343
|
+
function Je(e, r) {
|
|
343
344
|
s.value?.ensureIndexVisible(e, r);
|
|
344
345
|
}
|
|
345
|
-
function
|
|
346
|
+
function Qe(e) {
|
|
346
347
|
o.onRowClicked?.(e.data, e.event);
|
|
347
348
|
}
|
|
348
|
-
function
|
|
349
|
+
function Xe(e) {
|
|
349
350
|
o.onScrollEnd?.(e.direction);
|
|
350
351
|
}
|
|
351
|
-
function
|
|
352
|
+
function Ye(e) {
|
|
352
353
|
return s.value?.refreshCells(e);
|
|
353
354
|
}
|
|
354
|
-
function
|
|
355
|
+
function Ze(e) {
|
|
355
356
|
return s.value?.redrawRows(e);
|
|
356
357
|
}
|
|
357
|
-
const
|
|
358
|
+
const _e = (e) => {
|
|
358
359
|
const r = [
|
|
359
360
|
H.value.getRowClass?.(e)
|
|
360
361
|
];
|
|
361
362
|
if (!e.node.rowPinned) {
|
|
362
|
-
const a =
|
|
363
|
+
const a = G(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
|
|
363
364
|
r.push(a);
|
|
364
365
|
}
|
|
365
366
|
return r.flat().filter(Boolean);
|
|
@@ -367,13 +368,13 @@ const ct = /* @__PURE__ */ eo({
|
|
|
367
368
|
return z(
|
|
368
369
|
() => o.dataSource,
|
|
369
370
|
(e) => {
|
|
370
|
-
|
|
371
|
+
Te(e);
|
|
371
372
|
},
|
|
372
373
|
{ immediate: !0, deep: !0 }
|
|
373
374
|
), z(
|
|
374
375
|
() => o.size,
|
|
375
376
|
(e) => {
|
|
376
|
-
|
|
377
|
+
C.value = e;
|
|
377
378
|
}
|
|
378
379
|
), z(
|
|
379
380
|
() => t(w).loading,
|
|
@@ -383,25 +384,25 @@ const ct = /* @__PURE__ */ eo({
|
|
|
383
384
|
), ue({
|
|
384
385
|
submit: N,
|
|
385
386
|
reset: D,
|
|
386
|
-
refresh:
|
|
387
|
-
submitWith:
|
|
388
|
-
setSearchFormValues:
|
|
389
|
-
getSearchFormValues:
|
|
387
|
+
refresh: J,
|
|
388
|
+
submitWith: q,
|
|
389
|
+
setSearchFormValues: Y,
|
|
390
|
+
getSearchFormValues: X,
|
|
390
391
|
getShowColumns: () => t(f),
|
|
391
392
|
rowSelection: {
|
|
392
393
|
selectedRows: l(() => E.value),
|
|
393
|
-
setSelectedRowKeys:
|
|
394
|
+
setSelectedRowKeys: We,
|
|
394
395
|
clearAll: P
|
|
395
396
|
},
|
|
396
|
-
scrollToRow:
|
|
397
|
+
scrollToRow: Je,
|
|
397
398
|
getDataSource: () => t(w.records),
|
|
398
|
-
getPaging:
|
|
399
|
-
setPaging:
|
|
400
|
-
getSearchFormSorterItems:
|
|
401
|
-
setSearchFormSorterItems:
|
|
402
|
-
resetSearchFormSorterItems:
|
|
403
|
-
refreshCells:
|
|
404
|
-
redrawRows:
|
|
399
|
+
getPaging: xe,
|
|
400
|
+
setPaging: Ie,
|
|
401
|
+
getSearchFormSorterItems: Z,
|
|
402
|
+
setSearchFormSorterItems: _,
|
|
403
|
+
resetSearchFormSorterItems: ee,
|
|
404
|
+
refreshCells: Ye,
|
|
405
|
+
redrawRows: Ze,
|
|
405
406
|
_internalGridApi: l(() => s.value)
|
|
406
407
|
}), (e, r) => (b(), A("div", {
|
|
407
408
|
class: m(Ue.value),
|
|
@@ -412,30 +413,30 @@ const ct = /* @__PURE__ */ eo({
|
|
|
412
413
|
class: m(e.card ? t(k)("search-wrapper") : null),
|
|
413
414
|
style: V(e.searchFormWrapperStyle)
|
|
414
415
|
}, [
|
|
415
|
-
M(t(
|
|
416
|
+
M(t(So).SearchForm, O(e.searchForm || {}, {
|
|
416
417
|
ref_key: "formRef",
|
|
417
418
|
ref: g,
|
|
418
419
|
"custom-reset": "",
|
|
419
|
-
"submit-loading": t(
|
|
420
|
+
"submit-loading": t(j).loading,
|
|
420
421
|
onSubmit: t(N),
|
|
421
422
|
onReset: t(D)
|
|
422
|
-
}),
|
|
423
|
-
default:
|
|
424
|
-
(b(!0), A(
|
|
423
|
+
}), ao({
|
|
424
|
+
default: ne(() => [
|
|
425
|
+
(b(!0), A(no, null, lo(t(L), (a) => (b(), le(so(a.renderNode), {
|
|
425
426
|
key: a.dataIndex
|
|
426
427
|
}))), 128))
|
|
427
428
|
]),
|
|
428
429
|
_: 2
|
|
429
430
|
}, [
|
|
430
|
-
|
|
431
|
+
W.searchFormExtra ? {
|
|
431
432
|
name: "extra",
|
|
432
|
-
fn:
|
|
433
|
-
|
|
433
|
+
fn: ne(() => [
|
|
434
|
+
se(e.$slots, "searchFormExtra")
|
|
434
435
|
]),
|
|
435
436
|
key: "0"
|
|
436
437
|
} : void 0
|
|
437
438
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
438
|
-
], 6)) :
|
|
439
|
+
], 6)) : ae("", !0),
|
|
439
440
|
B("div", {
|
|
440
441
|
class: m([t(k)("table-wrapper"), e.card ? t(k)("table-wrapper-card") : null]),
|
|
441
442
|
style: V(e.tableWrapperStyle)
|
|
@@ -443,62 +444,64 @@ const ct = /* @__PURE__ */ eo({
|
|
|
443
444
|
B("div", {
|
|
444
445
|
class: m(t(u)("header-wrapper"))
|
|
445
446
|
}, [
|
|
446
|
-
|
|
447
|
+
se(e.$slots, "title", {
|
|
447
448
|
selectedRows: t(E),
|
|
448
|
-
selectedRowKeys: t(
|
|
449
|
+
selectedRowKeys: t(Pe),
|
|
449
450
|
shownColumns: t(f),
|
|
450
451
|
clearAll: P
|
|
451
452
|
})
|
|
452
453
|
], 2),
|
|
453
454
|
B("div", {
|
|
455
|
+
ref_key: "gridWrapperRef",
|
|
456
|
+
ref: ve,
|
|
454
457
|
class: m(t(u)("grid-wrapper"))
|
|
455
458
|
}, [
|
|
456
|
-
M(t(
|
|
457
|
-
"get-row-class":
|
|
458
|
-
style:
|
|
459
|
+
M(t(co), O(t(fo)(t(pe), t(H)), {
|
|
460
|
+
"get-row-class": _e,
|
|
461
|
+
style: je.value,
|
|
459
462
|
"row-data": t(w).records,
|
|
460
463
|
"column-defs": t(he),
|
|
461
464
|
"default-col-def": t(Ce),
|
|
462
465
|
"suppress-loading-overlay": "",
|
|
463
|
-
"row-selection":
|
|
464
|
-
"selection-column-def": t(
|
|
465
|
-
"get-row-id":
|
|
466
|
+
"row-selection": Me.value,
|
|
467
|
+
"selection-column-def": t(Ne),
|
|
468
|
+
"get-row-id": qe,
|
|
466
469
|
theme: t(me),
|
|
467
470
|
"tooltip-show-delay": 500,
|
|
468
471
|
"enable-browser-tooltips": e.browserTooltips,
|
|
469
472
|
"tooltip-interaction": "",
|
|
470
473
|
"row-class-rules": e.rowClassRules,
|
|
471
|
-
"no-rows-overlay-component":
|
|
474
|
+
"no-rows-overlay-component": Vo,
|
|
472
475
|
"suppress-cell-focus": "",
|
|
473
476
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
474
|
-
onSortChanged:
|
|
477
|
+
onSortChanged: be,
|
|
475
478
|
onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
|
|
476
|
-
onRowDataUpdated:
|
|
477
|
-
onRowSelected:
|
|
478
|
-
onFirstDataRendered:
|
|
479
|
-
onRowClicked:
|
|
480
|
-
onBodyScrollEnd:
|
|
479
|
+
onRowDataUpdated: Q,
|
|
480
|
+
onRowSelected: Oe,
|
|
481
|
+
onFirstDataRendered: Ge,
|
|
482
|
+
onRowClicked: Qe,
|
|
483
|
+
onBodyScrollEnd: Xe
|
|
481
484
|
}), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
|
|
482
|
-
|
|
485
|
+
io(B("div", {
|
|
483
486
|
class: m(t(k)("table-loading-wrapper"))
|
|
484
487
|
}, [
|
|
485
|
-
M(t(
|
|
488
|
+
M(t(go), { delay: 300 })
|
|
486
489
|
], 2), [
|
|
487
|
-
[
|
|
490
|
+
[uo, Le.value]
|
|
488
491
|
])
|
|
489
492
|
], 2),
|
|
490
493
|
B("div", {
|
|
491
494
|
class: m(t(u)("pagination-wrapper"))
|
|
492
495
|
}, [
|
|
493
|
-
e.pagination !== !1 ? (b(),
|
|
496
|
+
e.pagination !== !1 ? (b(), le(t(wo), O({
|
|
494
497
|
key: 0,
|
|
495
498
|
class: t(u)("pagination")
|
|
496
|
-
}, t(
|
|
499
|
+
}, t(j).pagination, { onChange: $e }), null, 16, ["class"])) : ae("", !0)
|
|
497
500
|
], 2)
|
|
498
501
|
], 6)
|
|
499
502
|
], 6));
|
|
500
503
|
}
|
|
501
504
|
});
|
|
502
505
|
export {
|
|
503
|
-
|
|
506
|
+
mt as default
|
|
504
507
|
};
|
|
@@ -106,7 +106,7 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
106
106
|
} : null;
|
|
107
107
|
export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>, 'type' | 'fixed' | 'columnWidth' | 'defaultSelectedRowKeys'> & {
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
109
|
+
* 设置禁用的行
|
|
110
110
|
* @param row
|
|
111
111
|
* @returns
|
|
112
112
|
*/
|
|
@@ -115,6 +115,10 @@ export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
|
|
|
115
115
|
* 在后端分页下,是否在网络请求后仍然保留上一次的选中(即使不在当前数据中)
|
|
116
116
|
*/
|
|
117
117
|
preserveSelectedRowKeys?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* 行选择列自定义tooltip
|
|
120
|
+
*/
|
|
121
|
+
tooltip?: string | ((checked: boolean, disabled: boolean, rowNode: IRowNode) => string | any);
|
|
118
122
|
};
|
|
119
123
|
export type AgGridVirtualConfig = {
|
|
120
124
|
row?: boolean;
|