@aplus-frontend/ui 0.5.34 → 0.5.36
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/editable/interface.d.ts +4 -0
- package/es/src/ap-grid/index.vue.mjs +65 -66
- package/es/src/ap-grid/interface.d.ts +8 -3
- package/es/src/ap-grid/utils/col.mjs +51 -51
- package/es/src/ap-grid/utils/table.mjs +13 -10
- package/es/src/ap-list/index.vue.mjs +23 -23
- package/es/src/design-token/index.mjs +1 -0
- package/es/src/editable-table/index.vue.mjs +1 -1
- package/es/src/editable-table/interface.d.ts +4 -0
- package/es/src/editable-table/utils.mjs +54 -52
- package/lib/src/ap-grid/editable/interface.d.ts +4 -0
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +8 -3
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +4 -0
- package/lib/src/editable-table/utils.js +1 -1
- package/package.json +1 -1
- package/theme/ap-grid/index.css +6 -5
- package/theme/ap-grid/index.less +5 -2
- package/theme/index.css +9 -8
- package/theme/splitter/index.less +6 -6
|
@@ -43,6 +43,10 @@ export type EditableGridColumnType<RecordType = any, ExtraValueType = 'text', Va
|
|
|
43
43
|
editable?: boolean;
|
|
44
44
|
originalNode?: VNode;
|
|
45
45
|
}) => any;
|
|
46
|
+
/**
|
|
47
|
+
* 是否渲染必填标记(只渲染标记不生成校验规则)
|
|
48
|
+
*/
|
|
49
|
+
markRequired?: boolean;
|
|
46
50
|
} : never;
|
|
47
51
|
export type EditableGridProps<RecordType = any> = Omit<ApGridProps<RecordType>, 'columns' | 'dataSource' | 'onChange' | 'card' | 'request' | 'params' | 'defaultData' | 'searchForm' | 'beforeSearchSubmit' | 'manual'> & {
|
|
48
52
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ke, useSlots as
|
|
1
|
+
import { defineComponent as ke, useSlots as Be, getCurrentInstance as Fe, ref as k, computed as n, unref as o, watch as B, createElementBlock as F, openBlock as s, normalizeStyle as z, normalizeClass as g, createCommentVNode as S, createElementVNode as I, createVNode as U, mergeProps as h, createSlots as G, withCtx as v, Fragment as X, renderList as _, createBlock as p, resolveDynamicComponent as A, renderSlot as V, normalizeProps as Ie, guardReactiveProps as Ee } from "vue";
|
|
2
2
|
import { VxeTable as Pe, VxeColumn as J } from "vxe-table";
|
|
3
3
|
import "vxe-table/es/style.css";
|
|
4
4
|
import "vxe-pc-ui/es/style.css";
|
|
@@ -9,11 +9,11 @@ import "../config-provider/index.mjs";
|
|
|
9
9
|
import { noRenderAsFormItemValueList as ze } from "../ap-table/constants.mjs";
|
|
10
10
|
import { getColumnOrder as Y, updateFormProps as _e, getFieldProps as Ae, getSearchFormItemRenderNode as Ve, recursionApColumns as Z } from "../ap-table/utils.mjs";
|
|
11
11
|
import { useTablePaging as Le } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
12
|
-
import { Empty as ee, Pagination as
|
|
13
|
-
import { useInnerParams as
|
|
14
|
-
import { toVxeProps as
|
|
15
|
-
import
|
|
16
|
-
import { useProvideApTable as
|
|
12
|
+
import { Empty as ee, Pagination as De } from "@aplus-frontend/antdv";
|
|
13
|
+
import { useInnerParams as Oe } from "./hooks/use-inner-params.mjs";
|
|
14
|
+
import { toVxeProps as $e, getRowExpandProps as Ke, getRowSelectionProps as We } from "./utils/table.mjs";
|
|
15
|
+
import je from "../ap-table/hooks/use-table-row-selection.mjs";
|
|
16
|
+
import { useProvideApTable as He } from "../ap-table/context.mjs";
|
|
17
17
|
import { sizeReverseMap as Me, sizeMap as qe, ROW_SELECTION_FIELD as Ue } from "./constants.mjs";
|
|
18
18
|
import { useRenderColumns as Ge } from "./hooks/use-render-columns.mjs";
|
|
19
19
|
import { useToken as Xe } from "@aplus-frontend/antdv/es/theme/internal";
|
|
@@ -22,7 +22,7 @@ import { useNamespace as Je } from "../config-provider/hooks/use-namespace.mjs";
|
|
|
22
22
|
import { useGlobalConfig as Qe } from "../config-provider/hooks/use-global-config.mjs";
|
|
23
23
|
import { useLocale as Ye } from "../config-provider/hooks/use-locale.mjs";
|
|
24
24
|
import Ze from "../scroll-bar/index.vue.mjs";
|
|
25
|
-
const
|
|
25
|
+
const Bo = /* @__PURE__ */ ke({
|
|
26
26
|
name: "ApGrid",
|
|
27
27
|
__name: "index",
|
|
28
28
|
props: {
|
|
@@ -112,22 +112,22 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
112
112
|
},
|
|
113
113
|
setup(oe, { expose: ae }) {
|
|
114
114
|
var q;
|
|
115
|
-
const L =
|
|
115
|
+
const L = Be(), a = oe, w = (q = Fe()) == null ? void 0 : q.appContext.app;
|
|
116
116
|
w && !w.__VXE_PC_UI_INSTALLED__ && (w.use(Q), w.__VXE_PC_UI_INSTALLED__ = !0);
|
|
117
|
-
const { e: E, b:
|
|
117
|
+
const { e: E, b: c, be: re } = Je("ap-grid"), te = Qe("valueTypeMap"), d = k([]), D = k([]), m = k(), C = k(a.size), [, i] = Xe(), { t: le } = Ye();
|
|
118
118
|
Q.setConfig({
|
|
119
119
|
i18n: (e, r) => le(`ap.${e}`, r)
|
|
120
120
|
});
|
|
121
121
|
const { renderConfig: ne, updateSignal: se } = Ge(d);
|
|
122
|
-
let
|
|
122
|
+
let O = 0;
|
|
123
123
|
const de = n(() => {
|
|
124
124
|
if (m.value)
|
|
125
125
|
return m.value.$el.querySelector(
|
|
126
126
|
".vxe-table--header-inner-wrapper"
|
|
127
127
|
);
|
|
128
|
-
}),
|
|
128
|
+
}), $ = n(() => {
|
|
129
129
|
var e, r, l;
|
|
130
|
-
return
|
|
130
|
+
return O++, ((l = (r = (e = a.columns) == null ? void 0 : e.filter(
|
|
131
131
|
(t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !ze.includes(t.valueType)
|
|
132
132
|
)) == null ? void 0 : r.sort((t, u) => {
|
|
133
133
|
let y = Y(t.order);
|
|
@@ -142,7 +142,7 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
142
142
|
label: t.title,
|
|
143
143
|
name: t.dataIndex,
|
|
144
144
|
...u || {},
|
|
145
|
-
_signal:
|
|
145
|
+
_signal: O
|
|
146
146
|
},
|
|
147
147
|
renderNode: void 0
|
|
148
148
|
};
|
|
@@ -152,20 +152,20 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
152
152
|
), y;
|
|
153
153
|
})) || [];
|
|
154
154
|
}), ie = n(() => [
|
|
155
|
-
|
|
156
|
-
a.card ? null :
|
|
157
|
-
a.adaptive ?
|
|
158
|
-
a.sticky ?
|
|
159
|
-
].filter(Boolean)),
|
|
155
|
+
c(),
|
|
156
|
+
a.card ? null : c("wrapper"),
|
|
157
|
+
a.adaptive ? c("adaptive") : null,
|
|
158
|
+
a.sticky ? c("sticky") : null
|
|
159
|
+
].filter(Boolean)), K = n(() => Z(o(d), (e) => {
|
|
160
160
|
if (e.sorter === !0)
|
|
161
161
|
return e.key || e.dataIndex;
|
|
162
|
-
}).filter(Boolean)),
|
|
162
|
+
}).filter(Boolean)), W = n(() => Z(o(d), (e) => {
|
|
163
163
|
if (e.filters && !e.onFilter)
|
|
164
164
|
return e.key || e.dataIndex;
|
|
165
165
|
}).filter(Boolean)), {
|
|
166
166
|
formRef: P,
|
|
167
|
-
submit:
|
|
168
|
-
reset:
|
|
167
|
+
submit: j,
|
|
168
|
+
reset: H,
|
|
169
169
|
refresh: ce,
|
|
170
170
|
data: f,
|
|
171
171
|
tableProps: M,
|
|
@@ -188,17 +188,17 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
188
188
|
};
|
|
189
189
|
},
|
|
190
190
|
namespace: "ap-grid",
|
|
191
|
-
filterFields:
|
|
192
|
-
sortFields:
|
|
191
|
+
filterFields: W,
|
|
192
|
+
sortFields: K,
|
|
193
193
|
defaultParams: a.params,
|
|
194
194
|
defaultData: a.defaultData,
|
|
195
195
|
manual: a.manual,
|
|
196
196
|
formatParams: a.beforeSearchSubmit,
|
|
197
197
|
pagination: a.pagination
|
|
198
|
-
}), { sortChangeEvent: me, filterChangeEvent: fe, paginationChangeEvent: ge } =
|
|
199
|
-
|
|
198
|
+
}), { sortChangeEvent: me, filterChangeEvent: fe, paginationChangeEvent: ge } = Oe(pe);
|
|
199
|
+
He({
|
|
200
200
|
columns: n(() => d.value),
|
|
201
|
-
columnsBackup: n(() =>
|
|
201
|
+
columnsBackup: n(() => D.value),
|
|
202
202
|
size: n(() => C.value ? qe[C.value] : "middle"),
|
|
203
203
|
updateColumns(e) {
|
|
204
204
|
var r;
|
|
@@ -209,7 +209,7 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
209
209
|
},
|
|
210
210
|
renderConfig: n(() => ({
|
|
211
211
|
className: re("table-header", "title"),
|
|
212
|
-
color:
|
|
212
|
+
color: i.value.colorPrimary
|
|
213
213
|
})),
|
|
214
214
|
dataSource: n(() => o(f).records)
|
|
215
215
|
});
|
|
@@ -221,7 +221,7 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
221
221
|
() => b(a.loading) ? f.loading : a.loading
|
|
222
222
|
), Ce = n(
|
|
223
223
|
() => b(a.dataSource) ? f.records : a.dataSource
|
|
224
|
-
), { selectedRows: x, rowSelection: R, ...ye } =
|
|
224
|
+
), { selectedRows: x, rowSelection: R, ...ye } = je({
|
|
225
225
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
226
226
|
dataSource: Ce,
|
|
227
227
|
rowKey: a.rowKey
|
|
@@ -259,37 +259,37 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
259
259
|
if (l)
|
|
260
260
|
return (t = m.value) == null ? void 0 : t.scrollToRow(l, r);
|
|
261
261
|
}
|
|
262
|
-
return
|
|
262
|
+
return B(
|
|
263
263
|
() => [a.columnResizable, a.columns],
|
|
264
264
|
() => {
|
|
265
265
|
var r;
|
|
266
266
|
const e = be();
|
|
267
|
-
d.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e),
|
|
267
|
+
d.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e), D.value = e;
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
270
|
deep: !0,
|
|
271
271
|
immediate: !0
|
|
272
272
|
}
|
|
273
|
-
),
|
|
273
|
+
), B(
|
|
274
274
|
() => a.dataSource,
|
|
275
275
|
(e) => {
|
|
276
276
|
ue(e);
|
|
277
277
|
},
|
|
278
278
|
{ immediate: !0, deep: !0 }
|
|
279
|
-
),
|
|
279
|
+
), B(
|
|
280
280
|
() => o(f).loading,
|
|
281
281
|
(e) => {
|
|
282
282
|
var r;
|
|
283
283
|
(r = a.onLoadingChange) == null || r.call(a, e);
|
|
284
284
|
}
|
|
285
|
-
),
|
|
285
|
+
), B(
|
|
286
286
|
() => a.size,
|
|
287
287
|
(e) => {
|
|
288
288
|
C.value = e;
|
|
289
289
|
}
|
|
290
290
|
), ae({
|
|
291
|
-
submit:
|
|
292
|
-
reset:
|
|
291
|
+
submit: j,
|
|
292
|
+
reset: H,
|
|
293
293
|
refresh: ce,
|
|
294
294
|
setSearchFormValues: we,
|
|
295
295
|
getSearchFormValues: xe,
|
|
@@ -298,12 +298,13 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
298
298
|
selectedRows: n(() => x.value),
|
|
299
299
|
clearAll: T
|
|
300
300
|
},
|
|
301
|
-
scrollToRow: Re
|
|
302
|
-
|
|
301
|
+
scrollToRow: Re,
|
|
302
|
+
getDataSource: () => o(f.records)
|
|
303
|
+
}), (e, r) => (s(), F("div", {
|
|
303
304
|
class: g(ie.value),
|
|
304
305
|
style: z(e.wrapperStyle)
|
|
305
306
|
}, [
|
|
306
|
-
o(b)(e.dataSource) && e.searchForm !== !1 &&
|
|
307
|
+
o(b)(e.dataSource) && e.searchForm !== !1 && $.value.length > 0 ? (s(), F("div", {
|
|
307
308
|
key: 0,
|
|
308
309
|
class: g(e.card ? o(E)("search-wrapper") : null),
|
|
309
310
|
style: z(e.searchFormWrapperStyle)
|
|
@@ -313,11 +314,11 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
313
314
|
ref: P,
|
|
314
315
|
"custom-reset": "",
|
|
315
316
|
"submit-loading": o(M).loading,
|
|
316
|
-
onSubmit: o(
|
|
317
|
-
onReset: o(
|
|
317
|
+
onSubmit: o(j),
|
|
318
|
+
onReset: o(H)
|
|
318
319
|
}), G({
|
|
319
320
|
default: v(() => [
|
|
320
|
-
(s(!0),
|
|
321
|
+
(s(!0), F(X, null, _($.value, (l) => (s(), p(A(l.renderNode.Comp), h({
|
|
321
322
|
key: l.dataIndex,
|
|
322
323
|
item: l,
|
|
323
324
|
ref_for: !0
|
|
@@ -342,7 +343,7 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
342
343
|
style: z(e.tableWrapperStyle)
|
|
343
344
|
}, [
|
|
344
345
|
I("div", {
|
|
345
|
-
class: g(o(
|
|
346
|
+
class: g(o(c)("header-wrapper"))
|
|
346
347
|
}, [
|
|
347
348
|
V(e.$slots, "title", {
|
|
348
349
|
selectedRows: o(x),
|
|
@@ -352,31 +353,28 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
352
353
|
})
|
|
353
354
|
], 2),
|
|
354
355
|
I("div", {
|
|
355
|
-
class: g(o(
|
|
356
|
+
class: g(o(c)("vxe-wrapper"))
|
|
356
357
|
}, [
|
|
357
|
-
(s(), p(o(Pe), h(o(
|
|
358
|
+
(s(), p(o(Pe), h(o($e)(a), {
|
|
358
359
|
ref_key: "tableRef",
|
|
359
360
|
ref: m,
|
|
360
361
|
key: o(se),
|
|
361
362
|
data: o(f).records,
|
|
362
|
-
"sort-config": { remote:
|
|
363
|
-
"filter-config": { remote:
|
|
363
|
+
"sort-config": { remote: K.value.length > 0 },
|
|
364
|
+
"filter-config": { remote: W.value.length > 0 },
|
|
364
365
|
loading: ve.value,
|
|
365
|
-
"row-config": {
|
|
366
|
-
isHover: !0,
|
|
367
|
-
keyField: a.rowKey
|
|
368
|
-
},
|
|
369
366
|
style: {
|
|
370
|
-
"--vxe-ui-table-row-checkbox-checked-background-color": o(
|
|
371
|
-
"--vxe-ui-table-row-hover-checkbox-checked-background-color": o(
|
|
372
|
-
"--vxe-ui-font-primary-color": o(
|
|
367
|
+
"--vxe-ui-table-row-checkbox-checked-background-color": o(i).controlItemBgActive,
|
|
368
|
+
"--vxe-ui-table-row-hover-checkbox-checked-background-color": o(i).controlItemBgActiveHover,
|
|
369
|
+
"--vxe-ui-font-primary-color": o(i).colorPrimary,
|
|
373
370
|
"--vxe-ui-table-header-background-color": "var(--ap-table-header-bg)",
|
|
374
371
|
"--vxe-ui-table-cell-padding-default": "12px",
|
|
375
372
|
"--vxe-ui-table-cell-padding-medium": "9px",
|
|
376
|
-
"--vxe-ui-table-row-radio-checked-background-color": o(
|
|
377
|
-
"--vxe-ui-table-row-hover-radio-checked-background-color": o(
|
|
378
|
-
"--vxe-ui-font-color": o(
|
|
379
|
-
"--vxe-ui-table-border-color": o(
|
|
373
|
+
"--vxe-ui-table-row-radio-checked-background-color": o(i).controlItemBgActive,
|
|
374
|
+
"--vxe-ui-table-row-hover-radio-checked-background-color": o(i).controlItemBgActiveHover,
|
|
375
|
+
"--vxe-ui-font-color": o(i).colorTextBase,
|
|
376
|
+
"--vxe-ui-table-border-color": o(i).colorBorderSecondary,
|
|
377
|
+
"--vxe-ui-table-header-font-color": o(i).colorTextBase
|
|
380
378
|
},
|
|
381
379
|
size: C.value,
|
|
382
380
|
onSortChange: o(me),
|
|
@@ -392,14 +390,14 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
392
390
|
}, null, 8, ["image"])
|
|
393
391
|
]),
|
|
394
392
|
default: v(() => [
|
|
395
|
-
a.expandable ? (s(), p(o(J), h({ key: 0 }, o(
|
|
393
|
+
a.expandable ? (s(), p(o(J), h({ key: 0 }, o(Ke)(e.expandable), { fixed: he.value }), {
|
|
396
394
|
content: v((l) => [
|
|
397
395
|
(s(), p(A(a.expandable.renderContent(l))))
|
|
398
396
|
]),
|
|
399
397
|
_: 1
|
|
400
398
|
}, 16, ["fixed"])) : S("", !0),
|
|
401
|
-
a.rowSelection ? (s(), p(o(J), h({ key: 1 }, o(
|
|
402
|
-
(s(!0),
|
|
399
|
+
a.rowSelection ? (s(), p(o(J), h({ key: 1 }, o(We)(o(R), d.value), { field: o(Ue) }), null, 16, ["field"])) : S("", !0),
|
|
400
|
+
(s(!0), F(X, null, _(o(ne), (l) => (s(), p(A(l), {
|
|
403
401
|
key: l.props.colId
|
|
404
402
|
}))), 128))
|
|
405
403
|
]),
|
|
@@ -411,19 +409,20 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
411
409
|
V(e.$slots, t, Ie(Ee(u || {})))
|
|
412
410
|
])
|
|
413
411
|
}))
|
|
414
|
-
]), 1040, ["data", "sort-config", "filter-config", "loading", "
|
|
412
|
+
]), 1040, ["data", "sort-config", "filter-config", "loading", "style", "size", "onSortChange", "onFilterChange"]))
|
|
415
413
|
], 2),
|
|
416
414
|
I("div", {
|
|
417
|
-
class: g(o(
|
|
415
|
+
class: g(o(c)("pagination-wrapper"))
|
|
418
416
|
}, [
|
|
419
417
|
e.sticky ? (s(), p(o(Ze), {
|
|
420
418
|
key: 0,
|
|
421
419
|
direction: "horizontal",
|
|
422
|
-
"scroll-container": de.value
|
|
420
|
+
"scroll-container": de.value,
|
|
421
|
+
"extra-size": -4.2
|
|
423
422
|
}, null, 8, ["scroll-container"])) : S("", !0),
|
|
424
|
-
e.pagination !== !1 ? (s(), p(o(
|
|
423
|
+
e.pagination !== !1 ? (s(), p(o(De), h({
|
|
425
424
|
key: 1,
|
|
426
|
-
class: o(
|
|
425
|
+
class: o(c)("pagination")
|
|
427
426
|
}, o(M).pagination, { onChange: o(ge) }), null, 16, ["class", "onChange"])) : S("", !0)
|
|
428
427
|
], 2)
|
|
429
428
|
], 6)
|
|
@@ -431,5 +430,5 @@ const Fo = /* @__PURE__ */ ke({
|
|
|
431
430
|
}
|
|
432
431
|
});
|
|
433
432
|
export {
|
|
434
|
-
|
|
433
|
+
Bo as default
|
|
435
434
|
};
|
|
@@ -4,9 +4,9 @@ import { Recordable } from '../type';
|
|
|
4
4
|
import { TableProps } from '@aplus-frontend/antdv';
|
|
5
5
|
import { ColumnFilterItem, SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
|
|
6
6
|
import { ComputedRef, CSSProperties, Ref, VNode } from 'vue';
|
|
7
|
-
import { VxeTablePropTypes, VxeColumnPropTypes, VxeTableProps, VxeTableDefines, VxeColumnSlots } from 'vxe-table';
|
|
7
|
+
import { VxeTablePropTypes, VxeColumnPropTypes, VxeTableProps, VxeTableDefines, VxeColumnSlots, VxeColumnProps } from 'vxe-table';
|
|
8
8
|
export type ColConfigType = VxeTableDefines.ColumnOptions;
|
|
9
|
-
export type ApGridColumnType<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'> & {
|
|
9
|
+
export type ApGridColumnType<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' | 'className' | 'class'> & {
|
|
10
10
|
children?: ApGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
|
|
11
11
|
/**
|
|
12
12
|
* 表单项所占据的格子数(1-24格)
|
|
@@ -100,7 +100,7 @@ export type ApGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
100
100
|
originalNode?: VNode;
|
|
101
101
|
originalText?: any;
|
|
102
102
|
}) => any;
|
|
103
|
-
} : never;
|
|
103
|
+
} & Pick<VxeColumnProps, 'className' | 'headerClassName' | 'footerClassName'> : never;
|
|
104
104
|
export type ApGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>, 'defaultSelectedRowKeys' | 'type' | 'preserveSelectedRowKeys' | 'onChange' | 'fixed' | 'columnWidth' | 'columnTitle'> & {
|
|
105
105
|
/**
|
|
106
106
|
* 设置禁用的列
|
|
@@ -298,4 +298,9 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
298
298
|
* @returns
|
|
299
299
|
*/
|
|
300
300
|
scrollToRow: (index: number, fieldOrColumn?: any) => Promise<any>;
|
|
301
|
+
/**
|
|
302
|
+
* 获取当前表格数据
|
|
303
|
+
* @returns
|
|
304
|
+
*/
|
|
305
|
+
getDataSource: () => RecordType[];
|
|
301
306
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { createVNode as v, Fragment as
|
|
2
|
-
import { isUndefined as
|
|
3
|
-
import { valueEnumToArray as
|
|
1
|
+
import { createVNode as v, Fragment as O } from "vue";
|
|
2
|
+
import { isUndefined as S, isArray as $, isString as x, isBoolean as c, isNumber as M, pick as A } from "lodash-unified";
|
|
3
|
+
import { valueEnumToArray as V, objectToString as j, getTableTitle as R, getTableRenderType as B, 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
|
-
if (
|
|
9
|
-
return
|
|
8
|
+
if (!S(e))
|
|
9
|
+
return $(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 c(e) ? {
|
|
17
17
|
sortable: e
|
|
18
18
|
} : e ? {
|
|
19
19
|
sortable: !0,
|
|
@@ -25,7 +25,7 @@ function G(e) {
|
|
|
25
25
|
}
|
|
26
26
|
function I(e) {
|
|
27
27
|
let r;
|
|
28
|
-
return
|
|
28
|
+
return c(e.filters) && e.valueEnum ? r = V(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((i) => ({
|
|
29
29
|
label: x(i.text) ? i.text : "",
|
|
30
30
|
value: i.value
|
|
31
31
|
}));
|
|
@@ -35,7 +35,7 @@ function L(e) {
|
|
|
35
35
|
return (r) => e(r.value, r.row);
|
|
36
36
|
}
|
|
37
37
|
function U(e, r) {
|
|
38
|
-
return e ?
|
|
38
|
+
return e ? M(e) ? {
|
|
39
39
|
tooltip: r,
|
|
40
40
|
rows: e
|
|
41
41
|
} : e === !0 || e === "tooltip" ? {
|
|
@@ -51,7 +51,7 @@ function q(e, r, i) {
|
|
|
51
51
|
if (k.includes(e.valueType))
|
|
52
52
|
return i;
|
|
53
53
|
if (e.copyable || e.ellipsis) {
|
|
54
|
-
const l = U(e.ellipsis, r), t =
|
|
54
|
+
const l = U(e.ellipsis, r), t = j(r);
|
|
55
55
|
return v(z, {
|
|
56
56
|
rawValue: t,
|
|
57
57
|
copyable: e.copyable,
|
|
@@ -62,73 +62,73 @@ function q(e, r, i) {
|
|
|
62
62
|
return i;
|
|
63
63
|
}
|
|
64
64
|
function y(e, r, i) {
|
|
65
|
-
const l =
|
|
65
|
+
const l = A(e, ["width", "minWidth", "align"]);
|
|
66
66
|
return l.field = b(e.dataIndex), l.fixed = w(e.fixed), l.slots = {
|
|
67
|
-
header: () =>
|
|
67
|
+
header: () => R(e, i, void 0, r)
|
|
68
68
|
}, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
|
|
69
69
|
}
|
|
70
70
|
function F(e, r, i, l) {
|
|
71
|
-
const t =
|
|
71
|
+
const t = A(e, ["width", "minWidth", "align", "resizable", "className", "headerClassName", "footerClassName"]);
|
|
72
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
|
-
const
|
|
74
|
-
value:
|
|
75
|
-
...
|
|
73
|
+
const f = ({
|
|
74
|
+
value: n,
|
|
75
|
+
...s
|
|
76
76
|
}) => {
|
|
77
77
|
var o, T;
|
|
78
|
-
const
|
|
78
|
+
const a = B(e), u = W({
|
|
79
79
|
...e,
|
|
80
|
-
valueType:
|
|
80
|
+
valueType: a
|
|
81
81
|
}, {
|
|
82
|
-
value:
|
|
83
|
-
...
|
|
84
|
-
}), E = _(
|
|
85
|
-
value:
|
|
86
|
-
...
|
|
87
|
-
})) ||
|
|
88
|
-
value:
|
|
89
|
-
...
|
|
82
|
+
value: n,
|
|
83
|
+
...s
|
|
84
|
+
}), E = _(a, u, s.record, l), h = ((o = e.renderText) == null ? void 0 : o.call(e, {
|
|
85
|
+
value: n,
|
|
86
|
+
...s
|
|
87
|
+
})) || n, N = e.renderText ? v(O, null, [(T = e.renderText) == null ? void 0 : T.call(e, {
|
|
88
|
+
value: n,
|
|
89
|
+
...s
|
|
90
90
|
})]) : E;
|
|
91
|
-
let p = q(e, h,
|
|
91
|
+
let p = q(e, h, N);
|
|
92
92
|
return e.customRender && (p = e.customRender({
|
|
93
|
-
value:
|
|
94
|
-
...
|
|
93
|
+
value: n,
|
|
94
|
+
...s,
|
|
95
95
|
column: e,
|
|
96
96
|
originalNode: p,
|
|
97
97
|
originalText: h
|
|
98
98
|
})), p;
|
|
99
|
-
},
|
|
100
|
-
row:
|
|
101
|
-
rowIndex:
|
|
102
|
-
}) =>
|
|
103
|
-
value:
|
|
104
|
-
text:
|
|
105
|
-
record:
|
|
106
|
-
index:
|
|
107
|
-
renderIndex:
|
|
99
|
+
}, d = ({
|
|
100
|
+
row: n,
|
|
101
|
+
rowIndex: s
|
|
102
|
+
}) => f({
|
|
103
|
+
value: n[t.field],
|
|
104
|
+
text: n[t.field],
|
|
105
|
+
record: n,
|
|
106
|
+
index: s,
|
|
107
|
+
renderIndex: s,
|
|
108
108
|
column: e
|
|
109
109
|
});
|
|
110
110
|
return t.slots = {
|
|
111
|
-
header: () =>
|
|
112
|
-
default:
|
|
113
|
-
footer:
|
|
111
|
+
header: () => R(e, i, void 0, r),
|
|
112
|
+
default: d,
|
|
113
|
+
footer: d
|
|
114
114
|
}, e.html && (delete t.slots.default, delete t.slots.footer, t.type = "html"), t;
|
|
115
115
|
}
|
|
116
116
|
function Y(e, r, i, l) {
|
|
117
|
-
var
|
|
118
|
-
if (!((
|
|
117
|
+
var d;
|
|
118
|
+
if (!((d = e.children) != null && d.length))
|
|
119
119
|
return F(e, r, i, l);
|
|
120
|
-
function t(
|
|
121
|
-
return
|
|
122
|
-
var
|
|
123
|
-
if ((
|
|
124
|
-
const u = y(
|
|
125
|
-
return u.children = t(
|
|
120
|
+
function t(n) {
|
|
121
|
+
return n.map((s) => {
|
|
122
|
+
var a;
|
|
123
|
+
if ((a = s.children) != null && a.length) {
|
|
124
|
+
const u = y(s, r, i);
|
|
125
|
+
return u.children = t(s.children), u;
|
|
126
126
|
}
|
|
127
|
-
return F(
|
|
127
|
+
return F(s, r, i, l);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
const
|
|
131
|
-
return
|
|
130
|
+
const f = y(e, r, i);
|
|
131
|
+
return f.children = t(e.children), f;
|
|
132
132
|
}
|
|
133
133
|
export {
|
|
134
134
|
Y as transformCol,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { omit as l, isUndefined as u, isFunction as h, isNumber as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
1
|
+
import { omit as l, isUndefined as u, isFunction as h, isNumber as w } from "lodash-unified";
|
|
2
|
+
const b = 20, y = 50;
|
|
3
|
+
function R(e) {
|
|
4
4
|
var i;
|
|
5
5
|
const t = {
|
|
6
6
|
...l(e, [
|
|
@@ -47,22 +47,25 @@ 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.rowConfig = {
|
|
51
|
+
isHover: !0,
|
|
52
|
+
keyField: e.rowKey
|
|
53
|
+
}, t.round = !0, t;
|
|
51
54
|
}
|
|
52
55
|
function a(e, t, i) {
|
|
53
|
-
const o = t === "X", r = o ? "x" : "y", n = o ? "virtualXConfig" : "virtualYConfig",
|
|
56
|
+
const o = t === "X", r = o ? "x" : "y", n = o ? "virtualXConfig" : "virtualYConfig", d = i == null ? void 0 : i[r], f = d !== !1, s = o ? b : y, c = w(d) && d >= 0 ? d : s;
|
|
54
57
|
e[n] = {
|
|
55
58
|
enabled: f,
|
|
56
59
|
gt: c,
|
|
57
60
|
oSize: (i == null ? void 0 : i.oSize) || 0
|
|
58
61
|
};
|
|
59
62
|
}
|
|
60
|
-
function
|
|
63
|
+
function x(e) {
|
|
61
64
|
return e === !0 ? "left" : e;
|
|
62
65
|
}
|
|
63
|
-
function
|
|
66
|
+
function m(e, t) {
|
|
64
67
|
const i = e === !0 || !e.type ? "checkbox" : e.type, o = e === !0 ? 60 : e.columnWidth || 60;
|
|
65
|
-
let r = e === !0 ? void 0 :
|
|
68
|
+
let r = e === !0 ? void 0 : x(e.fixed);
|
|
66
69
|
return r || (r === !1 ? r = void 0 : r = t.some(
|
|
67
70
|
(n) => n.fixed === "left" || n.fixed === !0
|
|
68
71
|
) ? "left" : void 0), {
|
|
@@ -81,6 +84,6 @@ function g(e) {
|
|
|
81
84
|
}
|
|
82
85
|
export {
|
|
83
86
|
g as getRowExpandProps,
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
m as getRowSelectionProps,
|
|
88
|
+
R as toVxeProps
|
|
86
89
|
};
|