@aplus-frontend/ui 0.5.4 → 0.5.6
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/ap-grid/index.vue.mjs +140 -131
- package/es/src/ap-grid/utils/table.d.ts +3 -2
- package/es/src/ap-grid/utils/table.mjs +37 -30
- package/es/src/ap-table/ap-table.vue2.mjs +172 -159
- package/es/src/ap-table/context.d.ts +4 -4
- package/es/src/ap-table/hooks/use-sorted-filtered.d.ts +4 -1
- package/es/src/ap-table/hooks/use-sorted-filtered.mjs +11 -9
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +3 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +53 -49
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -1
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +2 -2
- package/es/src/business/ap-batch-action-group/index.d.ts +4 -4
- package/es/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/es/src/locale/lang/en.mjs +5 -3
- package/es/src/locale/lang/zh-cn.mjs +5 -3
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/utils/table.d.ts +3 -2
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/context.d.ts +4 -4
- package/lib/src/ap-table/hooks/use-sorted-filtered.d.ts +4 -1
- package/lib/src/ap-table/hooks/use-sorted-filtered.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +3 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -1
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +2 -2
- package/lib/src/business/ap-batch-action-group/index.d.ts +4 -4
- package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/package.json +3 -3
- package/theme/antd-global-overwrite/aplus/field.css +6 -0
- package/theme/antd-global-overwrite/aplus/field.less +7 -0
- package/theme/antd-global-overwrite/aplus/index.css +6 -0
- package/theme/antd-global-overwrite/aplus/index.less +1 -0
- package/theme/ap-grid/index.css +0 -1
- package/theme/ap-grid/index.less +0 -1
- package/theme/index.css +0 -1
- package/es/src/ap-grid/hooks/use-load-vxe.mjs +0 -32
- package/lib/src/ap-grid/hooks/use-load-vxe.js +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Divider as
|
|
3
|
-
import { useToken as
|
|
4
|
-
import { ApForm as
|
|
5
|
-
import { noRenderAsFormItemValueList as
|
|
1
|
+
import { defineComponent as Ee, useSlots as Oe, ref as h, computed as s, unref as l, watch as k, createElementBlock as B, openBlock as p, normalizeStyle as K, normalizeClass as m, createCommentVNode as Z, createElementVNode as E, createVNode as y, mergeProps as w, createSlots as ee, withCtx as v, Fragment as oe, renderList as re, createBlock as ae, resolveDynamicComponent as Ve, renderSlot as R, normalizeProps as Le, guardReactiveProps as $e } from "vue";
|
|
2
|
+
import { Divider as Ae, Table as De } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useToken as We } from "@aplus-frontend/antdv/es/theme/internal";
|
|
4
|
+
import { ApForm as je } from "../ap-form/index.mjs";
|
|
5
|
+
import { noRenderAsFormItemValueList as te } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { useTablePaging as
|
|
8
|
-
import { isUndefined as
|
|
9
|
-
import { getColumnOrder as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { getScrollbarSize as
|
|
7
|
+
import { useTablePaging as _e } from "./hooks/use-table-paging-ng.mjs";
|
|
8
|
+
import { isUndefined as g, omit as le, isBoolean as He } from "lodash-unified";
|
|
9
|
+
import { getColumnOrder as ne, updateFormProps as Ue, getFieldProps as qe, getSearchFormItemRenderNode as Me, recursionApColumns as se, falseToUndefined as Ge, getTableTitle as Je, getTableRenderType as Qe, getTableRenderProps as Xe, getTableCellRenderNode as Ye, apColumnToColumn as Ze } from "./utils.mjs";
|
|
10
|
+
import eo from "./hooks/use-table-content-height.mjs";
|
|
11
|
+
import oo from "./hooks/use-table-row-selection.mjs";
|
|
12
|
+
import { getScrollbarSize as ro, isDef as ao } from "../utils/index.mjs";
|
|
13
13
|
import "./components/setting/modal/index.vue.mjs";
|
|
14
14
|
import "./components/paragraph-ellipsis/index.vue.mjs";
|
|
15
|
-
import { useProvideApTable as
|
|
15
|
+
import { useProvideApTable as to } from "./context.mjs";
|
|
16
16
|
import "../scroll-bar/index.mjs";
|
|
17
|
-
import { useStickyScroll as
|
|
18
|
-
import { useNamespace as
|
|
19
|
-
import { useGlobalConfig as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
const
|
|
17
|
+
import { useStickyScroll as lo } from "./hooks/use-sticky-scroll.mjs";
|
|
18
|
+
import { useNamespace as no } from "../config-provider/hooks/use-namespace.mjs";
|
|
19
|
+
import { useGlobalConfig as so } from "../config-provider/hooks/use-global-config.mjs";
|
|
20
|
+
import uo from "./components/setting/modal/index.vue2.mjs";
|
|
21
|
+
import io from "../scroll-bar/index.vue.mjs";
|
|
22
|
+
import co from "./components/paragraph-ellipsis/index.vue2.mjs";
|
|
23
|
+
const Eo = /* @__PURE__ */ Ee({
|
|
24
24
|
name: "ApTable",
|
|
25
25
|
__name: "ap-table",
|
|
26
26
|
props: {
|
|
@@ -144,187 +144,200 @@ const No = /* @__PURE__ */ Ne({
|
|
|
144
144
|
default: void 0
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
|
-
setup(
|
|
148
|
-
expose:
|
|
147
|
+
setup(de, {
|
|
148
|
+
expose: ue
|
|
149
149
|
}) {
|
|
150
|
-
const o =
|
|
150
|
+
const o = de;
|
|
151
151
|
let O = 0;
|
|
152
|
-
const C =
|
|
153
|
-
e:
|
|
152
|
+
const C = Oe(), [, ie] = We(), {
|
|
153
|
+
e: z,
|
|
154
154
|
b: c,
|
|
155
155
|
be: V,
|
|
156
|
-
m:
|
|
157
|
-
cssVar:
|
|
158
|
-
} =
|
|
156
|
+
m: ce,
|
|
157
|
+
cssVar: fe
|
|
158
|
+
} = no("ap-table"), L = so("valueTypeMap"), {
|
|
159
159
|
height: pe,
|
|
160
|
-
contentRef:
|
|
161
|
-
} =
|
|
160
|
+
contentRef: me
|
|
161
|
+
} = eo(), $ = h(), A = h(), {
|
|
162
162
|
isStickyMode: D,
|
|
163
163
|
scrollBarRef: i
|
|
164
|
-
} =
|
|
165
|
-
|
|
164
|
+
} = lo($), P = h(o.size), u = h([]), W = h([]), j = ro();
|
|
165
|
+
to({
|
|
166
166
|
columns: s(() => u.value),
|
|
167
167
|
columnsBackup: s(() => W.value),
|
|
168
|
-
size: s(() =>
|
|
168
|
+
size: s(() => P.value),
|
|
169
169
|
updateColumns(e) {
|
|
170
170
|
u.value = e;
|
|
171
171
|
},
|
|
172
172
|
updateSize(e) {
|
|
173
|
-
|
|
173
|
+
P.value = e;
|
|
174
174
|
},
|
|
175
|
-
dataSource: s(() =>
|
|
175
|
+
dataSource: s(() => l(b).records)
|
|
176
176
|
});
|
|
177
177
|
const _ = s(() => {
|
|
178
178
|
var e, a, r;
|
|
179
|
-
return O++, ((r = (a = (e = o.columns) == null ? void 0 : e.filter((
|
|
180
|
-
let n =
|
|
181
|
-
return
|
|
182
|
-
})) == null ? void 0 : r.map((
|
|
183
|
-
const d =
|
|
184
|
-
...
|
|
179
|
+
return O++, ((r = (a = (e = o.columns) == null ? void 0 : e.filter((t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !te.includes(t.valueType))) == null ? void 0 : a.sort((t, d) => {
|
|
180
|
+
let n = ne(t.order);
|
|
181
|
+
return ne(d.order) - n;
|
|
182
|
+
})) == null ? void 0 : r.map((t) => {
|
|
183
|
+
const d = Ue(t, qe(t.fieldProps, {})), n = {
|
|
184
|
+
...t,
|
|
185
185
|
fieldProps: {
|
|
186
|
-
label:
|
|
187
|
-
name:
|
|
186
|
+
label: t.title,
|
|
187
|
+
name: t.dataIndex,
|
|
188
188
|
...d || {},
|
|
189
189
|
_signal: O
|
|
190
190
|
},
|
|
191
191
|
renderNode: void 0
|
|
192
192
|
};
|
|
193
|
-
return n.renderNode =
|
|
193
|
+
return n.renderNode = Me(n, l(L)), n;
|
|
194
194
|
})) || [];
|
|
195
|
-
}),
|
|
195
|
+
}), ye = s(() => se(l(u), (e) => {
|
|
196
196
|
if (e.sorter === !0)
|
|
197
|
-
return e.key || e.dataIndex;
|
|
198
|
-
}).filter(Boolean)),
|
|
197
|
+
return e.key || (e == null ? void 0 : e.dataIndex);
|
|
198
|
+
}).filter(Boolean)), ge = s(() => se(l(u), (e) => {
|
|
199
199
|
if (e.filters && !e.onFilter)
|
|
200
|
-
return e.key || e.dataIndex;
|
|
201
|
-
}).filter(Boolean)), be = s(() =>
|
|
200
|
+
return e.key || (e == null ? void 0 : e.dataIndex);
|
|
201
|
+
}).filter(Boolean)), be = s(() => g(o.dataSource) ? b.records : o.dataSource), {
|
|
202
202
|
rowSelection: T,
|
|
203
203
|
selectedRows: F,
|
|
204
204
|
...x
|
|
205
|
-
} =
|
|
205
|
+
} = oo({
|
|
206
206
|
fixed: !0,
|
|
207
207
|
...o.rowSelection === !0 ? {} : o.rowSelection,
|
|
208
208
|
rowKey: o.rowKey,
|
|
209
209
|
dataSource: be
|
|
210
210
|
}), {
|
|
211
|
-
formRef:
|
|
211
|
+
formRef: I,
|
|
212
212
|
submit: H,
|
|
213
213
|
reset: U,
|
|
214
214
|
tableProps: q,
|
|
215
|
-
refresh:
|
|
216
|
-
data:
|
|
217
|
-
setDataSource:
|
|
218
|
-
getColumnSFConfig:
|
|
219
|
-
|
|
215
|
+
refresh: Se,
|
|
216
|
+
data: b,
|
|
217
|
+
setDataSource: he,
|
|
218
|
+
getColumnSFConfig: M,
|
|
219
|
+
sortedInfo: we,
|
|
220
|
+
filteredInfo: ve
|
|
221
|
+
} = _e({
|
|
220
222
|
async request(e) {
|
|
221
|
-
var r,
|
|
222
|
-
if (!T.value.preserveSelectedRowKeys &&
|
|
223
|
+
var r, t;
|
|
224
|
+
if (!T.value.preserveSelectedRowKeys && g(o.dataSource) && x.clearAll(), !g(o.dataSource))
|
|
223
225
|
return {
|
|
224
226
|
data: o.dataSource || [],
|
|
225
227
|
total: o.dataSource.length || 0
|
|
226
228
|
};
|
|
227
229
|
const a = await ((r = o.request) == null ? void 0 : r.call(o, e));
|
|
228
|
-
return (
|
|
230
|
+
return (t = o.onLoad) == null || t.call(o, (a == null ? void 0 : a.data) || []), {
|
|
229
231
|
data: (a == null ? void 0 : a.data) || [],
|
|
230
232
|
total: (a == null ? void 0 : a.total) || 0
|
|
231
233
|
};
|
|
232
234
|
},
|
|
233
|
-
filterFields:
|
|
234
|
-
sortFields:
|
|
235
|
+
filterFields: ge,
|
|
236
|
+
sortFields: ye,
|
|
235
237
|
defaultParams: o.params,
|
|
236
238
|
defaultData: o.defaultData,
|
|
237
239
|
manual: o.manual,
|
|
238
240
|
formatParams: o.beforeSearchSubmit,
|
|
239
241
|
pagination: o.pagination
|
|
240
|
-
}),
|
|
242
|
+
}), Re = () => {
|
|
241
243
|
var r;
|
|
242
|
-
let e = ((r = o.columns) == null ? void 0 : r.filter((
|
|
243
|
-
function a(
|
|
244
|
-
return
|
|
245
|
-
resizable:
|
|
246
|
-
...
|
|
244
|
+
let e = ((r = o.columns) == null ? void 0 : r.filter((t) => !t.hideInTable)) || [];
|
|
245
|
+
function a(t, d) {
|
|
246
|
+
return t.map((n) => ({
|
|
247
|
+
resizable: ao(n.resizable) ? n.resizable : o.columnResizable,
|
|
248
|
+
...le(Ze(n), ["ellipsis"]),
|
|
247
249
|
// tips: 此函数内部依赖查询&筛选的相应式值
|
|
248
|
-
...
|
|
250
|
+
...M(n),
|
|
249
251
|
fixed: d ? d.fixed : n.fixed,
|
|
250
|
-
title:
|
|
252
|
+
title: Je(n, V("table-header", "title"), C.headerCell, l(ie).colorPrimary),
|
|
251
253
|
customRender({
|
|
252
|
-
value:
|
|
254
|
+
value: f,
|
|
253
255
|
...S
|
|
254
256
|
}) {
|
|
255
|
-
var
|
|
256
|
-
const
|
|
257
|
+
var X, Y;
|
|
258
|
+
const J = Qe(n), Ie = Xe({
|
|
257
259
|
...n,
|
|
258
|
-
valueType:
|
|
260
|
+
valueType: J
|
|
259
261
|
}, {
|
|
260
|
-
value:
|
|
262
|
+
value: f,
|
|
261
263
|
...S
|
|
262
|
-
}),
|
|
263
|
-
value:
|
|
264
|
+
}), Ne = Ye(J, Ie, S.record, l(L)), Q = ((X = n.renderText) == null ? void 0 : X.call(n, {
|
|
265
|
+
value: f,
|
|
264
266
|
...S
|
|
265
|
-
})) ||
|
|
266
|
-
value:
|
|
267
|
+
})) || f, Ke = n.renderText ? y(oe, null, [(Y = n.renderText) == null ? void 0 : Y.call(n, {
|
|
268
|
+
value: f,
|
|
267
269
|
...S
|
|
268
|
-
})]) :
|
|
269
|
-
let N =
|
|
270
|
+
})]) : Ne;
|
|
271
|
+
let N = ke(n, Q, Ke);
|
|
270
272
|
return n.customRender && (N = n.customRender({
|
|
271
|
-
value:
|
|
273
|
+
value: f,
|
|
272
274
|
...S,
|
|
273
275
|
column: n,
|
|
274
276
|
originalNode: N,
|
|
275
|
-
originalText:
|
|
277
|
+
originalText: Q
|
|
276
278
|
})), N;
|
|
277
279
|
},
|
|
278
280
|
children: a(n.children || [], d || n)
|
|
279
281
|
}));
|
|
280
282
|
}
|
|
281
283
|
return a(e);
|
|
284
|
+
}, Ce = () => {
|
|
285
|
+
function e(a) {
|
|
286
|
+
var r;
|
|
287
|
+
for (const t of a)
|
|
288
|
+
(r = t.children) != null && r.length ? e(t.children) : M(t, !0);
|
|
289
|
+
}
|
|
290
|
+
e(u.value);
|
|
282
291
|
};
|
|
283
|
-
|
|
284
|
-
const e =
|
|
292
|
+
k(() => [o.columns, o.columnResizable], () => {
|
|
293
|
+
const e = Re();
|
|
285
294
|
u.value = e, W.value = e;
|
|
286
295
|
}, {
|
|
287
296
|
deep: !0,
|
|
288
297
|
immediate: !0
|
|
298
|
+
}), k(() => [we.value, ve.value], () => {
|
|
299
|
+
Ce();
|
|
300
|
+
}, {
|
|
301
|
+
deep: !0
|
|
289
302
|
});
|
|
290
|
-
const
|
|
303
|
+
const Te = s(() => {
|
|
291
304
|
var a, r;
|
|
292
|
-
if (o.adaptive && (
|
|
305
|
+
if (o.adaptive && (b.total > 0 || ((a = o.dataSource) == null ? void 0 : a.length)))
|
|
293
306
|
return {
|
|
294
|
-
y:
|
|
307
|
+
y: l(pe),
|
|
295
308
|
x: ((r = o.scroll) == null ? void 0 : r.x) || "100%"
|
|
296
309
|
};
|
|
297
310
|
if (o.scroll)
|
|
298
311
|
return o.scroll;
|
|
299
|
-
}),
|
|
312
|
+
}), Fe = s(() => {
|
|
300
313
|
var e;
|
|
301
314
|
if (o.tableLayout)
|
|
302
315
|
return o.tableLayout;
|
|
303
316
|
if ((e = o.columns) != null && e.some((a) => a.ellipsis))
|
|
304
317
|
return "fixed";
|
|
305
|
-
}),
|
|
318
|
+
}), G = s(() => {
|
|
306
319
|
var r;
|
|
307
|
-
const e =
|
|
320
|
+
const e = l(q), a = l(T);
|
|
308
321
|
return {
|
|
309
322
|
...o,
|
|
310
323
|
...e,
|
|
311
324
|
rowSelection: o.rowSelection === !0 || ((r = o.rowSelection) == null ? void 0 : r.mode) === "internal" ? {
|
|
312
325
|
...a,
|
|
313
326
|
// tips 如果是前端分页,则默认会走缓存
|
|
314
|
-
preserveSelectedRowKeys:
|
|
315
|
-
} :
|
|
316
|
-
loading:
|
|
327
|
+
preserveSelectedRowKeys: g(o.dataSource) ? a.preserveSelectedRowKeys : !0
|
|
328
|
+
} : Ge(o.rowSelection),
|
|
329
|
+
loading: g(o.loading) ? e.loading : o.loading,
|
|
317
330
|
pagination: o.pagination === !1 ? !1 : e.pagination,
|
|
318
|
-
scroll:
|
|
331
|
+
scroll: l(Te)
|
|
319
332
|
};
|
|
320
|
-
}),
|
|
333
|
+
}), xe = s(() => {
|
|
321
334
|
var e;
|
|
322
|
-
return [c(), o.card ? null : c("wrapper"), o.adaptive ? c("adaptive") : null, D.value && ((e = i.value) != null && e.visible) ?
|
|
335
|
+
return [c(), o.card ? null : c("wrapper"), o.adaptive ? c("adaptive") : null, D.value && ((e = i.value) != null && e.visible) ? ce(`sticky-${j === 0 ? "absolute" : "relative"}`) : null].filter(Boolean);
|
|
323
336
|
});
|
|
324
|
-
function
|
|
325
|
-
return
|
|
337
|
+
function ke(e, a, r) {
|
|
338
|
+
return te.includes(e.valueType) ? r : e.copyable || e.ellipsis ? y(co, {
|
|
326
339
|
copyable: e.copyable,
|
|
327
|
-
ellipsis: e.ellipsis ?
|
|
340
|
+
ellipsis: e.ellipsis ? He(e.ellipsis) ? {
|
|
328
341
|
tooltip: r,
|
|
329
342
|
rows: 1
|
|
330
343
|
} : {
|
|
@@ -334,36 +347,36 @@ const No = /* @__PURE__ */ Ne({
|
|
|
334
347
|
content: r
|
|
335
348
|
}, null) : r;
|
|
336
349
|
}
|
|
337
|
-
|
|
350
|
+
k(() => l(b).loading, (e) => {
|
|
338
351
|
var a;
|
|
339
352
|
(a = o.onLoadingChange) == null || a.call(o, e);
|
|
340
|
-
}),
|
|
341
|
-
|
|
353
|
+
}), k(() => o.dataSource, (e) => {
|
|
354
|
+
he(e);
|
|
342
355
|
}, {
|
|
343
356
|
immediate: !0
|
|
344
357
|
});
|
|
345
|
-
function
|
|
346
|
-
var a, r,
|
|
347
|
-
(
|
|
358
|
+
function Be(e) {
|
|
359
|
+
var a, r, t;
|
|
360
|
+
(t = (r = (a = I.value) == null ? void 0 : a.apForm) == null ? void 0 : r.setFieldsValue) == null || t.call(r, e);
|
|
348
361
|
}
|
|
349
|
-
function
|
|
350
|
-
var r,
|
|
362
|
+
function ze(e = !1) {
|
|
363
|
+
var r, t, d;
|
|
351
364
|
const a = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
352
|
-
return (d = (
|
|
365
|
+
return (d = (t = (r = I.value) == null ? void 0 : r.apForm) == null ? void 0 : t[a]) == null ? void 0 : d.call(t, !0);
|
|
353
366
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
367
|
+
function Pe() {
|
|
368
|
+
return l(u);
|
|
356
369
|
}
|
|
357
|
-
return
|
|
370
|
+
return ue({
|
|
358
371
|
submit: () => H(),
|
|
359
372
|
reset: () => U(),
|
|
360
|
-
refresh: () =>
|
|
361
|
-
setSearchFormValues:
|
|
362
|
-
getSearchFormValues:
|
|
363
|
-
getShownColumns:
|
|
364
|
-
dataSource: s(() =>
|
|
373
|
+
refresh: () => Se(),
|
|
374
|
+
setSearchFormValues: Be,
|
|
375
|
+
getSearchFormValues: ze,
|
|
376
|
+
getShownColumns: Pe,
|
|
377
|
+
dataSource: s(() => l(b).records),
|
|
365
378
|
rowSelection: {
|
|
366
|
-
selectedRows: s(() =>
|
|
379
|
+
selectedRows: s(() => l(F)),
|
|
367
380
|
...x
|
|
368
381
|
},
|
|
369
382
|
scrollBar: {
|
|
@@ -379,26 +392,26 @@ const No = /* @__PURE__ */ Ne({
|
|
|
379
392
|
},
|
|
380
393
|
y: void 0
|
|
381
394
|
}
|
|
382
|
-
}), (e, a) => (
|
|
395
|
+
}), (e, a) => (p(), B("div", {
|
|
383
396
|
ref_key: "tableWrapperRef",
|
|
384
397
|
ref: $,
|
|
385
|
-
class: m(
|
|
386
|
-
style: K(
|
|
387
|
-
"scroll-bar-width": `${
|
|
398
|
+
class: m(xe.value),
|
|
399
|
+
style: K(l(fe)({
|
|
400
|
+
"scroll-bar-width": `${l(j)}px`
|
|
388
401
|
}))
|
|
389
|
-
}, [
|
|
402
|
+
}, [l(g)(e.dataSource) && e.searchForm !== !1 && _.value.length > 0 ? (p(), B("div", {
|
|
390
403
|
key: 0,
|
|
391
|
-
class: m(e.card ?
|
|
404
|
+
class: m(e.card ? l(z)("search-wrapper") : null),
|
|
392
405
|
style: K(e.searchFormWrapperStyle)
|
|
393
|
-
}, [y(
|
|
406
|
+
}, [y(l(je).SearchForm, w(e.searchForm || {}, {
|
|
394
407
|
ref_key: "formRef",
|
|
395
|
-
ref:
|
|
408
|
+
ref: I,
|
|
396
409
|
"custom-reset": "",
|
|
397
|
-
"submit-loading":
|
|
398
|
-
onSubmit:
|
|
399
|
-
onReset:
|
|
400
|
-
}),
|
|
401
|
-
default: v(() => [(
|
|
410
|
+
"submit-loading": l(q).loading,
|
|
411
|
+
onSubmit: l(H),
|
|
412
|
+
onReset: l(U)
|
|
413
|
+
}), ee({
|
|
414
|
+
default: v(() => [(p(!0), B(oe, null, re(_.value, (r) => (p(), ae(Ve(r.renderNode.Comp), w({
|
|
402
415
|
key: r.dataIndex,
|
|
403
416
|
item: r,
|
|
404
417
|
ref_for: !0
|
|
@@ -411,66 +424,66 @@ const No = /* @__PURE__ */ Ne({
|
|
|
411
424
|
name: "extra",
|
|
412
425
|
fn: v(() => [R(e.$slots, "searchFormExtra")]),
|
|
413
426
|
key: "0"
|
|
414
|
-
} : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) :
|
|
427
|
+
} : void 0]), 1040, ["submit-loading", "onSubmit", "onReset"])], 6)) : Z("", !0), E("div", {
|
|
415
428
|
ref_key: "contentRef",
|
|
416
|
-
ref:
|
|
417
|
-
class: m([
|
|
429
|
+
ref: me,
|
|
430
|
+
class: m([l(z)("table-wrapper"), e.card ? l(z)("table-wrapper-card") : null]),
|
|
418
431
|
style: K(e.tableWrapperStyle)
|
|
419
432
|
}, [E("div", {
|
|
420
|
-
class: m(
|
|
421
|
-
}, [e.settings ? (
|
|
433
|
+
class: m(l(c)("header-wrapper"))
|
|
434
|
+
}, [e.settings ? (p(), B("div", {
|
|
422
435
|
key: 0,
|
|
423
|
-
class: m(
|
|
436
|
+
class: m(l(c)("header"))
|
|
424
437
|
}, [E("div", {
|
|
425
|
-
class: m(
|
|
438
|
+
class: m(l(V)("header", "title"))
|
|
426
439
|
}, [R(e.$slots, "title", w({
|
|
427
|
-
selectedRows:
|
|
428
|
-
selectedRowKeys:
|
|
440
|
+
selectedRows: l(F),
|
|
441
|
+
selectedRowKeys: l(T).selectedRowKeys,
|
|
429
442
|
shownColumns: u.value
|
|
430
|
-
}, x))], 2), C.title ? (
|
|
443
|
+
}, x))], 2), C.title ? (p(), ae(l(Ae), {
|
|
431
444
|
key: 0,
|
|
432
445
|
type: "vertical"
|
|
433
|
-
})) :
|
|
446
|
+
})) : Z("", !0), y(uo, {
|
|
434
447
|
config: e.settings === !0 ? {} : e.settings
|
|
435
448
|
}, null, 8, ["config"])], 2)) : R(e.$slots, "title", w({
|
|
436
449
|
key: 1,
|
|
437
|
-
selectedRows:
|
|
438
|
-
selectedRowKeys:
|
|
450
|
+
selectedRows: l(F),
|
|
451
|
+
selectedRowKeys: l(T).selectedRowKeys,
|
|
439
452
|
shownColumns: u.value
|
|
440
|
-
}, x))], 2), y(
|
|
453
|
+
}, x))], 2), y(l(De), w({
|
|
441
454
|
ref_key: "antdTableRef",
|
|
442
455
|
ref: A,
|
|
443
|
-
class:
|
|
444
|
-
},
|
|
445
|
-
size:
|
|
446
|
-
"table-layout":
|
|
456
|
+
class: l(c)("table")
|
|
457
|
+
}, G.value, {
|
|
458
|
+
size: P.value,
|
|
459
|
+
"table-layout": Fe.value,
|
|
447
460
|
columns: u.value,
|
|
448
|
-
onResizeColumn: a[0] || (a[0] = (r,
|
|
449
|
-
}),
|
|
461
|
+
onResizeColumn: a[0] || (a[0] = (r, t) => t.width = r)
|
|
462
|
+
}), ee({
|
|
450
463
|
summary: v(() => [R(e.$slots, "summary", {
|
|
451
464
|
columns: u.value,
|
|
452
|
-
records:
|
|
453
|
-
selectedRows:
|
|
465
|
+
records: G.value.dataSource,
|
|
466
|
+
selectedRows: l(F)
|
|
454
467
|
})]),
|
|
455
468
|
_: 2
|
|
456
|
-
}, [
|
|
469
|
+
}, [l(D) ? {
|
|
457
470
|
name: "bottomPaginationTop",
|
|
458
471
|
fn: v(() => {
|
|
459
|
-
var r,
|
|
460
|
-
return [y(
|
|
472
|
+
var r, t;
|
|
473
|
+
return [y(l(io), {
|
|
461
474
|
ref_key: "scrollBarRef",
|
|
462
475
|
ref: i,
|
|
463
|
-
"scroll-container": (
|
|
476
|
+
"scroll-container": (t = (r = A.value) == null ? void 0 : r.table) == null ? void 0 : t.scrollBodyRef,
|
|
464
477
|
direction: "horizontal"
|
|
465
478
|
}, null, 8, ["scroll-container"])];
|
|
466
479
|
}),
|
|
467
480
|
key: "0"
|
|
468
|
-
} : void 0,
|
|
469
|
-
name:
|
|
470
|
-
fn: v((d) => [R(e.$slots,
|
|
481
|
+
} : void 0, re(l(le)(C, ["title", "searchFormExtra", "headerCell", "summary"]), (r, t) => ({
|
|
482
|
+
name: t,
|
|
483
|
+
fn: v((d) => [R(e.$slots, t, Le($e(d || {})))])
|
|
471
484
|
}))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 6));
|
|
472
485
|
}
|
|
473
486
|
});
|
|
474
487
|
export {
|
|
475
|
-
|
|
488
|
+
Eo as default
|
|
476
489
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColumnsType } from '@aplus-frontend/antdv/es/table';
|
|
2
2
|
import { ComputedRef, InjectionKey } from 'vue';
|
|
3
3
|
import { ApTableContextRenderConfig, ApTableProps } from './interface';
|
|
4
4
|
type TableSize = ApTableProps['size'];
|
|
@@ -6,11 +6,11 @@ type ApTableContextProps<RecordType> = {
|
|
|
6
6
|
/**
|
|
7
7
|
* 表格列配置
|
|
8
8
|
*/
|
|
9
|
-
columns?: ComputedRef<
|
|
9
|
+
columns?: ComputedRef<ColumnsType<RecordType>>;
|
|
10
10
|
/**
|
|
11
11
|
* 表格列配置备份(只有在props变更后才会变更)
|
|
12
12
|
*/
|
|
13
|
-
columnsBackup?: ComputedRef<
|
|
13
|
+
columnsBackup?: ComputedRef<ColumnsType<RecordType>>;
|
|
14
14
|
/**
|
|
15
15
|
* 更新数据源的方法
|
|
16
16
|
* @param name
|
|
@@ -18,7 +18,7 @@ type ApTableContextProps<RecordType> = {
|
|
|
18
18
|
* @param triggerChange 是否触发外部的`onValuesChange`函数
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
|
-
updateColumns?: (nextColumns:
|
|
21
|
+
updateColumns?: (nextColumns: ColumnsType<RecordType>) => void;
|
|
22
22
|
/**
|
|
23
23
|
* ApForm内部实例
|
|
24
24
|
*/
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ApColumnType } from '../interface';
|
|
2
2
|
import { Recordable } from '../../type';
|
|
3
|
+
import { Ref } from 'vue';
|
|
3
4
|
export declare const useTableSortedAndFiltered: () => {
|
|
4
|
-
getColumnSFConfig: (column: ApColumnType) => Recordable;
|
|
5
|
+
getColumnSFConfig: (column: ApColumnType, append?: boolean) => Recordable;
|
|
5
6
|
setSF: (filters: any, sorter: any) => void;
|
|
6
7
|
clearSorter: () => void;
|
|
7
8
|
clearFilters: () => void;
|
|
8
9
|
clearAll: () => void;
|
|
10
|
+
sortedInfo: Ref<any, any>;
|
|
11
|
+
filteredInfo: Ref<any, any>;
|
|
9
12
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ref as i, unref as s } from "vue";
|
|
2
|
-
const
|
|
2
|
+
const S = () => {
|
|
3
3
|
const r = i(), t = i();
|
|
4
|
-
function c(e) {
|
|
5
|
-
const
|
|
6
|
-
return e.filters && (l.filteredValue =
|
|
4
|
+
function c(e, n = !1) {
|
|
5
|
+
const v = s(t) || {}, u = s(r) || {}, l = n ? e : {};
|
|
6
|
+
return e.filters && (l.filteredValue = v[e.key] || null), e.sorter && (l.sortOrder = u.columnKey === e.key ? u.order : null), l;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function a(e, n) {
|
|
9
9
|
t.value = e, r.value = n;
|
|
10
10
|
}
|
|
11
11
|
function o() {
|
|
@@ -14,17 +14,19 @@ const F = () => {
|
|
|
14
14
|
function f() {
|
|
15
15
|
t.value = null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function d() {
|
|
18
18
|
o(), f();
|
|
19
19
|
}
|
|
20
20
|
return {
|
|
21
21
|
getColumnSFConfig: c,
|
|
22
|
-
setSF:
|
|
22
|
+
setSF: a,
|
|
23
23
|
clearSorter: o,
|
|
24
24
|
clearFilters: f,
|
|
25
|
-
clearAll:
|
|
25
|
+
clearAll: d,
|
|
26
|
+
sortedInfo: r,
|
|
27
|
+
filteredInfo: t
|
|
26
28
|
};
|
|
27
29
|
};
|
|
28
30
|
export {
|
|
29
|
-
|
|
31
|
+
S as useTableSortedAndFiltered
|
|
30
32
|
};
|
|
@@ -88,6 +88,8 @@ export declare const useTablePaging: <DataType = any, ParamsType = Record<string
|
|
|
88
88
|
}>;
|
|
89
89
|
dataSource: ComputedRef<DataType[]>;
|
|
90
90
|
setDataSource: (dataSource?: DataType[]) => void;
|
|
91
|
-
getColumnSFConfig: (column: ApColumnType) => Recordable;
|
|
91
|
+
getColumnSFConfig: (column: ApColumnType, append?: boolean) => Recordable;
|
|
92
|
+
sortedInfo: Ref<any, any>;
|
|
93
|
+
filteredInfo: Ref<any, any>;
|
|
92
94
|
};
|
|
93
95
|
export {};
|