@aplus-frontend/ui 6.39.1 → 6.40.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/index.vue.mjs +138 -134
- package/es/src/ag-grid/interface.d.ts +7 -0
- package/es/src/ap-action/interface.d.ts +5 -1
- package/es/src/ap-action/item/index.vue2.mjs +17 -16
- package/es/src/ap-action/item-dropdown/index.vue.mjs +2 -1
- package/es/src/ap-action/item-modal/index.vue.mjs +8 -7
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +1 -0
- package/es/src/ap-form/modal-form/index.vue.d.ts +1 -9
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +28 -28
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +99 -95
- package/es/src/business/ag-grid-modal/interface.d.ts +6 -2
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +23 -23
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +7 -0
- package/lib/src/ap-action/interface.d.ts +5 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-action/item-modal/index.vue.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +1 -9
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +6 -2
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
- package/theme/ag-grid-modal/index.css +1 -0
- package/theme/ag-grid-modal/index.less +1 -0
- package/theme/index.css +1 -0
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
import { Spin as
|
|
6
|
-
import { isUndefined as B, isFunction as
|
|
1
|
+
import { defineComponent as io, useSlots as uo, ref as N, toRef as T, unref as t, computed as n, nextTick as z, watch as M, createElementBlock as W, openBlock as b, normalizeStyle as O, normalizeClass as f, createCommentVNode as le, createElementVNode as F, createVNode as G, mergeProps as H, createSlots as co, withCtx as ne, Fragment as mo, renderList as po, createBlock as se, resolveDynamicComponent as fo, renderSlot as ie, withDirectives as go, vShow as wo } from "vue";
|
|
2
|
+
import { AgGridVue as So } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as yo, AllCommunityModule as ho } from "ag-grid-community";
|
|
4
|
+
import { mergeProps as Co } from "./utils.mjs";
|
|
5
|
+
import { Spin as vo, Pagination as Ro } from "@aplus-frontend/antdv";
|
|
6
|
+
import { isUndefined as B, isFunction as D } 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
|
|
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 bo } from "../ap-form/index.mjs";
|
|
9
|
+
import { recursionApColumns as Fo } from "../ap-table/utils.mjs";
|
|
10
|
+
import { useTablePaging as Bo } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import ko from "./hooks/use-row-selection.mjs";
|
|
12
|
+
import { useProvideSorter as xo } from "./context.mjs";
|
|
13
|
+
import { useProvideApTable as Io } from "../ap-table/context.mjs";
|
|
14
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as ue, sizeReverseMap as No, sizeMap as To } from "../ap-grid/constants.mjs";
|
|
15
|
+
import { useToken as Do } from "@aplus-frontend/antdv/es/theme/internal";
|
|
16
|
+
import { useTheme as Eo } from "./theme.mjs";
|
|
17
|
+
import { useColumns as Ko } from "./hooks/use-columns.mjs";
|
|
18
|
+
import { useColumnsDef as Po } from "./hooks/use-columns-def.mjs";
|
|
19
|
+
import { isDef as Ao } from "../utils/index.mjs";
|
|
20
|
+
import { getValidVNodeList as Vo } from "../utils/slot.mjs";
|
|
21
|
+
import { useSearchForm as zo } from "./hooks/use-search-form.mjs";
|
|
22
22
|
import "./components/empty/index.vue.mjs";
|
|
23
23
|
import Mo from "./hooks/use-virtual-config.mjs";
|
|
24
|
-
import { usePinnedRow as
|
|
25
|
-
import
|
|
24
|
+
import { usePinnedRow as Wo } from "./hooks/use-pinned-row.mjs";
|
|
25
|
+
import Oo from "./hooks/use-selection-col-def.mjs";
|
|
26
26
|
import "./components/row/index.vue.mjs";
|
|
27
|
-
import { useNamespace as
|
|
28
|
-
import { useGlobalConfig as
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
const
|
|
27
|
+
import { useNamespace as Go } from "../config-provider/hooks/use-namespace.mjs";
|
|
28
|
+
import { useGlobalConfig as Ho } from "../config-provider/hooks/use-global-config.mjs";
|
|
29
|
+
import Lo from "./components/row/index.vue2.mjs";
|
|
30
|
+
import Uo from "./components/empty/index.vue2.mjs";
|
|
31
|
+
const vt = /* @__PURE__ */ io({
|
|
32
32
|
name: "AgGrid",
|
|
33
33
|
__name: "index",
|
|
34
34
|
props: {
|
|
@@ -102,14 +102,14 @@ const Ct = /* @__PURE__ */ so({
|
|
|
102
102
|
onUpdate: {},
|
|
103
103
|
customRow: {}
|
|
104
104
|
},
|
|
105
|
-
setup(
|
|
106
|
-
|
|
107
|
-
const o =
|
|
108
|
-
|
|
109
|
-
), we =
|
|
105
|
+
setup(de, { expose: ce }) {
|
|
106
|
+
yo.registerModules([ho]);
|
|
107
|
+
const o = de, L = uo(), { e: k, b: d, be: me } = Go("ag-grid"), h = N(o.size), pe = Eo(h, T(o, "rowHeight")), fe = Mo(T(o, "virtual")), { rowPinnedGridConfig: U, getRowPinnedCellClass: ge } = Wo(
|
|
108
|
+
T(o, "summary")
|
|
109
|
+
), we = Ho("apGrid"), s = N(), [, Se] = Do();
|
|
110
110
|
let C = !!o.dataSource;
|
|
111
|
-
const j =
|
|
112
|
-
|
|
111
|
+
const j = zo(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Ko(o), { defaultColDef: Ce, columnDefs: ve, gridWrapperRef: Re } = Po($, o, ge), x = N({});
|
|
112
|
+
xo({
|
|
113
113
|
sorter: x,
|
|
114
114
|
setSorter(e) {
|
|
115
115
|
x.value = e;
|
|
@@ -129,14 +129,14 @@ const Ct = /* @__PURE__ */ so({
|
|
|
129
129
|
}
|
|
130
130
|
if (!a)
|
|
131
131
|
return;
|
|
132
|
-
const
|
|
132
|
+
const u = a.getColDef(), m = a.getSort(), p = he(u.colId);
|
|
133
133
|
_(void 0, void 0, {
|
|
134
|
-
column:
|
|
135
|
-
field: p?.field ??
|
|
134
|
+
column: u,
|
|
135
|
+
field: p?.field ?? u.field ?? u.colId,
|
|
136
136
|
order: m ? be[m] : null
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
-
const Be = n(() =>
|
|
139
|
+
const Be = n(() => Fo(t(g), (e) => {
|
|
140
140
|
if (e.sorter === !0)
|
|
141
141
|
return e.field ?? e.dataIndex ?? e.key;
|
|
142
142
|
}).filter(Boolean)), ke = () => {
|
|
@@ -146,21 +146,21 @@ const Ct = /* @__PURE__ */ so({
|
|
|
146
146
|
return;
|
|
147
147
|
const r = e.getColumnState()?.map((a) => ({ ...a, sort: null }));
|
|
148
148
|
e.applyColumnState({ state: r });
|
|
149
|
-
}, xe = n(() =>
|
|
149
|
+
}, xe = n(() => Ao(o.manual) ? o.manual : Vo(L.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
|
|
150
150
|
formRef: w,
|
|
151
|
-
submit:
|
|
152
|
-
reset:
|
|
151
|
+
submit: E,
|
|
152
|
+
reset: K,
|
|
153
153
|
data: S,
|
|
154
154
|
tableProps: q,
|
|
155
155
|
handleTableChangeOptional: _,
|
|
156
156
|
submitWith: J,
|
|
157
157
|
refresh: Q,
|
|
158
158
|
getPaging: Ie,
|
|
159
|
-
setPaging:
|
|
160
|
-
setDataSource:
|
|
161
|
-
} =
|
|
159
|
+
setPaging: Ne,
|
|
160
|
+
setDataSource: Te
|
|
161
|
+
} = Bo({
|
|
162
162
|
async request(e) {
|
|
163
|
-
if (C = !1, y.value && !y.value.preserveSelectedRowKeys && B(o.dataSource) &&
|
|
163
|
+
if (C = !1, y.value && !y.value.preserveSelectedRowKeys && B(o.dataSource) && V(), !B(o.dataSource)) {
|
|
164
164
|
const a = e.pageSize * (e.current - 1);
|
|
165
165
|
return {
|
|
166
166
|
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(a, a + e.pageSize)) || [],
|
|
@@ -174,8 +174,8 @@ const Ct = /* @__PURE__ */ so({
|
|
|
174
174
|
};
|
|
175
175
|
},
|
|
176
176
|
namespace: "ap-grid",
|
|
177
|
-
filterFields:
|
|
178
|
-
params:
|
|
177
|
+
filterFields: N([]),
|
|
178
|
+
params: T(o, "params"),
|
|
179
179
|
defaultData: o.defaultData,
|
|
180
180
|
manual: t(xe),
|
|
181
181
|
formatParams: o.beforeSearchSubmit,
|
|
@@ -185,22 +185,22 @@ const Ct = /* @__PURE__ */ so({
|
|
|
185
185
|
}), y = n(() => {
|
|
186
186
|
const e = o.rowSelection || we.value?.rowSelection;
|
|
187
187
|
if (e)
|
|
188
|
-
return e === !0 ?
|
|
189
|
-
...
|
|
188
|
+
return e === !0 ? ue : {
|
|
189
|
+
...ue,
|
|
190
190
|
...e
|
|
191
191
|
};
|
|
192
|
-
}),
|
|
192
|
+
}), De = Oo(o, g), Ee = n(
|
|
193
193
|
() => B(o.dataSource) ? S.records : o.dataSource
|
|
194
194
|
), {
|
|
195
195
|
select: Ke,
|
|
196
196
|
unSelect: Pe,
|
|
197
|
-
selectedRows:
|
|
198
|
-
selectedRowKeys:
|
|
199
|
-
clearAll:
|
|
200
|
-
selectMultiByKeys:
|
|
201
|
-
selectMulti:
|
|
197
|
+
selectedRows: P,
|
|
198
|
+
selectedRowKeys: Ae,
|
|
199
|
+
clearAll: Ve,
|
|
200
|
+
selectMultiByKeys: ze,
|
|
201
|
+
selectMulti: Me,
|
|
202
202
|
unSelectMulti: We
|
|
203
|
-
} =
|
|
203
|
+
} = ko({
|
|
204
204
|
...y.value,
|
|
205
205
|
dataSource: Ee,
|
|
206
206
|
rowKey: o.rowKey
|
|
@@ -218,25 +218,25 @@ const Ct = /* @__PURE__ */ so({
|
|
|
218
218
|
hideDisabledCheckboxes: e.hideDisabled ?? !1
|
|
219
219
|
};
|
|
220
220
|
});
|
|
221
|
-
function
|
|
222
|
-
return
|
|
221
|
+
function A(e) {
|
|
222
|
+
return D(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
223
223
|
}
|
|
224
224
|
const I = ({
|
|
225
225
|
api: e = s.value
|
|
226
226
|
}) => {
|
|
227
227
|
if (o.onUpdate?.(), !y.value)
|
|
228
228
|
return;
|
|
229
|
-
const r =
|
|
229
|
+
const r = P.value || [];
|
|
230
230
|
C = !1;
|
|
231
231
|
const a = [];
|
|
232
232
|
e.forEachNode((i) => {
|
|
233
|
-
const
|
|
234
|
-
r.find((p) =>
|
|
233
|
+
const v = i.data, u = A(v), m = i.isSelected();
|
|
234
|
+
r.find((p) => A(p) === u) ? !m && a.push(i) : m && i.setSelected(!1);
|
|
235
235
|
}), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
|
|
236
236
|
C = !0;
|
|
237
237
|
}, 0);
|
|
238
238
|
}, He = (e) => {
|
|
239
|
-
C && (e.node.isSelected() ? Ke(e.data) : Pe(e.data),
|
|
239
|
+
C && (e.node.isSelected() ? Ke(e.data) : Pe(e.data), D(y.value?.tooltip) && e.api.refreshCells({
|
|
240
240
|
rowNodes: [e.node],
|
|
241
241
|
// todo: 取消硬编码
|
|
242
242
|
columns: ["ag-Grid-SelectionColumn"],
|
|
@@ -244,11 +244,11 @@ const Ct = /* @__PURE__ */ so({
|
|
|
244
244
|
}));
|
|
245
245
|
}, Le = () => {
|
|
246
246
|
C = !0;
|
|
247
|
-
},
|
|
248
|
-
|
|
247
|
+
}, V = () => {
|
|
248
|
+
Ve(), s.value?.deselectAll();
|
|
249
249
|
};
|
|
250
250
|
function Ue(e) {
|
|
251
|
-
|
|
251
|
+
ze(e), z(() => {
|
|
252
252
|
I({});
|
|
253
253
|
});
|
|
254
254
|
}
|
|
@@ -256,19 +256,19 @@ const Ct = /* @__PURE__ */ so({
|
|
|
256
256
|
const e = o.customRow;
|
|
257
257
|
return e ? {
|
|
258
258
|
isFullWidthRow: e.isCustomRow,
|
|
259
|
-
fullWidthCellRenderer:
|
|
259
|
+
fullWidthCellRenderer: Lo,
|
|
260
260
|
fullWidthCellRendererParams: {
|
|
261
261
|
render: e.render
|
|
262
262
|
}
|
|
263
263
|
} : {};
|
|
264
264
|
});
|
|
265
265
|
function $e(e) {
|
|
266
|
-
|
|
266
|
+
Me(e), z(() => {
|
|
267
267
|
I({});
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
function qe(e) {
|
|
271
|
-
We(e),
|
|
271
|
+
We(e), z(() => {
|
|
272
272
|
I({});
|
|
273
273
|
});
|
|
274
274
|
}
|
|
@@ -295,38 +295,38 @@ const Ct = /* @__PURE__ */ so({
|
|
|
295
295
|
const r = s.value;
|
|
296
296
|
if (!r)
|
|
297
297
|
return;
|
|
298
|
-
const a = r.getColumnState() || [], i = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean),
|
|
298
|
+
const a = r.getColumnState() || [], i = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean), v = a.map((l) => {
|
|
299
299
|
if (!ye.value.includes(l.colId))
|
|
300
300
|
return l;
|
|
301
|
-
const
|
|
301
|
+
const R = !i.includes(l.colId), re = {
|
|
302
302
|
...l,
|
|
303
|
-
hide:
|
|
303
|
+
hide: R
|
|
304
304
|
}, ae = e.find(
|
|
305
|
-
(
|
|
305
|
+
(so) => te(so.key) === l.colId
|
|
306
306
|
);
|
|
307
307
|
return ae && (re.pinned = ae.fixed || null), re;
|
|
308
|
-
}),
|
|
309
|
-
e.map((l,
|
|
310
|
-
), m =
|
|
311
|
-
(l,
|
|
308
|
+
}), u = new Map(
|
|
309
|
+
e.map((l, R) => [te(l.key), R])
|
|
310
|
+
), m = v.filter((l) => u.has(l.colId)).sort(
|
|
311
|
+
(l, R) => u.get(l.colId) - u.get(R.colId)
|
|
312
312
|
), p = [];
|
|
313
313
|
let c = 0;
|
|
314
|
-
for (const l of
|
|
315
|
-
|
|
314
|
+
for (const l of v)
|
|
315
|
+
u.has(l.colId) ? p.push(m[c++]) : p.push(l);
|
|
316
316
|
r.applyColumnState({
|
|
317
317
|
state: p,
|
|
318
318
|
applyOrder: !0
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
|
-
|
|
321
|
+
Io({
|
|
322
322
|
columns: n(() => g.value),
|
|
323
323
|
columnsBackup: n(() => $.value),
|
|
324
|
-
size: n(() =>
|
|
324
|
+
size: n(() => To[h.value]),
|
|
325
325
|
updateColumns(e) {
|
|
326
326
|
g.value = e, o.onShownColumnsChange?.(e), _e(e);
|
|
327
327
|
},
|
|
328
328
|
updateSize(e) {
|
|
329
|
-
h.value =
|
|
329
|
+
h.value = No[e];
|
|
330
330
|
},
|
|
331
331
|
renderConfig: n(() => ({
|
|
332
332
|
className: me("table-header", "title"),
|
|
@@ -335,9 +335,9 @@ const Ct = /* @__PURE__ */ so({
|
|
|
335
335
|
dataSource: n(() => t(S).records),
|
|
336
336
|
getSearchFormValues: X,
|
|
337
337
|
setSearchFormValues: Y,
|
|
338
|
-
submit:
|
|
338
|
+
submit: E,
|
|
339
339
|
submitWith: J,
|
|
340
|
-
reset:
|
|
340
|
+
reset: K,
|
|
341
341
|
refresh: Q,
|
|
342
342
|
getSearchFormSorterItems: Z,
|
|
343
343
|
setSearchFormSorterItems: ee,
|
|
@@ -346,10 +346,10 @@ const Ct = /* @__PURE__ */ so({
|
|
|
346
346
|
const Je = n(
|
|
347
347
|
() => B(o.loading) ? S.loading : o.loading
|
|
348
348
|
), Qe = n(() => [
|
|
349
|
-
|
|
350
|
-
o.card ? null :
|
|
351
|
-
|
|
352
|
-
|
|
349
|
+
d(),
|
|
350
|
+
o.card ? null : d("wrapper"),
|
|
351
|
+
d("adaptive"),
|
|
352
|
+
d(`size-${h.value}`)
|
|
353
353
|
].filter(Boolean)), Xe = n(() => ({
|
|
354
354
|
height: "100%",
|
|
355
355
|
...o.tableStyle || {}
|
|
@@ -358,29 +358,32 @@ const Ct = /* @__PURE__ */ so({
|
|
|
358
358
|
};
|
|
359
359
|
function Ze(e) {
|
|
360
360
|
const r = e.data;
|
|
361
|
-
return
|
|
361
|
+
return A(r);
|
|
362
362
|
}
|
|
363
363
|
function eo(e, r) {
|
|
364
|
-
s.value?.ensureIndexVisible(e, r);
|
|
364
|
+
(D(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, r);
|
|
365
365
|
}
|
|
366
|
-
function oo(e) {
|
|
367
|
-
|
|
366
|
+
function oo(e, r) {
|
|
367
|
+
s.value?.ensureColumnVisible(e, r);
|
|
368
368
|
}
|
|
369
369
|
function to(e) {
|
|
370
|
-
o.
|
|
370
|
+
o.onRowClicked?.(e.data, e.event);
|
|
371
371
|
}
|
|
372
372
|
function ro(e) {
|
|
373
|
-
|
|
373
|
+
o.onScrollEnd?.(e.direction);
|
|
374
374
|
}
|
|
375
375
|
function ao(e) {
|
|
376
|
+
return s.value?.refreshCells(e);
|
|
377
|
+
}
|
|
378
|
+
function lo(e) {
|
|
376
379
|
return s.value?.redrawRows(e);
|
|
377
380
|
}
|
|
378
|
-
const
|
|
381
|
+
const no = (e) => {
|
|
379
382
|
const r = [
|
|
380
383
|
U.value.getRowClass?.(e)
|
|
381
384
|
];
|
|
382
385
|
if (!e.node.rowPinned) {
|
|
383
|
-
const a =
|
|
386
|
+
const a = D(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
|
|
384
387
|
r.push(a);
|
|
385
388
|
}
|
|
386
389
|
return r.flat().filter(Boolean);
|
|
@@ -388,7 +391,7 @@ const Ct = /* @__PURE__ */ so({
|
|
|
388
391
|
return M(
|
|
389
392
|
() => o.dataSource,
|
|
390
393
|
(e) => {
|
|
391
|
-
|
|
394
|
+
Te(e);
|
|
392
395
|
},
|
|
393
396
|
{ immediate: !0, deep: !0 }
|
|
394
397
|
), M(
|
|
@@ -402,49 +405,50 @@ const Ct = /* @__PURE__ */ so({
|
|
|
402
405
|
o.onLoadingChange?.(e);
|
|
403
406
|
}
|
|
404
407
|
), ce({
|
|
405
|
-
submit:
|
|
406
|
-
reset:
|
|
408
|
+
submit: E,
|
|
409
|
+
reset: K,
|
|
407
410
|
refresh: Q,
|
|
408
411
|
submitWith: J,
|
|
409
412
|
setSearchFormValues: Y,
|
|
410
413
|
getSearchFormValues: X,
|
|
411
414
|
getShowColumns: () => t(g),
|
|
412
415
|
rowSelection: {
|
|
413
|
-
selectedRows: n(() =>
|
|
416
|
+
selectedRows: n(() => P.value),
|
|
414
417
|
setSelectedRowKeys: Ue,
|
|
415
418
|
setSelectedRows: $e,
|
|
416
|
-
clearAll:
|
|
419
|
+
clearAll: V,
|
|
417
420
|
unSelectRows: qe
|
|
418
421
|
},
|
|
419
422
|
scrollToRow: eo,
|
|
423
|
+
scrollToColumn: oo,
|
|
420
424
|
getDataSource: () => t(S.records),
|
|
421
425
|
getPaging: Ie,
|
|
422
|
-
setPaging:
|
|
426
|
+
setPaging: Ne,
|
|
423
427
|
getSearchFormSorterItems: Z,
|
|
424
428
|
setSearchFormSorterItems: ee,
|
|
425
429
|
resetSearchFormSorterItems: oe,
|
|
426
|
-
refreshCells:
|
|
427
|
-
redrawRows:
|
|
430
|
+
refreshCells: ao,
|
|
431
|
+
redrawRows: lo,
|
|
428
432
|
_internalGridApi: n(() => s.value)
|
|
429
|
-
}), (e, r) => (b(),
|
|
433
|
+
}), (e, r) => (b(), W("div", {
|
|
430
434
|
class: f(Qe.value),
|
|
431
|
-
style:
|
|
435
|
+
style: O(e.wrapperStyle)
|
|
432
436
|
}, [
|
|
433
|
-
t(B)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (b(),
|
|
437
|
+
t(B)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (b(), W("div", {
|
|
434
438
|
key: 0,
|
|
435
439
|
class: f(e.card ? t(k)("search-wrapper") : null),
|
|
436
|
-
style:
|
|
440
|
+
style: O(e.searchFormWrapperStyle)
|
|
437
441
|
}, [
|
|
438
|
-
|
|
442
|
+
G(t(bo).SearchForm, H(e.searchForm || {}, {
|
|
439
443
|
ref_key: "formRef",
|
|
440
444
|
ref: w,
|
|
441
445
|
"custom-reset": "",
|
|
442
446
|
"submit-loading": t(q).loading,
|
|
443
|
-
onSubmit: t(
|
|
444
|
-
onReset: t(
|
|
445
|
-
}),
|
|
447
|
+
onSubmit: t(E),
|
|
448
|
+
onReset: t(K)
|
|
449
|
+
}), co({
|
|
446
450
|
default: ne(() => [
|
|
447
|
-
(b(!0),
|
|
451
|
+
(b(!0), W(mo, null, po(t(j), (a) => (b(), se(fo(a.renderNode), {
|
|
448
452
|
key: a.dataIndex
|
|
449
453
|
}))), 128))
|
|
450
454
|
]),
|
|
@@ -461,34 +465,34 @@ const Ct = /* @__PURE__ */ so({
|
|
|
461
465
|
], 6)) : le("", !0),
|
|
462
466
|
F("div", {
|
|
463
467
|
class: f([t(k)("table-wrapper"), e.card ? t(k)("table-wrapper-card") : null]),
|
|
464
|
-
style:
|
|
468
|
+
style: O(e.tableWrapperStyle)
|
|
465
469
|
}, [
|
|
466
470
|
F("div", {
|
|
467
|
-
class: f(t(
|
|
471
|
+
class: f(t(d)("header-wrapper"))
|
|
468
472
|
}, [
|
|
469
473
|
ie(e.$slots, "title", {
|
|
470
|
-
selectedRows: t(
|
|
471
|
-
selectedRowKeys: t(
|
|
474
|
+
selectedRows: t(P),
|
|
475
|
+
selectedRowKeys: t(Ae),
|
|
472
476
|
shownColumns: t(g),
|
|
473
|
-
clearAll:
|
|
477
|
+
clearAll: V
|
|
474
478
|
})
|
|
475
479
|
], 2),
|
|
476
480
|
F("div", {
|
|
477
481
|
ref_key: "gridWrapperRef",
|
|
478
|
-
ref:
|
|
479
|
-
class: f(t(
|
|
482
|
+
ref: Re,
|
|
483
|
+
class: f(t(d)("grid-wrapper"))
|
|
480
484
|
}, [
|
|
481
|
-
|
|
482
|
-
t(
|
|
485
|
+
G(t(So), H(
|
|
486
|
+
t(Co)(t(fe), t(U), je.value),
|
|
483
487
|
{
|
|
484
|
-
"get-row-class":
|
|
488
|
+
"get-row-class": no,
|
|
485
489
|
style: Xe.value,
|
|
486
490
|
"row-data": t(S).records,
|
|
487
|
-
"column-defs": t(
|
|
491
|
+
"column-defs": t(ve),
|
|
488
492
|
"default-col-def": t(Ce),
|
|
489
493
|
"suppress-loading-overlay": "",
|
|
490
494
|
"row-selection": Ge.value,
|
|
491
|
-
"selection-column-def": t(
|
|
495
|
+
"selection-column-def": t(De),
|
|
492
496
|
"get-row-id": Ze,
|
|
493
497
|
"get-row-height": o.getRowHeight,
|
|
494
498
|
theme: t(pe),
|
|
@@ -496,7 +500,7 @@ const Ct = /* @__PURE__ */ so({
|
|
|
496
500
|
"enable-browser-tooltips": e.browserTooltips,
|
|
497
501
|
"tooltip-interaction": "",
|
|
498
502
|
"row-class-rules": e.rowClassRules,
|
|
499
|
-
"no-rows-overlay-component":
|
|
503
|
+
"no-rows-overlay-component": Uo,
|
|
500
504
|
"suppress-cell-focus": "",
|
|
501
505
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
502
506
|
onSortChanged: Fe,
|
|
@@ -504,24 +508,24 @@ const Ct = /* @__PURE__ */ so({
|
|
|
504
508
|
onRowDataUpdated: I,
|
|
505
509
|
onRowSelected: He,
|
|
506
510
|
onFirstDataRendered: Le,
|
|
507
|
-
onRowClicked:
|
|
508
|
-
onBodyScrollEnd:
|
|
511
|
+
onRowClicked: to,
|
|
512
|
+
onBodyScrollEnd: ro
|
|
509
513
|
}
|
|
510
514
|
), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
|
|
511
|
-
|
|
515
|
+
go(F("div", {
|
|
512
516
|
class: f(t(k)("table-loading-wrapper"))
|
|
513
517
|
}, [
|
|
514
|
-
|
|
518
|
+
G(t(vo), { delay: 300 })
|
|
515
519
|
], 2), [
|
|
516
|
-
[
|
|
520
|
+
[wo, Je.value]
|
|
517
521
|
])
|
|
518
522
|
], 2),
|
|
519
523
|
F("div", {
|
|
520
|
-
class: f(t(
|
|
524
|
+
class: f(t(d)("pagination-wrapper"))
|
|
521
525
|
}, [
|
|
522
|
-
e.pagination !== !1 ? (b(), se(t(Ro),
|
|
526
|
+
e.pagination !== !1 ? (b(), se(t(Ro), H({
|
|
523
527
|
key: 0,
|
|
524
|
-
class: t(
|
|
528
|
+
class: t(d)("pagination")
|
|
525
529
|
}, t(q).pagination, { onChange: Ye }), null, 16, ["class"])) : le("", !0)
|
|
526
530
|
], 2)
|
|
527
531
|
], 6)
|
|
@@ -529,5 +533,5 @@ const Ct = /* @__PURE__ */ so({
|
|
|
529
533
|
}
|
|
530
534
|
});
|
|
531
535
|
export {
|
|
532
|
-
|
|
536
|
+
vt as default
|
|
533
537
|
};
|
|
@@ -393,6 +393,13 @@ export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
393
393
|
* @returns
|
|
394
394
|
*/
|
|
395
395
|
scrollToRow: (index: number, position?: 'top' | 'bottom' | 'middle' | null) => void;
|
|
396
|
+
/**
|
|
397
|
+
* 滚动到某一列
|
|
398
|
+
* @param key 列的唯一标识
|
|
399
|
+
* @param position
|
|
400
|
+
* @returns
|
|
401
|
+
*/
|
|
402
|
+
scrollToColumn: (key: string, position?: 'auto' | 'start' | 'middle' | 'end') => void;
|
|
396
403
|
/**
|
|
397
404
|
* 获取当前表格数据
|
|
398
405
|
* @returns
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DropdownProps, ModalFuncProps, PopconfirmProps } from '@aplus-frontend/antdv';
|
|
1
|
+
import { DropdownProps, ModalFuncProps, PopconfirmProps, TooltipProps } from '@aplus-frontend/antdv';
|
|
2
2
|
import { VNode } from 'vue';
|
|
3
3
|
export type ActionColor = 'primary' | 'success' | 'error' | 'warn';
|
|
4
4
|
export type ApActionItemProps = {
|
|
@@ -43,6 +43,10 @@ export type ApActionItemProps = {
|
|
|
43
43
|
* 是否优先显示图标
|
|
44
44
|
*/
|
|
45
45
|
iconFirst?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 优先显示图标时,对弹出的tooltip进行设置
|
|
48
|
+
*/
|
|
49
|
+
tooltip?: Partial<Omit<TooltipProps, 'title'>>;
|
|
46
50
|
};
|
|
47
51
|
export type MixedActionTypes = ApActionItemProps | ApActionItemModalProps | ApActionItemPopconfirmProps;
|
|
48
52
|
export type GroupActionTypes = MixedActionTypes | ApActionItemDropdownProps;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as B, useSlots as h, createPropsRestProxy as A, ref as F, computed as u, unref as n, renderSlot as y, createElementBlock as f, createCommentVNode as a, openBlock as t, mergeProps as g, createBlock as m, normalizeClass as N, createVNode as L, withCtx as P, resolveDynamicComponent as k, isVNode as S, toDisplayString as V } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
3
|
import $ from "@aplus-frontend/antdv/es/button/LoadingIcon";
|
|
4
4
|
import { Tooltip as w } from "@aplus-frontend/antdv";
|
|
5
|
-
import { useNamespace as
|
|
6
|
-
const
|
|
5
|
+
import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
|
|
6
|
+
const I = { key: 1 }, q = /* @__PURE__ */ B({
|
|
7
7
|
name: "ApActionItem",
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
@@ -15,27 +15,28 @@ const D = { key: 1 }, q = /* @__PURE__ */ C({
|
|
|
15
15
|
onClick: { type: Function },
|
|
16
16
|
loading: { type: Boolean, default: !1 },
|
|
17
17
|
icon: {},
|
|
18
|
-
iconFirst: { type: Boolean, default: !1 }
|
|
18
|
+
iconFirst: { type: Boolean, default: !1 },
|
|
19
|
+
tooltip: { default: () => ({}) }
|
|
19
20
|
},
|
|
20
21
|
setup(o) {
|
|
21
|
-
const s =
|
|
22
|
+
const s = h(), r = A(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon", "tooltip"]), { b: v, m: l, e: b } = D("action-item"), c = F(!1), d = u(() => o.iconFirst && (o.icon || s.icon));
|
|
22
23
|
function p(e) {
|
|
23
24
|
n(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
|
|
24
25
|
}
|
|
25
|
-
const i = u(() => o.loading || n(c)),
|
|
26
|
-
|
|
26
|
+
const i = u(() => o.loading || n(c)), C = u(() => [
|
|
27
|
+
v(),
|
|
27
28
|
l(o.color),
|
|
28
29
|
d.value ? l("icon-first") : null,
|
|
29
30
|
o.disabled ? l("disabled") : null,
|
|
30
31
|
i.value ? l("loading") : null
|
|
31
32
|
].filter(Boolean));
|
|
32
|
-
return (e,
|
|
33
|
+
return (e, T) => y(e.$slots, "trigger", {
|
|
33
34
|
loading: i.value,
|
|
34
35
|
disabled: e.disabled,
|
|
35
36
|
onClick: p
|
|
36
37
|
}, () => [
|
|
37
|
-
e.visible ? (t(), f("span",
|
|
38
|
-
class:
|
|
38
|
+
e.visible ? (t(), f("span", g({ key: 0 }, e.$attrs, {
|
|
39
|
+
class: C.value,
|
|
39
40
|
onClick: p
|
|
40
41
|
}), [
|
|
41
42
|
i.value ? (t(), m(n($), {
|
|
@@ -46,19 +47,19 @@ const D = { key: 1 }, q = /* @__PURE__ */ C({
|
|
|
46
47
|
})) : a("", !0),
|
|
47
48
|
e.icon || s.icon ? (t(), f("span", {
|
|
48
49
|
key: 1,
|
|
49
|
-
class: N(n(
|
|
50
|
+
class: N(n(b)("icon-wrapper"))
|
|
50
51
|
}, [
|
|
51
|
-
L(n(w), {
|
|
52
|
+
L(n(w), g({
|
|
52
53
|
title: d.value ? e.text : null
|
|
53
|
-
}, {
|
|
54
|
+
}, e.tooltip), {
|
|
54
55
|
default: P(() => [
|
|
55
|
-
(t(), m(
|
|
56
|
+
(t(), m(k(e.icon || s.icon)))
|
|
56
57
|
]),
|
|
57
58
|
_: 1
|
|
58
|
-
},
|
|
59
|
+
}, 16, ["title"])
|
|
59
60
|
], 2)) : a("", !0),
|
|
60
61
|
d.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
|
|
61
|
-
S(e.text) ? (t(), m(
|
|
62
|
+
S(e.text) ? (t(), m(k(e.text), { key: 0 })) : (t(), f("span", I, V(e.text || ""), 1))
|
|
62
63
|
])
|
|
63
64
|
], 16)) : a("", !0)
|
|
64
65
|
]);
|
|
@@ -25,7 +25,8 @@ const T = /* @__PURE__ */ _({
|
|
|
25
25
|
onClick: {},
|
|
26
26
|
loading: { type: Boolean, default: !1 },
|
|
27
27
|
icon: {},
|
|
28
|
-
iconFirst: { type: Boolean }
|
|
28
|
+
iconFirst: { type: Boolean },
|
|
29
|
+
tooltip: {}
|
|
29
30
|
},
|
|
30
31
|
setup(d) {
|
|
31
32
|
const f = d, i = v(!1), { e: p } = E("action-item-dropdown"), g = k(() => f.actions.filter((e) => e.visible || V(e.visible)).map((e) => ({
|