@aplus-frontend/ui 6.23.0 → 6.24.1
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/body-cell/index.vue2.mjs +2 -1
- package/es/src/ag-grid/hooks/use-columns-def.d.ts +13 -0
- package/es/src/ag-grid/hooks/use-columns-def.mjs +140 -0
- package/es/src/ag-grid/hooks/use-columns.d.ts +9 -0
- package/es/src/ag-grid/hooks/use-columns.mjs +26 -0
- package/es/src/ag-grid/index.vue.mjs +268 -322
- package/es/src/ag-grid/interface.d.ts +13 -1
- package/es/src/ag-grid/renderer/checkbox.d.ts +2 -0
- package/es/src/ag-grid/renderer/checkbox.mjs +8 -0
- package/es/src/ag-grid/renderer/date-range.d.ts +2 -0
- package/es/src/ag-grid/renderer/date-range.mjs +15 -0
- package/es/src/ag-grid/renderer/date.d.ts +2 -0
- package/es/src/ag-grid/renderer/date.mjs +19 -0
- package/es/src/ag-grid/renderer/index.d.ts +26 -0
- package/es/src/ag-grid/renderer/index.mjs +40 -0
- package/es/src/ag-grid/renderer/number.d.ts +2 -0
- package/es/src/ag-grid/renderer/number.mjs +13 -0
- package/es/src/ag-grid/renderer/password.d.ts +2 -0
- package/es/src/ag-grid/renderer/password.mjs +6 -0
- package/es/src/ag-grid/renderer/radio.d.ts +2 -0
- package/es/src/ag-grid/renderer/radio.mjs +18 -0
- package/es/src/ag-grid/renderer/rate.d.ts +2 -0
- package/es/src/ag-grid/renderer/segmented.d.ts +2 -0
- package/es/src/ag-grid/renderer/select.d.ts +2 -0
- package/es/src/ag-grid/renderer/select.mjs +20 -0
- package/es/src/ag-grid/renderer/slider.d.ts +2 -0
- package/es/src/ag-grid/renderer/switch.d.ts +2 -0
- package/es/src/ag-grid/renderer/switch.mjs +7 -0
- package/es/src/ag-grid/renderer/text-area.d.ts +2 -0
- package/es/src/ag-grid/renderer/text-area.mjs +7 -0
- package/es/src/ag-grid/renderer/text.d.ts +2 -0
- package/es/src/ag-grid/renderer/text.mjs +8 -0
- package/es/src/ag-grid/renderer/tree-select.d.ts +2 -0
- package/es/src/ag-grid/renderer/tree-select.mjs +20 -0
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +49 -47
- package/es/src/ap-grid/utils/col.d.ts +2 -1
- package/es/src/ap-grid/utils/col.mjs +69 -69
- package/es/src/ap-pro-card/components/card/index.vue.d.ts +11 -1
- package/es/src/ap-pro-card/components/card/index.vue2.mjs +159 -117
- package/es/src/ap-pro-card/components/statistic-card/index.vue.d.ts +11 -1
- package/es/src/ap-pro-card/components/statistic-card/index.vue2.mjs +59 -42
- package/es/src/ap-pro-card/interface.d.ts +30 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/body-cell/index.vue2.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.d.ts +13 -0
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -0
- package/lib/src/ag-grid/hooks/use-columns.d.ts +9 -0
- package/lib/src/ag-grid/hooks/use-columns.js +1 -0
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +13 -1
- package/lib/src/ag-grid/renderer/checkbox.d.ts +2 -0
- package/lib/src/ag-grid/renderer/checkbox.js +1 -0
- package/lib/src/ag-grid/renderer/date-range.d.ts +2 -0
- package/lib/src/ag-grid/renderer/date-range.js +1 -0
- package/lib/src/ag-grid/renderer/date.d.ts +2 -0
- package/lib/src/ag-grid/renderer/date.js +1 -0
- package/lib/src/ag-grid/renderer/index.d.ts +26 -0
- package/lib/src/ag-grid/renderer/index.js +1 -0
- package/lib/src/ag-grid/renderer/number.d.ts +2 -0
- package/lib/src/ag-grid/renderer/number.js +1 -0
- package/lib/src/ag-grid/renderer/password.d.ts +2 -0
- package/lib/src/ag-grid/renderer/password.js +1 -0
- package/lib/src/ag-grid/renderer/radio.d.ts +2 -0
- package/lib/src/ag-grid/renderer/radio.js +1 -0
- package/lib/src/ag-grid/renderer/rate.d.ts +2 -0
- package/lib/src/ag-grid/renderer/segmented.d.ts +2 -0
- package/lib/src/ag-grid/renderer/select.d.ts +2 -0
- package/lib/src/ag-grid/renderer/select.js +1 -0
- package/lib/src/ag-grid/renderer/slider.d.ts +2 -0
- package/lib/src/ag-grid/renderer/switch.d.ts +2 -0
- package/lib/src/ag-grid/renderer/switch.js +1 -0
- package/lib/src/ag-grid/renderer/text-area.d.ts +2 -0
- package/lib/src/ag-grid/renderer/text-area.js +1 -0
- package/lib/src/ag-grid/renderer/text.d.ts +2 -0
- package/lib/src/ag-grid/renderer/text.js +1 -0
- package/lib/src/ag-grid/renderer/tree-select.d.ts +2 -0
- package/lib/src/ag-grid/renderer/tree-select.js +1 -0
- package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/ap-grid/utils/col.d.ts +2 -1
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-pro-card/components/card/index.vue.d.ts +11 -1
- package/lib/src/ap-pro-card/components/card/index.vue2.js +1 -1
- package/lib/src/ap-pro-card/components/statistic-card/index.vue.d.ts +11 -1
- package/lib/src/ap-pro-card/components/statistic-card/index.vue2.js +1 -1
- package/lib/src/ap-pro-card/interface.d.ts +30 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/theme/ag-grid/index.css +9 -0
- package/theme/ag-grid/index.less +9 -0
- package/theme/ap-pro-card/index.css +32 -4
- package/theme/ap-pro-card/index.less +32 -4
- package/theme/ap-tag/ap-tag.css +4 -2
- package/theme/ap-tag/ap-tag.less +4 -2
- package/theme/index.css +45 -6
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { Spin as
|
|
5
|
-
import {
|
|
1
|
+
import { defineComponent as Ne, useSlots as Pe, ref as b, toRef as q, computed as s, unref as n, nextTick as Ve, watch as U, createElementBlock as I, openBlock as S, normalizeStyle as R, normalizeClass as c, createCommentVNode as $, createElementVNode as h, createVNode as k, mergeProps as J, createSlots as Ae, withCtx as Q, Fragment as Ke, renderList as Ee, createBlock as X, resolveDynamicComponent as Me, renderSlot as Y, withDirectives as Oe, vShow as We } from "vue";
|
|
2
|
+
import { AgGridVue as Le } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as Ge, AllCommunityModule as He } from "ag-grid-community";
|
|
4
|
+
import { Spin as je, Pagination as qe } from "@aplus-frontend/antdv";
|
|
5
|
+
import { isUndefined as C, isFunction as Ue } from "lodash-unified";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { ApForm as
|
|
8
|
-
import { noRenderAsFormItemValueList as
|
|
9
|
-
import { getColumnOrder as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import "
|
|
14
|
-
import "
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { useNamespace as
|
|
22
|
-
import { useGlobalConfig as
|
|
23
|
-
|
|
24
|
-
import gt from "./components/header-cell/index.vue2.mjs";
|
|
25
|
-
const Lt = /* @__PURE__ */ Ve({
|
|
7
|
+
import { ApForm as $e } from "../ap-form/index.mjs";
|
|
8
|
+
import { noRenderAsFormItemValueList as Je } from "../ap-table/constants.mjs";
|
|
9
|
+
import { getColumnOrder as Z, updateFormProps as Qe, getFieldProps as Xe, getSearchFormItemRenderNode as Ye, recursionApColumns as Ze } from "../ap-table/utils.mjs";
|
|
10
|
+
import { useTablePaging as _e } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import eo from "./hooks/use-row-selection.mjs";
|
|
12
|
+
import { useProvideSorter as oo } from "./context.mjs";
|
|
13
|
+
import { useProvideApTable as to } from "../ap-table/context.mjs";
|
|
14
|
+
import { sizeReverseMap as ro, sizeMap as ao } from "../ap-grid/constants.mjs";
|
|
15
|
+
import { useToken as no } from "@aplus-frontend/antdv/es/theme/internal";
|
|
16
|
+
import { useTheme as lo } from "./theme.mjs";
|
|
17
|
+
import { useColumns as so } from "./hooks/use-columns.mjs";
|
|
18
|
+
import { useColumnsDef as io } from "./hooks/use-columns-def.mjs";
|
|
19
|
+
import { isDef as uo } from "../utils/index.mjs";
|
|
20
|
+
import { getValidVNodeList as co } from "../utils/slot.mjs";
|
|
21
|
+
import { useNamespace as mo } from "../config-provider/hooks/use-namespace.mjs";
|
|
22
|
+
import { useGlobalConfig as po } from "../config-provider/hooks/use-global-config.mjs";
|
|
23
|
+
const Ko = /* @__PURE__ */ Ne({
|
|
26
24
|
name: "AgGrid",
|
|
27
25
|
__name: "index",
|
|
28
26
|
props: {
|
|
@@ -84,424 +82,372 @@ const Lt = /* @__PURE__ */ Ve({
|
|
|
84
82
|
columnResizable: { type: Boolean, default: !1 },
|
|
85
83
|
loading: { type: Boolean, default: void 0 },
|
|
86
84
|
summary: {},
|
|
87
|
-
rowHeight: {}
|
|
85
|
+
rowHeight: {},
|
|
86
|
+
advanceRenderer: { type: Boolean },
|
|
87
|
+
browserTooltips: { type: Boolean }
|
|
88
88
|
},
|
|
89
|
-
setup(
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
let w = !!
|
|
93
|
-
const
|
|
94
|
-
var e,
|
|
95
|
-
return
|
|
96
|
-
(
|
|
97
|
-
)) == null ? void 0 :
|
|
98
|
-
let i =
|
|
99
|
-
return
|
|
100
|
-
})) == null ? void 0 : a.map((
|
|
101
|
-
const l =
|
|
102
|
-
|
|
103
|
-
|
|
89
|
+
setup(_, { expose: ee }) {
|
|
90
|
+
Ge.registerModules([He]);
|
|
91
|
+
const t = _, y = Pe(), { e: v, b: d, be: oe } = mo("ag-grid"), f = b(t.size), te = lo(f, q(t, "rowHeight")), g = b(), [, re] = no();
|
|
92
|
+
let w = !!t.dataSource, z = 0;
|
|
93
|
+
const ae = po("valueTypeMap"), D = s(() => {
|
|
94
|
+
var e, o, a;
|
|
95
|
+
return z++, ((a = (o = (e = t.columns) == null ? void 0 : e.filter(
|
|
96
|
+
(r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !Je.includes(r.valueType)
|
|
97
|
+
)) == null ? void 0 : o.sort((r, l) => {
|
|
98
|
+
let i = Z(r.order);
|
|
99
|
+
return Z(l.order) - i;
|
|
100
|
+
})) == null ? void 0 : a.map((r) => {
|
|
101
|
+
const l = Qe(
|
|
102
|
+
r,
|
|
103
|
+
Xe(r.fieldProps, {})
|
|
104
104
|
), i = {
|
|
105
|
-
...
|
|
105
|
+
...r,
|
|
106
106
|
fieldProps: {
|
|
107
|
-
label:
|
|
108
|
-
name:
|
|
107
|
+
label: r.title,
|
|
108
|
+
name: r.dataIndex,
|
|
109
109
|
// tips: 在表格中的查询表单项默认是带边框的
|
|
110
110
|
bordered: !0,
|
|
111
111
|
...l || {},
|
|
112
|
-
_signal:
|
|
112
|
+
_signal: z
|
|
113
113
|
},
|
|
114
114
|
renderNode: void 0
|
|
115
115
|
};
|
|
116
|
-
return i.renderNode =
|
|
116
|
+
return i.renderNode = Ye(
|
|
117
117
|
i,
|
|
118
|
-
n(
|
|
118
|
+
n(ae)
|
|
119
119
|
), i;
|
|
120
120
|
})) || [];
|
|
121
|
-
}),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
() => o.columns,
|
|
128
|
-
() => {
|
|
129
|
-
var r;
|
|
130
|
-
const e = de();
|
|
131
|
-
c.value = e, N.value = e, (r = o.onShownColumnsChange) == null || r.call(o, e);
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
deep: !0,
|
|
135
|
-
immediate: !0
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
const ce = s(() => {
|
|
139
|
-
const e = n(c);
|
|
140
|
-
function r(a) {
|
|
141
|
-
return a.map((t) => {
|
|
142
|
-
var i;
|
|
143
|
-
const l = {
|
|
144
|
-
field: rt(t.dataIndex),
|
|
145
|
-
colId: at(t.key) ? String(t.key) : void 0,
|
|
146
|
-
sortable: !!t.sorter,
|
|
147
|
-
comparator: t.sorter === !0 ? () => 0 : t.sorter,
|
|
148
|
-
headerComponentParams: {
|
|
149
|
-
column: t
|
|
150
|
-
},
|
|
151
|
-
cellRendererParams: {
|
|
152
|
-
column: t,
|
|
153
|
-
extraValueType: n(A)
|
|
154
|
-
},
|
|
155
|
-
resizable: t.resizable,
|
|
156
|
-
width: t.width,
|
|
157
|
-
minWidth: t.minWidth,
|
|
158
|
-
maxWidth: t.maxWidth,
|
|
159
|
-
flex: t.width ? void 0 : 1,
|
|
160
|
-
// 如果没有设置确切的宽度,则设置为可自由伸缩列
|
|
161
|
-
pinned: t.fixed || null,
|
|
162
|
-
// undefined to null
|
|
163
|
-
colSpan: t.colSpan,
|
|
164
|
-
cellClass: (h) => {
|
|
165
|
-
const I = t.cellClass || "", Ne = ee(I) ? I(h.data, h.node) : I;
|
|
166
|
-
return [
|
|
167
|
-
`${ne("cell", t.align || "left")}`,
|
|
168
|
-
Ne
|
|
169
|
-
].flat().filter(Boolean);
|
|
170
|
-
},
|
|
171
|
-
wrapText: !t.ellipsis,
|
|
172
|
-
autoHeight: !t.ellipsis
|
|
173
|
-
};
|
|
174
|
-
return (i = t.children) != null && i.length ? {
|
|
175
|
-
...l,
|
|
176
|
-
children: r(t.children)
|
|
177
|
-
} : l;
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
return r(e);
|
|
181
|
-
}), ue = u({
|
|
182
|
-
headerComponent: gt,
|
|
183
|
-
cellRenderer: ft,
|
|
184
|
-
resizable: o.columnResizable,
|
|
185
|
-
suppressMovable: !0,
|
|
186
|
-
cellDataType: !1,
|
|
187
|
-
cellStyle: {
|
|
188
|
-
whiteSpace: "pre-line"
|
|
189
|
-
}
|
|
190
|
-
}), V = u({});
|
|
191
|
-
lt({
|
|
192
|
-
sorter: V,
|
|
121
|
+
}), { shownColumns: u, shownColumnsBackup: ne } = so(t), { defaultColDef: le, columnDefs: se } = io(
|
|
122
|
+
u,
|
|
123
|
+
t
|
|
124
|
+
), N = b({});
|
|
125
|
+
oo({
|
|
126
|
+
sorter: N,
|
|
193
127
|
setSorter(e) {
|
|
194
|
-
|
|
128
|
+
N.value = e;
|
|
195
129
|
}
|
|
196
130
|
});
|
|
197
|
-
const
|
|
131
|
+
const ie = {
|
|
198
132
|
asc: "ascend",
|
|
199
133
|
desc: "descend"
|
|
200
134
|
};
|
|
201
|
-
function
|
|
135
|
+
function de() {
|
|
202
136
|
var l;
|
|
203
|
-
const e = (l =
|
|
137
|
+
const e = (l = g.value.getColumns()) == null ? void 0 : l.filter((i) => i.getSort() !== void 0);
|
|
204
138
|
if (!(e != null && e.length))
|
|
205
139
|
return;
|
|
206
|
-
const
|
|
207
|
-
|
|
140
|
+
const o = e[0], a = o.getColDef(), r = o.getSort();
|
|
141
|
+
V(void 0, void 0, {
|
|
208
142
|
column: a,
|
|
209
143
|
field: a.field,
|
|
210
|
-
order:
|
|
144
|
+
order: r ? ie[r] : null
|
|
211
145
|
});
|
|
212
146
|
}
|
|
213
|
-
const
|
|
147
|
+
const ue = s(() => Ze(n(u), (e) => {
|
|
214
148
|
if (e.sorter === !0)
|
|
215
149
|
return e.key || e.dataIndex;
|
|
216
|
-
}).filter(Boolean)), {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
150
|
+
}).filter(Boolean)), ce = s(() => {
|
|
151
|
+
var o;
|
|
152
|
+
return uo(t.manual) ? t.manual : co(((o = y.searchFormExtra) == null ? void 0 : o.call(y)) || []).some((a) => {
|
|
153
|
+
var r;
|
|
154
|
+
return ((r = a.type) == null ? void 0 : r.name) === "ApView";
|
|
155
|
+
});
|
|
156
|
+
}), {
|
|
157
|
+
formRef: m,
|
|
158
|
+
submit: F,
|
|
159
|
+
reset: x,
|
|
160
|
+
data: p,
|
|
161
|
+
tableProps: P,
|
|
162
|
+
handleTableChangeOptional: V,
|
|
163
|
+
submitWith: A,
|
|
164
|
+
refresh: K,
|
|
165
|
+
getPaging: me,
|
|
166
|
+
setPaging: pe
|
|
167
|
+
} = _e({
|
|
228
168
|
async request(e) {
|
|
229
169
|
var a;
|
|
230
|
-
if (w = !1, !
|
|
231
|
-
const
|
|
170
|
+
if (w = !1, !C(t.dataSource)) {
|
|
171
|
+
const r = e.pageSize * (e.current - 1);
|
|
232
172
|
return {
|
|
233
|
-
data: (
|
|
234
|
-
total:
|
|
173
|
+
data: (t.pagination === !1 ? t.dataSource : t.dataSource.slice(r, r + e.pageSize)) || [],
|
|
174
|
+
total: t.dataSource.length || 0
|
|
235
175
|
};
|
|
236
176
|
}
|
|
237
|
-
const
|
|
177
|
+
const o = await ((a = t.request) == null ? void 0 : a.call(t, e));
|
|
238
178
|
return {
|
|
239
|
-
data: (
|
|
240
|
-
total: (
|
|
179
|
+
data: (o == null ? void 0 : o.data) || [],
|
|
180
|
+
total: (o == null ? void 0 : o.total) || 0
|
|
241
181
|
};
|
|
242
182
|
},
|
|
243
183
|
namespace: "ap-grid",
|
|
244
|
-
filterFields:
|
|
245
|
-
params:
|
|
246
|
-
defaultData:
|
|
247
|
-
manual:
|
|
248
|
-
formatParams:
|
|
249
|
-
pagination:
|
|
250
|
-
sortFields:
|
|
251
|
-
}),
|
|
252
|
-
() =>
|
|
184
|
+
filterFields: b([]),
|
|
185
|
+
params: q(t, "params"),
|
|
186
|
+
defaultData: t.defaultData,
|
|
187
|
+
manual: n(ce),
|
|
188
|
+
formatParams: t.beforeSearchSubmit,
|
|
189
|
+
pagination: t.pagination,
|
|
190
|
+
sortFields: ue
|
|
191
|
+
}), fe = s(
|
|
192
|
+
() => C(t.dataSource) ? p.records : t.dataSource
|
|
253
193
|
), {
|
|
254
|
-
select:
|
|
255
|
-
unSelect:
|
|
256
|
-
selectedRows:
|
|
257
|
-
selectedRowKeys:
|
|
258
|
-
clearAll:
|
|
259
|
-
selectMultiByKeys:
|
|
260
|
-
} =
|
|
261
|
-
...
|
|
262
|
-
dataSource:
|
|
263
|
-
rowKey:
|
|
264
|
-
}),
|
|
194
|
+
select: ge,
|
|
195
|
+
unSelect: we,
|
|
196
|
+
selectedRows: B,
|
|
197
|
+
selectedRowKeys: Se,
|
|
198
|
+
clearAll: he,
|
|
199
|
+
selectMultiByKeys: ye
|
|
200
|
+
} = eo({
|
|
201
|
+
...t.rowSelection === !0 ? {} : t.rowSelection,
|
|
202
|
+
dataSource: fe,
|
|
203
|
+
rowKey: t.rowKey
|
|
204
|
+
}), ve = {
|
|
265
205
|
checkbox: "multiRow",
|
|
266
206
|
radio: "singleRow"
|
|
267
|
-
},
|
|
268
|
-
if (!
|
|
207
|
+
}, be = s(() => {
|
|
208
|
+
if (!t.rowSelection)
|
|
269
209
|
return;
|
|
270
|
-
const { type: e = "checkbox", disabled:
|
|
210
|
+
const { type: e = "checkbox", disabled: o } = t.rowSelection === !0 ? {} : t.rowSelection;
|
|
271
211
|
return {
|
|
272
|
-
mode:
|
|
273
|
-
isRowSelectable: (a) =>
|
|
212
|
+
mode: ve[e],
|
|
213
|
+
isRowSelectable: (a) => o ? !o(a.data) : !0
|
|
274
214
|
};
|
|
275
|
-
}),
|
|
276
|
-
if (!
|
|
215
|
+
}), Re = s(() => {
|
|
216
|
+
if (!t.rowSelection)
|
|
277
217
|
return;
|
|
278
|
-
const e =
|
|
279
|
-
|
|
218
|
+
const e = t.rowSelection === !0 ? {} : t.rowSelection;
|
|
219
|
+
let o = e.fixed;
|
|
220
|
+
return o === void 0 && (o = u.value.some(
|
|
221
|
+
(a) => a.fixed === "left" || a.fixed === !0
|
|
222
|
+
) ? "left" : void 0), {
|
|
280
223
|
sortable: !1,
|
|
281
224
|
resizable: !1,
|
|
282
225
|
width: e.columnWidth || 60,
|
|
283
|
-
pinned:
|
|
226
|
+
pinned: o
|
|
284
227
|
};
|
|
285
228
|
});
|
|
286
|
-
function
|
|
287
|
-
return
|
|
229
|
+
function T(e) {
|
|
230
|
+
return Ue(t.rowKey) ? t.rowKey(e) : e[t.rowKey];
|
|
288
231
|
}
|
|
289
|
-
const
|
|
290
|
-
api: e =
|
|
232
|
+
const E = ({
|
|
233
|
+
api: e = g.value
|
|
291
234
|
}) => {
|
|
292
|
-
if (!
|
|
235
|
+
if (!t.rowSelection)
|
|
293
236
|
return;
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
237
|
+
const o = B.value;
|
|
238
|
+
if (!o.length)
|
|
296
239
|
return;
|
|
297
240
|
w = !1;
|
|
298
241
|
const a = [];
|
|
299
|
-
e.forEachNode((
|
|
300
|
-
const l =
|
|
301
|
-
|
|
242
|
+
e.forEachNode((r) => {
|
|
243
|
+
const l = r.data, i = T(l);
|
|
244
|
+
o.find((j) => T(j) === i) && a.push(r);
|
|
302
245
|
}), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
|
|
303
246
|
w = !0;
|
|
304
247
|
}, 0);
|
|
305
|
-
},
|
|
306
|
-
w && (e.node.isSelected() ?
|
|
307
|
-
},
|
|
248
|
+
}, Ce = (e) => {
|
|
249
|
+
w && (e.node.isSelected() ? ge(e.data) : we(e.data));
|
|
250
|
+
}, Fe = () => {
|
|
308
251
|
w = !0;
|
|
309
|
-
},
|
|
252
|
+
}, M = () => {
|
|
310
253
|
var e;
|
|
311
|
-
|
|
254
|
+
he(), (e = g.value) == null || e.deselectAll();
|
|
312
255
|
};
|
|
313
|
-
function
|
|
314
|
-
|
|
315
|
-
|
|
256
|
+
function xe(e) {
|
|
257
|
+
ye(e), Ve(() => {
|
|
258
|
+
E({});
|
|
316
259
|
});
|
|
317
260
|
}
|
|
318
|
-
function
|
|
319
|
-
var a,
|
|
320
|
-
const
|
|
321
|
-
return (l = (
|
|
261
|
+
function O(e = !1) {
|
|
262
|
+
var a, r, l;
|
|
263
|
+
const o = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
264
|
+
return (l = (r = (a = m.value) == null ? void 0 : a.apForm) == null ? void 0 : r[o]) == null ? void 0 : l.call(r, !0);
|
|
322
265
|
}
|
|
323
|
-
function
|
|
324
|
-
var
|
|
325
|
-
(
|
|
266
|
+
function W(e) {
|
|
267
|
+
var o, a, r;
|
|
268
|
+
(r = (a = (o = m.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
|
|
326
269
|
}
|
|
327
|
-
function
|
|
270
|
+
function L() {
|
|
328
271
|
var e;
|
|
329
|
-
return ((e =
|
|
272
|
+
return ((e = m.value) == null ? void 0 : e.getSorterItems()) || [];
|
|
330
273
|
}
|
|
331
|
-
function
|
|
332
|
-
var
|
|
333
|
-
(
|
|
274
|
+
function G(e) {
|
|
275
|
+
var o;
|
|
276
|
+
(o = m.value) == null || o.setSorterItems(e);
|
|
334
277
|
}
|
|
335
|
-
function
|
|
278
|
+
function H() {
|
|
336
279
|
var e;
|
|
337
|
-
(e =
|
|
280
|
+
(e = m.value) == null || e.resetSorterItems();
|
|
338
281
|
}
|
|
339
|
-
|
|
340
|
-
columns: s(() =>
|
|
341
|
-
columnsBackup: s(() =>
|
|
342
|
-
size: s(() =>
|
|
282
|
+
to({
|
|
283
|
+
columns: s(() => u.value),
|
|
284
|
+
columnsBackup: s(() => ne.value),
|
|
285
|
+
size: s(() => ao[f.value]),
|
|
343
286
|
updateColumns(e) {
|
|
344
|
-
var
|
|
345
|
-
console.log(e),
|
|
287
|
+
var o;
|
|
288
|
+
console.log(e), u.value = e, (o = t.onShownColumnsChange) == null || o.call(t, e);
|
|
346
289
|
},
|
|
347
290
|
updateSize(e) {
|
|
348
|
-
|
|
291
|
+
f.value = ro[e];
|
|
349
292
|
},
|
|
350
293
|
renderConfig: s(() => ({
|
|
351
|
-
className:
|
|
352
|
-
color:
|
|
294
|
+
className: oe("table-header", "title"),
|
|
295
|
+
color: re.value.colorTextTertiary
|
|
353
296
|
})),
|
|
354
|
-
dataSource: s(() => n(
|
|
355
|
-
getSearchFormValues:
|
|
356
|
-
setSearchFormValues:
|
|
357
|
-
submit:
|
|
358
|
-
submitWith:
|
|
359
|
-
reset:
|
|
360
|
-
refresh:
|
|
361
|
-
getSearchFormSorterItems:
|
|
362
|
-
setSearchFormSorterItems:
|
|
363
|
-
resetSearchFormSorterItems:
|
|
297
|
+
dataSource: s(() => n(p).records),
|
|
298
|
+
getSearchFormValues: O,
|
|
299
|
+
setSearchFormValues: W,
|
|
300
|
+
submit: F,
|
|
301
|
+
submitWith: A,
|
|
302
|
+
reset: x,
|
|
303
|
+
refresh: K,
|
|
304
|
+
getSearchFormSorterItems: L,
|
|
305
|
+
setSearchFormSorterItems: G,
|
|
306
|
+
resetSearchFormSorterItems: H
|
|
364
307
|
});
|
|
365
|
-
const
|
|
366
|
-
() =>
|
|
367
|
-
),
|
|
308
|
+
const Be = s(
|
|
309
|
+
() => C(t.loading) ? p.loading : t.loading
|
|
310
|
+
), Te = s(() => [
|
|
368
311
|
d(),
|
|
369
|
-
|
|
312
|
+
t.card ? null : d("wrapper"),
|
|
370
313
|
d("adaptive"),
|
|
371
|
-
d(`size-${
|
|
372
|
-
].filter(Boolean)),
|
|
314
|
+
d(`size-${f.value}`)
|
|
315
|
+
].filter(Boolean)), Ie = s(() => ({
|
|
373
316
|
height: "100%",
|
|
374
|
-
...
|
|
375
|
-
})),
|
|
376
|
-
|
|
317
|
+
...t.tableStyle || {}
|
|
318
|
+
})), ke = (e, o) => {
|
|
319
|
+
V({ current: e, pageSize: o });
|
|
377
320
|
};
|
|
378
|
-
function
|
|
379
|
-
const
|
|
380
|
-
return
|
|
321
|
+
function ze(e) {
|
|
322
|
+
const o = e.data;
|
|
323
|
+
return T(o);
|
|
381
324
|
}
|
|
382
|
-
function
|
|
325
|
+
function De(e, o) {
|
|
383
326
|
var a;
|
|
384
|
-
(a =
|
|
327
|
+
(a = g.value) == null || a.ensureIndexVisible(e, o);
|
|
385
328
|
}
|
|
386
|
-
return
|
|
387
|
-
() =>
|
|
329
|
+
return U(
|
|
330
|
+
() => t.size,
|
|
388
331
|
(e) => {
|
|
389
|
-
|
|
332
|
+
f.value = e;
|
|
390
333
|
}
|
|
391
|
-
),
|
|
392
|
-
() => n(
|
|
334
|
+
), U(
|
|
335
|
+
() => n(p).loading,
|
|
393
336
|
(e) => {
|
|
394
|
-
var
|
|
395
|
-
(
|
|
337
|
+
var o;
|
|
338
|
+
(o = t.onLoadingChange) == null || o.call(t, e);
|
|
396
339
|
}
|
|
397
|
-
),
|
|
398
|
-
submit:
|
|
399
|
-
reset:
|
|
400
|
-
refresh:
|
|
401
|
-
submitWith:
|
|
402
|
-
setSearchFormValues:
|
|
403
|
-
getSearchFormValues:
|
|
404
|
-
getShowColumns: () => n(
|
|
340
|
+
), ee({
|
|
341
|
+
submit: F,
|
|
342
|
+
reset: x,
|
|
343
|
+
refresh: K,
|
|
344
|
+
submitWith: A,
|
|
345
|
+
setSearchFormValues: W,
|
|
346
|
+
getSearchFormValues: O,
|
|
347
|
+
getShowColumns: () => n(u),
|
|
405
348
|
rowSelection: {
|
|
406
|
-
selectedRows: s(() =>
|
|
407
|
-
setSelectedRowKeys:
|
|
408
|
-
clearAll:
|
|
349
|
+
selectedRows: s(() => B.value),
|
|
350
|
+
setSelectedRowKeys: xe,
|
|
351
|
+
clearAll: M
|
|
409
352
|
},
|
|
410
|
-
scrollToRow:
|
|
411
|
-
getDataSource: () => n(
|
|
412
|
-
getPaging:
|
|
413
|
-
setPaging:
|
|
414
|
-
getSearchFormSorterItems:
|
|
415
|
-
setSearchFormSorterItems:
|
|
416
|
-
resetSearchFormSorterItems:
|
|
417
|
-
}), (e,
|
|
418
|
-
var a,
|
|
419
|
-
return
|
|
420
|
-
class:
|
|
421
|
-
style:
|
|
353
|
+
scrollToRow: De,
|
|
354
|
+
getDataSource: () => n(p.records),
|
|
355
|
+
getPaging: me,
|
|
356
|
+
setPaging: pe,
|
|
357
|
+
getSearchFormSorterItems: L,
|
|
358
|
+
setSearchFormSorterItems: G,
|
|
359
|
+
resetSearchFormSorterItems: H
|
|
360
|
+
}), (e, o) => {
|
|
361
|
+
var a, r;
|
|
362
|
+
return S(), I("div", {
|
|
363
|
+
class: c(Te.value),
|
|
364
|
+
style: R(e.wrapperStyle)
|
|
422
365
|
}, [
|
|
423
|
-
n(
|
|
366
|
+
n(C)(e.dataSource) && e.searchForm !== !1 && D.value.length > 0 ? (S(), I("div", {
|
|
424
367
|
key: 0,
|
|
425
|
-
class:
|
|
426
|
-
style:
|
|
368
|
+
class: c(e.card ? n(v)("search-wrapper") : null),
|
|
369
|
+
style: R(e.searchFormWrapperStyle)
|
|
427
370
|
}, [
|
|
428
|
-
|
|
371
|
+
k(n($e).SearchForm, J(e.searchForm || {}, {
|
|
429
372
|
ref_key: "formRef",
|
|
430
|
-
ref:
|
|
373
|
+
ref: m,
|
|
431
374
|
"custom-reset": "",
|
|
432
|
-
"submit-loading": n(
|
|
433
|
-
onSubmit: n(
|
|
434
|
-
onReset: n(
|
|
435
|
-
}),
|
|
436
|
-
default:
|
|
437
|
-
(
|
|
375
|
+
"submit-loading": n(P).loading,
|
|
376
|
+
onSubmit: n(F),
|
|
377
|
+
onReset: n(x)
|
|
378
|
+
}), Ae({
|
|
379
|
+
default: Q(() => [
|
|
380
|
+
(S(!0), I(Ke, null, Ee(D.value, (l) => (S(), X(Me(l.renderNode), {
|
|
438
381
|
key: l.dataIndex
|
|
439
382
|
}))), 128))
|
|
440
383
|
]),
|
|
441
384
|
_: 2
|
|
442
385
|
}, [
|
|
443
|
-
|
|
386
|
+
y.searchFormExtra ? {
|
|
444
387
|
name: "extra",
|
|
445
|
-
fn:
|
|
446
|
-
|
|
388
|
+
fn: Q(() => [
|
|
389
|
+
Y(e.$slots, "searchFormExtra")
|
|
447
390
|
]),
|
|
448
391
|
key: "0"
|
|
449
392
|
} : void 0
|
|
450
393
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
451
|
-
], 6)) :
|
|
452
|
-
|
|
453
|
-
class:
|
|
454
|
-
style:
|
|
394
|
+
], 6)) : $("", !0),
|
|
395
|
+
h("div", {
|
|
396
|
+
class: c([n(v)("table-wrapper"), e.card ? n(v)("table-wrapper-card") : null]),
|
|
397
|
+
style: R(e.tableWrapperStyle)
|
|
455
398
|
}, [
|
|
456
|
-
|
|
457
|
-
class:
|
|
399
|
+
h("div", {
|
|
400
|
+
class: c(n(d)("header-wrapper"))
|
|
458
401
|
}, [
|
|
459
|
-
|
|
460
|
-
selectedRows: n(
|
|
461
|
-
selectedRowKeys: n(
|
|
462
|
-
shownColumns:
|
|
463
|
-
clearAll:
|
|
402
|
+
Y(e.$slots, "title", {
|
|
403
|
+
selectedRows: n(B),
|
|
404
|
+
selectedRowKeys: n(Se),
|
|
405
|
+
shownColumns: n(u),
|
|
406
|
+
clearAll: M
|
|
464
407
|
})
|
|
465
408
|
], 2),
|
|
466
|
-
|
|
467
|
-
class:
|
|
409
|
+
h("div", {
|
|
410
|
+
class: c(n(d)("grid-wrapper"))
|
|
468
411
|
}, [
|
|
469
|
-
|
|
470
|
-
style:
|
|
471
|
-
"row-data": n(
|
|
472
|
-
"column-defs":
|
|
473
|
-
"default-col-def":
|
|
412
|
+
k(n(Le), {
|
|
413
|
+
style: R(Ie.value),
|
|
414
|
+
"row-data": n(p).records,
|
|
415
|
+
"column-defs": n(se),
|
|
416
|
+
"default-col-def": n(le),
|
|
474
417
|
"locale-text": {
|
|
475
418
|
noRowsToShow: ""
|
|
476
419
|
// 为了隐藏默认的无数据提示,因为外部已经自行实现了loading
|
|
477
420
|
},
|
|
478
|
-
"row-selection":
|
|
479
|
-
"selection-column-def":
|
|
480
|
-
"get-row-id":
|
|
421
|
+
"row-selection": be.value,
|
|
422
|
+
"selection-column-def": Re.value,
|
|
423
|
+
"get-row-id": ze,
|
|
481
424
|
"pinned-top-row-data": (a = e.summary) == null ? void 0 : a.top,
|
|
482
|
-
"pinned-bottom-row-data": (
|
|
483
|
-
theme: n(
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
425
|
+
"pinned-bottom-row-data": (r = e.summary) == null ? void 0 : r.bottom,
|
|
426
|
+
theme: n(te),
|
|
427
|
+
"tooltip-show-delay": 500,
|
|
428
|
+
"enable-browser-tooltips": e.browserTooltips,
|
|
429
|
+
"tooltip-interaction": "",
|
|
430
|
+
onSortChanged: de,
|
|
431
|
+
onGridReady: o[0] || (o[0] = (l) => g.value = l.api),
|
|
432
|
+
onRowDataUpdated: E,
|
|
433
|
+
onRowSelected: Ce,
|
|
434
|
+
onFirstDataRendered: Fe
|
|
435
|
+
}, null, 8, ["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"]),
|
|
436
|
+
Oe(h("div", {
|
|
437
|
+
class: c(n(v)("table-loading-wrapper"))
|
|
492
438
|
}, [
|
|
493
|
-
|
|
439
|
+
k(n(je), { delay: 300 })
|
|
494
440
|
], 2), [
|
|
495
|
-
[
|
|
441
|
+
[We, Be.value]
|
|
496
442
|
])
|
|
497
443
|
], 2),
|
|
498
|
-
|
|
499
|
-
class:
|
|
444
|
+
h("div", {
|
|
445
|
+
class: c(n(d)("pagination-wrapper"))
|
|
500
446
|
}, [
|
|
501
|
-
e.pagination !== !1 ? (
|
|
447
|
+
e.pagination !== !1 ? (S(), X(n(qe), J({
|
|
502
448
|
key: 0,
|
|
503
449
|
class: n(d)("pagination")
|
|
504
|
-
}, n(
|
|
450
|
+
}, n(P).pagination, { onChange: ke }), null, 16, ["class"])) : $("", !0)
|
|
505
451
|
], 2)
|
|
506
452
|
], 6)
|
|
507
453
|
], 6);
|
|
@@ -509,5 +455,5 @@ const Lt = /* @__PURE__ */ Ve({
|
|
|
509
455
|
}
|
|
510
456
|
});
|
|
511
457
|
export {
|
|
512
|
-
|
|
458
|
+
Ko as default
|
|
513
459
|
};
|