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