@aplus-frontend/ui 6.38.0 → 6.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +108 -104
- package/es/src/ag-grid/hooks/use-columns-def.mjs +73 -71
- package/es/src/ag-grid/index.vue.mjs +201 -200
- package/es/src/ag-grid/interface.d.ts +14 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -71
- package/es/src/ap-table/interface.d.ts +6 -0
- package/es/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/es/src/business/ag-grid-modal/constants.mjs +6 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +50 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +58 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +122 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.mjs +49 -0
- package/es/src/business/ag-grid-modal/index.d.ts +2 -0
- package/es/src/business/ag-grid-modal/index.mjs +6 -0
- package/es/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +102 -0
- package/es/src/business/ag-grid-modal/style/css.d.ts +0 -0
- package/es/src/business/ag-grid-modal/style/css.js +1 -0
- package/es/src/business/ag-grid-modal/style/index.d.ts +0 -0
- package/es/src/business/ag-grid-modal/style/index.js +1 -0
- package/es/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/es/src/business/ag-grid-modal/utils.mjs +72 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -0
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/index.d.ts +3 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +55 -54
- package/es/src/index.mjs +78 -74
- package/es/src/path-map.mjs +3 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +14 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/interface.d.ts +6 -0
- package/lib/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/lib/src/business/ag-grid-modal/constants.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.js +1 -0
- package/lib/src/business/ag-grid-modal/index.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/index.js +1 -0
- package/lib/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -0
- package/lib/src/business/ag-grid-modal/style/css.cjs +1 -0
- package/lib/src/business/ag-grid-modal/style/css.d.ts +0 -0
- package/lib/src/business/ag-grid-modal/style/index.cjs +1 -0
- package/lib/src/business/ag-grid-modal/style/index.d.ts +0 -0
- package/lib/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/index.d.ts +3 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.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/ag-grid/index.css +3 -0
- package/theme/ag-grid-modal/index.css +773 -0
- package/theme/ag-grid-modal/index.less +58 -0
- package/theme/ap-form/ap-form-item.css +3 -0
- package/theme/ap-form/ap-form-item.less +3 -0
- package/theme/ap-form/index.css +3 -0
- package/theme/ap-form/search-form.css +3 -0
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-table/ap-table.css +3 -0
- package/theme/ap-table-modal/index.css +3 -0
- package/theme/ap-upload/index.css +5 -0
- package/theme/ap-upload/multiple-file.css +5 -0
- package/theme/ap-upload/multiple-file.less +6 -0
- package/theme/editable-table/index.css +3 -0
- package/theme/index.css +54 -0
- package/theme/index.less +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 so, useSlots as io, ref as D, toRef as N, unref as t, computed as n, nextTick as A, watch as M, createElementBlock as V, openBlock as b, normalizeStyle as W, normalizeClass as f, createCommentVNode as le, createElementVNode as F, createVNode as O, mergeProps as G, createSlots as uo, withCtx as ne, Fragment as co, renderList as mo, createBlock as se, resolveDynamicComponent as po, renderSlot as ie, withDirectives as fo, vShow as go } from "vue";
|
|
2
|
+
import { AgGridVue as wo } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as So, AllCommunityModule as yo } from "ag-grid-community";
|
|
4
|
+
import { mergeProps as ho } from "./utils.mjs";
|
|
5
|
+
import { Spin as Co, Pagination as Ro } from "@aplus-frontend/antdv";
|
|
6
|
+
import { isUndefined as B, isFunction as H } 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 de, sizeReverseMap as
|
|
15
|
-
import { useToken as
|
|
8
|
+
import { ApForm as vo } from "../ap-form/index.mjs";
|
|
9
|
+
import { recursionApColumns as bo } from "../ap-table/utils.mjs";
|
|
10
|
+
import { useTablePaging as Fo } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import Bo from "./hooks/use-row-selection.mjs";
|
|
12
|
+
import { useProvideSorter as ko } from "./context.mjs";
|
|
13
|
+
import { useProvideApTable as xo } from "../ap-table/context.mjs";
|
|
14
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as de, sizeReverseMap as Io, sizeMap as Do } from "../ap-grid/constants.mjs";
|
|
15
|
+
import { useToken as No } from "@aplus-frontend/antdv/es/theme/internal";
|
|
16
16
|
import { useTheme as To } from "./theme.mjs";
|
|
17
|
-
import { useColumns as
|
|
18
|
-
import { useColumnsDef as
|
|
19
|
-
import { isDef as
|
|
20
|
-
import { getValidVNodeList as
|
|
21
|
-
import { useSearchForm as
|
|
17
|
+
import { useColumns as Eo } from "./hooks/use-columns.mjs";
|
|
18
|
+
import { useColumnsDef as Ko } from "./hooks/use-columns-def.mjs";
|
|
19
|
+
import { isDef as Po } from "../utils/index.mjs";
|
|
20
|
+
import { getValidVNodeList as zo } from "../utils/slot.mjs";
|
|
21
|
+
import { useSearchForm as Ao } from "./hooks/use-search-form.mjs";
|
|
22
22
|
import "./components/empty/index.vue.mjs";
|
|
23
|
-
import
|
|
24
|
-
import { usePinnedRow as
|
|
25
|
-
import
|
|
23
|
+
import Mo from "./hooks/use-virtual-config.mjs";
|
|
24
|
+
import { usePinnedRow as Vo } from "./hooks/use-pinned-row.mjs";
|
|
25
|
+
import Wo 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 Oo } from "../config-provider/hooks/use-namespace.mjs";
|
|
28
|
+
import { useGlobalConfig as Go } from "../config-provider/hooks/use-global-config.mjs";
|
|
29
|
+
import Ho from "./components/row/index.vue2.mjs";
|
|
30
|
+
import Lo from "./components/empty/index.vue2.mjs";
|
|
31
|
+
const Ct = /* @__PURE__ */ so({
|
|
32
32
|
name: "AgGrid",
|
|
33
33
|
__name: "index",
|
|
34
34
|
props: {
|
|
@@ -103,13 +103,13 @@ const yt = /* @__PURE__ */ lo({
|
|
|
103
103
|
customRow: {}
|
|
104
104
|
},
|
|
105
105
|
setup(ue, { expose: ce }) {
|
|
106
|
-
|
|
107
|
-
const o = ue,
|
|
108
|
-
|
|
109
|
-
), we =
|
|
110
|
-
let
|
|
111
|
-
const
|
|
112
|
-
|
|
106
|
+
So.registerModules([yo]);
|
|
107
|
+
const o = ue, L = io(), { e: k, b: u, be: me } = Oo("ag-grid"), h = D(o.size), pe = To(h, N(o, "rowHeight")), fe = Mo(N(o, "virtual")), { rowPinnedGridConfig: U, getRowPinnedCellClass: ge } = Vo(
|
|
108
|
+
N(o, "summary")
|
|
109
|
+
), we = Go("apGrid"), s = D(), [, Se] = No();
|
|
110
|
+
let C = !!o.dataSource;
|
|
111
|
+
const j = Ao(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Eo(o), { defaultColDef: Ce, columnDefs: Re, gridWrapperRef: ve } = Ko($, o, ge), x = D({});
|
|
112
|
+
ko({
|
|
113
113
|
sorter: x,
|
|
114
114
|
setSorter(e) {
|
|
115
115
|
x.value = e;
|
|
@@ -130,13 +130,13 @@ const yt = /* @__PURE__ */ lo({
|
|
|
130
130
|
if (!a)
|
|
131
131
|
return;
|
|
132
132
|
const d = a.getColDef(), m = a.getSort(), p = he(d.colId);
|
|
133
|
-
|
|
133
|
+
_(void 0, void 0, {
|
|
134
134
|
column: d,
|
|
135
135
|
field: p?.field ?? d.field ?? d.colId,
|
|
136
136
|
order: m ? be[m] : null
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
|
-
const Be = n(() =>
|
|
139
|
+
const Be = n(() => bo(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 yt = /* @__PURE__ */ lo({
|
|
|
146
146
|
return;
|
|
147
147
|
const r = e.getColumnState()?.map((a) => ({ ...a, sort: null }));
|
|
148
148
|
e.applyColumnState({ state: r });
|
|
149
|
-
}, xe = n(() =>
|
|
150
|
-
formRef:
|
|
151
|
-
submit:
|
|
152
|
-
reset:
|
|
153
|
-
data:
|
|
154
|
-
tableProps:
|
|
155
|
-
handleTableChangeOptional:
|
|
156
|
-
submitWith:
|
|
157
|
-
refresh:
|
|
149
|
+
}, xe = n(() => Po(o.manual) ? o.manual : zo(L.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
|
|
150
|
+
formRef: w,
|
|
151
|
+
submit: T,
|
|
152
|
+
reset: E,
|
|
153
|
+
data: S,
|
|
154
|
+
tableProps: q,
|
|
155
|
+
handleTableChangeOptional: _,
|
|
156
|
+
submitWith: J,
|
|
157
|
+
refresh: Q,
|
|
158
158
|
getPaging: Ie,
|
|
159
|
-
setPaging:
|
|
160
|
-
setDataSource:
|
|
161
|
-
} =
|
|
159
|
+
setPaging: De,
|
|
160
|
+
setDataSource: Ne
|
|
161
|
+
} = Fo({
|
|
162
162
|
async request(e) {
|
|
163
|
-
if (
|
|
163
|
+
if (C = !1, y.value && !y.value.preserveSelectedRowKeys && B(o.dataSource) && z(), !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,139 +174,139 @@ const yt = /* @__PURE__ */ lo({
|
|
|
174
174
|
};
|
|
175
175
|
},
|
|
176
176
|
namespace: "ap-grid",
|
|
177
|
-
filterFields:
|
|
178
|
-
params:
|
|
177
|
+
filterFields: D([]),
|
|
178
|
+
params: N(o, "params"),
|
|
179
179
|
defaultData: o.defaultData,
|
|
180
180
|
manual: t(xe),
|
|
181
181
|
formatParams: o.beforeSearchSubmit,
|
|
182
182
|
pagination: o.pagination,
|
|
183
183
|
sortFields: Be,
|
|
184
184
|
onClickReset: ke
|
|
185
|
-
}),
|
|
185
|
+
}), y = n(() => {
|
|
186
186
|
const e = o.rowSelection || we.value?.rowSelection;
|
|
187
187
|
if (e)
|
|
188
188
|
return e === !0 ? de : {
|
|
189
189
|
...de,
|
|
190
190
|
...e
|
|
191
191
|
};
|
|
192
|
-
}),
|
|
193
|
-
() => B(o.dataSource) ?
|
|
192
|
+
}), Te = Wo(o, g), Ee = n(
|
|
193
|
+
() => B(o.dataSource) ? S.records : o.dataSource
|
|
194
194
|
), {
|
|
195
195
|
select: Ke,
|
|
196
196
|
unSelect: Pe,
|
|
197
|
-
selectedRows:
|
|
197
|
+
selectedRows: K,
|
|
198
198
|
selectedRowKeys: ze,
|
|
199
199
|
clearAll: Ae,
|
|
200
|
-
selectMultiByKeys:
|
|
201
|
-
selectMulti:
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
selectMultiByKeys: Me,
|
|
201
|
+
selectMulti: Ve,
|
|
202
|
+
unSelectMulti: We
|
|
203
|
+
} = Bo({
|
|
204
|
+
...y.value,
|
|
204
205
|
dataSource: Ee,
|
|
205
206
|
rowKey: o.rowKey
|
|
206
|
-
}),
|
|
207
|
+
}), Oe = {
|
|
207
208
|
checkbox: "multiRow",
|
|
208
209
|
radio: "singleRow"
|
|
209
|
-
},
|
|
210
|
-
const e =
|
|
210
|
+
}, Ge = n(() => {
|
|
211
|
+
const e = y.value;
|
|
211
212
|
if (!e)
|
|
212
213
|
return;
|
|
213
214
|
const { type: r = "checkbox", disabled: a } = e;
|
|
214
215
|
return {
|
|
215
|
-
mode:
|
|
216
|
+
mode: Oe[r],
|
|
216
217
|
isRowSelectable: (i) => a ? !a(i.data) : !0,
|
|
217
218
|
hideDisabledCheckboxes: e.hideDisabled ?? !1
|
|
218
219
|
};
|
|
219
220
|
});
|
|
220
|
-
function
|
|
221
|
-
return
|
|
221
|
+
function P(e) {
|
|
222
|
+
return H(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
222
223
|
}
|
|
223
|
-
const
|
|
224
|
+
const I = ({
|
|
224
225
|
api: e = s.value
|
|
225
226
|
}) => {
|
|
226
|
-
if (o.onUpdate?.(), !
|
|
227
|
+
if (o.onUpdate?.(), !y.value)
|
|
227
228
|
return;
|
|
228
|
-
const r =
|
|
229
|
-
|
|
230
|
-
setTimeout(() => {
|
|
231
|
-
g = !0;
|
|
232
|
-
}, 0);
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
g = !1;
|
|
229
|
+
const r = K.value || [];
|
|
230
|
+
C = !1;
|
|
236
231
|
const a = [];
|
|
237
232
|
e.forEachNode((i) => {
|
|
238
|
-
const R = i.data, d =
|
|
239
|
-
r.find((p) =>
|
|
233
|
+
const R = i.data, d = P(R), m = i.isSelected();
|
|
234
|
+
r.find((p) => P(p) === d) ? !m && a.push(i) : m && i.setSelected(!1);
|
|
240
235
|
}), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
|
|
241
|
-
|
|
236
|
+
C = !0;
|
|
242
237
|
}, 0);
|
|
243
|
-
},
|
|
244
|
-
|
|
238
|
+
}, He = (e) => {
|
|
239
|
+
C && (e.node.isSelected() ? Ke(e.data) : Pe(e.data), H(y.value?.tooltip) && e.api.refreshCells({
|
|
245
240
|
rowNodes: [e.node],
|
|
246
241
|
// todo: 取消硬编码
|
|
247
242
|
columns: ["ag-Grid-SelectionColumn"],
|
|
248
243
|
force: !0
|
|
249
244
|
}));
|
|
250
|
-
},
|
|
251
|
-
|
|
245
|
+
}, Le = () => {
|
|
246
|
+
C = !0;
|
|
252
247
|
}, z = () => {
|
|
253
248
|
Ae(), s.value?.deselectAll();
|
|
254
249
|
};
|
|
255
|
-
function
|
|
256
|
-
|
|
257
|
-
|
|
250
|
+
function Ue(e) {
|
|
251
|
+
Me(e), A(() => {
|
|
252
|
+
I({});
|
|
258
253
|
});
|
|
259
254
|
}
|
|
260
|
-
const
|
|
255
|
+
const je = n(() => {
|
|
261
256
|
const e = o.customRow;
|
|
262
257
|
return e ? {
|
|
263
258
|
isFullWidthRow: e.isCustomRow,
|
|
264
|
-
fullWidthCellRenderer:
|
|
259
|
+
fullWidthCellRenderer: Ho,
|
|
265
260
|
fullWidthCellRendererParams: {
|
|
266
261
|
render: e.render
|
|
267
262
|
}
|
|
268
263
|
} : {};
|
|
269
264
|
});
|
|
270
|
-
function
|
|
271
|
-
|
|
272
|
-
|
|
265
|
+
function $e(e) {
|
|
266
|
+
Ve(e), A(() => {
|
|
267
|
+
I({});
|
|
273
268
|
});
|
|
274
269
|
}
|
|
275
|
-
function
|
|
270
|
+
function qe(e) {
|
|
271
|
+
We(e), A(() => {
|
|
272
|
+
I({});
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function X(e = !1) {
|
|
276
276
|
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
277
|
-
return
|
|
277
|
+
return w.value?.apForm?.[r]?.(!0);
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
|
|
279
|
+
function Y(e) {
|
|
280
|
+
w.value?.apForm?.setFieldsValue?.(e);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
return
|
|
282
|
+
function Z() {
|
|
283
|
+
return w.value?.getSorterItems() || [];
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
|
|
285
|
+
function ee(e) {
|
|
286
|
+
w.value?.setSorterItems(e);
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
|
|
288
|
+
function oe() {
|
|
289
|
+
w.value?.resetSorterItems();
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function te(e) {
|
|
292
292
|
return e && String(e);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function _e(e) {
|
|
295
295
|
const r = s.value;
|
|
296
296
|
if (!r)
|
|
297
297
|
return;
|
|
298
298
|
const a = r.getColumnState() || [], i = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean), R = a.map((l) => {
|
|
299
299
|
if (!ye.value.includes(l.colId))
|
|
300
300
|
return l;
|
|
301
|
-
const v = !i.includes(l.colId),
|
|
301
|
+
const v = !i.includes(l.colId), re = {
|
|
302
302
|
...l,
|
|
303
303
|
hide: v
|
|
304
|
-
},
|
|
305
|
-
(
|
|
304
|
+
}, ae = e.find(
|
|
305
|
+
(no) => te(no.key) === l.colId
|
|
306
306
|
);
|
|
307
|
-
return
|
|
307
|
+
return ae && (re.pinned = ae.fixed || null), re;
|
|
308
308
|
}), d = new Map(
|
|
309
|
-
e.map((l, v) => [
|
|
309
|
+
e.map((l, v) => [te(l.key), v])
|
|
310
310
|
), m = R.filter((l) => d.has(l.colId)).sort(
|
|
311
311
|
(l, v) => d.get(l.colId) - d.get(v.colId)
|
|
312
312
|
), p = [];
|
|
@@ -318,138 +318,139 @@ const yt = /* @__PURE__ */ lo({
|
|
|
318
318
|
applyOrder: !0
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
|
-
|
|
322
|
-
columns: n(() =>
|
|
323
|
-
columnsBackup: n(() =>
|
|
324
|
-
size: n(() =>
|
|
321
|
+
xo({
|
|
322
|
+
columns: n(() => g.value),
|
|
323
|
+
columnsBackup: n(() => $.value),
|
|
324
|
+
size: n(() => Do[h.value]),
|
|
325
325
|
updateColumns(e) {
|
|
326
|
-
|
|
326
|
+
g.value = e, o.onShownColumnsChange?.(e), _e(e);
|
|
327
327
|
},
|
|
328
328
|
updateSize(e) {
|
|
329
|
-
|
|
329
|
+
h.value = Io[e];
|
|
330
330
|
},
|
|
331
331
|
renderConfig: n(() => ({
|
|
332
332
|
className: me("table-header", "title"),
|
|
333
333
|
color: Se.value.colorTextTertiary
|
|
334
334
|
})),
|
|
335
|
-
dataSource: n(() => t(
|
|
336
|
-
getSearchFormValues:
|
|
337
|
-
setSearchFormValues:
|
|
338
|
-
submit:
|
|
339
|
-
submitWith:
|
|
340
|
-
reset:
|
|
341
|
-
refresh:
|
|
342
|
-
getSearchFormSorterItems:
|
|
343
|
-
setSearchFormSorterItems:
|
|
344
|
-
resetSearchFormSorterItems:
|
|
335
|
+
dataSource: n(() => t(S).records),
|
|
336
|
+
getSearchFormValues: X,
|
|
337
|
+
setSearchFormValues: Y,
|
|
338
|
+
submit: T,
|
|
339
|
+
submitWith: J,
|
|
340
|
+
reset: E,
|
|
341
|
+
refresh: Q,
|
|
342
|
+
getSearchFormSorterItems: Z,
|
|
343
|
+
setSearchFormSorterItems: ee,
|
|
344
|
+
resetSearchFormSorterItems: oe
|
|
345
345
|
});
|
|
346
|
-
const
|
|
347
|
-
() => B(o.loading) ?
|
|
348
|
-
),
|
|
346
|
+
const Je = n(
|
|
347
|
+
() => B(o.loading) ? S.loading : o.loading
|
|
348
|
+
), Qe = n(() => [
|
|
349
349
|
u(),
|
|
350
350
|
o.card ? null : u("wrapper"),
|
|
351
351
|
u("adaptive"),
|
|
352
|
-
u(`size-${
|
|
353
|
-
].filter(Boolean)),
|
|
352
|
+
u(`size-${h.value}`)
|
|
353
|
+
].filter(Boolean)), Xe = n(() => ({
|
|
354
354
|
height: "100%",
|
|
355
355
|
...o.tableStyle || {}
|
|
356
|
-
})),
|
|
357
|
-
|
|
356
|
+
})), Ye = (e, r) => {
|
|
357
|
+
_({ current: e, pageSize: r });
|
|
358
358
|
};
|
|
359
|
-
function
|
|
359
|
+
function Ze(e) {
|
|
360
360
|
const r = e.data;
|
|
361
|
-
return
|
|
361
|
+
return P(r);
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function eo(e, r) {
|
|
364
364
|
s.value?.ensureIndexVisible(e, r);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function oo(e) {
|
|
367
367
|
o.onRowClicked?.(e.data, e.event);
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function to(e) {
|
|
370
370
|
o.onScrollEnd?.(e.direction);
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function ro(e) {
|
|
373
373
|
return s.value?.refreshCells(e);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function ao(e) {
|
|
376
376
|
return s.value?.redrawRows(e);
|
|
377
377
|
}
|
|
378
|
-
const
|
|
378
|
+
const lo = (e) => {
|
|
379
379
|
const r = [
|
|
380
|
-
|
|
380
|
+
U.value.getRowClass?.(e)
|
|
381
381
|
];
|
|
382
382
|
if (!e.node.rowPinned) {
|
|
383
|
-
const a =
|
|
383
|
+
const a = H(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
|
|
384
384
|
r.push(a);
|
|
385
385
|
}
|
|
386
386
|
return r.flat().filter(Boolean);
|
|
387
387
|
};
|
|
388
|
-
return
|
|
388
|
+
return M(
|
|
389
389
|
() => o.dataSource,
|
|
390
390
|
(e) => {
|
|
391
|
-
|
|
391
|
+
Ne(e);
|
|
392
392
|
},
|
|
393
393
|
{ immediate: !0, deep: !0 }
|
|
394
|
-
),
|
|
394
|
+
), M(
|
|
395
395
|
() => o.size,
|
|
396
396
|
(e) => {
|
|
397
|
-
|
|
397
|
+
h.value = e;
|
|
398
398
|
}
|
|
399
|
-
),
|
|
400
|
-
() => t(
|
|
399
|
+
), M(
|
|
400
|
+
() => t(S).loading,
|
|
401
401
|
(e) => {
|
|
402
402
|
o.onLoadingChange?.(e);
|
|
403
403
|
}
|
|
404
404
|
), ce({
|
|
405
|
-
submit:
|
|
406
|
-
reset:
|
|
407
|
-
refresh:
|
|
408
|
-
submitWith:
|
|
409
|
-
setSearchFormValues:
|
|
410
|
-
getSearchFormValues:
|
|
411
|
-
getShowColumns: () => t(
|
|
405
|
+
submit: T,
|
|
406
|
+
reset: E,
|
|
407
|
+
refresh: Q,
|
|
408
|
+
submitWith: J,
|
|
409
|
+
setSearchFormValues: Y,
|
|
410
|
+
getSearchFormValues: X,
|
|
411
|
+
getShowColumns: () => t(g),
|
|
412
412
|
rowSelection: {
|
|
413
|
-
selectedRows: n(() =>
|
|
414
|
-
setSelectedRowKeys:
|
|
415
|
-
setSelectedRows:
|
|
416
|
-
clearAll: z
|
|
413
|
+
selectedRows: n(() => K.value),
|
|
414
|
+
setSelectedRowKeys: Ue,
|
|
415
|
+
setSelectedRows: $e,
|
|
416
|
+
clearAll: z,
|
|
417
|
+
unSelectRows: qe
|
|
417
418
|
},
|
|
418
|
-
scrollToRow:
|
|
419
|
-
getDataSource: () => t(
|
|
419
|
+
scrollToRow: eo,
|
|
420
|
+
getDataSource: () => t(S.records),
|
|
420
421
|
getPaging: Ie,
|
|
421
|
-
setPaging:
|
|
422
|
-
getSearchFormSorterItems:
|
|
423
|
-
setSearchFormSorterItems:
|
|
424
|
-
resetSearchFormSorterItems:
|
|
425
|
-
refreshCells:
|
|
426
|
-
redrawRows:
|
|
422
|
+
setPaging: De,
|
|
423
|
+
getSearchFormSorterItems: Z,
|
|
424
|
+
setSearchFormSorterItems: ee,
|
|
425
|
+
resetSearchFormSorterItems: oe,
|
|
426
|
+
refreshCells: ro,
|
|
427
|
+
redrawRows: ao,
|
|
427
428
|
_internalGridApi: n(() => s.value)
|
|
428
429
|
}), (e, r) => (b(), V("div", {
|
|
429
|
-
class: f(
|
|
430
|
-
style:
|
|
430
|
+
class: f(Qe.value),
|
|
431
|
+
style: W(e.wrapperStyle)
|
|
431
432
|
}, [
|
|
432
|
-
t(B)(e.dataSource) && e.searchForm !== !1 && t(
|
|
433
|
+
t(B)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (b(), V("div", {
|
|
433
434
|
key: 0,
|
|
434
435
|
class: f(e.card ? t(k)("search-wrapper") : null),
|
|
435
|
-
style:
|
|
436
|
+
style: W(e.searchFormWrapperStyle)
|
|
436
437
|
}, [
|
|
437
|
-
|
|
438
|
+
O(t(vo).SearchForm, G(e.searchForm || {}, {
|
|
438
439
|
ref_key: "formRef",
|
|
439
|
-
ref:
|
|
440
|
+
ref: w,
|
|
440
441
|
"custom-reset": "",
|
|
441
|
-
"submit-loading": t(
|
|
442
|
-
onSubmit: t(
|
|
443
|
-
onReset: t(
|
|
444
|
-
}),
|
|
442
|
+
"submit-loading": t(q).loading,
|
|
443
|
+
onSubmit: t(T),
|
|
444
|
+
onReset: t(E)
|
|
445
|
+
}), uo({
|
|
445
446
|
default: ne(() => [
|
|
446
|
-
(b(!0), V(
|
|
447
|
+
(b(!0), V(co, null, mo(t(j), (a) => (b(), se(po(a.renderNode), {
|
|
447
448
|
key: a.dataIndex
|
|
448
449
|
}))), 128))
|
|
449
450
|
]),
|
|
450
451
|
_: 2
|
|
451
452
|
}, [
|
|
452
|
-
|
|
453
|
+
L.searchFormExtra ? {
|
|
453
454
|
name: "extra",
|
|
454
455
|
fn: ne(() => [
|
|
455
456
|
ie(e.$slots, "searchFormExtra")
|
|
@@ -460,15 +461,15 @@ const yt = /* @__PURE__ */ lo({
|
|
|
460
461
|
], 6)) : le("", !0),
|
|
461
462
|
F("div", {
|
|
462
463
|
class: f([t(k)("table-wrapper"), e.card ? t(k)("table-wrapper-card") : null]),
|
|
463
|
-
style:
|
|
464
|
+
style: W(e.tableWrapperStyle)
|
|
464
465
|
}, [
|
|
465
466
|
F("div", {
|
|
466
467
|
class: f(t(u)("header-wrapper"))
|
|
467
468
|
}, [
|
|
468
469
|
ie(e.$slots, "title", {
|
|
469
|
-
selectedRows: t(
|
|
470
|
+
selectedRows: t(K),
|
|
470
471
|
selectedRowKeys: t(ze),
|
|
471
|
-
shownColumns: t(
|
|
472
|
+
shownColumns: t(g),
|
|
472
473
|
clearAll: z
|
|
473
474
|
})
|
|
474
475
|
], 2),
|
|
@@ -477,56 +478,56 @@ const yt = /* @__PURE__ */ lo({
|
|
|
477
478
|
ref: ve,
|
|
478
479
|
class: f(t(u)("grid-wrapper"))
|
|
479
480
|
}, [
|
|
480
|
-
|
|
481
|
-
t(
|
|
481
|
+
O(t(wo), G(
|
|
482
|
+
t(ho)(t(fe), t(U), je.value),
|
|
482
483
|
{
|
|
483
|
-
"get-row-class":
|
|
484
|
-
style:
|
|
485
|
-
"row-data": t(
|
|
484
|
+
"get-row-class": lo,
|
|
485
|
+
style: Xe.value,
|
|
486
|
+
"row-data": t(S).records,
|
|
486
487
|
"column-defs": t(Re),
|
|
487
488
|
"default-col-def": t(Ce),
|
|
488
489
|
"suppress-loading-overlay": "",
|
|
489
|
-
"row-selection":
|
|
490
|
-
"selection-column-def": t(
|
|
491
|
-
"get-row-id":
|
|
490
|
+
"row-selection": Ge.value,
|
|
491
|
+
"selection-column-def": t(Te),
|
|
492
|
+
"get-row-id": Ze,
|
|
492
493
|
"get-row-height": o.getRowHeight,
|
|
493
494
|
theme: t(pe),
|
|
494
495
|
"tooltip-show-delay": 500,
|
|
495
496
|
"enable-browser-tooltips": e.browserTooltips,
|
|
496
497
|
"tooltip-interaction": "",
|
|
497
498
|
"row-class-rules": e.rowClassRules,
|
|
498
|
-
"no-rows-overlay-component":
|
|
499
|
+
"no-rows-overlay-component": Lo,
|
|
499
500
|
"suppress-cell-focus": "",
|
|
500
501
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
501
502
|
onSortChanged: Fe,
|
|
502
503
|
onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
|
|
503
|
-
onRowDataUpdated:
|
|
504
|
-
onRowSelected:
|
|
505
|
-
onFirstDataRendered:
|
|
506
|
-
onRowClicked:
|
|
507
|
-
onBodyScrollEnd:
|
|
504
|
+
onRowDataUpdated: I,
|
|
505
|
+
onRowSelected: He,
|
|
506
|
+
onFirstDataRendered: Le,
|
|
507
|
+
onRowClicked: oo,
|
|
508
|
+
onBodyScrollEnd: to
|
|
508
509
|
}
|
|
509
510
|
), 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"]),
|
|
510
|
-
|
|
511
|
+
fo(F("div", {
|
|
511
512
|
class: f(t(k)("table-loading-wrapper"))
|
|
512
513
|
}, [
|
|
513
|
-
|
|
514
|
+
O(t(Co), { delay: 300 })
|
|
514
515
|
], 2), [
|
|
515
|
-
[
|
|
516
|
+
[go, Je.value]
|
|
516
517
|
])
|
|
517
518
|
], 2),
|
|
518
519
|
F("div", {
|
|
519
520
|
class: f(t(u)("pagination-wrapper"))
|
|
520
521
|
}, [
|
|
521
|
-
e.pagination !== !1 ? (b(), se(t(
|
|
522
|
+
e.pagination !== !1 ? (b(), se(t(Ro), G({
|
|
522
523
|
key: 0,
|
|
523
524
|
class: t(u)("pagination")
|
|
524
|
-
}, t(
|
|
525
|
+
}, t(q).pagination, { onChange: Ye }), null, 16, ["class"])) : le("", !0)
|
|
525
526
|
], 2)
|
|
526
527
|
], 6)
|
|
527
528
|
], 6));
|
|
528
529
|
}
|
|
529
530
|
});
|
|
530
531
|
export {
|
|
531
|
-
|
|
532
|
+
Ct as default
|
|
532
533
|
};
|
|
@@ -103,6 +103,14 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
103
103
|
* @description 仅限内部使用
|
|
104
104
|
*/
|
|
105
105
|
_requireMark?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* 自定义列表头样式
|
|
108
|
+
*/
|
|
109
|
+
headerStyle?: ColDef<RecordType>['headerStyle'];
|
|
110
|
+
/**
|
|
111
|
+
* 自定表头列类名
|
|
112
|
+
*/
|
|
113
|
+
headerClass?: ColDef<RecordType>['headerClass'];
|
|
106
114
|
} : null;
|
|
107
115
|
export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>, 'type' | 'fixed' | 'columnWidth' | 'defaultSelectedRowKeys'> & {
|
|
108
116
|
/**
|
|
@@ -370,6 +378,12 @@ export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
370
378
|
* @returns
|
|
371
379
|
*/
|
|
372
380
|
setSelectedRows: (rows: RecordType[]) => void;
|
|
381
|
+
/**
|
|
382
|
+
* 反选中行
|
|
383
|
+
* @param rows
|
|
384
|
+
* @returns
|
|
385
|
+
*/
|
|
386
|
+
unSelectRows: (rows: RecordType[]) => void;
|
|
373
387
|
clearAll: () => void;
|
|
374
388
|
};
|
|
375
389
|
/**
|