@aplus-frontend/ui 0.6.0-beta.13 → 0.6.0-beta.15
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/form-item.vue.mjs +38 -35
- package/es/src/ap-grid/editable/index.vue.mjs +13 -10
- 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 +271 -222
- package/es/src/ap-grid/interface.d.ts +16 -0
- package/es/src/ap-grid/utils/table.mjs +15 -15
- 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-copy/ApCopy.mjs +43 -43
- 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-product-info/ApProductInfo.mjs +23 -24
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +43 -42
- package/es/src/business/ap-view/ap-view.vue.d.ts +4 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +96 -84
- package/es/src/business/ap-view/index.d.ts +12 -3
- package/es/src/business/ap-view/interface.d.ts +7 -0
- package/es/src/business/hooks/usePageListApGrid.mjs +17 -20
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +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/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 +16 -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-copy/ApCopy.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-product-info/ApProductInfo.js +1 -1
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/business/ap-view/ap-view.vue.d.ts +4 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/index.d.ts +12 -3
- package/lib/src/business/ap-view/interface.d.ts +7 -0
- package/lib/src/business/hooks/usePageListApGrid.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +4 -3
- package/theme/ap-copy/ap-copy.css +2 -0
- package/theme/ap-copy/ap-copy.less +2 -0
- package/theme/ap-table-modal/index.css +15 -13
- package/theme/ap-table-modal/index.less +15 -13
- package/theme/index.css +17 -13
|
@@ -239,6 +239,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
239
239
|
* 作为表单项时内部传递,请勿使用
|
|
240
240
|
*/
|
|
241
241
|
value?: any;
|
|
242
|
+
/**
|
|
243
|
+
* 行是否可以被高亮(传入函数可以获取当前被选中的行)
|
|
244
|
+
*/
|
|
245
|
+
rowHighlightable?: boolean | ((current: RecordType) => void);
|
|
242
246
|
};
|
|
243
247
|
export type ApGridVirtualConfig = {
|
|
244
248
|
x?: false | number;
|
|
@@ -289,6 +293,12 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
289
293
|
*/
|
|
290
294
|
rowSelection: {
|
|
291
295
|
selectedRows: ComputedRef<RecordType[]>;
|
|
296
|
+
/**
|
|
297
|
+
* 通过API调用设置行选中
|
|
298
|
+
* @param keys
|
|
299
|
+
* @returns
|
|
300
|
+
*/
|
|
301
|
+
setSelectedRowKeys: (keys: (string | number)[]) => void;
|
|
292
302
|
clearAll: () => void;
|
|
293
303
|
};
|
|
294
304
|
/**
|
|
@@ -303,4 +313,10 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
303
313
|
* @returns
|
|
304
314
|
*/
|
|
305
315
|
getDataSource: () => RecordType[];
|
|
316
|
+
/**
|
|
317
|
+
* 设置某一行被选中
|
|
318
|
+
* @param nextRow
|
|
319
|
+
* @returns
|
|
320
|
+
*/
|
|
321
|
+
setCurrentRow: (nextRow: Partial<RecordType>) => void;
|
|
306
322
|
};
|
|
@@ -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
|
-
const
|
|
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",
|
|
@@ -16,8 +16,9 @@ function v(e) {
|
|
|
16
16
|
};
|
|
17
17
|
if (t.rowConfig = {
|
|
18
18
|
isHover: !0,
|
|
19
|
-
keyField: e.rowKey
|
|
20
|
-
|
|
19
|
+
keyField: e.rowKey,
|
|
20
|
+
isCurrent: !!e.rowHighlightable
|
|
21
|
+
}, t.columnConfig = {}, y(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
|
|
21
22
|
const o = e.rowSelection === !0 ? {} : e.rowSelection;
|
|
22
23
|
o.type === "radio" ? t.radioConfig = {
|
|
23
24
|
highlight: !0,
|
|
@@ -28,7 +29,7 @@ function v(e) {
|
|
|
28
29
|
return o.shown ? o.shown(r) : !0;
|
|
29
30
|
},
|
|
30
31
|
checkRowKey: (i = o.defaultSelectedRowKeys) == null ? void 0 : i[0],
|
|
31
|
-
reserve:
|
|
32
|
+
reserve: s(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
|
|
32
33
|
} : t.checkboxConfig = {
|
|
33
34
|
highlight: !0,
|
|
34
35
|
checkMethod({ row: r }) {
|
|
@@ -37,12 +38,11 @@ function v(e) {
|
|
|
37
38
|
visibleMethod({ row: r }) {
|
|
38
39
|
return o.shown ? o.shown(r) : !0;
|
|
39
40
|
},
|
|
40
|
-
|
|
41
|
-
reserve: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
|
|
41
|
+
reserve: s(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
|
|
42
42
|
range: o.range || !1
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
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, [
|
|
46
46
|
"renderContent",
|
|
47
47
|
"width",
|
|
48
48
|
"title"
|
|
@@ -50,22 +50,22 @@ function v(e) {
|
|
|
50
50
|
enabled: !1
|
|
51
51
|
}, t.virtualYConfig = {
|
|
52
52
|
enabled: !1
|
|
53
|
-
}) : (
|
|
53
|
+
}) : (a(t, "X", e.virtual), a(t, "Y", e.virtual)), t.round = w(e.round) ? e.round : !e.card, t;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig",
|
|
55
|
+
function a(e, t, n) {
|
|
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;
|
|
57
57
|
e[r] = {
|
|
58
|
-
enabled:
|
|
58
|
+
enabled: f,
|
|
59
59
|
gt: c,
|
|
60
60
|
oSize: (n == null ? void 0 : n.oSize) || 0
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function g(e) {
|
|
64
64
|
return e === !0 ? "left" : e;
|
|
65
65
|
}
|
|
66
66
|
function K(e, t) {
|
|
67
67
|
const n = e === !0 || !e.type ? "checkbox" : e.type, i = e === !0 ? 60 : e.columnWidth || 60;
|
|
68
|
-
let o = e === !0 ? void 0 :
|
|
68
|
+
let o = e === !0 ? void 0 : g(e.fixed);
|
|
69
69
|
return o || (o === !1 ? o = void 0 : o = t.some(
|
|
70
70
|
(r) => r.fixed === "left" || r.fixed === !0
|
|
71
71
|
) ? "left" : void 0), {
|
|
@@ -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,47 +1,47 @@
|
|
|
1
|
-
import { defineComponent as T, Text as
|
|
2
|
-
import { ApCopyProps as
|
|
1
|
+
import { defineComponent as T, Text as p, isVNode as y, computed as m, createVNode as n, Fragment as b } from "vue";
|
|
2
|
+
import { ApCopyProps as h } from "./constans.mjs";
|
|
3
3
|
import { IconApAdLineCopy as k } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { message as
|
|
6
|
-
import { isNull as
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
import { useLocale as
|
|
9
|
-
const
|
|
5
|
+
import { message as d } from "@aplus-frontend/antdv";
|
|
6
|
+
import { isNull as P, isUndefined as j } from "lodash-unified";
|
|
7
|
+
import { useNamespace as A } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
import { useLocale as N } from "../../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
const D = /* @__PURE__ */ T({
|
|
10
10
|
name: "CopyBtn",
|
|
11
|
-
props:
|
|
12
|
-
setup(
|
|
13
|
-
slots:
|
|
11
|
+
props: h(),
|
|
12
|
+
setup(r, {
|
|
13
|
+
slots: a
|
|
14
14
|
}) {
|
|
15
15
|
const {
|
|
16
|
-
b:
|
|
17
|
-
e:
|
|
18
|
-
m:
|
|
19
|
-
} =
|
|
20
|
-
t:
|
|
21
|
-
} =
|
|
22
|
-
navigator.clipboard.writeText(
|
|
23
|
-
|
|
16
|
+
b: x,
|
|
17
|
+
e: l,
|
|
18
|
+
m: g
|
|
19
|
+
} = A("ap-copy"), {
|
|
20
|
+
t: u
|
|
21
|
+
} = N(), v = (t) => {
|
|
22
|
+
t.stopPropagation(), t.preventDefault(), t.stopImmediatePropagation(), navigator.clipboard.writeText(r.text || c() || "").then(() => {
|
|
23
|
+
d.success(u("ap.apCopy.copySuccess"));
|
|
24
24
|
}).catch(() => {
|
|
25
|
-
|
|
25
|
+
d.error(u("ap.apCopy.copyError"));
|
|
26
26
|
});
|
|
27
27
|
}, S = (t) => {
|
|
28
28
|
if (t.length === 1) {
|
|
29
29
|
const e = t[0];
|
|
30
|
-
if (e.type ===
|
|
30
|
+
if (e.type === p || e.type.toString() === "Symbol(Text)" || y(e) && typeof e.children == "string")
|
|
31
31
|
return !0;
|
|
32
32
|
}
|
|
33
33
|
return !1;
|
|
34
34
|
}, C = (t) => {
|
|
35
35
|
if (!t.length) return "";
|
|
36
36
|
const e = t[0];
|
|
37
|
-
return e.type ===
|
|
38
|
-
},
|
|
37
|
+
return e.type === p || e.type.toString() === "Symbol(Text)" ? String(e.children) : y(e) && typeof e.children == "string" ? e.children : "";
|
|
38
|
+
}, c = () => {
|
|
39
39
|
var f;
|
|
40
|
-
const t = (f =
|
|
40
|
+
const t = (f = a.default) == null ? void 0 : f.call(a);
|
|
41
41
|
return t && S(t) ? C(t) : null;
|
|
42
|
-
}, s = (t) => !(
|
|
43
|
-
if (typeof
|
|
44
|
-
switch (
|
|
42
|
+
}, s = (t) => !(P(t) || j(t) || typeof t == "string" && t === ""), o = m(() => {
|
|
43
|
+
if (typeof r.textStyle == "string")
|
|
44
|
+
switch (r.textStyle) {
|
|
45
45
|
case "link":
|
|
46
46
|
return "text-link";
|
|
47
47
|
case "minor":
|
|
@@ -51,29 +51,29 @@ const I = /* @__PURE__ */ T({
|
|
|
51
51
|
default:
|
|
52
52
|
return "text-major";
|
|
53
53
|
}
|
|
54
|
-
else if (typeof
|
|
54
|
+
else if (typeof r.textStyle == "object")
|
|
55
55
|
return {
|
|
56
|
-
...
|
|
56
|
+
...r.textStyle
|
|
57
57
|
};
|
|
58
58
|
return {};
|
|
59
|
-
}),
|
|
60
|
-
return () =>
|
|
61
|
-
class: [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
href: n.link,
|
|
59
|
+
}), i = m(() => c() || r.text || "");
|
|
60
|
+
return () => n(b, null, [n("div", {
|
|
61
|
+
class: [x()]
|
|
62
|
+
}, [n("div", {
|
|
63
|
+
class: [l("text"), typeof o.value == "string" && g(o.value)],
|
|
64
|
+
style: typeof o.value != "string" && o.value,
|
|
65
|
+
title: typeof o.value == "string" ? i.value : ""
|
|
66
|
+
}, [s(i.value) ? r.link ? n("a", {
|
|
67
|
+
href: r.link,
|
|
69
68
|
target: "_blank"
|
|
70
|
-
}, [
|
|
71
|
-
class: [
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
}, [i.value]) : i.value : "--"]), s(i.value) && !r.disableCopy && n("div", {
|
|
70
|
+
class: [l("copy-btn"), "copy-btn"],
|
|
71
|
+
onClick: r.disableCopy ? void 0 : v
|
|
72
|
+
}, [n(k, {
|
|
73
|
+
size: r.size
|
|
74
74
|
}, null)])])]);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
export {
|
|
78
|
-
|
|
78
|
+
D as default
|
|
79
79
|
};
|
|
@@ -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;
|