@aplus-frontend/ui 0.6.0-beta.14 → 0.6.0-beta.16
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 +1 -1
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +9 -8
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/search-form/hooks/use-count-per-row.mjs +33 -13
- package/es/src/ap-form/search-form/index.vue.mjs +16 -15
- package/es/src/ap-grid/hooks/use-row-selection.d.ts +100 -0
- package/es/src/ap-grid/hooks/use-row-selection.mjs +122 -0
- package/es/src/ap-grid/index.vue.mjs +272 -238
- package/es/src/ap-grid/interface.d.ts +6 -0
- package/es/src/ap-grid/utils/table.mjs +6 -7
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +6 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +99 -96
- package/es/src/business/ap-label/group/ApLabelGroup.mjs +15 -16
- package/es/src/business/ap-label/interface.d.ts +2 -3
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +43 -42
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/search-form/hooks/use-count-per-row.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-grid/hooks/use-row-selection.d.ts +100 -0
- package/lib/src/ap-grid/hooks/use-row-selection.js +1 -0
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +6 -0
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +6 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/business/ap-label/group/ApLabelGroup.js +1 -1
- package/lib/src/business/ap-label/interface.d.ts +2 -3
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/antd-global-overwrite/admin/index.css +9 -194
- package/theme/antd-global-overwrite/admin/table.css +9 -194
- package/theme/antd-global-overwrite/admin/table.less +2 -126
- package/theme/antd-global-overwrite/aplus/index.css +9 -186
- package/theme/antd-global-overwrite/aplus/table.css +9 -186
- package/theme/antd-global-overwrite/aplus/table.less +2 -129
- package/theme/ap-expand-alert/ap-expand-alert.css +2 -1
- package/theme/ap-expand-alert/ap-expand-alert.less +2 -2
- package/theme/ap-table-modal/index.css +15 -13
- package/theme/ap-table-modal/index.less +15 -13
- package/theme/index.css +17 -14
|
@@ -293,6 +293,12 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
293
293
|
*/
|
|
294
294
|
rowSelection: {
|
|
295
295
|
selectedRows: ComputedRef<RecordType[]>;
|
|
296
|
+
/**
|
|
297
|
+
* 通过API调用设置行选中
|
|
298
|
+
* @param keys
|
|
299
|
+
* @returns
|
|
300
|
+
*/
|
|
301
|
+
setSelectedRowKeys: (keys: (string | number)[]) => void;
|
|
296
302
|
clearAll: () => void;
|
|
297
303
|
};
|
|
298
304
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { omit as
|
|
1
|
+
import { omit as l, isUndefined as s, isFunction as h, isNumber as m } from "lodash-unified";
|
|
2
2
|
import { isDef as w } from "../../utils/index.mjs";
|
|
3
3
|
const C = 20, b = 50, y = (e) => e.some((t) => !!t.html);
|
|
4
4
|
function v(e) {
|
|
5
5
|
var i;
|
|
6
6
|
const t = {
|
|
7
|
-
...
|
|
7
|
+
...l(e, [
|
|
8
8
|
"columns",
|
|
9
9
|
"request",
|
|
10
10
|
"searchForm",
|
|
@@ -29,7 +29,7 @@ function v(e) {
|
|
|
29
29
|
return o.shown ? o.shown(r) : !0;
|
|
30
30
|
},
|
|
31
31
|
checkRowKey: (i = o.defaultSelectedRowKeys) == null ? void 0 : i[0],
|
|
32
|
-
reserve:
|
|
32
|
+
reserve: s(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
|
|
33
33
|
} : t.checkboxConfig = {
|
|
34
34
|
highlight: !0,
|
|
35
35
|
checkMethod({ row: r }) {
|
|
@@ -38,12 +38,11 @@ function v(e) {
|
|
|
38
38
|
visibleMethod({ row: r }) {
|
|
39
39
|
return o.shown ? o.shown(r) : !0;
|
|
40
40
|
},
|
|
41
|
-
|
|
42
|
-
reserve: u(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
|
|
41
|
+
reserve: s(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
|
|
43
42
|
range: o.range || !1
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
|
-
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig =
|
|
45
|
+
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = l(e.expandable, [
|
|
47
46
|
"renderContent",
|
|
48
47
|
"width",
|
|
49
48
|
"title"
|
|
@@ -54,7 +53,7 @@ function v(e) {
|
|
|
54
53
|
}) : (a(t, "X", e.virtual), a(t, "Y", e.virtual)), t.round = w(e.round) ? e.round : !e.card, t;
|
|
55
54
|
}
|
|
56
55
|
function a(e, t, n) {
|
|
57
|
-
const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig",
|
|
56
|
+
const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig", u = n == null ? void 0 : n[o], f = u !== !1, d = i ? C : b, c = m(u) && u >= 0 ? u : d;
|
|
58
57
|
e[r] = {
|
|
59
58
|
enabled: f,
|
|
60
59
|
gt: c,
|
|
@@ -58,6 +58,11 @@ export type UseTablePagingParams<DataType, ParamsType> = {
|
|
|
58
58
|
* @returns
|
|
59
59
|
*/
|
|
60
60
|
onClickReset?: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* 当请求结束后触发的事件
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
onAfterRequest?: () => void;
|
|
61
66
|
};
|
|
62
67
|
type InternalDataType<DataType = Recordable> = {
|
|
63
68
|
total: number;
|
|
@@ -67,7 +72,7 @@ type InternalDataType<DataType = Recordable> = {
|
|
|
67
72
|
export declare const DEFAULT_CURRENT = 1;
|
|
68
73
|
export declare const DEFAULT_PAGE_SIZE = 20;
|
|
69
74
|
export type OptionalOnTableChange<T extends (...args: any[]) => any> = (...args: Partial<Parameters<T>>) => ReturnType<T>;
|
|
70
|
-
export declare const useTablePaging: <DataType = any, ParamsType = Record<string, any>>({ manual, request, defaultParams, defaultData, formatParams, paramsValueTypeMap, resetFieldsIgnores, filterFields, sortFields, namespace, pagination, onClickReset }: UseTablePagingParams<DataType, ParamsType>) => {
|
|
75
|
+
export declare const useTablePaging: <DataType = any, ParamsType = Record<string, any>>({ manual, request, defaultParams, defaultData, formatParams, paramsValueTypeMap, resetFieldsIgnores, filterFields, sortFields, namespace, pagination, onClickReset, onAfterRequest }: UseTablePagingParams<DataType, ParamsType>) => {
|
|
71
76
|
formRef: Ref<ApFormSearchFormExpose | undefined, ApFormSearchFormExpose | undefined>;
|
|
72
77
|
submit: () => void;
|
|
73
78
|
reset: () => void;
|
|
@@ -1,98 +1,101 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useTableSortedAndFiltered as
|
|
1
|
+
import { ref as ce, reactive as M, unref as m, nextTick as ue, onMounted as le, watch as fe, computed as O, createVNode as C } from "vue";
|
|
2
|
+
import { useTableSortedAndFiltered as ge } from "./use-sorted-filtered.mjs";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
|
-
import { parseFieldValue as
|
|
5
|
-
import { isArray as
|
|
6
|
-
import { isDef as
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
const S = 1,
|
|
4
|
+
import { parseFieldValue as de, dataIndexToStr as pe, isEqualCustom as me } from "../utils.mjs";
|
|
5
|
+
import { isArray as Q, isEqualWith as Se, isUndefined as he } from "lodash-unified";
|
|
6
|
+
import { isDef as $ } from "../../utils/index.mjs";
|
|
7
|
+
import { useLocale as ze } from "../../config-provider/hooks/use-locale.mjs";
|
|
8
|
+
import { useNamespace as Te } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const S = 1, y = 20, G = {
|
|
10
10
|
defaultCurrent: S,
|
|
11
|
-
defaultPageSize:
|
|
11
|
+
defaultPageSize: y,
|
|
12
12
|
showLessItems: !1,
|
|
13
13
|
showTotal: !0
|
|
14
14
|
};
|
|
15
|
-
function
|
|
16
|
-
return i === !1 ? {} : i == null || i === !0 ?
|
|
17
|
-
...
|
|
15
|
+
function Pe(i) {
|
|
16
|
+
return i === !1 ? {} : i == null || i === !0 ? G : {
|
|
17
|
+
...G,
|
|
18
18
|
...i
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function we(i) {
|
|
22
22
|
const f = {};
|
|
23
|
-
return i === !1 || (i === !0 || i == null ? (f.current = S, f.pageSize =
|
|
23
|
+
return i === !1 || (i === !0 || i == null ? (f.current = S, f.pageSize = y) : (f.current = i.defaultCurrent || S, f.pageSize = i.defaultPageSize || y)), f;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const Oe = ({
|
|
26
26
|
manual: i = !1,
|
|
27
27
|
request: f,
|
|
28
|
-
defaultParams:
|
|
29
|
-
defaultData:
|
|
30
|
-
formatParams:
|
|
31
|
-
paramsValueTypeMap:
|
|
32
|
-
resetFieldsIgnores:
|
|
33
|
-
filterFields:
|
|
34
|
-
sortFields:
|
|
35
|
-
namespace:
|
|
28
|
+
defaultParams: I = {},
|
|
29
|
+
defaultData: V = [],
|
|
30
|
+
formatParams: U,
|
|
31
|
+
paramsValueTypeMap: _,
|
|
32
|
+
resetFieldsIgnores: j,
|
|
33
|
+
filterFields: W,
|
|
34
|
+
sortFields: Z,
|
|
35
|
+
namespace: H = "ap-table",
|
|
36
36
|
pagination: h,
|
|
37
|
-
onClickReset: b
|
|
37
|
+
onClickReset: b,
|
|
38
|
+
onAfterRequest: E
|
|
38
39
|
}) => {
|
|
39
|
-
let
|
|
40
|
-
const
|
|
41
|
-
getColumnSFConfig:
|
|
42
|
-
setSF:
|
|
43
|
-
clearAll:
|
|
44
|
-
sortedInfo:
|
|
45
|
-
filteredInfo:
|
|
46
|
-
} =
|
|
40
|
+
let v = 0, c = {};
|
|
41
|
+
const X = Pe(h), Y = (e) => U ? U(e) : e, z = ce(), s = M(we(h)), {
|
|
42
|
+
getColumnSFConfig: q,
|
|
43
|
+
setSF: R,
|
|
44
|
+
clearAll: k,
|
|
45
|
+
sortedInfo: A,
|
|
46
|
+
filteredInfo: N
|
|
47
|
+
} = ge(), {
|
|
47
48
|
t: T
|
|
48
|
-
} =
|
|
49
|
+
} = ze(), {
|
|
49
50
|
b: P
|
|
50
|
-
} =
|
|
51
|
-
total:
|
|
52
|
-
records:
|
|
51
|
+
} = Te(H), o = M({
|
|
52
|
+
total: V.length,
|
|
53
|
+
records: V,
|
|
53
54
|
loading: !1
|
|
54
55
|
}), w = () => {
|
|
55
56
|
var e, t;
|
|
56
57
|
return ((t = (e = z.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
|
|
57
|
-
},
|
|
58
|
+
}, B = async (e) => {
|
|
58
59
|
var n;
|
|
59
|
-
const t =
|
|
60
|
-
|
|
60
|
+
const t = Y(e), r = Date.now();
|
|
61
|
+
v = r, o.loading = !0;
|
|
61
62
|
try {
|
|
62
63
|
const a = await f({
|
|
63
|
-
...m(
|
|
64
|
+
...m(I),
|
|
64
65
|
...t
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
+
v === r && (o.total = a.total || ((n = a.data) == null ? void 0 : n.length) || 0, o.records = [...a.data || []], o.loading = !1);
|
|
67
68
|
} catch {
|
|
68
|
-
|
|
69
|
+
v === r && (o.records = [], o.total = 0, o.loading = !1);
|
|
70
|
+
} finally {
|
|
71
|
+
E == null || E();
|
|
69
72
|
}
|
|
70
|
-
},
|
|
73
|
+
}, J = (e) => {
|
|
71
74
|
const t = {};
|
|
72
75
|
return Object.entries(e).forEach(([r, n]) => {
|
|
73
|
-
if (t[r] = n,
|
|
74
|
-
const a =
|
|
75
|
-
a && (t[r] =
|
|
76
|
+
if (t[r] = n, _ && n) {
|
|
77
|
+
const a = _[r];
|
|
78
|
+
a && (t[r] = de(a, n));
|
|
76
79
|
}
|
|
77
80
|
}), t;
|
|
78
|
-
},
|
|
81
|
+
}, ee = async (e) => {
|
|
79
82
|
var n, a, l, g, d;
|
|
80
83
|
const t = w(), r = {};
|
|
81
84
|
Object.entries(t).forEach(([p, F]) => {
|
|
82
|
-
|
|
83
|
-
}), await ((a = (n = z.value) == null ? void 0 : n.apForm) == null ? void 0 : a.resetFields()), (d = (g = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : g.setFieldsValue) == null || d.call(g, r),
|
|
85
|
+
j && j.indexOf(p) > -1 && (r[p] = F);
|
|
86
|
+
}), await ((a = (n = z.value) == null ? void 0 : n.apForm) == null ? void 0 : a.resetFields()), (d = (g = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : g.setFieldsValue) == null || d.call(g, r), ue(() => {
|
|
84
87
|
e == null || e();
|
|
85
88
|
});
|
|
86
89
|
}, x = (e) => {
|
|
87
90
|
c = e;
|
|
88
|
-
const t =
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
+
const t = J(e);
|
|
92
|
+
B(t);
|
|
93
|
+
}, te = (e) => {
|
|
91
94
|
x({
|
|
92
95
|
...c,
|
|
93
96
|
...e
|
|
94
97
|
});
|
|
95
|
-
},
|
|
98
|
+
}, D = () => {
|
|
96
99
|
const e = w(), t = h !== !1;
|
|
97
100
|
t && (s.current = S), x({
|
|
98
101
|
...e,
|
|
@@ -101,32 +104,32 @@ const Ae = ({
|
|
|
101
104
|
current: t ? S : void 0,
|
|
102
105
|
pageSize: t ? c.pageSize || s.pageSize : void 0
|
|
103
106
|
});
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
+
}, re = () => {
|
|
108
|
+
k(), c.sort = {}, c.filter = {}, b == null || b(), ee(D);
|
|
109
|
+
}, K = () => {
|
|
107
110
|
x(c);
|
|
108
|
-
},
|
|
111
|
+
}, ne = (e) => {
|
|
109
112
|
if (h === !1)
|
|
110
|
-
|
|
113
|
+
K();
|
|
111
114
|
else {
|
|
112
115
|
const {
|
|
113
116
|
current: t,
|
|
114
117
|
pageSize: r
|
|
115
118
|
} = s, n = o.total - e, a = Math.ceil(n / r), l = t > a ? a : t;
|
|
116
|
-
|
|
119
|
+
te({
|
|
117
120
|
current: l > 0 ? l : 1
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
|
-
},
|
|
123
|
+
}, L = (e, t, r) => {
|
|
121
124
|
var p, F;
|
|
122
125
|
const n = w();
|
|
123
|
-
s.current = e.current, s.pageSize = e.pageSize,
|
|
124
|
-
const a =
|
|
126
|
+
s.current = e.current, s.pageSize = e.pageSize, R(t, r);
|
|
127
|
+
const a = Q(r) ? [...r] : [r], l = {};
|
|
125
128
|
for (const u of a)
|
|
126
|
-
(p = m(
|
|
129
|
+
(p = m(Z)) != null && p.includes(u.columnKey || u.field) && u.order && (l[pe(u.columnKey || u.field)] = u.order);
|
|
127
130
|
const g = {};
|
|
128
131
|
for (const u of Object.keys(t))
|
|
129
|
-
(F = m(
|
|
132
|
+
(F = m(W)) != null && F.includes(u) && t[u] && (g[u] = t[u]);
|
|
130
133
|
const d = {
|
|
131
134
|
...n,
|
|
132
135
|
filter: g,
|
|
@@ -134,10 +137,10 @@ const Ae = ({
|
|
|
134
137
|
current: e.current,
|
|
135
138
|
pageSize: e.pageSize
|
|
136
139
|
};
|
|
137
|
-
|
|
138
|
-
},
|
|
140
|
+
Se(c, d, me) || x(d);
|
|
141
|
+
}, ae = (e, t = N.value || {}, r = A.value || {}) => {
|
|
139
142
|
const n = (e == null ? void 0 : e.current) ?? s.current, a = (e == null ? void 0 : e.pageSize) ?? s.pageSize;
|
|
140
|
-
|
|
143
|
+
L(
|
|
141
144
|
{
|
|
142
145
|
current: n,
|
|
143
146
|
pageSize: a
|
|
@@ -151,7 +154,7 @@ const Ae = ({
|
|
|
151
154
|
}
|
|
152
155
|
);
|
|
153
156
|
};
|
|
154
|
-
|
|
157
|
+
le(() => {
|
|
155
158
|
const e = w(), {
|
|
156
159
|
current: t,
|
|
157
160
|
pageSize: r
|
|
@@ -163,15 +166,15 @@ const Ae = ({
|
|
|
163
166
|
sort: {},
|
|
164
167
|
...e
|
|
165
168
|
}, !i) {
|
|
166
|
-
const n =
|
|
167
|
-
|
|
169
|
+
const n = J(c);
|
|
170
|
+
B(n);
|
|
168
171
|
}
|
|
169
|
-
}),
|
|
170
|
-
|
|
172
|
+
}), fe(() => m(I), () => {
|
|
173
|
+
D();
|
|
171
174
|
}, {
|
|
172
175
|
deep: !0
|
|
173
176
|
});
|
|
174
|
-
const
|
|
177
|
+
const oe = O(() => {
|
|
175
178
|
if (o.total === 0)
|
|
176
179
|
return "-";
|
|
177
180
|
const {
|
|
@@ -180,28 +183,28 @@ const Ae = ({
|
|
|
180
183
|
} = s;
|
|
181
184
|
return `${e}/${Math.ceil(o.total / t)}`;
|
|
182
185
|
});
|
|
183
|
-
function
|
|
184
|
-
|
|
186
|
+
function se(e) {
|
|
187
|
+
Q(e) && (o.records = e, o.total = e.length);
|
|
185
188
|
}
|
|
186
|
-
const
|
|
189
|
+
const ie = O(() => {
|
|
187
190
|
const {
|
|
188
191
|
showLessItems: e,
|
|
189
192
|
showTotal: t,
|
|
190
193
|
showQuickJumper: r,
|
|
191
194
|
showSizeChanger: n,
|
|
192
195
|
pageSizeOptions: a
|
|
193
|
-
} =
|
|
196
|
+
} = X;
|
|
194
197
|
return {
|
|
195
198
|
loading: o.loading,
|
|
196
199
|
pagination: {
|
|
197
200
|
current: s.current,
|
|
198
201
|
pageSize: s.pageSize,
|
|
199
202
|
total: o.total,
|
|
200
|
-
showSizeChanger:
|
|
201
|
-
showQuickJumper:
|
|
203
|
+
showSizeChanger: $(n) ? n : !e,
|
|
204
|
+
showQuickJumper: $(r) ? r : !e,
|
|
202
205
|
showLessItems: e,
|
|
203
206
|
size: "default",
|
|
204
|
-
pageSizeOptions:
|
|
207
|
+
pageSizeOptions: he(a) ? ["10", "20", "50", "100"] : a,
|
|
205
208
|
showTotal: t ? (l) => C("span", {
|
|
206
209
|
class: P("pagination-total-wrapper")
|
|
207
210
|
}, [T("ap.apTable.pagination.totalLeftPrefix"), " ", C("span", {
|
|
@@ -210,33 +213,33 @@ const Ae = ({
|
|
|
210
213
|
class: P("pagination--total-right")
|
|
211
214
|
}, [T("ap.apTable.pagination.totalRightPrefix"), " ", C("span", {
|
|
212
215
|
class: P("pagination-count-text")
|
|
213
|
-
}, [m(
|
|
216
|
+
}, [m(oe)]), " ", T("ap.apTable.pagination.totalRightSuffix")])]) : void 0
|
|
214
217
|
},
|
|
215
|
-
onChange:
|
|
218
|
+
onChange: L,
|
|
216
219
|
dataSource: o.records
|
|
217
220
|
};
|
|
218
221
|
});
|
|
219
222
|
return {
|
|
220
223
|
formRef: z,
|
|
221
|
-
submit:
|
|
222
|
-
reset:
|
|
223
|
-
refresh:
|
|
224
|
-
refreshByDelete:
|
|
224
|
+
submit: D,
|
|
225
|
+
reset: re,
|
|
226
|
+
refresh: K,
|
|
227
|
+
refreshByDelete: ne,
|
|
225
228
|
data: o,
|
|
226
229
|
current: s.current,
|
|
227
230
|
pageSize: s.pageSize,
|
|
228
|
-
handleTableChange:
|
|
229
|
-
handleTableChangeOptional:
|
|
230
|
-
tableProps:
|
|
231
|
-
dataSource:
|
|
232
|
-
setDataSource:
|
|
233
|
-
getColumnSFConfig:
|
|
234
|
-
sortedInfo:
|
|
235
|
-
filteredInfo:
|
|
231
|
+
handleTableChange: L,
|
|
232
|
+
handleTableChangeOptional: ae,
|
|
233
|
+
tableProps: ie,
|
|
234
|
+
dataSource: O(() => o.records),
|
|
235
|
+
setDataSource: se,
|
|
236
|
+
getColumnSFConfig: q,
|
|
237
|
+
sortedInfo: A,
|
|
238
|
+
filteredInfo: N
|
|
236
239
|
};
|
|
237
240
|
};
|
|
238
241
|
export {
|
|
239
242
|
S as DEFAULT_CURRENT,
|
|
240
|
-
|
|
241
|
-
|
|
243
|
+
y as DEFAULT_PAGE_SIZE,
|
|
244
|
+
Oe as useTablePaging
|
|
242
245
|
};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { defineComponent as n, createVNode as o, mergeProps as
|
|
1
|
+
import { defineComponent as n, createVNode as o, mergeProps as a, createTextVNode as l } from "vue";
|
|
2
2
|
import "../../../config-provider/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import { omit as
|
|
5
|
-
import { ApLabelGroupProps as
|
|
6
|
-
import
|
|
7
|
-
import { useNamespace as
|
|
3
|
+
import m from "../ApLabel.mjs";
|
|
4
|
+
import { omit as s } from "lodash-unified";
|
|
5
|
+
import { ApLabelGroupProps as c } from "../constans.mjs";
|
|
6
|
+
import "../../../ap-tag/index.mjs";
|
|
7
|
+
import { useNamespace as f } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
import i from "../../../ap-tag/ap-tag.vue.mjs";
|
|
8
9
|
const {
|
|
9
10
|
b: p
|
|
10
|
-
} =
|
|
11
|
+
} = f("ap-label-group"), _ = /* @__PURE__ */ n({
|
|
11
12
|
name: "ApLabelGroup",
|
|
12
|
-
props:
|
|
13
|
+
props: c(),
|
|
13
14
|
setup(r) {
|
|
14
|
-
const
|
|
15
|
-
default: () => [u.text]
|
|
16
|
-
})) : e.customRender ? () => o("div", null, [e.customRender(r.record)]) : null;
|
|
15
|
+
const t = (e) => (r.tagValue || r.tagValue === 0) && e.tagConfig && e.tagConfig.length > 0 ? () => e.tagConfig.filter((u) => r.tagValue === u.value).map((u) => o(i, u, null)) : e.customRender ? () => o("div", null, [e.customRender(r.record)]) : null;
|
|
17
16
|
return () => o("div", {
|
|
18
17
|
class: p()
|
|
19
|
-
}, [r.columns ? r.columns.map((e, u) => o(
|
|
18
|
+
}, [r.columns ? r.columns.map((e, u) => o(m, a({
|
|
20
19
|
key: u,
|
|
21
20
|
show: r.value === e.value
|
|
22
|
-
},
|
|
23
|
-
custom:
|
|
24
|
-
})) : o("div", null, [
|
|
21
|
+
}, s(e, ["value", "tagConfig", "customRender"])), {
|
|
22
|
+
custom: t(e)
|
|
23
|
+
})) : o("div", null, [l("columns数组不能为空")])]);
|
|
25
24
|
}
|
|
26
25
|
});
|
|
27
26
|
export {
|
|
28
|
-
|
|
27
|
+
_ as default
|
|
29
28
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BadgeProps } from '@aplus-frontend/antdv';
|
|
2
2
|
import { TooltipPlacement } from '@aplus-frontend/antdv/es/tooltip/Tooltip';
|
|
3
|
-
import {
|
|
3
|
+
import { ApTagProps } from '../../ap-tag';
|
|
4
4
|
import { VNode, VNodeChild } from 'vue';
|
|
5
5
|
type Recordable = Record<string, any>;
|
|
6
6
|
export type ApLabelProps = BadgeProps & Partial<{
|
|
@@ -12,9 +12,8 @@ export type ApLabelProps = BadgeProps & Partial<{
|
|
|
12
12
|
show: boolean;
|
|
13
13
|
toolTipBgColor: string;
|
|
14
14
|
}>;
|
|
15
|
-
export type tagConfigKey =
|
|
15
|
+
export type tagConfigKey = ApTagProps & {
|
|
16
16
|
value: number | string | undefined | null;
|
|
17
|
-
text: string;
|
|
18
17
|
};
|
|
19
18
|
export type ApLabelGroupItemProps<T extends Recordable = Recordable> = ApLabelProps & {
|
|
20
19
|
value?: string | number | null | undefined;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { message as
|
|
1
|
+
import { defineComponent as H, ref as m, unref as s, computed as U, h as q, createBlock as k, openBlock as T, mergeProps as y, withCtx as h, createCommentVNode as V, createVNode as S, resolveDynamicComponent as $ } from "vue";
|
|
2
|
+
import { message as R, Modal as z } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
|
-
import { ApTable as
|
|
5
|
-
import { cloneDeep as J, omit as
|
|
4
|
+
import { ApTable as W } from "../../ap-table/index.mjs";
|
|
5
|
+
import { cloneDeep as J, omit as B } from "lodash-unified";
|
|
6
6
|
import { transformTableParams as Q } from "@aplus-frontend/utils";
|
|
7
7
|
import "./modal-title.vue.mjs";
|
|
8
8
|
import { AsyncOpenResultError as b } from "./interface.mjs";
|
|
9
9
|
import "./table-layout/index.vue.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
const pe = /* @__PURE__ */ U({
|
|
10
|
+
import { useLocale as X } from "../../config-provider/hooks/use-locale.mjs";
|
|
11
|
+
import Y from "./modal-title.vue2.mjs";
|
|
12
|
+
import Z from "./table-layout/index.vue2.mjs";
|
|
13
|
+
const ce = /* @__PURE__ */ H({
|
|
15
14
|
__name: "table-modal",
|
|
16
15
|
props: {
|
|
17
16
|
columns: {},
|
|
@@ -62,10 +61,10 @@ const pe = /* @__PURE__ */ U({
|
|
|
62
61
|
mousePosition: {}
|
|
63
62
|
},
|
|
64
63
|
emits: ["finish"],
|
|
65
|
-
setup(
|
|
66
|
-
const e =
|
|
64
|
+
setup(P, { expose: M, emit: K }) {
|
|
65
|
+
const e = P, _ = K, i = m(!1), x = m({}), d = m(null), a = m([]), C = m();
|
|
67
66
|
let c = null, n = null;
|
|
68
|
-
const
|
|
67
|
+
const { t: g } = X(), I = async (o = [], t = {}) => {
|
|
69
68
|
var l, r, u;
|
|
70
69
|
switch (a.value = [...o], i.value = !0, x.value = t == null ? void 0 : t.extraParams, C.value = t.apTableDataSources || ((l = e.apTableProps) == null ? void 0 : l.dataSource), t.refreshMode || "reset") {
|
|
71
70
|
case "reset":
|
|
@@ -82,7 +81,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
82
81
|
});
|
|
83
82
|
}, w = () => {
|
|
84
83
|
i.value = !1, c = null, n == null || n(b.ModalCancel), n = null;
|
|
85
|
-
},
|
|
84
|
+
}, D = async (o) => {
|
|
86
85
|
o = Q({
|
|
87
86
|
...o,
|
|
88
87
|
...x.value
|
|
@@ -92,7 +91,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
92
91
|
data: l,
|
|
93
92
|
total: r
|
|
94
93
|
};
|
|
95
|
-
},
|
|
94
|
+
}, L = () => {
|
|
96
95
|
if (a.value.length > e.maxCount) {
|
|
97
96
|
n == null || n(b.ExceedMaxCount);
|
|
98
97
|
return;
|
|
@@ -105,7 +104,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
105
104
|
return;
|
|
106
105
|
}
|
|
107
106
|
i.value = !1;
|
|
108
|
-
},
|
|
107
|
+
}, N = U(() => {
|
|
109
108
|
if (!e.getRowKey) return;
|
|
110
109
|
const o = e.getRowKey;
|
|
111
110
|
return {
|
|
@@ -116,7 +115,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
116
115
|
onSelectAll(t, l) {
|
|
117
116
|
var u, p;
|
|
118
117
|
if (l.length > e.maxCount) {
|
|
119
|
-
|
|
118
|
+
R.warning(
|
|
120
119
|
g("ap.apTableModal.messageMaxCount", {
|
|
121
120
|
maxCount: e.maxCount
|
|
122
121
|
})
|
|
@@ -125,7 +124,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
125
124
|
}
|
|
126
125
|
const r = (u = d.value) == null ? void 0 : u.dataSource;
|
|
127
126
|
if (t) {
|
|
128
|
-
const f = s(r).filter((v) => !a.value.some((
|
|
127
|
+
const f = s(r).filter((v) => !a.value.some((G) => o(G) === o(v)));
|
|
129
128
|
a.value = a.value.concat(f);
|
|
130
129
|
} else
|
|
131
130
|
a.value = (p = a.value) == null ? void 0 : p.filter((f) => !r.some((v) => o(v) === o(f)));
|
|
@@ -133,7 +132,7 @@ const pe = /* @__PURE__ */ U({
|
|
|
133
132
|
onSelect(t, l) {
|
|
134
133
|
if (l) {
|
|
135
134
|
if (a.value.length >= e.maxCount) {
|
|
136
|
-
|
|
135
|
+
R.warning(
|
|
137
136
|
g("ap.apTableModal.messageMaxCount", {
|
|
138
137
|
maxCount: e.maxCount
|
|
139
138
|
})
|
|
@@ -154,8 +153,8 @@ const pe = /* @__PURE__ */ U({
|
|
|
154
153
|
}),
|
|
155
154
|
...e.rowSelection || {}
|
|
156
155
|
};
|
|
157
|
-
}),
|
|
158
|
-
|
|
156
|
+
}), A = () => e.isRenderModalTitleSuffix ? q(
|
|
157
|
+
Y,
|
|
159
158
|
{
|
|
160
159
|
title: e.title,
|
|
161
160
|
count: a.value.length || 0,
|
|
@@ -164,9 +163,9 @@ const pe = /* @__PURE__ */ U({
|
|
|
164
163
|
{
|
|
165
164
|
default: e.renderModalTitleSuffix ?? void 0
|
|
166
165
|
}
|
|
167
|
-
) : e.title,
|
|
166
|
+
) : e.title, O = () => d.value, E = () => {
|
|
168
167
|
a.value = [];
|
|
169
|
-
},
|
|
168
|
+
}, F = (o) => {
|
|
170
169
|
const t = e.getRowKey;
|
|
171
170
|
if (!t) return;
|
|
172
171
|
const l = a.value.findIndex(
|
|
@@ -174,16 +173,16 @@ const pe = /* @__PURE__ */ U({
|
|
|
174
173
|
);
|
|
175
174
|
a.value.splice(l, 1);
|
|
176
175
|
};
|
|
177
|
-
return
|
|
178
|
-
open:
|
|
176
|
+
return M({
|
|
177
|
+
open: I,
|
|
179
178
|
close: w,
|
|
180
|
-
getApTableInstance:
|
|
181
|
-
}), (o, t) => (T(), k(s(
|
|
179
|
+
getApTableInstance: O
|
|
180
|
+
}), (o, t) => (T(), k(s(z), y(
|
|
182
181
|
{
|
|
183
182
|
open: i.value,
|
|
184
183
|
"onUpdate:open": t[0] || (t[0] = (l) => i.value = l)
|
|
185
184
|
},
|
|
186
|
-
s(
|
|
185
|
+
s(B)(e, [
|
|
187
186
|
"api",
|
|
188
187
|
"getRowKey",
|
|
189
188
|
"centered",
|
|
@@ -198,33 +197,35 @@ const pe = /* @__PURE__ */ U({
|
|
|
198
197
|
"tableLayoutConfig"
|
|
199
198
|
]),
|
|
200
199
|
{
|
|
201
|
-
title:
|
|
202
|
-
"body-style": { maxHeight: "calc(100vh - 205px)", overflowY: "scroll" },
|
|
200
|
+
title: A(),
|
|
203
201
|
centered: e.centered ?? !0,
|
|
204
|
-
onOk:
|
|
202
|
+
onOk: L,
|
|
205
203
|
onCancel: w
|
|
206
204
|
}
|
|
207
205
|
), {
|
|
208
206
|
default: h(() => [
|
|
209
|
-
e.renderHeader ? (T(), k(
|
|
210
|
-
S(
|
|
207
|
+
e.renderHeader ? (T(), k($(e.renderHeader), { key: 0 })) : V("", !0),
|
|
208
|
+
S(Z, y(e.tableLayoutConfig || {}, {
|
|
211
209
|
"selected-list": a.value,
|
|
212
|
-
onClear:
|
|
213
|
-
onDeleteItem:
|
|
210
|
+
onClear: E,
|
|
211
|
+
onDeleteItem: F
|
|
214
212
|
}), {
|
|
215
213
|
default: h(() => [
|
|
216
|
-
S(s(
|
|
214
|
+
S(s(W), y({
|
|
217
215
|
ref_key: "apTableRef",
|
|
218
216
|
ref: d,
|
|
219
|
-
scroll: { y:
|
|
217
|
+
scroll: { y: 450 },
|
|
220
218
|
style: { padding: "0px" },
|
|
221
219
|
columns: o.columns,
|
|
222
|
-
request:
|
|
220
|
+
request: D,
|
|
223
221
|
"row-key": o.getRowKey,
|
|
224
|
-
"row-selection":
|
|
225
|
-
|
|
226
|
-
"
|
|
227
|
-
|
|
222
|
+
"row-selection": N.value,
|
|
223
|
+
"data-source": C.value,
|
|
224
|
+
"search-form": {
|
|
225
|
+
sortable: !1,
|
|
226
|
+
countPerRow: 2
|
|
227
|
+
}
|
|
228
|
+
}, s(B)(e.apTableProps, "dataSource")), null, 16, ["columns", "row-key", "row-selection", "data-source"])
|
|
228
229
|
]),
|
|
229
230
|
_: 1
|
|
230
231
|
}, 16, ["selected-list"])
|
|
@@ -234,5 +235,5 @@ const pe = /* @__PURE__ */ U({
|
|
|
234
235
|
}
|
|
235
236
|
});
|
|
236
237
|
export {
|
|
237
|
-
|
|
238
|
+
ce as default
|
|
238
239
|
};
|