@aplus-frontend/ui 0.0.33 → 0.0.35
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 +217 -215
- package/es/src/ap-field/select/index.vue.mjs +36 -32
- package/es/src/ap-form/ap-form-item-group/index.vue.mjs +27 -26
- package/es/src/ap-form/ap-form.vue.d.ts +1 -1
- package/es/src/ap-form/ap-form.vue2.mjs +40 -40
- package/es/src/ap-form/interface.d.ts +1 -1
- package/es/src/ap-form/search-form/index.vue.mjs +79 -78
- package/es/src/ap-modal/utils/createModal.mjs +34 -31
- package/es/src/ap-table/ap-table.vue.d.ts +54 -11
- package/es/src/ap-table/ap-table.vue.mjs +171 -148
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging.mjs +48 -47
- package/es/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
- package/es/src/ap-table/hooks/use-table-row-selection.mjs +62 -0
- package/es/src/ap-table/interface.d.ts +14 -2
- package/es/src/ap-table/style/ap-table.css +2 -0
- package/es/src/ap-upload/apUpload.vue.d.ts +3 -3
- package/es/src/ap-upload/hooks/useOss.d.ts +3 -3
- package/es/src/business/ap-select-layout/index.css +117 -0
- package/es/src/business/ap-select-layout/index.d.ts +4 -0
- package/es/src/business/ap-select-layout/interface.d.ts +9 -0
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
- package/es/src/business/ap-select-layout/select-layout.vue.mjs +4 -0
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +145 -0
- package/es/src/business/index.d.ts +76 -1
- package/es/src/business/index.mjs +9 -6
- package/es/src/config-provider/config-provider.d.ts +144 -1
- package/es/src/config-provider/config-provider.mjs +35 -29
- package/es/src/config-provider/index.mjs +22 -20
- package/es/src/design-token/index.mjs +1 -1
- package/es/src/editable-table/form-item.vue.d.ts +7 -7
- package/es/src/editable-table/form-item.vue.mjs +2 -2
- package/es/src/editable-table/index.vue.d.ts +7 -7
- package/es/src/editable-table/index.vue.mjs +10 -10
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/index.mjs +188 -186
- package/es/src/theme/ap-select-layout/ap-select-layout.css +117 -0
- package/es/src/theme/ap-table/ap-table.css +2 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/interface.d.ts +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-modal/utils/createModal.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +54 -11
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
- package/lib/src/ap-table/hooks/use-table-row-selection.js +1 -0
- package/lib/src/ap-table/interface.d.ts +14 -2
- package/lib/src/ap-table/style/ap-table.css +2 -0
- package/lib/src/ap-upload/apUpload.vue.d.ts +3 -3
- package/lib/src/ap-upload/hooks/useOss.d.ts +3 -3
- package/lib/src/business/ap-select-layout/index.css +117 -0
- package/lib/src/business/ap-select-layout/index.d.ts +4 -0
- package/lib/src/business/ap-select-layout/interface.d.ts +9 -0
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
- package/lib/src/business/ap-select-layout/select-layout.vue.js +1 -0
- package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -0
- package/lib/src/business/index.d.ts +76 -1
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +144 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/index.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.d.ts +7 -7
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +7 -7
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-select-layout/ap-select-layout.css +117 -0
- package/lib/src/theme/ap-table/ap-table.css +2 -0
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ApColumnType, ApTableProps, ValueEnum, RequestData } from './interface';
|
|
1
|
+
import { ApColumnType, ApTableProps, ValueEnum, ApTableRowSelection, RequestData } from './interface';
|
|
2
2
|
import { ComputedRef, ExtractPropTypes, PropType, VNode, RendererNode, RendererElement, CSSProperties, VNodeProps, AllowedComponentProps, ComponentCustomProps, ShallowUnwrapRef } from 'vue';
|
|
3
3
|
import { ColumnType } from 'ant-design-vue/es/table';
|
|
4
|
+
import { RowSelectionReturnType } from './hooks/use-table-row-selection';
|
|
4
5
|
import { SpinSize } from 'ant-design-vue/es/spin/Spin';
|
|
5
6
|
import { VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
6
|
-
import { GetPopupContainer, FilterValue, SorterResult, TableCurrentDataSource, TableLocale, CompareFn, ColumnFilterItem, SortOrder
|
|
7
|
+
import { GetPopupContainer, FilterValue, SorterResult, TableCurrentDataSource, TableLocale, CompareFn, ColumnFilterItem, SortOrder } from 'ant-design-vue/es/table/interface';
|
|
7
8
|
import { RenderExpandIcon, PanelRender, TableComponents, TransformCellText, TableLayout, GetRowKey, TableSticky, RowClassName, GetComponentProps, ColumnType, Key, ExpandedRowRender } from 'ant-design-vue/es/vc-table/interface';
|
|
8
9
|
import { TablePaginationConfig } from 'ant-design-vue';
|
|
9
10
|
import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
|
|
@@ -671,6 +672,7 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
671
672
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
672
673
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
673
674
|
}>> | undefined;
|
|
675
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | undefined;
|
|
674
676
|
rowClassName?: string | RowClassName<RecordType> | undefined;
|
|
675
677
|
showHeader?: boolean | undefined;
|
|
676
678
|
customRow?: GetComponentProps<RecordType> | undefined;
|
|
@@ -690,7 +692,6 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
690
692
|
childrenColumnName?: string | undefined;
|
|
691
693
|
rowExpandable?: ((record: RecordType) => boolean) | undefined;
|
|
692
694
|
onResizeColumn?: ((w: number, col: ColumnType<any>) => void) | undefined;
|
|
693
|
-
rowSelection?: TableRowSelection<RecordType> | undefined;
|
|
694
695
|
manual?: boolean | undefined;
|
|
695
696
|
request?: ((params: Partial<any> & {
|
|
696
697
|
pageSize: number;
|
|
@@ -712,7 +713,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
712
713
|
default: any;
|
|
713
714
|
emptyText?: any;
|
|
714
715
|
expandIcon?: any;
|
|
715
|
-
title?:
|
|
716
|
+
title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
|
|
717
|
+
selectedRows: RecordType[];
|
|
718
|
+
}) => any) | undefined;
|
|
716
719
|
footer?: any;
|
|
717
720
|
summary?: any;
|
|
718
721
|
expandedRowRender?: any;
|
|
@@ -728,7 +731,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
728
731
|
default: any;
|
|
729
732
|
emptyText?: any;
|
|
730
733
|
expandIcon?: any;
|
|
731
|
-
title?:
|
|
734
|
+
title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
|
|
735
|
+
selectedRows: RecordType[];
|
|
736
|
+
}) => any) | undefined;
|
|
732
737
|
footer?: any;
|
|
733
738
|
summary?: any;
|
|
734
739
|
expandedRowRender?: any;
|
|
@@ -748,6 +753,16 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
748
753
|
setSearchFormValues: (fields: any) => void;
|
|
749
754
|
getSearchFormValues: () => Partial<any> | undefined;
|
|
750
755
|
dataSource: ComputedRef<RecordType[]>;
|
|
756
|
+
rowSelection: {
|
|
757
|
+
select: (item: RecordType) => void;
|
|
758
|
+
unSelect: (item: RecordType) => void;
|
|
759
|
+
isSelected: (item: RecordType) => boolean;
|
|
760
|
+
selectAll: () => void;
|
|
761
|
+
unSelectAll: () => void;
|
|
762
|
+
clearAll: () => void;
|
|
763
|
+
toggleSelect: (item: RecordType) => void;
|
|
764
|
+
selectedRows: ComputedRef<RecordType[]>;
|
|
765
|
+
};
|
|
751
766
|
}>) => void) | undefined, __VLS_setup?: Promise<{
|
|
752
767
|
props: {
|
|
753
768
|
loading?: boolean | Partial< ExtractPropTypes<{
|
|
@@ -1402,6 +1417,7 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
1402
1417
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
1403
1418
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
1404
1419
|
}>> | undefined;
|
|
1420
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | undefined;
|
|
1405
1421
|
rowClassName?: string | RowClassName<RecordType> | undefined;
|
|
1406
1422
|
showHeader?: boolean | undefined;
|
|
1407
1423
|
customRow?: GetComponentProps<RecordType> | undefined;
|
|
@@ -1421,7 +1437,6 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
1421
1437
|
childrenColumnName?: string | undefined;
|
|
1422
1438
|
rowExpandable?: ((record: RecordType) => boolean) | undefined;
|
|
1423
1439
|
onResizeColumn?: ((w: number, col: ColumnType<any>) => void) | undefined;
|
|
1424
|
-
rowSelection?: TableRowSelection<RecordType> | undefined;
|
|
1425
1440
|
manual?: boolean | undefined;
|
|
1426
1441
|
request?: ((params: Partial<any> & {
|
|
1427
1442
|
pageSize: number;
|
|
@@ -1444,13 +1459,25 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
1444
1459
|
setSearchFormValues: (fields: any) => void;
|
|
1445
1460
|
getSearchFormValues: () => Partial<any> | undefined;
|
|
1446
1461
|
dataSource: ComputedRef<RecordType[]>;
|
|
1462
|
+
rowSelection: {
|
|
1463
|
+
select: (item: RecordType) => void;
|
|
1464
|
+
unSelect: (item: RecordType) => void;
|
|
1465
|
+
isSelected: (item: RecordType) => boolean;
|
|
1466
|
+
selectAll: () => void;
|
|
1467
|
+
unSelectAll: () => void;
|
|
1468
|
+
clearAll: () => void;
|
|
1469
|
+
toggleSelect: (item: RecordType) => void;
|
|
1470
|
+
selectedRows: ComputedRef<RecordType[]>;
|
|
1471
|
+
};
|
|
1447
1472
|
}>): void;
|
|
1448
1473
|
attrs: any;
|
|
1449
1474
|
slots: Readonly<{
|
|
1450
1475
|
default: any;
|
|
1451
1476
|
emptyText?: any;
|
|
1452
1477
|
expandIcon?: any;
|
|
1453
|
-
title?:
|
|
1478
|
+
title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
|
|
1479
|
+
selectedRows: RecordType[];
|
|
1480
|
+
}) => any) | undefined;
|
|
1454
1481
|
footer?: any;
|
|
1455
1482
|
summary?: any;
|
|
1456
1483
|
expandedRowRender?: any;
|
|
@@ -1466,7 +1493,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
1466
1493
|
default: any;
|
|
1467
1494
|
emptyText?: any;
|
|
1468
1495
|
expandIcon?: any;
|
|
1469
|
-
title?:
|
|
1496
|
+
title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
|
|
1497
|
+
selectedRows: RecordType[];
|
|
1498
|
+
}) => any) | undefined;
|
|
1470
1499
|
footer?: any;
|
|
1471
1500
|
summary?: any;
|
|
1472
1501
|
expandedRowRender?: any;
|
|
@@ -2137,6 +2166,7 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
2137
2166
|
onOpenChange: PropType<(vis: boolean) => void>;
|
|
2138
2167
|
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
2139
2168
|
}>> | undefined;
|
|
2169
|
+
rowSelection?: true | ApTableRowSelection<RecordType> | undefined;
|
|
2140
2170
|
rowClassName?: string | RowClassName<RecordType> | undefined;
|
|
2141
2171
|
showHeader?: boolean | undefined;
|
|
2142
2172
|
customRow?: GetComponentProps<RecordType> | undefined;
|
|
@@ -2156,7 +2186,6 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
2156
2186
|
childrenColumnName?: string | undefined;
|
|
2157
2187
|
rowExpandable?: ((record: RecordType) => boolean) | undefined;
|
|
2158
2188
|
onResizeColumn?: ((w: number, col: ColumnType<any>) => void) | undefined;
|
|
2159
|
-
rowSelection?: TableRowSelection<RecordType> | undefined;
|
|
2160
2189
|
manual?: boolean | undefined;
|
|
2161
2190
|
request?: ((params: Partial<any> & {
|
|
2162
2191
|
pageSize: number;
|
|
@@ -2179,13 +2208,25 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
2179
2208
|
setSearchFormValues: (fields: any) => void;
|
|
2180
2209
|
getSearchFormValues: () => Partial<any> | undefined;
|
|
2181
2210
|
dataSource: ComputedRef<RecordType[]>;
|
|
2211
|
+
rowSelection: {
|
|
2212
|
+
select: (item: RecordType) => void;
|
|
2213
|
+
unSelect: (item: RecordType) => void;
|
|
2214
|
+
isSelected: (item: RecordType) => boolean;
|
|
2215
|
+
selectAll: () => void;
|
|
2216
|
+
unSelectAll: () => void;
|
|
2217
|
+
clearAll: () => void;
|
|
2218
|
+
toggleSelect: (item: RecordType) => void;
|
|
2219
|
+
selectedRows: ComputedRef<RecordType[]>;
|
|
2220
|
+
};
|
|
2182
2221
|
}>): void;
|
|
2183
2222
|
attrs: any;
|
|
2184
2223
|
slots: Readonly<{
|
|
2185
2224
|
default: any;
|
|
2186
2225
|
emptyText?: any;
|
|
2187
2226
|
expandIcon?: any;
|
|
2188
|
-
title?:
|
|
2227
|
+
title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
|
|
2228
|
+
selectedRows: RecordType[];
|
|
2229
|
+
}) => any) | undefined;
|
|
2189
2230
|
footer?: any;
|
|
2190
2231
|
summary?: any;
|
|
2191
2232
|
expandedRowRender?: any;
|
|
@@ -2201,7 +2242,9 @@ declare const _default: <RecordType>(__VLS_props: {
|
|
|
2201
2242
|
default: any;
|
|
2202
2243
|
emptyText?: any;
|
|
2203
2244
|
expandIcon?: any;
|
|
2204
|
-
title?:
|
|
2245
|
+
title?: ((params: Omit<RowSelectionReturnType<RecordType>, "rowSelection" | "selectedRows"> & {
|
|
2246
|
+
selectedRows: RecordType[];
|
|
2247
|
+
}) => any) | undefined;
|
|
2205
2248
|
footer?: any;
|
|
2206
2249
|
summary?: any;
|
|
2207
2250
|
expandedRowRender?: any;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { useToken as
|
|
4
|
-
import { ApForm as
|
|
5
|
-
import { apTableRenderItemMap as
|
|
1
|
+
import { defineComponent as ne, useSlots as se, computed as s, createVNode as d, mergeProps as p, unref as r, watch as de, openBlock as c, createElementBlock as y, normalizeClass as F, normalizeStyle as T, createSlots as V, withCtx as f, Fragment as ue, renderList as z, createBlock as ie, resolveDynamicComponent as pe, renderSlot as x, createCommentVNode as D, createElementVNode as K, toDisplayString as ce, normalizeProps as fe, guardReactiveProps as me } from "vue";
|
|
2
|
+
import { Typography as ge, Table as ye, Tooltip as be } from "ant-design-vue";
|
|
3
|
+
import { useToken as Se } from "ant-design-vue/es/theme/internal";
|
|
4
|
+
import { ApForm as he } from "../ap-form/index.mjs";
|
|
5
|
+
import { apTableRenderItemMap as we, noRenderAsFormItemValueList as N, apTableFormItemMap as Ce } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { useTablePaging as
|
|
8
|
-
import { omit as
|
|
7
|
+
import { useTablePaging as Re } from "./hooks/use-table-paging.mjs";
|
|
8
|
+
import { omit as W, isUndefined as u, isBoolean as Fe } from "lodash-unified";
|
|
9
9
|
import "./style/ap-table.css";
|
|
10
|
-
import { QuestionCircleOutlined as
|
|
11
|
-
import { apColumnToColumn as
|
|
12
|
-
import
|
|
13
|
-
import { getRawDisplayValue as
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
10
|
+
import { QuestionCircleOutlined as Te } from "@ant-design/icons-vue";
|
|
11
|
+
import { apColumnToColumn as xe, getTableRenderType as ve, getTableRenderProps as Be, getColumnOrder as _, updateFormProps as Pe, getFieldProps as Ie, getPlaceholder as ke } from "./utils.mjs";
|
|
12
|
+
import Le from "./hooks/use-table-content-height.mjs";
|
|
13
|
+
import { getRawDisplayValue as Ee } from "../editable-table/utils.mjs";
|
|
14
|
+
import Oe from "./hooks/use-table-row-selection.mjs";
|
|
15
|
+
import { useLocale as Ve } from "../config-provider/hooks/use-locale.mjs";
|
|
16
|
+
import { useNamespace as ze } from "../config-provider/hooks/use-namespace.mjs";
|
|
17
|
+
import { useGlobalConfig as De } from "../config-provider/hooks/use-global-config.mjs";
|
|
18
|
+
const Ke = {
|
|
18
19
|
key: 0
|
|
19
|
-
},
|
|
20
|
+
}, aa = /* @__PURE__ */ ne({
|
|
20
21
|
name: "ApTable",
|
|
21
22
|
__name: "ap-table",
|
|
22
23
|
props: {
|
|
@@ -32,7 +33,6 @@ const Ee = {
|
|
|
32
33
|
locale: {},
|
|
33
34
|
onChange: {},
|
|
34
35
|
onResizeColumn: {},
|
|
35
|
-
rowSelection: {},
|
|
36
36
|
getPopupContainer: {},
|
|
37
37
|
scroll: {},
|
|
38
38
|
sortDirections: {
|
|
@@ -96,6 +96,9 @@ const Ee = {
|
|
|
96
96
|
},
|
|
97
97
|
transformCellText: {},
|
|
98
98
|
columns: {},
|
|
99
|
+
rowSelection: {
|
|
100
|
+
type: Boolean
|
|
101
|
+
},
|
|
99
102
|
card: {
|
|
100
103
|
type: Boolean,
|
|
101
104
|
default: !1
|
|
@@ -130,206 +133,226 @@ const Ee = {
|
|
|
130
133
|
default: !1
|
|
131
134
|
}
|
|
132
135
|
},
|
|
133
|
-
setup(
|
|
134
|
-
expose:
|
|
136
|
+
setup(j, {
|
|
137
|
+
expose: A
|
|
135
138
|
}) {
|
|
136
|
-
const
|
|
137
|
-
let
|
|
138
|
-
const B =
|
|
139
|
-
t:
|
|
140
|
-
} =
|
|
141
|
-
e:
|
|
142
|
-
b:
|
|
143
|
-
} =
|
|
144
|
-
height:
|
|
145
|
-
contentRef:
|
|
146
|
-
} =
|
|
139
|
+
const a = j;
|
|
140
|
+
let v = 0;
|
|
141
|
+
const B = se(), [, M] = Se(), {
|
|
142
|
+
t: q
|
|
143
|
+
} = Ve(), {
|
|
144
|
+
e: b,
|
|
145
|
+
b: i
|
|
146
|
+
} = ze("ap-table"), H = De("uiMode", "aplus"), {
|
|
147
|
+
height: $,
|
|
148
|
+
contentRef: G
|
|
149
|
+
} = Le(), S = s(() => {
|
|
147
150
|
var t;
|
|
148
|
-
let e = ((t =
|
|
149
|
-
return e = e.map((
|
|
150
|
-
...
|
|
151
|
+
let e = ((t = a.columns) == null ? void 0 : t.filter((o) => !o.hideInTable)) || [];
|
|
152
|
+
return e = e.map((o) => ({
|
|
153
|
+
...W(xe(o), ["ellipsis"]),
|
|
151
154
|
customRender({
|
|
152
|
-
value:
|
|
155
|
+
value: l,
|
|
153
156
|
...n
|
|
154
157
|
}) {
|
|
155
|
-
const C =
|
|
156
|
-
value:
|
|
158
|
+
const C = ve(o), O = we[C], le = Be(o, {
|
|
159
|
+
value: l,
|
|
157
160
|
...n
|
|
158
161
|
});
|
|
159
|
-
let
|
|
162
|
+
let R = oe(o, l, d(O, p(le, {
|
|
160
163
|
mode: "read"
|
|
161
164
|
}), null));
|
|
162
|
-
return
|
|
163
|
-
value:
|
|
165
|
+
return o.customRender && (R = o.customRender({
|
|
166
|
+
value: l,
|
|
164
167
|
...n,
|
|
165
|
-
column:
|
|
166
|
-
originalNode:
|
|
167
|
-
})),
|
|
168
|
+
column: o,
|
|
169
|
+
originalNode: R
|
|
170
|
+
})), R;
|
|
168
171
|
}
|
|
169
172
|
})), e;
|
|
170
173
|
}), P = s(() => {
|
|
171
|
-
var e, t,
|
|
172
|
-
return
|
|
173
|
-
let C =
|
|
174
|
-
return
|
|
175
|
-
})) == null ? void 0 :
|
|
176
|
-
const n =
|
|
174
|
+
var e, t, o;
|
|
175
|
+
return v++, ((o = (t = (e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !N.includes(l.valueType))) == null ? void 0 : t.sort((l, n) => {
|
|
176
|
+
let C = _(l.order);
|
|
177
|
+
return _(n.order) - C;
|
|
178
|
+
})) == null ? void 0 : o.map((l) => {
|
|
179
|
+
const n = Pe(l, Ie(l.fieldProps, {}));
|
|
177
180
|
return {
|
|
178
|
-
...
|
|
181
|
+
...l,
|
|
179
182
|
fieldProps: {
|
|
180
|
-
label:
|
|
181
|
-
name:
|
|
183
|
+
label: l.title,
|
|
184
|
+
name: l.dataIndex,
|
|
182
185
|
...n || {},
|
|
183
186
|
// 格式化placeholder
|
|
184
|
-
placeholder:
|
|
185
|
-
_signal:
|
|
187
|
+
placeholder: ke(q, l.valueType, n == null ? void 0 : n.placeholder),
|
|
188
|
+
_signal: v
|
|
186
189
|
}
|
|
187
190
|
};
|
|
188
191
|
})) || [];
|
|
189
|
-
}),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
}), Q = s(() => r(S).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), U = s(() => r(S).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), J = s(() => u(a.dataSource) ? g.value.records : a.dataSource), {
|
|
193
|
+
rowSelection: I,
|
|
194
|
+
selectedRows: k,
|
|
195
|
+
...h
|
|
196
|
+
} = Oe({
|
|
197
|
+
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
198
|
+
rowKey: a.rowKey,
|
|
199
|
+
dataSource: J
|
|
200
|
+
}), {
|
|
201
|
+
formRef: w,
|
|
202
|
+
submit: L,
|
|
203
|
+
reset: E,
|
|
204
|
+
tableProps: m,
|
|
205
|
+
handleTableChange: X,
|
|
206
|
+
data: g
|
|
207
|
+
} = Re({
|
|
197
208
|
async request(e) {
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
|
|
209
|
+
var o, l;
|
|
210
|
+
!I.value.preserveSelectedRowKeys && u(a.dataSource) && h.clearAll();
|
|
211
|
+
const t = await ((o = a.request) == null ? void 0 : o.call(a, e));
|
|
212
|
+
return (l = a.onLoad) == null || l.call(a, (t == null ? void 0 : t.data) || []), {
|
|
201
213
|
data: (t == null ? void 0 : t.data) || [],
|
|
202
214
|
total: (t == null ? void 0 : t.total) || 0
|
|
203
215
|
};
|
|
204
216
|
},
|
|
205
|
-
filterFields:
|
|
206
|
-
sortFields:
|
|
207
|
-
defaultParams:
|
|
208
|
-
defaultData:
|
|
209
|
-
manual:
|
|
210
|
-
defaultCurrent:
|
|
211
|
-
defaultPageSize:
|
|
212
|
-
formatParams:
|
|
213
|
-
}),
|
|
217
|
+
filterFields: r(U),
|
|
218
|
+
sortFields: r(Q),
|
|
219
|
+
defaultParams: a.params,
|
|
220
|
+
defaultData: a.defaultData,
|
|
221
|
+
manual: a.manual,
|
|
222
|
+
defaultCurrent: a.pagination ? a.pagination.defaultCurrent : void 0,
|
|
223
|
+
defaultPageSize: a.pagination ? a.pagination.defaultPageSize : void 0,
|
|
224
|
+
formatParams: a.beforeSearchSubmit
|
|
225
|
+
}), Y = s(() => {
|
|
214
226
|
var e;
|
|
215
|
-
return
|
|
216
|
-
y:
|
|
227
|
+
return a.scroll ? a.scroll : a.adaptive && (g.value.total > 0 || (e = a.dataSource) != null && e.length) ? {
|
|
228
|
+
y: r($),
|
|
217
229
|
x: "100%"
|
|
218
230
|
} : {
|
|
219
231
|
x: !0
|
|
220
232
|
};
|
|
221
|
-
}),
|
|
233
|
+
}), Z = s(() => {
|
|
222
234
|
var e;
|
|
223
|
-
if (
|
|
224
|
-
return
|
|
225
|
-
if ((e =
|
|
235
|
+
if (a.tableLayout)
|
|
236
|
+
return a.tableLayout;
|
|
237
|
+
if ((e = a.columns) != null && e.some((t) => t.ellipsis))
|
|
226
238
|
return "fixed";
|
|
227
|
-
}),
|
|
228
|
-
const e =
|
|
239
|
+
}), ee = s(() => {
|
|
240
|
+
const e = r(m), t = u(a.dataSource) ? e : {
|
|
229
241
|
...e,
|
|
230
|
-
dataSource:
|
|
231
|
-
onChange:
|
|
232
|
-
};
|
|
242
|
+
dataSource: a.dataSource,
|
|
243
|
+
onChange: a.onChange
|
|
244
|
+
}, o = r(I);
|
|
233
245
|
return {
|
|
234
|
-
...
|
|
246
|
+
...a,
|
|
235
247
|
...t,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
248
|
+
rowSelection: a.rowSelection ? {
|
|
249
|
+
...o,
|
|
250
|
+
// tips 如果是前端分页,则默认会走缓存
|
|
251
|
+
preserveSelectedRowKeys: u(a.dataSource) ? o.preserveSelectedRowKeys : !0
|
|
252
|
+
} : void 0,
|
|
253
|
+
loading: u(a.loading) ? r(m).loading : a.loading,
|
|
254
|
+
pagination: a.pagination === !1 ? !1 : r(m).pagination,
|
|
255
|
+
scroll: r(Y)
|
|
239
256
|
};
|
|
240
|
-
}),
|
|
241
|
-
function
|
|
242
|
-
return
|
|
257
|
+
}), ae = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
|
|
258
|
+
function oe(e, t, o) {
|
|
259
|
+
return N.includes(e.valueType) ? o : e.copyable || e.ellipsis ? d(ge.Paragraph, {
|
|
243
260
|
copyable: e.copyable ? {
|
|
244
261
|
text: t,
|
|
245
262
|
tooltip: !1
|
|
246
263
|
} : !1,
|
|
247
|
-
ellipsis: e.ellipsis ?
|
|
264
|
+
ellipsis: e.ellipsis ? Fe(e.ellipsis) ? {
|
|
248
265
|
tooltip: t
|
|
249
266
|
} : {
|
|
250
267
|
...e.ellipsis,
|
|
251
268
|
tooltip: t
|
|
252
269
|
} : !1,
|
|
253
|
-
content: e.ellipsis ?
|
|
254
|
-
}, null) :
|
|
270
|
+
content: e.ellipsis ? Ee(e, t) : o
|
|
271
|
+
}, null) : o;
|
|
255
272
|
}
|
|
256
|
-
|
|
273
|
+
de(() => r(g).loading, (e) => {
|
|
257
274
|
var t;
|
|
258
|
-
(t =
|
|
275
|
+
(t = a.onLoadingChange) == null || t.call(a, e);
|
|
259
276
|
});
|
|
260
|
-
function
|
|
261
|
-
var t,
|
|
262
|
-
(
|
|
277
|
+
function te(e) {
|
|
278
|
+
var t, o, l;
|
|
279
|
+
(l = (o = (t = w.value) == null ? void 0 : t.apForm) == null ? void 0 : o.setFieldsValue) == null || l.call(o, e);
|
|
263
280
|
}
|
|
264
|
-
function
|
|
265
|
-
var e, t,
|
|
266
|
-
return (
|
|
281
|
+
function re() {
|
|
282
|
+
var e, t, o;
|
|
283
|
+
return (o = (t = (e = w.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : o.call(t, !0);
|
|
267
284
|
}
|
|
268
|
-
return
|
|
269
|
-
submit: () =>
|
|
270
|
-
reset: () =>
|
|
271
|
-
setSearchFormValues:
|
|
272
|
-
getSearchFormValues:
|
|
273
|
-
dataSource: s(() =>
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
285
|
+
return A({
|
|
286
|
+
submit: () => L(),
|
|
287
|
+
reset: () => E(),
|
|
288
|
+
setSearchFormValues: te,
|
|
289
|
+
getSearchFormValues: re,
|
|
290
|
+
dataSource: s(() => r(g).records),
|
|
291
|
+
rowSelection: {
|
|
292
|
+
selectedRows: s(() => r(k)),
|
|
293
|
+
...h
|
|
294
|
+
}
|
|
295
|
+
}), (e, t) => (c(), y("div", {
|
|
296
|
+
class: F(ae.value)
|
|
297
|
+
}, [r(u)(e.dataSource) && e.searchForm !== !1 && P.value.length > 0 ? (c(), y("div", {
|
|
277
298
|
key: 0,
|
|
278
|
-
class: F(e.card ?
|
|
279
|
-
style:
|
|
280
|
-
}, [d(
|
|
299
|
+
class: F(e.card ? r(b)("search-wrapper") : null),
|
|
300
|
+
style: T(e.searchFormWrapperStyle)
|
|
301
|
+
}, [d(r(he).SearchForm, p(e.searchForm || {}, {
|
|
281
302
|
ref_key: "formRef",
|
|
282
|
-
ref:
|
|
303
|
+
ref: w,
|
|
283
304
|
"custom-reset": "",
|
|
284
|
-
onSubmit:
|
|
285
|
-
onReset:
|
|
286
|
-
"submit-loading":
|
|
287
|
-
}),
|
|
288
|
-
default:
|
|
289
|
-
key:
|
|
305
|
+
onSubmit: r(L),
|
|
306
|
+
onReset: r(E),
|
|
307
|
+
"submit-loading": r(m).loading
|
|
308
|
+
}), V({
|
|
309
|
+
default: f(() => [(c(!0), y(ue, null, z(P.value, (o) => (c(), ie(pe(o.customRenderFormItem ? o.customRenderFormItem(o) : r(Ce)[o.valueType || "text"]), p({
|
|
310
|
+
key: o.dataIndex,
|
|
290
311
|
ref_for: !0
|
|
291
|
-
},
|
|
292
|
-
span:
|
|
312
|
+
}, o.fieldProps || {}, {
|
|
313
|
+
span: o.span
|
|
293
314
|
}), null, 16, ["span"]))), 128))]),
|
|
294
315
|
_: 2
|
|
295
316
|
}, [B.searchFormExtra ? {
|
|
296
317
|
name: "extra",
|
|
297
|
-
fn:
|
|
318
|
+
fn: f(() => [x(e.$slots, "searchFormExtra")]),
|
|
298
319
|
key: "0"
|
|
299
|
-
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
320
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : D("", !0), K("div", {
|
|
300
321
|
ref_key: "contentRef",
|
|
301
|
-
ref:
|
|
302
|
-
class: F([
|
|
303
|
-
style:
|
|
304
|
-
}, [
|
|
305
|
-
|
|
306
|
-
},
|
|
307
|
-
"table-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
title:
|
|
322
|
+
ref: G,
|
|
323
|
+
class: F([r(b)("table-wrapper"), e.card ? r(b)("table-wrapper-card") : null]),
|
|
324
|
+
style: T(e.tableWrapperStyle)
|
|
325
|
+
}, [x(e.$slots, "title", p({
|
|
326
|
+
selectedRows: r(k)
|
|
327
|
+
}, h)), d(r(ye), p({
|
|
328
|
+
class: r(H) === "admin" ? r(i)("table-admin") : r(i)("table")
|
|
329
|
+
}, ee.value, {
|
|
330
|
+
"table-layout": Z.value,
|
|
331
|
+
onChange: r(X),
|
|
332
|
+
columns: S.value
|
|
333
|
+
}), V({
|
|
334
|
+
headerCell: f(({
|
|
335
|
+
column: o,
|
|
336
|
+
title: l
|
|
337
|
+
}) => [o.tooltip ? (c(), y("span", Ke, [K("span", null, ce(l), 1), d(r(be), {
|
|
338
|
+
title: o.tooltip,
|
|
316
339
|
placement: "bottom"
|
|
317
340
|
}, {
|
|
318
|
-
default:
|
|
319
|
-
style:
|
|
341
|
+
default: f(() => [d(r(Te), {
|
|
342
|
+
style: T({
|
|
320
343
|
paddingLeft: "4px",
|
|
321
|
-
color:
|
|
344
|
+
color: r(M).colorPrimary
|
|
322
345
|
})
|
|
323
346
|
}, null, 8, ["style"])]),
|
|
324
347
|
_: 2
|
|
325
|
-
}, 1032, ["title"])])) :
|
|
348
|
+
}, 1032, ["title"])])) : D("", !0)]),
|
|
326
349
|
_: 2
|
|
327
|
-
}, [
|
|
328
|
-
name:
|
|
329
|
-
fn:
|
|
350
|
+
}, [z(r(W)(B, ["title", "searchFormExtra"]), (o, l) => ({
|
|
351
|
+
name: l,
|
|
352
|
+
fn: f((n) => [x(e.$slots, l, fe(me(n || {})))])
|
|
330
353
|
}))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
|
|
331
354
|
}
|
|
332
355
|
});
|
|
333
356
|
export {
|
|
334
|
-
|
|
357
|
+
aa as default
|
|
335
358
|
};
|
|
@@ -79,4 +79,5 @@ export declare const useTablePaging: <DataType = any, ParamsType = Record<string
|
|
|
79
79
|
onChange: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<any> | SorterResult<any>[], extra: TableCurrentDataSource<any>) => void;
|
|
80
80
|
dataSource: DataType[];
|
|
81
81
|
}>;
|
|
82
|
+
dataSource: ComputedRef<DataType[]>;
|
|
82
83
|
};
|