@aplus-frontend/ui 0.5.27 → 0.5.29
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 +84 -82
- package/es/src/ap-grid/editable/form-item.vue.mjs +20 -18
- package/es/src/ap-grid/editable/index.vue.mjs +22 -20
- package/es/src/ap-grid/index.vue.mjs +78 -69
- package/es/src/ap-grid/interface.d.ts +5 -1
- package/es/src/ap-grid/utils/col.mjs +48 -48
- package/es/src/ap-grid/utils/table.mjs +2 -2
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +52 -52
- package/es/src/business/hooks/index.d.ts +1 -0
- package/es/src/business/hooks/index.mjs +6 -4
- package/es/src/business/hooks/useGridRefresh.d.ts +17 -0
- package/es/src/business/hooks/useGridRefresh.mjs +17 -0
- package/es/src/business/hooks/usePageListApGrid.mjs +11 -11
- package/es/src/full-screen/index.vue.mjs +17 -16
- package/es/src/full-screen/interface.d.ts +2 -1
- package/es/src/index.mjs +73 -71
- package/lib/index.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +5 -1
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/business/hooks/index.d.ts +1 -0
- package/lib/src/business/hooks/index.js +1 -1
- package/lib/src/business/hooks/useGridRefresh.d.ts +17 -0
- package/lib/src/business/hooks/useGridRefresh.js +1 -0
- package/lib/src/business/hooks/usePageListApGrid.js +1 -1
- package/lib/src/full-screen/index.vue.js +1 -1
- package/lib/src/full-screen/interface.d.ts +2 -1
- package/lib/src/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as
|
|
1
|
+
import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as F, createElementBlock as B, openBlock as s, normalizeStyle as z, normalizeClass as f, createCommentVNode as b, createElementVNode as I, createVNode as U, mergeProps as g, createSlots as G, withCtx as v, Fragment as X, renderList as A, createBlock as p, resolveDynamicComponent as _, renderSlot as V, normalizeProps as J, guardReactiveProps as Pe } from "vue";
|
|
2
2
|
import { VxeTable as Ee, VxeColumn as Q } from "vxe-table";
|
|
3
3
|
import "vxe-table/es/style.css";
|
|
4
4
|
import "vxe-pc-ui/es/style.css";
|
|
5
5
|
import { VxeUI as Y } from "vxe-pc-ui";
|
|
6
|
-
import { isUndefined as
|
|
6
|
+
import { isUndefined as w, omit as Ne } from "lodash-unified";
|
|
7
7
|
import { ApForm as Te } from "../ap-form/index.mjs";
|
|
8
8
|
import "../config-provider/index.mjs";
|
|
9
9
|
import { noRenderAsFormItemValueList as ze } from "../ap-table/constants.mjs";
|
|
@@ -83,6 +83,8 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
83
83
|
cellConfig: {},
|
|
84
84
|
loading: { type: Boolean, default: void 0 },
|
|
85
85
|
loadingConfig: {},
|
|
86
|
+
headerCellConfig: {},
|
|
87
|
+
footerCellConfig: {},
|
|
86
88
|
columns: {},
|
|
87
89
|
rowSelection: { type: Boolean },
|
|
88
90
|
card: { type: Boolean, default: !1 },
|
|
@@ -109,17 +111,17 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
109
111
|
},
|
|
110
112
|
setup(ae, { expose: re }) {
|
|
111
113
|
var q;
|
|
112
|
-
const L = Be(), a = ae,
|
|
113
|
-
|
|
114
|
-
const { e:
|
|
114
|
+
const L = Be(), a = ae, S = (q = Ie()) == null ? void 0 : q.appContext.app;
|
|
115
|
+
S && !S.__VXE_PC_UI_INSTALLED__ && (S.use(Y), S.__VXE_PC_UI_INSTALLED__ = !0);
|
|
116
|
+
const { e: P, b: d, be: te } = Xe("ap-grid"), le = Je("valueTypeMap"), i = k([]), D = k([]), m = k(), h = k(a.size), [, c] = Ge(), { t: ne } = Qe();
|
|
115
117
|
Y.setConfig({
|
|
116
118
|
i18n: (e, l) => ne(`ap.${e}`, l)
|
|
117
119
|
});
|
|
118
120
|
const { renderConfig: se, updateSignal: ie } = Ue(i);
|
|
119
121
|
let O = 0;
|
|
120
122
|
const de = n(() => {
|
|
121
|
-
if (
|
|
122
|
-
return
|
|
123
|
+
if (m.value)
|
|
124
|
+
return m.value.$el.querySelector(
|
|
123
125
|
".vxe-table--header-inner-wrapper"
|
|
124
126
|
);
|
|
125
127
|
}), K = n(() => {
|
|
@@ -148,7 +150,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
148
150
|
o(le)
|
|
149
151
|
), y;
|
|
150
152
|
})) || [];
|
|
151
|
-
}),
|
|
153
|
+
}), ce = n(() => [
|
|
152
154
|
d(),
|
|
153
155
|
a.card ? null : d("wrapper"),
|
|
154
156
|
a.adaptive ? d("adaptive") : null,
|
|
@@ -160,18 +162,18 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
160
162
|
if (e.filters && !e.onFilter)
|
|
161
163
|
return e.key || e.dataIndex;
|
|
162
164
|
}).filter(Boolean)), {
|
|
163
|
-
formRef:
|
|
165
|
+
formRef: E,
|
|
164
166
|
submit: j,
|
|
165
167
|
reset: W,
|
|
166
|
-
refresh:
|
|
167
|
-
data:
|
|
168
|
+
refresh: ue,
|
|
169
|
+
data: C,
|
|
168
170
|
tableProps: M,
|
|
169
171
|
setDataSource: pe,
|
|
170
172
|
handleTableChange: me
|
|
171
173
|
} = Le({
|
|
172
174
|
async request(e) {
|
|
173
175
|
var t;
|
|
174
|
-
if (!R.value.preserveSelectedRowKeys &&
|
|
176
|
+
if (!R.value.preserveSelectedRowKeys && w(a.dataSource) && T(), !w(a.dataSource)) {
|
|
175
177
|
const r = e.pageSize * (e.current - 1);
|
|
176
178
|
return {
|
|
177
179
|
data: (a.pagination === !1 ? a.dataSource : a.dataSource.slice(r, r + e.pageSize)) || [],
|
|
@@ -196,38 +198,38 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
196
198
|
We({
|
|
197
199
|
columns: n(() => i.value),
|
|
198
200
|
columnsBackup: n(() => D.value),
|
|
199
|
-
size: n(() =>
|
|
201
|
+
size: n(() => h.value ? qe[h.value] : "middle"),
|
|
200
202
|
updateColumns(e) {
|
|
201
203
|
i.value = e;
|
|
202
204
|
},
|
|
203
205
|
updateSize(e) {
|
|
204
|
-
|
|
206
|
+
h.value = Me[e];
|
|
205
207
|
},
|
|
206
208
|
renderConfig: n(() => ({
|
|
207
209
|
className: te("table-header", "title"),
|
|
208
|
-
color:
|
|
210
|
+
color: c.value.colorPrimary
|
|
209
211
|
}))
|
|
210
212
|
});
|
|
211
213
|
const he = n(
|
|
212
214
|
() => i.value.some(
|
|
213
215
|
(e) => e.fixed === "left" || e.fixed === !0
|
|
214
216
|
) ? "left" : void 0
|
|
215
|
-
), ye = n(
|
|
216
|
-
() => b(a.loading) ? h.loading : a.loading
|
|
217
217
|
), Ce = n(
|
|
218
|
-
() =>
|
|
218
|
+
() => w(a.loading) ? C.loading : a.loading
|
|
219
|
+
), ye = n(
|
|
220
|
+
() => w(a.dataSource) ? C.records : a.dataSource
|
|
219
221
|
), { selectedRows: x, rowSelection: R, ...be } = je({
|
|
220
222
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
221
|
-
dataSource:
|
|
223
|
+
dataSource: ye,
|
|
222
224
|
rowKey: a.rowKey
|
|
223
|
-
}),
|
|
224
|
-
const e =
|
|
225
|
+
}), N = () => {
|
|
226
|
+
const e = m.value;
|
|
225
227
|
e && (x.value = [
|
|
226
228
|
...e.getCheckboxReserveRecords(),
|
|
227
229
|
...e.getCheckboxRecords()
|
|
228
230
|
]);
|
|
229
231
|
}, we = () => {
|
|
230
|
-
const e =
|
|
232
|
+
const e = m.value;
|
|
231
233
|
e && (x.value = [e.getRadioRecord()]);
|
|
232
234
|
};
|
|
233
235
|
function Se() {
|
|
@@ -236,25 +238,25 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
236
238
|
}
|
|
237
239
|
function xe(e) {
|
|
238
240
|
var l, t, r;
|
|
239
|
-
(r = (t = (l =
|
|
241
|
+
(r = (t = (l = E.value) == null ? void 0 : l.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, e);
|
|
240
242
|
}
|
|
241
243
|
function Re(e = !1) {
|
|
242
244
|
var t, r, u;
|
|
243
245
|
const l = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
244
|
-
return (u = (r = (t =
|
|
246
|
+
return (u = (r = (t = E.value) == null ? void 0 : t.apForm) == null ? void 0 : r[l]) == null ? void 0 : u.call(r, !0);
|
|
245
247
|
}
|
|
246
|
-
function
|
|
248
|
+
function T() {
|
|
247
249
|
be.clearAll();
|
|
248
|
-
const e =
|
|
250
|
+
const e = m.value;
|
|
249
251
|
e && (R.value.type === "radio" ? (e.clearRadioRow(), e.clearRadioReserve()) : (e.clearCheckboxRow(), e.clearCheckboxReserve()));
|
|
250
252
|
}
|
|
251
253
|
async function ke(e, l) {
|
|
252
254
|
var r;
|
|
253
|
-
const t =
|
|
255
|
+
const t = C.records[e];
|
|
254
256
|
if (t)
|
|
255
|
-
return (r =
|
|
257
|
+
return (r = m.value) == null ? void 0 : r.scrollToRow(t, l);
|
|
256
258
|
}
|
|
257
|
-
return
|
|
259
|
+
return F(
|
|
258
260
|
() => [a.columnResizable, a.columns],
|
|
259
261
|
() => {
|
|
260
262
|
const e = Se();
|
|
@@ -264,49 +266,54 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
264
266
|
deep: !0,
|
|
265
267
|
immediate: !0
|
|
266
268
|
}
|
|
267
|
-
),
|
|
269
|
+
), F(
|
|
268
270
|
() => a.dataSource,
|
|
269
271
|
(e) => {
|
|
270
272
|
pe(e);
|
|
271
273
|
},
|
|
272
274
|
{ immediate: !0, deep: !0 }
|
|
273
|
-
),
|
|
274
|
-
() => o(
|
|
275
|
+
), F(
|
|
276
|
+
() => o(C).loading,
|
|
275
277
|
(e) => {
|
|
276
278
|
var l;
|
|
277
279
|
(l = a.onLoadingChange) == null || l.call(a, e);
|
|
278
280
|
}
|
|
281
|
+
), F(
|
|
282
|
+
() => a.size,
|
|
283
|
+
(e) => {
|
|
284
|
+
h.value = e;
|
|
285
|
+
}
|
|
279
286
|
), re({
|
|
280
287
|
submit: j,
|
|
281
288
|
reset: W,
|
|
282
|
-
refresh:
|
|
289
|
+
refresh: ue,
|
|
283
290
|
setSearchFormValues: xe,
|
|
284
291
|
getSearchFormValues: Re,
|
|
285
292
|
getShowColumns: () => o(i),
|
|
286
293
|
rowSelection: {
|
|
287
294
|
selectedRows: n(() => x.value),
|
|
288
|
-
clearAll:
|
|
295
|
+
clearAll: T
|
|
289
296
|
},
|
|
290
297
|
scrollToRow: ke
|
|
291
|
-
}), (e, l) => (s(),
|
|
292
|
-
class: f(
|
|
298
|
+
}), (e, l) => (s(), B("div", {
|
|
299
|
+
class: f(ce.value),
|
|
293
300
|
style: z(e.wrapperStyle)
|
|
294
301
|
}, [
|
|
295
|
-
o(
|
|
302
|
+
o(w)(e.dataSource) && e.searchForm !== !1 && K.value.length > 0 ? (s(), B("div", {
|
|
296
303
|
key: 0,
|
|
297
|
-
class: f(e.card ? o(
|
|
304
|
+
class: f(e.card ? o(P)("search-wrapper") : null),
|
|
298
305
|
style: z(e.searchFormWrapperStyle)
|
|
299
306
|
}, [
|
|
300
307
|
U(o(Te).SearchForm, g(e.searchForm || {}, {
|
|
301
308
|
ref_key: "formRef",
|
|
302
|
-
ref:
|
|
309
|
+
ref: E,
|
|
303
310
|
"custom-reset": "",
|
|
304
311
|
"submit-loading": o(M).loading,
|
|
305
312
|
onSubmit: o(j),
|
|
306
313
|
onReset: o(W)
|
|
307
314
|
}), G({
|
|
308
315
|
default: v(() => [
|
|
309
|
-
(s(!0),
|
|
316
|
+
(s(!0), B(X, null, A(K.value, (t) => (s(), p(_(t.renderNode.Comp), g({
|
|
310
317
|
key: t.dataIndex,
|
|
311
318
|
item: t,
|
|
312
319
|
ref_for: !0
|
|
@@ -325,52 +332,54 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
325
332
|
key: "0"
|
|
326
333
|
} : void 0
|
|
327
334
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
328
|
-
], 6)) :
|
|
329
|
-
|
|
330
|
-
class: f([o(
|
|
335
|
+
], 6)) : b("", !0),
|
|
336
|
+
I("div", {
|
|
337
|
+
class: f([o(P)("table-wrapper"), e.card ? o(P)("table-wrapper-card") : null]),
|
|
331
338
|
style: z(e.tableWrapperStyle)
|
|
332
339
|
}, [
|
|
333
|
-
|
|
340
|
+
I("div", {
|
|
334
341
|
class: f(o(d)("header-wrapper"))
|
|
335
342
|
}, [
|
|
336
343
|
V(e.$slots, "title", {
|
|
337
344
|
selectedRows: o(x),
|
|
338
345
|
selectedRowKeys: o(R).selectedRowKeys,
|
|
339
346
|
shownColumns: i.value,
|
|
340
|
-
clearAll:
|
|
347
|
+
clearAll: T
|
|
341
348
|
})
|
|
342
349
|
], 2),
|
|
343
|
-
|
|
350
|
+
I("div", {
|
|
344
351
|
class: f(o(d)("vxe-wrapper"))
|
|
345
352
|
}, [
|
|
346
|
-
(s(),
|
|
353
|
+
(s(), p(o(Ee), g(o(Ke)(a), {
|
|
347
354
|
ref_key: "tableRef",
|
|
348
|
-
ref:
|
|
355
|
+
ref: m,
|
|
349
356
|
key: o(ie),
|
|
350
|
-
data: o(
|
|
357
|
+
data: o(C).records,
|
|
351
358
|
"sort-config": { remote: $.value.length > 0 },
|
|
352
359
|
"filter-config": { remote: H.value.length > 0 },
|
|
353
|
-
loading:
|
|
360
|
+
loading: Ce.value,
|
|
354
361
|
"row-config": {
|
|
355
362
|
isHover: !0,
|
|
356
363
|
keyField: a.rowKey
|
|
357
364
|
},
|
|
358
365
|
style: {
|
|
359
|
-
"--vxe-ui-table-row-checkbox-checked-background-color": o(
|
|
360
|
-
"--vxe-ui-table-row-hover-checkbox-checked-background-color": o(
|
|
361
|
-
"--vxe-ui-font-primary-color": o(
|
|
366
|
+
"--vxe-ui-table-row-checkbox-checked-background-color": o(c).controlItemBgActive,
|
|
367
|
+
"--vxe-ui-table-row-hover-checkbox-checked-background-color": o(c).controlItemBgActiveHover,
|
|
368
|
+
"--vxe-ui-font-primary-color": o(c).colorPrimary,
|
|
362
369
|
"--vxe-ui-table-header-background-color": "var(--ap-table-header-bg)",
|
|
363
370
|
"--vxe-ui-table-cell-padding-default": "12px",
|
|
364
371
|
"--vxe-ui-table-cell-padding-medium": "9px",
|
|
365
|
-
"--vxe-ui-table-row-radio-checked-background-color": o(
|
|
366
|
-
"--vxe-ui-table-row-hover-radio-checked-background-color": o(
|
|
372
|
+
"--vxe-ui-table-row-radio-checked-background-color": o(c).controlItemBgActive,
|
|
373
|
+
"--vxe-ui-table-row-hover-radio-checked-background-color": o(c).controlItemBgActiveHover,
|
|
374
|
+
"--vxe-ui-font-color": o(c).colorTextBase,
|
|
375
|
+
"--vxe-ui-table-border-color": o(c).colorBorderSecondary
|
|
367
376
|
},
|
|
368
|
-
size:
|
|
377
|
+
size: h.value,
|
|
369
378
|
onSortChange: o(fe),
|
|
370
379
|
onFilterChange: o(ge),
|
|
371
|
-
onCheckboxChange:
|
|
372
|
-
onCheckboxRangeChange:
|
|
373
|
-
onCheckboxAll:
|
|
380
|
+
onCheckboxChange: N,
|
|
381
|
+
onCheckboxRangeChange: N,
|
|
382
|
+
onCheckboxAll: N,
|
|
374
383
|
onRadioChange: we
|
|
375
384
|
}), G({
|
|
376
385
|
empty: v(() => [
|
|
@@ -379,14 +388,14 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
379
388
|
}, null, 8, ["image"])
|
|
380
389
|
]),
|
|
381
390
|
default: v(() => [
|
|
382
|
-
a.expandable ? (s(),
|
|
391
|
+
a.expandable ? (s(), p(o(Q), g({ key: 0 }, o($e)(e.expandable), { fixed: he.value }), {
|
|
383
392
|
content: v((t) => [
|
|
384
|
-
(s(),
|
|
393
|
+
(s(), p(_(a.expandable.renderContent(t))))
|
|
385
394
|
]),
|
|
386
395
|
_: 1
|
|
387
|
-
}, 16, ["fixed"])) :
|
|
388
|
-
a.rowSelection ? (s(),
|
|
389
|
-
(s(!0),
|
|
396
|
+
}, 16, ["fixed"])) : b("", !0),
|
|
397
|
+
a.rowSelection ? (s(), p(o(Q), J(g({ key: 1 }, o(He)(o(R), i.value))), null, 16)) : b("", !0),
|
|
398
|
+
(s(!0), B(X, null, A(o(se), (t) => (s(), p(_(t), {
|
|
390
399
|
key: t.props.colId
|
|
391
400
|
}))), 128))
|
|
392
401
|
]),
|
|
@@ -400,18 +409,18 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
400
409
|
}))
|
|
401
410
|
]), 1040, ["data", "sort-config", "filter-config", "loading", "row-config", "style", "size", "onSortChange", "onFilterChange"]))
|
|
402
411
|
], 2),
|
|
403
|
-
|
|
412
|
+
I("div", {
|
|
404
413
|
class: f(o(d)("pagination-wrapper"))
|
|
405
414
|
}, [
|
|
406
|
-
e.sticky ? (s(),
|
|
415
|
+
e.sticky ? (s(), p(o(Ye), {
|
|
407
416
|
key: 0,
|
|
408
417
|
direction: "horizontal",
|
|
409
418
|
"scroll-container": de.value
|
|
410
|
-
}, null, 8, ["scroll-container"])) :
|
|
411
|
-
e.pagination !== !1 ? (s(),
|
|
419
|
+
}, null, 8, ["scroll-container"])) : b("", !0),
|
|
420
|
+
e.pagination !== !1 ? (s(), p(o(De), g({
|
|
412
421
|
key: 1,
|
|
413
422
|
class: o(d)("pagination")
|
|
414
|
-
}, o(M).pagination, { onChange: o(ve) }), null, 16, ["class", "onChange"])) :
|
|
423
|
+
}, o(M).pagination, { onChange: o(ve) }), null, 16, ["class", "onChange"])) : b("", !0)
|
|
415
424
|
], 2)
|
|
416
425
|
], 6)
|
|
417
426
|
], 6));
|
|
@@ -60,6 +60,10 @@ export type ApGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
60
60
|
* 指定值类型(将会用于默认渲染和查询表单生成)
|
|
61
61
|
*/
|
|
62
62
|
valueType?: MergedValueType;
|
|
63
|
+
/**
|
|
64
|
+
* 指定渲染内容是否为html
|
|
65
|
+
*/
|
|
66
|
+
html?: boolean;
|
|
63
67
|
/**
|
|
64
68
|
* 值类型额外配置的参数(用于查询表单渲染)
|
|
65
69
|
*/
|
|
@@ -115,7 +119,7 @@ export type ApGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
|
|
|
115
119
|
*/
|
|
116
120
|
range?: boolean;
|
|
117
121
|
};
|
|
118
|
-
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig'> & {
|
|
122
|
+
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig' | 'headerCellConfig' | 'footerCellConfig'> & {
|
|
119
123
|
/**
|
|
120
124
|
* 列配置
|
|
121
125
|
*/
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createVNode as v, Fragment as S } from "vue";
|
|
2
|
-
import { isUndefined as $, isArray as M, isString as x, isBoolean as
|
|
3
|
-
import { valueEnumToArray as j, objectToString as B, getTableTitle as
|
|
2
|
+
import { isUndefined as $, isArray as M, isString as x, isBoolean as A, isNumber as V, pick as R } from "lodash-unified";
|
|
3
|
+
import { valueEnumToArray as j, objectToString as B, getTableTitle as c, getTableRenderType as N, getTableRenderProps as W, getTableCellRenderNode as _ } from "../../ap-table/utils.mjs";
|
|
4
4
|
import { noRenderAsFormItemValueList as k } from "../../ap-table/constants.mjs";
|
|
5
5
|
import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
|
|
6
6
|
import z from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
|
|
7
7
|
function b(e) {
|
|
8
8
|
if (!$(e))
|
|
9
|
-
return M(e) ? e.reduce((r,
|
|
9
|
+
return M(e) ? e.reduce((r, i) => x(i) ? `${r}.${i}` : `${r}[${i}]`, "") : String(e);
|
|
10
10
|
}
|
|
11
11
|
function w(e) {
|
|
12
12
|
if (e)
|
|
13
13
|
return e === !0 ? "left" : e;
|
|
14
14
|
}
|
|
15
15
|
function G(e) {
|
|
16
|
-
return
|
|
16
|
+
return A(e) ? {
|
|
17
17
|
sortable: e
|
|
18
18
|
} : e ? {
|
|
19
19
|
sortable: !0,
|
|
@@ -25,9 +25,9 @@ function G(e) {
|
|
|
25
25
|
}
|
|
26
26
|
function I(e) {
|
|
27
27
|
let r;
|
|
28
|
-
return
|
|
29
|
-
label: x(
|
|
30
|
-
value:
|
|
28
|
+
return A(e.filters) && e.valueEnum ? r = j(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((i) => ({
|
|
29
|
+
label: x(i.text) ? i.text : "",
|
|
30
|
+
value: i.value
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
33
|
function L(e) {
|
|
@@ -47,88 +47,88 @@ function U(e, r) {
|
|
|
47
47
|
htmlTitle: e === "title" ? r : ""
|
|
48
48
|
} : !1;
|
|
49
49
|
}
|
|
50
|
-
function q(e, r,
|
|
50
|
+
function q(e, r, i) {
|
|
51
51
|
if (k.includes(e.valueType))
|
|
52
|
-
return
|
|
52
|
+
return i;
|
|
53
53
|
if (e.copyable || e.ellipsis) {
|
|
54
|
-
const
|
|
54
|
+
const l = U(e.ellipsis, r), t = B(r);
|
|
55
55
|
return v(z, {
|
|
56
|
-
rawValue:
|
|
56
|
+
rawValue: t,
|
|
57
57
|
copyable: e.copyable,
|
|
58
|
-
ellipsis:
|
|
59
|
-
content:
|
|
58
|
+
ellipsis: l,
|
|
59
|
+
content: i
|
|
60
60
|
}, null);
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return i;
|
|
63
63
|
}
|
|
64
|
-
function y(e, r,
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
header: () =>
|
|
68
|
-
},
|
|
64
|
+
function y(e, r, i) {
|
|
65
|
+
const l = R(e, ["width", "minWidth", "align"]);
|
|
66
|
+
return l.field = b(e.dataIndex), l.fixed = w(e.fixed), l.slots = {
|
|
67
|
+
header: () => c(e, i, void 0, r)
|
|
68
|
+
}, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
|
|
69
69
|
}
|
|
70
|
-
function F(e, r,
|
|
71
|
-
const
|
|
72
|
-
|
|
70
|
+
function F(e, r, i, l) {
|
|
71
|
+
const t = R(e, ["width", "minWidth", "align", "resizable"]);
|
|
72
|
+
t.field = b(e.dataIndex), t.fixed = w(e.fixed), t.headerAlign = e.align, t.footerAlign = e.align, t.showOverflow = !1, t.showFooterOverflow = !1, Object.assign(t, G(e.sorter)), t.filters = I(e), t.filterMultiple = e.filterMultiple, t.filterMethod = L(e.onFilter);
|
|
73
73
|
const a = ({
|
|
74
74
|
value: d,
|
|
75
|
-
...
|
|
75
|
+
...n
|
|
76
76
|
}) => {
|
|
77
|
-
var
|
|
77
|
+
var o, T;
|
|
78
78
|
const f = N(e), u = W({
|
|
79
79
|
...e,
|
|
80
80
|
valueType: f
|
|
81
81
|
}, {
|
|
82
82
|
value: d,
|
|
83
|
-
...
|
|
84
|
-
}), E = _(f, u,
|
|
83
|
+
...n
|
|
84
|
+
}), E = _(f, u, n.record, l), h = ((o = e.renderText) == null ? void 0 : o.call(e, {
|
|
85
85
|
value: d,
|
|
86
|
-
...
|
|
87
|
-
})) || d, O = e.renderText ? v(S, null, [(
|
|
86
|
+
...n
|
|
87
|
+
})) || d, O = e.renderText ? v(S, null, [(T = e.renderText) == null ? void 0 : T.call(e, {
|
|
88
88
|
value: d,
|
|
89
|
-
...
|
|
89
|
+
...n
|
|
90
90
|
})]) : E;
|
|
91
91
|
let p = q(e, h, O);
|
|
92
92
|
return e.customRender && (p = e.customRender({
|
|
93
93
|
value: d,
|
|
94
|
-
...
|
|
94
|
+
...n,
|
|
95
95
|
column: e,
|
|
96
96
|
originalNode: p,
|
|
97
97
|
originalText: h
|
|
98
98
|
})), p;
|
|
99
99
|
}, s = ({
|
|
100
100
|
row: d,
|
|
101
|
-
rowIndex:
|
|
101
|
+
rowIndex: n
|
|
102
102
|
}) => a({
|
|
103
|
-
value: d[
|
|
104
|
-
text: d[
|
|
103
|
+
value: d[t.field],
|
|
104
|
+
text: d[t.field],
|
|
105
105
|
record: d,
|
|
106
|
-
index:
|
|
107
|
-
renderIndex:
|
|
106
|
+
index: n,
|
|
107
|
+
renderIndex: n,
|
|
108
108
|
column: e
|
|
109
109
|
});
|
|
110
|
-
return
|
|
111
|
-
header: () =>
|
|
110
|
+
return t.slots = {
|
|
111
|
+
header: () => c(e, i, void 0, r),
|
|
112
112
|
default: s,
|
|
113
113
|
footer: s
|
|
114
|
-
},
|
|
114
|
+
}, e.html && (delete t.slots.default, delete t.slots.footer, t.type = "html"), t;
|
|
115
115
|
}
|
|
116
|
-
function Y(e, r,
|
|
116
|
+
function Y(e, r, i, l) {
|
|
117
117
|
var s;
|
|
118
118
|
if (!((s = e.children) != null && s.length))
|
|
119
|
-
return F(e, r,
|
|
120
|
-
function
|
|
121
|
-
return d.map((
|
|
119
|
+
return F(e, r, i, l);
|
|
120
|
+
function t(d) {
|
|
121
|
+
return d.map((n) => {
|
|
122
122
|
var f;
|
|
123
|
-
if ((f =
|
|
124
|
-
const u = y(
|
|
125
|
-
return u.children =
|
|
123
|
+
if ((f = n.children) != null && f.length) {
|
|
124
|
+
const u = y(n, r, i);
|
|
125
|
+
return u.children = t(n.children), u;
|
|
126
126
|
}
|
|
127
|
-
return F(
|
|
127
|
+
return F(n, r, i, l);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
const a = y(e, r,
|
|
131
|
-
return a.children =
|
|
130
|
+
const a = y(e, r, i);
|
|
131
|
+
return a.children = t(e.children), a;
|
|
132
132
|
}
|
|
133
133
|
export {
|
|
134
134
|
Y as transformCol,
|
|
@@ -39,7 +39,7 @@ function m(e) {
|
|
|
39
39
|
range: o.range || !1
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
return t.border = e.bordered, e.expandable && (t.expandConfig = l(e.expandable, [
|
|
42
|
+
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = l(e.expandable, [
|
|
43
43
|
"renderContent",
|
|
44
44
|
"width",
|
|
45
45
|
"title"
|
|
@@ -47,7 +47,7 @@ function m(e) {
|
|
|
47
47
|
enabled: !1
|
|
48
48
|
}, t.virtualYConfig = {
|
|
49
49
|
enabled: !1
|
|
50
|
-
}) : (a(t, "X", e.virtual), a(t, "Y", e.virtual)), t;
|
|
50
|
+
}) : (a(t, "X", e.virtual), a(t, "Y", e.virtual)), t.round = !0, t;
|
|
51
51
|
}
|
|
52
52
|
function a(e, t, i) {
|
|
53
53
|
const o = t === "X", r = o ? "x" : "y", n = o ? "virtualXConfig" : "virtualYConfig", s = i == null ? void 0 : i[r], f = s !== !1, d = o ? w : x, c = b(s) && s >= 0 ? s : d;
|