@aplus-frontend/ui 0.1.9 → 0.1.10
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-field/interface.d.ts +4 -0
- package/es/src/ap-field/select/index.vue.d.ts +6 -0
- package/es/src/ap-field/select/index.vue.mjs +36 -31
- package/es/src/ap-layout/ap-info-layout/ap-info-layout.vue.d.ts +6 -2
- package/es/src/ap-layout/ap-info-layout/ap-info-layout.vue.mjs +33 -23
- package/es/src/ap-table/ap-table.vue.mjs +158 -147
- package/es/src/ap-table/constants.d.ts +26 -0
- package/es/src/ap-table/hooks/use-table-paging.d.ts +4 -3
- package/es/src/ap-table/hooks/use-table-paging.mjs +63 -63
- package/es/src/ap-table/interface.d.ts +13 -1
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +53 -48
- package/es/src/business/ap-export-group/interface.d.ts +4 -0
- package/es/src/business/ap-label/ApLabel.vue2.mjs +18 -17
- package/es/src/business/ap-label/ApLabelGroup.d.ts +22 -4
- package/es/src/business/ap-label/ApLabelGroup.mjs +17 -23
- package/es/src/business/ap-label/constans.d.ts +10 -2
- package/es/src/business/ap-label/constans.mjs +8 -0
- package/es/src/business/ap-label/interface.d.ts +13 -8
- package/es/src/business/index.d.ts +35 -5
- package/es/src/theme/antd-global-overwrite/admin/button.css +3 -0
- package/es/src/theme/antd-global-overwrite/admin/index.css +3 -0
- package/es/src/theme/antd-global-overwrite/aplus/button.css +3 -0
- package/es/src/theme/antd-global-overwrite/aplus/index.css +3 -0
- package/lib/src/ap-field/interface.d.ts +4 -0
- package/lib/src/ap-field/select/index.vue.d.ts +6 -0
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-layout/ap-info-layout/ap-info-layout.vue.d.ts +6 -2
- package/lib/src/ap-layout/ap-info-layout/ap-info-layout.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +26 -0
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +4 -3
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +13 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/interface.d.ts +4 -0
- package/lib/src/business/ap-label/ApLabel.vue2.js +1 -1
- package/lib/src/business/ap-label/ApLabelGroup.d.ts +22 -4
- package/lib/src/business/ap-label/ApLabelGroup.js +1 -1
- package/lib/src/business/ap-label/constans.d.ts +10 -2
- package/lib/src/business/ap-label/constans.js +1 -1
- package/lib/src/business/ap-label/interface.d.ts +13 -8
- package/lib/src/business/index.d.ts +35 -5
- package/lib/src/theme/antd-global-overwrite/admin/button.css +3 -0
- package/lib/src/theme/antd-global-overwrite/admin/index.css +3 -0
- package/lib/src/theme/antd-global-overwrite/aplus/button.css +3 -0
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +3 -0
- package/package.json +3 -3
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as S, nextTick as N, unref as o, onMounted as U, computed as z } from "vue";
|
|
2
2
|
import { parseFieldValue as W, dataIndexToStr as X } from "../utils.mjs";
|
|
3
3
|
import { isArray as Y } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
|
|
6
6
|
const oe = ({
|
|
7
|
-
manual:
|
|
8
|
-
defaultCurrent:
|
|
9
|
-
defaultPageSize:
|
|
10
|
-
request:
|
|
11
|
-
defaultParams:
|
|
12
|
-
defaultData:
|
|
13
|
-
formatParams:
|
|
14
|
-
paramsValueTypeMap:
|
|
15
|
-
resetFieldsIgnores:
|
|
16
|
-
filterFields:
|
|
17
|
-
sortFields:
|
|
7
|
+
manual: j = !1,
|
|
8
|
+
defaultCurrent: D = 1,
|
|
9
|
+
defaultPageSize: P = 10,
|
|
10
|
+
request: R,
|
|
11
|
+
defaultParams: A = {},
|
|
12
|
+
defaultData: B = [],
|
|
13
|
+
formatParams: w,
|
|
14
|
+
paramsValueTypeMap: V,
|
|
15
|
+
resetFieldsIgnores: b,
|
|
16
|
+
filterFields: E,
|
|
17
|
+
sortFields: L
|
|
18
18
|
}) => {
|
|
19
|
-
let
|
|
20
|
-
const
|
|
19
|
+
let T = 0, f = {};
|
|
20
|
+
const M = (e) => w ? w(e) : e, l = S(), i = S(D), g = S(P), { t: C } = Z(), n = S({
|
|
21
21
|
total: 0,
|
|
22
|
-
records:
|
|
22
|
+
records: B,
|
|
23
23
|
loading: !1
|
|
24
|
-
}),
|
|
24
|
+
}), x = async (e) => {
|
|
25
25
|
var r;
|
|
26
|
-
const a =
|
|
27
|
-
|
|
26
|
+
const a = M(e), t = Date.now();
|
|
27
|
+
T = t, n.value.loading = !0;
|
|
28
28
|
try {
|
|
29
|
-
const s = await
|
|
30
|
-
...
|
|
29
|
+
const s = await R({
|
|
30
|
+
...A,
|
|
31
31
|
...a
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
T === t && (n.value.total = s.total || ((r = s.data) == null ? void 0 : r.length) || 0, n.value.records = [...s.data || []]);
|
|
34
34
|
} catch {
|
|
35
|
-
|
|
35
|
+
T === t && (n.value.records = [], n.value.total = 0);
|
|
36
36
|
} finally {
|
|
37
37
|
n.value.loading = !1;
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, y = (e) => {
|
|
40
40
|
const a = {};
|
|
41
41
|
return Object.entries(e).forEach(([t, r]) => {
|
|
42
|
-
if (a[t] = r,
|
|
43
|
-
const s =
|
|
42
|
+
if (a[t] = r, V && r) {
|
|
43
|
+
const s = V[t];
|
|
44
44
|
s && (a[t] = W(s, r));
|
|
45
45
|
}
|
|
46
46
|
}), a;
|
|
47
|
-
},
|
|
48
|
-
var r, s, d, p, m, u,
|
|
47
|
+
}, q = async (e) => {
|
|
48
|
+
var r, s, d, p, m, u, h;
|
|
49
49
|
const a = ((s = (r = l.value) == null ? void 0 : r.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
|
|
50
|
-
Object.entries(a).forEach(([
|
|
51
|
-
|
|
52
|
-
}), await ((p = (d = l.value) == null ? void 0 : d.apForm) == null ? void 0 : p.resetFields()), (
|
|
50
|
+
Object.entries(a).forEach(([v, c]) => {
|
|
51
|
+
b && b.indexOf(v) > -1 && (t[v] = c);
|
|
52
|
+
}), await ((p = (d = l.value) == null ? void 0 : d.apForm) == null ? void 0 : p.resetFields()), (h = (u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || h.call(u, t), N(() => {
|
|
53
53
|
e == null || e();
|
|
54
54
|
});
|
|
55
|
-
},
|
|
55
|
+
}, F = (e) => {
|
|
56
56
|
f = e;
|
|
57
|
-
const a =
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
57
|
+
const a = y(e);
|
|
58
|
+
x(a);
|
|
59
|
+
}, J = (e) => {
|
|
60
|
+
F({
|
|
61
61
|
...f,
|
|
62
62
|
...e
|
|
63
63
|
});
|
|
64
|
-
},
|
|
64
|
+
}, O = () => {
|
|
65
65
|
var a, t;
|
|
66
66
|
const e = ((t = (a = l.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
67
|
-
i.value = 1,
|
|
67
|
+
i.value = 1, F({
|
|
68
68
|
...e,
|
|
69
69
|
current: 1,
|
|
70
|
-
pageSize: f.pageSize ||
|
|
70
|
+
pageSize: f.pageSize || P
|
|
71
71
|
});
|
|
72
|
-
}, J = () => {
|
|
73
|
-
M(x);
|
|
74
72
|
}, Q = () => {
|
|
75
|
-
|
|
76
|
-
}, G = (
|
|
73
|
+
q(O);
|
|
74
|
+
}, G = () => {
|
|
75
|
+
F(f);
|
|
76
|
+
}, H = (e) => {
|
|
77
77
|
const a = o(n).total - e, t = Math.ceil(a / o(g)), r = o(i) > t ? t : o(i);
|
|
78
|
-
|
|
78
|
+
J({
|
|
79
79
|
current: r > 0 ? r : 1
|
|
80
80
|
});
|
|
81
|
-
},
|
|
82
|
-
var m, u;
|
|
81
|
+
}, $ = (e, a, t) => {
|
|
82
|
+
var m, u, h, v;
|
|
83
83
|
const r = ((u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
|
|
84
84
|
i.value = e.current, g.value = e.pageSize;
|
|
85
85
|
const s = Y(t) ? [...t] : [t], d = {};
|
|
86
86
|
for (const c of s)
|
|
87
|
-
|
|
87
|
+
(h = o(L)) != null && h.includes(c.field) && (d[X(c.field)] = c.order);
|
|
88
88
|
const p = {};
|
|
89
89
|
for (const c of Object.keys(a))
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
(v = o(E)) != null && v.includes(c) && (p[c] = a[c]);
|
|
91
|
+
F({
|
|
92
92
|
...r,
|
|
93
93
|
filter: p,
|
|
94
94
|
sort: d,
|
|
@@ -103,14 +103,14 @@ const oe = ({
|
|
|
103
103
|
current: o(i),
|
|
104
104
|
pageSize: o(g),
|
|
105
105
|
...e
|
|
106
|
-
},
|
|
107
|
-
const r =
|
|
108
|
-
|
|
106
|
+
}, !j) {
|
|
107
|
+
const r = y(f);
|
|
108
|
+
x(r);
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
|
-
const
|
|
111
|
+
const I = z(() => o(n).total === 0 ? "-" : `${o(i.value)}/${Math.ceil(
|
|
112
112
|
o(n).total / o(g)
|
|
113
|
-
)}`),
|
|
113
|
+
)}`), K = z(() => ({
|
|
114
114
|
loading: o(n).loading,
|
|
115
115
|
pagination: {
|
|
116
116
|
current: o(i),
|
|
@@ -118,26 +118,26 @@ const oe = ({
|
|
|
118
118
|
total: o(n).total,
|
|
119
119
|
showSizeChanger: !0,
|
|
120
120
|
showQuickJumper: !0,
|
|
121
|
-
showTotal: (e) => `${
|
|
121
|
+
showTotal: (e) => `${C("ap.apTable.pagination.totalLeft", { total: e })} ${C(
|
|
122
122
|
"ap.apTable.pagination.totalRight",
|
|
123
|
-
{ page: o(
|
|
123
|
+
{ page: o(I) }
|
|
124
124
|
)}`
|
|
125
125
|
},
|
|
126
|
-
onChange:
|
|
126
|
+
onChange: $,
|
|
127
127
|
dataSource: o(n).records
|
|
128
128
|
}));
|
|
129
129
|
return {
|
|
130
130
|
formRef: l,
|
|
131
|
-
submit:
|
|
132
|
-
reset:
|
|
133
|
-
refresh:
|
|
134
|
-
refreshByDelete:
|
|
131
|
+
submit: O,
|
|
132
|
+
reset: Q,
|
|
133
|
+
refresh: G,
|
|
134
|
+
refreshByDelete: H,
|
|
135
135
|
data: n,
|
|
136
136
|
current: i,
|
|
137
137
|
pageSize: g,
|
|
138
|
-
handleTableChange:
|
|
139
|
-
tableProps:
|
|
140
|
-
dataSource:
|
|
138
|
+
handleTableChange: $,
|
|
139
|
+
tableProps: K,
|
|
140
|
+
dataSource: z(() => o(n).records)
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
143
|
export {
|
|
@@ -101,6 +101,17 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
|
|
|
101
101
|
* 自定义查询表单渲染
|
|
102
102
|
*/
|
|
103
103
|
customRenderFormItem?: (config: ApColumnType<RecordType, ValueType>) => any;
|
|
104
|
+
/**
|
|
105
|
+
* 自定义渲染文本,和customRender相比,其必须返回字符串,并且后续的渲染(例如copy/ellipsis)都将使用这个值
|
|
106
|
+
*/
|
|
107
|
+
renderText?: (option: {
|
|
108
|
+
value: any;
|
|
109
|
+
text: any;
|
|
110
|
+
record: RecordType;
|
|
111
|
+
index: number;
|
|
112
|
+
renderIndex: number;
|
|
113
|
+
column: ApColumnType<RecordType>;
|
|
114
|
+
}) => string;
|
|
104
115
|
/**
|
|
105
116
|
* 指定值类型(将会用于默认渲染和查询表单生成)
|
|
106
117
|
*/
|
|
@@ -126,7 +137,7 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
|
|
|
126
137
|
*/
|
|
127
138
|
filters?: ColumnType<RecordType>['filters'] | true;
|
|
128
139
|
/**
|
|
129
|
-
* 自定义渲染,添加了`editable`以及`originalNode`
|
|
140
|
+
* 自定义渲染,添加了`editable`以及`originalNode、originalText`
|
|
130
141
|
* @param opt
|
|
131
142
|
* @returns
|
|
132
143
|
*/
|
|
@@ -138,6 +149,7 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
|
|
|
138
149
|
renderIndex: number;
|
|
139
150
|
column: ApColumnType<RecordType>;
|
|
140
151
|
originalNode?: VNode;
|
|
152
|
+
originalText?: any;
|
|
141
153
|
}) => any;
|
|
142
154
|
} : never;
|
|
143
155
|
export type RequestData<T> = {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { formatFileNameAndDownloadFile as
|
|
1
|
+
import { defineComponent as D, computed as c, ref as B, openBlock as p, createBlock as y, unref as t, normalizeClass as K, withCtx as i, createVNode as x, createTextVNode as h, toDisplayString as w, normalizeStyle as T, createCommentVNode as I } from "vue";
|
|
2
|
+
import { formatFileNameAndDownloadFile as P } from "@aplus-frontend/utils";
|
|
3
3
|
import { DownOutlined as V } from "@ant-design/icons-vue";
|
|
4
|
-
import { Modal as z, Dropdown as O, Menu as
|
|
4
|
+
import { Modal as z, Dropdown as O, Menu as J, MenuItem as E, Button as R } from "ant-design-vue";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { ActionType as
|
|
7
|
-
import { usePermission as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useGlobalConfig as
|
|
11
|
-
const
|
|
6
|
+
import { ActionType as d } from "./interface.mjs";
|
|
7
|
+
import { usePermission as j } from "@aplus-frontend/hooks";
|
|
8
|
+
import { useNamespace as H } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
import { useLocale as Q } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useGlobalConfig as U } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
const ne = /* @__PURE__ */ D({
|
|
12
12
|
__name: "ApExportGroup",
|
|
13
13
|
props: {
|
|
14
14
|
selectedRowKeys: {},
|
|
@@ -17,71 +17,76 @@ const oe = /* @__PURE__ */ G({
|
|
|
17
17
|
ifShow: { type: Function },
|
|
18
18
|
text: {},
|
|
19
19
|
request: { type: Function },
|
|
20
|
-
getRequestParams: { type: Function }
|
|
20
|
+
getRequestParams: { type: Function },
|
|
21
|
+
getInitialParams: { type: Function }
|
|
21
22
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const { hasPermission: L } =
|
|
23
|
+
setup(F) {
|
|
24
|
+
const { hasPermission: L } = j(), e = F, { b: S } = H("ap-export-group"), { t: s } = Q(), g = U("uiMode"), A = c(() => {
|
|
24
25
|
const o = {
|
|
25
26
|
aplus: "#0070FF",
|
|
26
27
|
admin: "#34b77c"
|
|
27
28
|
};
|
|
28
|
-
return b.value ? "" : o[
|
|
29
|
-
}), b =
|
|
29
|
+
return b.value ? "" : o[g.value] || o.aplus;
|
|
30
|
+
}), b = c(() => !!(e != null && e.disabled)), M = {
|
|
30
31
|
textAlign: "center"
|
|
31
|
-
},
|
|
32
|
+
}, m = B(!1), v = c(() => (e == null ? void 0 : e.selectedRowKeys) || []), k = c(() => {
|
|
32
33
|
let o = e == null ? void 0 : e.ifShow;
|
|
33
34
|
return !(e != null && e.ifShow) && (e != null && e.auth) && (o = () => L(e.auth)), (o == null ? void 0 : o()) ?? !0;
|
|
34
35
|
});
|
|
35
|
-
async function
|
|
36
|
-
var _;
|
|
37
|
-
const { getRequestParams: n, request:
|
|
38
|
-
let
|
|
39
|
-
if (o ===
|
|
36
|
+
async function G({ key: o }) {
|
|
37
|
+
var _, C;
|
|
38
|
+
const { getRequestParams: n, request: l } = e || {};
|
|
39
|
+
let r = {};
|
|
40
|
+
if (o === d.SELECT) {
|
|
40
41
|
const a = ((n == null ? void 0 : n()) || {}).exportFieldList;
|
|
41
|
-
|
|
42
|
+
r = {
|
|
42
43
|
ids: v.value,
|
|
43
44
|
exportFieldList: a
|
|
44
45
|
};
|
|
45
|
-
for (const
|
|
46
|
-
|
|
47
|
-
} else o ===
|
|
46
|
+
for (const u in r)
|
|
47
|
+
r[u] || delete r[u];
|
|
48
|
+
} else o === d.ALL && (r = (n == null ? void 0 : n()) || {});
|
|
49
|
+
const N = ((_ = e == null ? void 0 : e.getInitialParams) == null ? void 0 : _.call(e)) || {};
|
|
48
50
|
try {
|
|
49
|
-
|
|
50
|
-
const a = await (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
m.value = !0;
|
|
52
|
+
const a = await (l == null ? void 0 : l({
|
|
53
|
+
...r,
|
|
54
|
+
...N
|
|
55
|
+
}));
|
|
56
|
+
a.headers && !((C = a == null ? void 0 : a.headers) != null && C["content-disposition"]) ? a.data.text().then((u) => {
|
|
57
|
+
const f = JSON.parse(u || "{}");
|
|
58
|
+
f.code && f.code !== "200" && z.error({
|
|
54
59
|
title: s("ap.apExportGroup.exportError"),
|
|
55
|
-
content:
|
|
60
|
+
content: f.message,
|
|
56
61
|
centered: !0
|
|
57
62
|
});
|
|
58
|
-
}) :
|
|
63
|
+
}) : P(a);
|
|
59
64
|
} finally {
|
|
60
|
-
|
|
65
|
+
m.value = !1;
|
|
61
66
|
}
|
|
62
67
|
}
|
|
63
|
-
return (o, n) =>
|
|
68
|
+
return (o, n) => k.value ? (p(), y(t(O), {
|
|
64
69
|
key: 0,
|
|
65
|
-
class:
|
|
66
|
-
overlayStyle:
|
|
70
|
+
class: K([t(S)()]),
|
|
71
|
+
overlayStyle: M,
|
|
67
72
|
disabled: b.value
|
|
68
73
|
}, {
|
|
69
74
|
overlay: i(() => [
|
|
70
|
-
x(t(
|
|
75
|
+
x(t(J), { onClick: G }, {
|
|
71
76
|
default: i(() => {
|
|
72
|
-
var
|
|
77
|
+
var l;
|
|
73
78
|
return [
|
|
74
|
-
(
|
|
75
|
-
key: t(
|
|
76
|
-
disabled: ((
|
|
79
|
+
(p(), y(t(E), {
|
|
80
|
+
key: t(d).SELECT,
|
|
81
|
+
disabled: ((l = v.value) == null ? void 0 : l.length) === 0
|
|
77
82
|
}, {
|
|
78
83
|
default: i(() => [
|
|
79
84
|
h(w(t(s)("ap.apExportGroup.exportSelected")), 1)
|
|
80
85
|
]),
|
|
81
86
|
_: 1
|
|
82
87
|
}, 8, ["disabled"])),
|
|
83
|
-
(
|
|
84
|
-
key: t(
|
|
88
|
+
(p(), y(t(E), {
|
|
89
|
+
key: t(d).ALL
|
|
85
90
|
}, {
|
|
86
91
|
default: i(() => [
|
|
87
92
|
h(w(t(s)("ap.apExportGroup.exportAll")), 1)
|
|
@@ -94,11 +99,11 @@ const oe = /* @__PURE__ */ G({
|
|
|
94
99
|
})
|
|
95
100
|
]),
|
|
96
101
|
default: i(() => [
|
|
97
|
-
x(t(
|
|
98
|
-
style:
|
|
99
|
-
color:
|
|
102
|
+
x(t(R), {
|
|
103
|
+
style: T({
|
|
104
|
+
color: A.value
|
|
100
105
|
}),
|
|
101
|
-
loading:
|
|
106
|
+
loading: m.value
|
|
102
107
|
}, {
|
|
103
108
|
default: i(() => [
|
|
104
109
|
h(w((e == null ? void 0 : e.text) ?? t(s)("ap.apExportGroup.export")) + " ", 1),
|
|
@@ -108,9 +113,9 @@ const oe = /* @__PURE__ */ G({
|
|
|
108
113
|
}, 8, ["style", "loading"])
|
|
109
114
|
]),
|
|
110
115
|
_: 1
|
|
111
|
-
}, 8, ["class", "disabled"])) :
|
|
116
|
+
}, 8, ["class", "disabled"])) : I("", !0);
|
|
112
117
|
}
|
|
113
118
|
});
|
|
114
119
|
export {
|
|
115
|
-
|
|
120
|
+
ne as default
|
|
116
121
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as y, computed as A, openBlock as l, createElementBlock as
|
|
2
|
-
import { Badge as b, Tooltip as
|
|
3
|
-
import { IconApAdLineAnnotation as
|
|
1
|
+
import { defineComponent as y, computed as A, openBlock as l, createElementBlock as c, normalizeClass as i, unref as t, createElementVNode as u, createVNode as k, normalizeProps as C, guardReactiveProps as g, renderSlot as m, Fragment as h, createBlock as n, withCtx as v, normalizeStyle as a, createCommentVNode as o } from "vue";
|
|
2
|
+
import { Badge as b, Tooltip as x } from "ant-design-vue";
|
|
3
|
+
import { IconApAdLineAnnotation as z, IconApAdFillWarn as B, IconApAdFillExecution as F, IconApAdFillSuccessful as S } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { omit as
|
|
5
|
+
import { omit as w } from "lodash-unified";
|
|
6
6
|
import "./style.css";
|
|
7
7
|
import { useNamespace as T } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
8
|
const $ = /* @__PURE__ */ y({
|
|
@@ -33,36 +33,37 @@ const $ = /* @__PURE__ */ y({
|
|
|
33
33
|
const s = A(() => ({
|
|
34
34
|
color: e.iconColor,
|
|
35
35
|
"font-size": e.iconSize + "px",
|
|
36
|
-
"margin-left": "4px"
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
"margin-left": "4px",
|
|
37
|
+
display: "inline-flex"
|
|
38
|
+
})), e = d, { b: f, e: p } = T("ap-label");
|
|
39
|
+
return (r, N) => e.show ? (l(), c("div", {
|
|
39
40
|
key: 0,
|
|
40
|
-
class:
|
|
41
|
+
class: i([t(f)()])
|
|
41
42
|
}, [
|
|
42
43
|
u("div", {
|
|
43
|
-
class:
|
|
44
|
+
class: i([t(p)("content")])
|
|
44
45
|
}, [
|
|
45
|
-
k(t(b), C(g(t(
|
|
46
|
-
r.$slots.default ? m(r.$slots, "default", { key: 0 }) : (l(),
|
|
47
|
-
e.helpMessage ? (l(), n(t(
|
|
46
|
+
k(t(b), C(g(t(w)(e, ["helpMessage", "placement", "iconColor"]))), null, 16),
|
|
47
|
+
r.$slots.default ? m(r.$slots, "default", { key: 0 }) : (l(), c(h, { key: 1 }, [
|
|
48
|
+
e.helpMessage ? (l(), n(t(x), {
|
|
48
49
|
key: 0,
|
|
49
50
|
placement: e.placement,
|
|
50
51
|
title: e.helpMessage
|
|
51
52
|
}, {
|
|
52
53
|
default: v(() => [
|
|
53
|
-
e.iconType === "question" ? (l(), n(t(
|
|
54
|
+
e.iconType === "question" ? (l(), n(t(z), {
|
|
54
55
|
key: 0,
|
|
55
56
|
style: a(s.value)
|
|
56
57
|
}, null, 8, ["style"])) : o("", !0),
|
|
57
|
-
e.iconType === "warning" ? (l(), n(t(
|
|
58
|
+
e.iconType === "warning" ? (l(), n(t(B), {
|
|
58
59
|
key: 1,
|
|
59
60
|
style: a(s.value)
|
|
60
61
|
}, null, 8, ["style"])) : o("", !0),
|
|
61
|
-
e.iconType === "ellipsis" ? (l(), n(t(
|
|
62
|
+
e.iconType === "ellipsis" ? (l(), n(t(F), {
|
|
62
63
|
key: 2,
|
|
63
64
|
style: a(s.value)
|
|
64
65
|
}, null, 8, ["style"])) : o("", !0),
|
|
65
|
-
e.iconType === "success" ? (l(), n(t(
|
|
66
|
+
e.iconType === "success" ? (l(), n(t(S), {
|
|
66
67
|
key: 3,
|
|
67
68
|
style: a(s.value)
|
|
68
69
|
}, null, 8, ["style"])) : o("", !0)
|
|
@@ -72,7 +73,7 @@ const $ = /* @__PURE__ */ y({
|
|
|
72
73
|
], 64))
|
|
73
74
|
], 2),
|
|
74
75
|
u("div", {
|
|
75
|
-
class:
|
|
76
|
+
class: i([t(p)("custom")])
|
|
76
77
|
}, [
|
|
77
78
|
m(r.$slots, "custom")
|
|
78
79
|
], 2)
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApLabelGroupItemProps } from './interface';
|
|
2
2
|
import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
|
|
3
3
|
declare const _default: DefineComponent<{
|
|
4
4
|
value: {
|
|
5
5
|
type: PropType<string | number | undefined>;
|
|
6
6
|
default: undefined;
|
|
7
7
|
};
|
|
8
|
+
tagValue: {
|
|
9
|
+
type: PropType<string | number | undefined>;
|
|
10
|
+
default: undefined;
|
|
11
|
+
};
|
|
8
12
|
columns: {
|
|
9
|
-
type: PropType<Array<
|
|
13
|
+
type: PropType<Array<ApLabelGroupItemProps<any>>>;
|
|
14
|
+
default: null;
|
|
15
|
+
};
|
|
16
|
+
record: {
|
|
17
|
+
type: PropType<any>;
|
|
10
18
|
default: null;
|
|
11
19
|
};
|
|
12
20
|
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
@@ -14,12 +22,22 @@ declare const _default: DefineComponent<{
|
|
|
14
22
|
type: PropType<string | number | undefined>;
|
|
15
23
|
default: undefined;
|
|
16
24
|
};
|
|
25
|
+
tagValue: {
|
|
26
|
+
type: PropType<string | number | undefined>;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
17
29
|
columns: {
|
|
18
|
-
type: PropType<Array<
|
|
30
|
+
type: PropType<Array<ApLabelGroupItemProps<any>>>;
|
|
31
|
+
default: null;
|
|
32
|
+
};
|
|
33
|
+
record: {
|
|
34
|
+
type: PropType<any>;
|
|
19
35
|
default: null;
|
|
20
36
|
};
|
|
21
37
|
}>>, {
|
|
22
38
|
value: string | number | undefined;
|
|
23
|
-
columns:
|
|
39
|
+
columns: ApLabelGroupItemProps<any>[];
|
|
40
|
+
record: any;
|
|
41
|
+
tagValue: string | number | undefined;
|
|
24
42
|
}, {}>;
|
|
25
43
|
export default _default;
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as n, createVNode as o, mergeProps as l, createTextVNode as m } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
3
|
import "./ApLabel.vue.mjs";
|
|
4
|
-
import { omit as
|
|
4
|
+
import { omit as t } from "lodash-unified";
|
|
5
5
|
import { ApLabelGroupProps as f } from "./constans.mjs";
|
|
6
|
-
import { Tag as
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
import
|
|
6
|
+
import { Tag as s } from "ant-design-vue";
|
|
7
|
+
import { useNamespace as c } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
import i from "./ApLabel.vue2.mjs";
|
|
9
9
|
const {
|
|
10
|
-
b:
|
|
11
|
-
} =
|
|
10
|
+
b: g
|
|
11
|
+
} = c("ap-label-group"), E = /* @__PURE__ */ n({
|
|
12
12
|
name: "ApLabelGroup",
|
|
13
13
|
props: f(),
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
default: () => {
|
|
19
|
-
var n;
|
|
20
|
-
return [(n = r.tagConfig) == null ? void 0 : n.text];
|
|
21
|
-
}
|
|
22
|
-
}) : r.customRender ? () => o("div", null, [r.customRender(r.value, u)]) : null;
|
|
23
|
-
};
|
|
14
|
+
setup(r) {
|
|
15
|
+
const a = (e) => (r.tagValue || r.tagValue === 0) && e.tagConfig && e.tagConfig.length > 0 ? () => e.tagConfig.filter((u) => r.tagValue === u.value).map((u) => o(s, t(u, ["text"]), {
|
|
16
|
+
default: () => [u.text]
|
|
17
|
+
})) : e.customRender ? () => o("div", null, [e.customRender(r.record)]) : null;
|
|
24
18
|
return () => o("div", {
|
|
25
|
-
class:
|
|
26
|
-
}, [
|
|
19
|
+
class: g()
|
|
20
|
+
}, [r.columns ? r.columns.map((e, u) => o(i, l({
|
|
27
21
|
key: u,
|
|
28
|
-
show:
|
|
29
|
-
},
|
|
30
|
-
custom:
|
|
22
|
+
show: r.value === e.value
|
|
23
|
+
}, t(e, ["value", "tagConfig", "customRender"])), {
|
|
24
|
+
custom: a(e)
|
|
31
25
|
})) : o("div", null, [m("columns数组不能为空")])]);
|
|
32
26
|
}
|
|
33
27
|
});
|
|
34
28
|
export {
|
|
35
|
-
|
|
29
|
+
E as default
|
|
36
30
|
};
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { ApLabelGroupItemProps } from './interface';
|
|
3
3
|
export declare const ApLabelGroupProps: () => {
|
|
4
4
|
value: {
|
|
5
5
|
type: PropType<string | number | undefined>;
|
|
6
6
|
default: undefined;
|
|
7
7
|
};
|
|
8
|
+
tagValue: {
|
|
9
|
+
type: PropType<string | number | undefined>;
|
|
10
|
+
default: undefined;
|
|
11
|
+
};
|
|
8
12
|
columns: {
|
|
9
|
-
type: PropType<Array<
|
|
13
|
+
type: PropType<Array<ApLabelGroupItemProps<any>>>;
|
|
14
|
+
default: null;
|
|
15
|
+
};
|
|
16
|
+
record: {
|
|
17
|
+
type: PropType<any>;
|
|
10
18
|
default: null;
|
|
11
19
|
};
|
|
12
20
|
};
|