@aplus-frontend/ui 0.1.30 → 0.1.32
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 +153 -145
- package/es/src/{business/ap-action-button/ApActionButton.vue.d.ts → ap-button/ap-action-button.vue.d.ts} +3 -3
- package/es/src/ap-button/ap-action-button.vue.mjs +43 -0
- package/es/src/ap-button/ap-action-button.vue2.mjs +4 -0
- package/es/src/ap-button/ap-button.vue.d.ts +48 -0
- package/es/src/ap-button/ap-button.vue.mjs +118 -0
- package/es/src/ap-button/ap-button.vue2.mjs +4 -0
- package/es/src/ap-button/index.d.ts +4 -0
- package/es/src/ap-button/index.mjs +3 -0
- package/es/src/{business/ap-action-button → ap-button}/interface.d.ts +3 -1
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +43 -45
- package/es/src/ap-descriptions/formatter/index.d.ts +2 -2
- package/es/src/ap-descriptions/helper.d.ts +19 -1
- package/es/src/ap-descriptions/helper.mjs +22 -12
- package/es/src/ap-descriptions/style/ap-descriptions.css +1 -5
- package/es/src/ap-download/ap-download.vue.mjs +51 -40
- package/es/src/ap-download/utils/getFileInfo.d.ts +4 -1
- package/es/src/ap-download/utils/getFileInfo.mjs +51 -26
- package/es/src/ap-form/dependency/index.vue.d.ts +28 -0
- package/es/src/ap-form/dependency/index.vue.mjs +37 -0
- package/es/src/ap-form/dependency/index.vue2.mjs +4 -0
- package/es/src/ap-form/index.d.ts +3 -1
- package/es/src/ap-form/index.mjs +10 -6
- package/es/src/ap-form/interface.d.ts +3 -0
- package/es/src/business/ap-attachment/ApAttachment.mjs +76 -68
- package/es/src/business/ap-card/ApCard.vue.d.ts +27 -0
- package/es/src/business/ap-card/ApCard.vue.mjs +4 -0
- package/es/src/business/ap-card/ApCard.vue2.mjs +60 -0
- package/es/src/business/ap-card/index.css +10 -0
- package/es/src/business/ap-card/interface.d.ts +9 -0
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +56 -65
- package/es/src/business/ap-export-group/handleExportDownload.d.ts +1 -0
- package/es/src/business/ap-export-group/handleExportDownload.mjs +14 -0
- package/es/src/business/hooks/useTableRefresh.d.ts +1 -1
- package/es/src/business/hooks/useTableRefresh.mjs +1 -1
- package/es/src/business/index.d.ts +21 -235
- package/es/src/business/index.mjs +30 -29
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +6 -2
- package/es/src/config-provider/config-provider.d.ts +10 -1
- package/es/src/config-provider/config-provider.mjs +20 -19
- package/es/src/config-provider/constants.d.ts +9 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +20 -1
- package/es/src/editable-table/interface.d.ts +3 -2
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +274 -265
- package/es/src/theme/ap-card/ap-card.css +10 -0
- package/es/src/theme/ap-descriptions/ap-descriptions.css +1 -5
- package/es/src/theme/css-var/index.mjs +33 -15
- package/lib/index.js +1 -1
- package/lib/src/{business/ap-action-button/ApActionButton.vue.d.ts → ap-button/ap-action-button.vue.d.ts} +3 -3
- package/lib/src/ap-button/ap-action-button.vue.js +1 -0
- package/lib/src/ap-button/ap-action-button.vue2.js +1 -0
- package/lib/src/ap-button/ap-button.vue.d.ts +48 -0
- package/lib/src/ap-button/ap-button.vue.js +1 -0
- package/lib/src/ap-button/ap-button.vue2.js +1 -0
- package/lib/src/ap-button/index.d.ts +4 -0
- package/lib/src/ap-button/index.js +1 -0
- package/lib/src/{business/ap-action-button → ap-button}/interface.d.ts +3 -1
- package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/ap-descriptions/formatter/index.d.ts +2 -2
- package/lib/src/ap-descriptions/helper.d.ts +19 -1
- package/lib/src/ap-descriptions/helper.js +1 -1
- package/lib/src/ap-descriptions/style/ap-descriptions.css +1 -5
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/utils/getFileInfo.d.ts +4 -1
- package/lib/src/ap-download/utils/getFileInfo.js +1 -1
- package/lib/src/ap-form/dependency/index.vue.d.ts +28 -0
- package/lib/src/ap-form/dependency/index.vue.js +1 -0
- package/lib/src/ap-form/dependency/index.vue2.js +1 -0
- package/lib/src/ap-form/index.d.ts +3 -1
- package/lib/src/ap-form/index.js +1 -1
- package/lib/src/ap-form/interface.d.ts +3 -0
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-card/ApCard.vue.d.ts +27 -0
- package/lib/src/business/{ap-action-button/ApActionButton.vue.js → ap-card/ApCard.vue.js} +1 -1
- package/lib/src/business/ap-card/ApCard.vue2.js +1 -0
- package/lib/src/business/ap-card/index.css +10 -0
- package/lib/src/business/ap-card/interface.d.ts +9 -0
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/handleExportDownload.d.ts +1 -0
- package/lib/src/business/ap-export-group/handleExportDownload.js +1 -0
- package/lib/src/business/hooks/useTableRefresh.d.ts +1 -1
- package/lib/src/business/hooks/useTableRefresh.js +1 -1
- package/lib/src/business/index.d.ts +21 -235
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +10 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +9 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +20 -1
- package/lib/src/editable-table/interface.d.ts +3 -2
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-card/ap-card.css +10 -0
- package/lib/src/theme/ap-descriptions/ap-descriptions.css +1 -5
- package/lib/src/theme/css-var/index.js +1 -1
- package/package.json +1 -1
- package/es/src/business/ap-action-button/ApActionButton.vue.mjs +0 -4
- package/es/src/business/ap-action-button/ApActionButton.vue2.mjs +0 -97
- package/lib/src/business/ap-action-button/ApActionButton.vue2.js +0 -1
- /package/es/src/{business/ap-action-button → ap-button}/index.css +0 -0
- /package/es/src/{business/ap-action-button → ap-button}/interface.mjs +0 -0
- /package/es/src/business/{title → ap-title}/ApTitle.vue.d.ts +0 -0
- /package/es/src/business/{title → ap-title}/ApTitle.vue.mjs +0 -0
- /package/es/src/business/{title → ap-title}/ApTitle.vue2.mjs +0 -0
- /package/es/src/business/{title → ap-title}/interface.d.ts +0 -0
- /package/es/src/business/{title → ap-title}/style.css +0 -0
- /package/es/src/theme/{ap-action-button/ap-action-button.css → ap-button/ap-button.css} +0 -0
- /package/lib/src/{business/ap-action-button → ap-button}/index.css +0 -0
- /package/lib/src/{business/ap-action-button → ap-button}/interface.js +0 -0
- /package/lib/src/business/{title → ap-title}/ApTitle.vue.d.ts +0 -0
- /package/lib/src/business/{title → ap-title}/ApTitle.vue.js +0 -0
- /package/lib/src/business/{title → ap-title}/ApTitle.vue2.js +0 -0
- /package/lib/src/business/{title → ap-title}/interface.d.ts +0 -0
- /package/lib/src/business/{title → ap-title}/style.css +0 -0
- /package/lib/src/theme/{ap-action-button/ap-action-button.css → ap-button/ap-button.css} +0 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { defineComponent as L, ref as $, computed as a, openBlock as M, createBlock as j, unref as c, mergeProps as w, createSlots as P, renderList as x, withCtx as _, renderSlot as N, normalizeProps as z, guardReactiveProps as A } from "vue";
|
|
2
|
+
import "./index.css";
|
|
3
|
+
import { Button as F } from "ant-design-vue";
|
|
4
|
+
import "../config-provider/index.mjs";
|
|
5
|
+
import { omit as O } from "lodash-unified";
|
|
6
|
+
import { useNamespace as S } from "../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
import { useGlobalConfig as T } from "../config-provider/hooks/use-global-config.mjs";
|
|
8
|
+
const G = 88, Q = /* @__PURE__ */ L({
|
|
9
|
+
__name: "ap-button",
|
|
10
|
+
props: {
|
|
11
|
+
prefixCls: {},
|
|
12
|
+
htmlType: {},
|
|
13
|
+
shape: {},
|
|
14
|
+
size: {},
|
|
15
|
+
loading: { type: [Boolean, Object], default: void 0 },
|
|
16
|
+
disabled: { type: Boolean },
|
|
17
|
+
ghost: { type: Boolean },
|
|
18
|
+
block: { type: Boolean },
|
|
19
|
+
danger: { type: Boolean },
|
|
20
|
+
icon: {},
|
|
21
|
+
href: {},
|
|
22
|
+
target: {},
|
|
23
|
+
title: {},
|
|
24
|
+
onMousedown: {},
|
|
25
|
+
type: { default: "default" },
|
|
26
|
+
borderLinkColor: {},
|
|
27
|
+
minWidth: { type: [Boolean, Number, String], default: !1 },
|
|
28
|
+
onClick: {}
|
|
29
|
+
},
|
|
30
|
+
setup(y) {
|
|
31
|
+
const e = y, d = {
|
|
32
|
+
aplus: "#0070FF",
|
|
33
|
+
admin: "#34b77c"
|
|
34
|
+
}, { b: p } = S("ap-action-button"), g = T("uiMode"), s = $(!1), h = a(
|
|
35
|
+
() => e.borderLinkColor || d[g.value] || d.aplus
|
|
36
|
+
), f = a(
|
|
37
|
+
() => e.type === "borderLink" ? h.value : void 0
|
|
38
|
+
), m = a(() => W(f.value)), v = a(() => e.minWidth === !0 ? `${G}px` : typeof e.minWidth == "number" ? `${e.minWidth}px` : typeof e.minWidth == "string" ? e.minWidth : void 0), k = a(
|
|
39
|
+
() => (e.type === "borderLink" ? "default" : e.type) || "default"
|
|
40
|
+
), b = a(() => e.loading ?? s.value ?? !1);
|
|
41
|
+
function C() {
|
|
42
|
+
const t = O(e, [
|
|
43
|
+
"type",
|
|
44
|
+
"borderLinkColor",
|
|
45
|
+
"minWidth",
|
|
46
|
+
"onClick",
|
|
47
|
+
"loading"
|
|
48
|
+
]);
|
|
49
|
+
return t ? {
|
|
50
|
+
...t,
|
|
51
|
+
type: k.value,
|
|
52
|
+
onclick: B
|
|
53
|
+
} : {};
|
|
54
|
+
}
|
|
55
|
+
async function B() {
|
|
56
|
+
var t;
|
|
57
|
+
if (!b.value) {
|
|
58
|
+
s.value = !0;
|
|
59
|
+
try {
|
|
60
|
+
await ((t = e.onClick) == null ? void 0 : t.call(e));
|
|
61
|
+
} finally {
|
|
62
|
+
s.value = !1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function W(t, u = "0.7") {
|
|
67
|
+
var i;
|
|
68
|
+
try {
|
|
69
|
+
let o = t == null ? void 0 : t.toLowerCase();
|
|
70
|
+
if (o && /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(o)) {
|
|
71
|
+
if (o.length === 4) {
|
|
72
|
+
let r = "#";
|
|
73
|
+
for (let l = 1; l < 4; l += 1)
|
|
74
|
+
r += o.slice(l, l + 1).concat(o.slice(l, l + 1));
|
|
75
|
+
o = r;
|
|
76
|
+
}
|
|
77
|
+
const n = [];
|
|
78
|
+
for (let r = 1; r < 7; r += 2)
|
|
79
|
+
n.push(parseInt("0x" + o.slice(r, r + 2)));
|
|
80
|
+
return "rgba(" + n.join(",") + "," + u + ")";
|
|
81
|
+
}
|
|
82
|
+
if (o && o.startsWith("rgb")) {
|
|
83
|
+
let n = o.match(/(\d(\.\d+)?)+/g);
|
|
84
|
+
return n = (i = n == null ? void 0 : n.slice(0, 3)) == null ? void 0 : i.concat(u), "rgba(" + n.join(",") + ")";
|
|
85
|
+
}
|
|
86
|
+
return o;
|
|
87
|
+
} catch {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return (t, u) => (M(), j(c(F), w({
|
|
92
|
+
class: {
|
|
93
|
+
[c(p)()]: !0,
|
|
94
|
+
[`${c(p)()}-border-link`]: m.value
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
...t.$attrs,
|
|
98
|
+
...C()
|
|
99
|
+
}, {
|
|
100
|
+
style: {
|
|
101
|
+
color: f.value,
|
|
102
|
+
minWidth: v.value,
|
|
103
|
+
"--button-border-color": m.value
|
|
104
|
+
},
|
|
105
|
+
loading: b.value
|
|
106
|
+
}), P({ _: 2 }, [
|
|
107
|
+
x(Object.keys(t.$slots), (i) => ({
|
|
108
|
+
name: i,
|
|
109
|
+
fn: _((o) => [
|
|
110
|
+
N(t.$slots, i, z(A(o || {})))
|
|
111
|
+
])
|
|
112
|
+
}))
|
|
113
|
+
]), 1040, ["class", "style", "loading"]));
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
export {
|
|
117
|
+
Q as default
|
|
118
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ButtonProps } from 'ant-design-vue';
|
|
2
|
-
export type
|
|
2
|
+
export type ApButtonProps = Omit<ButtonProps, 'type' | 'onClick'> & {
|
|
3
3
|
type?: ButtonProps['type'] | 'borderLink';
|
|
4
4
|
borderLinkColor?: string;
|
|
5
5
|
minWidth?: boolean | number | string;
|
|
6
|
+
onClick?: () => any | Promise<any>;
|
|
6
7
|
};
|
|
8
|
+
export type ApActionButtonProps = ApButtonProps;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Descriptions as V, DescriptionsItem as
|
|
3
|
-
import { transformValue as
|
|
1
|
+
import { defineComponent as N, openBlock as l, createElementBlock as a, normalizeClass as h, unref as r, normalizeStyle as T, createVNode as B, mergeProps as _, withCtx as f, Fragment as s, renderList as w, createBlock as i, h as c, renderSlot as E, resolveDynamicComponent as M } from "vue";
|
|
2
|
+
import { Descriptions as V, DescriptionsItem as m } from "ant-design-vue";
|
|
3
|
+
import { mixinsAttachmentExtraProps as j, transformValue as x, isEmptyWithType as z } from "./helper.mjs";
|
|
4
4
|
import { get as S } from "lodash-unified";
|
|
5
5
|
import "./help-message/index.vue.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
7
|
import "./style/ap-descriptions.css";
|
|
8
|
-
import { useGlobalConfig as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import
|
|
11
|
-
const
|
|
8
|
+
import { useGlobalConfig as u } from "../config-provider/hooks/use-global-config.mjs";
|
|
9
|
+
import { useNamespace as A } from "../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import F from "./help-message/index.vue2.mjs";
|
|
11
|
+
const G = { key: 0 }, Q = /* @__PURE__ */ N({
|
|
12
12
|
__name: "ap-descriptions",
|
|
13
13
|
props: {
|
|
14
14
|
descriptionsProps: {},
|
|
@@ -18,46 +18,44 @@ const E = { key: 0 }, J = /* @__PURE__ */ D({
|
|
|
18
18
|
className: {}
|
|
19
19
|
},
|
|
20
20
|
setup(b) {
|
|
21
|
-
const
|
|
22
|
-
var
|
|
23
|
-
let
|
|
24
|
-
return ((
|
|
25
|
-
justifyContent:
|
|
21
|
+
const p = b, g = u("uiMode", "admin"), C = u("apDescriptions"), k = u("downloadCenterTriggerConfig"), { m: v, b: P } = A("ap-descriptions"), D = (t = {}) => {
|
|
22
|
+
var o;
|
|
23
|
+
let n = "";
|
|
24
|
+
return ((o = p.descriptionsProps) == null ? void 0 : o.layout) === "vertical" && (n = "start"), {
|
|
25
|
+
justifyContent: n,
|
|
26
26
|
...t
|
|
27
27
|
};
|
|
28
|
-
},
|
|
29
|
-
var
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
downloadFile: l
|
|
36
|
-
}), h({ value: a, record: i.dataSource }, t);
|
|
28
|
+
}, y = (t) => {
|
|
29
|
+
var o, e;
|
|
30
|
+
const n = S(p.dataSource, t.field);
|
|
31
|
+
return t.customRender ? t.customRender(p.dataSource) : (t.valueType === "attachment" && (t.extraProps = j(t.extraProps, {
|
|
32
|
+
fromConfig: (o = C.value) == null ? void 0 : o.downloadFile,
|
|
33
|
+
fromGlobal: (e = k.value) == null ? void 0 : e.trigger
|
|
34
|
+
})), x({ value: n, record: p.dataSource }, t));
|
|
37
35
|
};
|
|
38
|
-
return (t,
|
|
39
|
-
var
|
|
40
|
-
return
|
|
41
|
-
class:
|
|
42
|
-
style:
|
|
36
|
+
return (t, n) => {
|
|
37
|
+
var o;
|
|
38
|
+
return l(), a("div", {
|
|
39
|
+
class: h([t.className, r(P)(), r(v)(r(g))]),
|
|
40
|
+
style: T(t.style)
|
|
43
41
|
}, [
|
|
44
|
-
|
|
45
|
-
labelStyle:
|
|
42
|
+
B(r(V), _(t.descriptionsProps, {
|
|
43
|
+
labelStyle: D({ ...((o = t.descriptionsProps) == null ? void 0 : o.labelStyle) || {} })
|
|
46
44
|
}), {
|
|
47
|
-
default:
|
|
48
|
-
(
|
|
49
|
-
key: e.field || "empty" +
|
|
45
|
+
default: f(() => [
|
|
46
|
+
(l(!0), a(s, null, w(t.schemas, (e, d) => (l(), a(s, {
|
|
47
|
+
key: e.field || "empty" + d
|
|
50
48
|
}, [
|
|
51
|
-
e.valueType === "empty" ? (
|
|
49
|
+
e.valueType === "empty" ? (l(), i(r(m), {
|
|
52
50
|
key: 0,
|
|
53
51
|
contentStyle: e.contentStyle,
|
|
54
52
|
labelStyle: e.labelStyle,
|
|
55
53
|
span: e.span
|
|
56
|
-
}, null, 8, ["contentStyle", "labelStyle", "span"])) : (
|
|
54
|
+
}, null, 8, ["contentStyle", "labelStyle", "span"])) : (l(), i(r(m), {
|
|
57
55
|
key: 1,
|
|
58
|
-
label: e.label ?
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
label: e.label ? c(s, [
|
|
57
|
+
c(
|
|
58
|
+
F,
|
|
61
59
|
{ helpMessage: e.helpMessage },
|
|
62
60
|
{ default: () => e.label }
|
|
63
61
|
)
|
|
@@ -66,17 +64,17 @@ const E = { key: 0 }, J = /* @__PURE__ */ D({
|
|
|
66
64
|
contentStyle: e.contentStyle,
|
|
67
65
|
labelStyle: e.labelStyle
|
|
68
66
|
}, {
|
|
69
|
-
default:
|
|
70
|
-
r(
|
|
71
|
-
e.contentSlotName ?
|
|
67
|
+
default: f(() => [
|
|
68
|
+
r(z)(r(S)(t.dataSource, e.field), e.valueType) ? (l(), a("span", G, "--")) : (l(), a(s, { key: 1 }, [
|
|
69
|
+
e.contentSlotName ? E(t.$slots, e.contentSlotName, {
|
|
72
70
|
key: 0,
|
|
73
|
-
index:
|
|
74
|
-
item:
|
|
71
|
+
index: d,
|
|
72
|
+
item: y(e),
|
|
75
73
|
record: t.dataSource
|
|
76
|
-
}) : (
|
|
77
|
-
|
|
74
|
+
}) : (l(), i(M(
|
|
75
|
+
c(s, [
|
|
78
76
|
e.prefix,
|
|
79
|
-
|
|
77
|
+
y(e),
|
|
80
78
|
e.suffix
|
|
81
79
|
])
|
|
82
80
|
), { key: 1 }))
|
|
@@ -93,5 +91,5 @@ const E = { key: 0 }, J = /* @__PURE__ */ D({
|
|
|
93
91
|
}
|
|
94
92
|
});
|
|
95
93
|
export {
|
|
96
|
-
|
|
94
|
+
Q as default
|
|
97
95
|
};
|
|
@@ -44,7 +44,7 @@ interface DateRangeExtraProps {
|
|
|
44
44
|
}
|
|
45
45
|
/** 处理日期范围 */
|
|
46
46
|
export declare function dateRange({ value, record }: FormatOptions, extraProps: DateRangeExtraProps): string;
|
|
47
|
-
interface AttachmentExtraProps {
|
|
47
|
+
export interface AttachmentExtraProps {
|
|
48
48
|
/** url字段路径 */
|
|
49
49
|
urlPath?: string | string[];
|
|
50
50
|
/** 资源名称字段路径 */
|
|
@@ -53,7 +53,7 @@ interface AttachmentExtraProps {
|
|
|
53
53
|
style?: StyleValue;
|
|
54
54
|
/** 类名称 */
|
|
55
55
|
className?: string;
|
|
56
|
-
/**
|
|
56
|
+
/** 配置downloadCenterTriggerConfig优先级最高,次配置失效 */
|
|
57
57
|
downloadFile?: (url: string, name: string) => void;
|
|
58
58
|
}
|
|
59
59
|
/** 处理附件类型 */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormatOptions, FormatterValueType, TransformOptionType } from './interface';
|
|
2
|
-
import { VNode, VNodeChild } from 'vue';
|
|
2
|
+
import { VNode, VNodeChild, StyleValue } from 'vue';
|
|
3
|
+
import { AttachmentExtraProps } from './formatter';
|
|
3
4
|
export declare function transformValue(data: FormatOptions, opt: TransformOptionType): VNodeChild | VNode;
|
|
4
5
|
/**
|
|
5
6
|
* 根据type判断是否为空
|
|
@@ -7,3 +8,20 @@ export declare function transformValue(data: FormatOptions, opt: TransformOption
|
|
|
7
8
|
* @param type 类型
|
|
8
9
|
*/
|
|
9
10
|
export declare function isEmptyWithType(value: unknown, type: FormatterValueType): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 混入附件类型额外属性
|
|
13
|
+
* @param target 原配置
|
|
14
|
+
* @param options.fromGlobal 来自全局配置的下载文件方法
|
|
15
|
+
* @param options.fromConfig 来自全局配置里的ApDescriptions的下载文件方法
|
|
16
|
+
* @returns 混入后的配置
|
|
17
|
+
*/
|
|
18
|
+
export declare function mixinsAttachmentExtraProps(target: AttachmentExtraProps | undefined, options: {
|
|
19
|
+
fromGlobal?: (...args: any[]) => any;
|
|
20
|
+
fromConfig?: (...args: any[]) => any;
|
|
21
|
+
}): AttachmentExtraProps | {
|
|
22
|
+
downloadFile: (...args: any[]) => any;
|
|
23
|
+
urlPath?: string | string[];
|
|
24
|
+
namePath?: string | string[];
|
|
25
|
+
style?: StyleValue;
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
import { isEmpty as
|
|
2
|
-
import { formatterMap as
|
|
3
|
-
function
|
|
4
|
-
const e = n
|
|
5
|
-
return e ? e(
|
|
1
|
+
import { isEmpty as o } from "lodash-unified";
|
|
2
|
+
import { formatterMap as f } from "./formatter/index.mjs";
|
|
3
|
+
function m(r, n) {
|
|
4
|
+
const e = f[n.valueType];
|
|
5
|
+
return e ? e(r, n.extraProps || {}) : r.value;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
switch (
|
|
7
|
+
function a(r, n) {
|
|
8
|
+
switch (n) {
|
|
9
9
|
case "text":
|
|
10
10
|
case "number":
|
|
11
11
|
case "dateRange":
|
|
12
12
|
case "date":
|
|
13
|
-
return
|
|
13
|
+
return r == null || r === "";
|
|
14
14
|
case "array":
|
|
15
15
|
case "attachment":
|
|
16
|
-
return
|
|
16
|
+
return o(r);
|
|
17
17
|
default:
|
|
18
|
-
return !
|
|
18
|
+
return !r;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
function c(r = {}, n) {
|
|
22
|
+
return n.fromGlobal ? {
|
|
23
|
+
...r,
|
|
24
|
+
downloadFile: n.fromGlobal
|
|
25
|
+
} : !(r != null && r.downloadFile) && n.fromConfig ? {
|
|
26
|
+
...r,
|
|
27
|
+
downloadFile: n.fromConfig
|
|
28
|
+
} : r;
|
|
29
|
+
}
|
|
21
30
|
export {
|
|
22
|
-
|
|
23
|
-
c as
|
|
31
|
+
a as isEmptyWithType,
|
|
32
|
+
c as mixinsAttachmentExtraProps,
|
|
33
|
+
m as transformValue
|
|
24
34
|
};
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
TODO:
|
|
3
3
|
1.admin和aplus样式提成变量?
|
|
4
4
|
*/
|
|
5
|
-
.aplus-ap-descriptions {
|
|
6
|
-
--ap-descriptions-item-padding-bottom: 24px;
|
|
7
|
-
--ap-descriptions-item-label-width: auto;
|
|
8
|
-
}
|
|
9
5
|
.aplus-ap-descriptions .ant-descriptions .ant-descriptions-view table {
|
|
10
6
|
table-layout: fixed;
|
|
11
7
|
}
|
|
@@ -16,7 +12,7 @@
|
|
|
16
12
|
padding-bottom: 8px;
|
|
17
13
|
}
|
|
18
14
|
.aplus-ap-descriptions .ant-descriptions .ant-descriptions-row:last-child .ant-descriptions-item {
|
|
19
|
-
padding-bottom:
|
|
15
|
+
padding-bottom: var(--ap-descriptions-last-row-item-padding-bottom);
|
|
20
16
|
}
|
|
21
17
|
.aplus-ap-descriptions .ant-descriptions .ant-descriptions-item-label::after {
|
|
22
18
|
margin-inline: 4px 20px;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Button as
|
|
3
|
-
import { LoadingOutlined as
|
|
1
|
+
import { defineComponent as x, ref as A, useSlots as S, computed as t, unref as s, openBlock as r, createBlock as j, mergeProps as I, withCtx as M, createElementVNode as u, normalizeClass as T, createElementBlock as f, createVNode as U, createCommentVNode as g, renderSlot as V, toDisplayString as D } from "vue";
|
|
2
|
+
import { Button as E } from "ant-design-vue";
|
|
3
|
+
import { LoadingOutlined as G } from "@ant-design/icons-vue";
|
|
4
4
|
import "../config-provider/index.mjs";
|
|
5
|
-
import { useOssInit as
|
|
5
|
+
import { useOssInit as P } from "./hooks/index.mjs";
|
|
6
6
|
import "./style/ap-download.css";
|
|
7
|
-
import { getFileInfo as
|
|
8
|
-
import { useStyle as
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useGlobalConfig as
|
|
11
|
-
const
|
|
7
|
+
import { getFileInfo as y } from "./utils/getFileInfo.mjs";
|
|
8
|
+
import { useStyle as R } from "./hooks/useStyle.mjs";
|
|
9
|
+
import { useLocale as W } from "../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useGlobalConfig as c } from "../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
const $ = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "spin"
|
|
14
|
-
},
|
|
14
|
+
}, q = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "icon"
|
|
17
|
-
},
|
|
17
|
+
}, H = { class: "text" }, le = /* @__PURE__ */ x({
|
|
18
18
|
name: "ApDownload",
|
|
19
19
|
__name: "ap-download",
|
|
20
20
|
props: {
|
|
@@ -41,45 +41,56 @@ const P = {
|
|
|
41
41
|
getOssAccess: {}
|
|
42
42
|
},
|
|
43
43
|
emits: ["downloadCallback"],
|
|
44
|
-
setup(
|
|
45
|
-
const
|
|
44
|
+
setup(C, { emit: b }) {
|
|
45
|
+
const h = b, l = A(!1), { lang: N } = W(), _ = S(), w = t(() => N.value === "zh-cn" ? "zh_CN" : "en_US"), k = c("uiMode"), e = C, v = c("apUpload"), d = c(
|
|
46
|
+
"downloadCenterTriggerConfig"
|
|
47
|
+
), p = t(() => e.disabled), B = t(() => e.color ? e.color : k.value === "aplus" ? "#0070FF" : "#1890FF"), z = t(() => e.size), { getInnerWrapperClass: O } = R(B, z, p), F = t(() => {
|
|
46
48
|
var o;
|
|
47
|
-
return e.getOssAccess || ((o =
|
|
48
|
-
}),
|
|
49
|
+
return e.getOssAccess || ((o = v.value) == null ? void 0 : o.getOssAccess);
|
|
50
|
+
}), L = async () => {
|
|
51
|
+
var o, a;
|
|
49
52
|
if (!e.disabled) {
|
|
50
|
-
|
|
53
|
+
l.value = !0;
|
|
51
54
|
try {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
if ((o = d.value) != null && o.trigger) {
|
|
56
|
+
let i = y(e.needName, e.fileName).map((m) => ({
|
|
57
|
+
objectName: m.path,
|
|
58
|
+
fileName: m.fileName
|
|
59
|
+
}));
|
|
60
|
+
(a = d.value) == null || a.trigger(i);
|
|
61
|
+
} else {
|
|
62
|
+
const i = await (await P(
|
|
63
|
+
F.value,
|
|
64
|
+
s(w)
|
|
65
|
+
)).downloadFile(
|
|
66
|
+
y(e.needName, e.fileName)
|
|
67
|
+
);
|
|
68
|
+
h("downloadCallback", i);
|
|
69
|
+
}
|
|
70
|
+
} catch (n) {
|
|
71
|
+
console.error(n);
|
|
61
72
|
} finally {
|
|
62
|
-
|
|
73
|
+
l.value = !1;
|
|
63
74
|
}
|
|
64
75
|
}
|
|
65
76
|
};
|
|
66
|
-
return (o,
|
|
77
|
+
return (o, a) => (r(), j(s(E), I(e, {
|
|
67
78
|
type: e.type,
|
|
68
79
|
size: e.size,
|
|
69
|
-
disabled:
|
|
70
|
-
onClick:
|
|
80
|
+
disabled: p.value,
|
|
81
|
+
onClick: L
|
|
71
82
|
}), {
|
|
72
|
-
default:
|
|
73
|
-
|
|
74
|
-
class:
|
|
83
|
+
default: M(() => [
|
|
84
|
+
u("div", {
|
|
85
|
+
class: T(s(O))
|
|
75
86
|
}, [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
])) :
|
|
79
|
-
s(
|
|
80
|
-
|
|
81
|
-
])) :
|
|
82
|
-
|
|
87
|
+
l.value ? (r(), f("span", $, [
|
|
88
|
+
U(s(G), { spin: !0 })
|
|
89
|
+
])) : g("", !0),
|
|
90
|
+
s(_).icon ? (r(), f("span", q, [
|
|
91
|
+
V(o.$slots, "icon")
|
|
92
|
+
])) : g("", !0),
|
|
93
|
+
u("span", H, D(o.text), 1)
|
|
83
94
|
], 2)
|
|
84
95
|
]),
|
|
85
96
|
_: 3
|
|
@@ -87,5 +98,5 @@ const P = {
|
|
|
87
98
|
}
|
|
88
99
|
});
|
|
89
100
|
export {
|
|
90
|
-
|
|
101
|
+
le as default
|
|
91
102
|
};
|
|
@@ -2,7 +2,10 @@ import { ApDownLoadNeedNameModel } from '../interface';
|
|
|
2
2
|
/**
|
|
3
3
|
* 根据needName将fileName转换为OSS下载格式
|
|
4
4
|
*/
|
|
5
|
-
export declare function getFileInfo(needName?: ApDownLoadNeedNameModel, fileName?: any):
|
|
5
|
+
export declare function getFileInfo(needName?: ApDownLoadNeedNameModel, fileName?: any): {
|
|
6
|
+
path: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
}[];
|
|
6
9
|
/**
|
|
7
10
|
* 根据hexColor颜色和opacity透明度计算rgba颜色数值,返回
|
|
8
11
|
*/
|
|
@@ -1,41 +1,66 @@
|
|
|
1
1
|
import { ApDownLoadNeedNameKeyDefault as y } from "../interface.mjs";
|
|
2
|
-
function K(
|
|
3
|
-
if (
|
|
4
|
-
if (typeof
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
function K(r, t) {
|
|
3
|
+
if (r === !0) {
|
|
4
|
+
if (typeof t == "string")
|
|
5
|
+
return [
|
|
6
|
+
{
|
|
7
|
+
path: t,
|
|
8
|
+
fileName: t
|
|
9
|
+
}
|
|
10
|
+
];
|
|
11
|
+
if (Array.isArray(t))
|
|
12
|
+
return t.map((p) => ({
|
|
13
|
+
path: (p == null ? void 0 : p[y.pathKey]) ?? p,
|
|
14
|
+
fileName: (p == null ? void 0 : p[y.nameKey]) ?? p
|
|
10
15
|
}));
|
|
11
|
-
if (typeof
|
|
16
|
+
if (typeof t == "object")
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
path: t == null ? void 0 : t[y.pathKey],
|
|
20
|
+
fileName: t == null ? void 0 : t[y.nameKey]
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
} else if (typeof r == "object") {
|
|
24
|
+
if (typeof t == "string")
|
|
12
25
|
return [
|
|
13
26
|
{
|
|
14
|
-
path:
|
|
15
|
-
fileName:
|
|
27
|
+
path: t,
|
|
28
|
+
fileName: t
|
|
16
29
|
}
|
|
17
30
|
];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return r.map((p) => ({
|
|
23
|
-
path: p == null ? void 0 : p[(t == null ? void 0 : t.pathKey) || y.pathKey],
|
|
24
|
-
fileName: p == null ? void 0 : p[(t == null ? void 0 : t.nameKey) || y.nameKey]
|
|
31
|
+
if (Array.isArray(t))
|
|
32
|
+
return t.map((p) => ({
|
|
33
|
+
path: (p == null ? void 0 : p[(r == null ? void 0 : r.pathKey) || y.pathKey]) ?? p,
|
|
34
|
+
fileName: (p == null ? void 0 : p[(r == null ? void 0 : r.nameKey) || y.nameKey]) ?? p
|
|
25
35
|
}));
|
|
26
|
-
if (typeof
|
|
36
|
+
if (typeof t == "object")
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
path: t == null ? void 0 : t[(r == null ? void 0 : r.pathKey) || y.pathKey],
|
|
40
|
+
fileName: t == null ? void 0 : t[(r == null ? void 0 : r.nameKey) || y.nameKey]
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
} else {
|
|
44
|
+
if (typeof t == "string")
|
|
27
45
|
return [
|
|
28
46
|
{
|
|
29
|
-
path:
|
|
30
|
-
fileName:
|
|
47
|
+
path: t,
|
|
48
|
+
fileName: t
|
|
31
49
|
}
|
|
32
50
|
];
|
|
33
|
-
|
|
34
|
-
|
|
51
|
+
if (Array.isArray(t))
|
|
52
|
+
return t.map((p) => typeof p == "string" ? {
|
|
53
|
+
path: p,
|
|
54
|
+
fileName: p
|
|
55
|
+
} : p);
|
|
56
|
+
if (typeof t == "object")
|
|
57
|
+
return [t];
|
|
58
|
+
}
|
|
59
|
+
return [];
|
|
35
60
|
}
|
|
36
|
-
function g(
|
|
37
|
-
|
|
38
|
-
const p = parseInt(
|
|
61
|
+
function g(r, t) {
|
|
62
|
+
r.length === 4 && (r = `#${r[1]}${r[1]}${r[2]}${r[2]}${r[3]}${r[3]}`);
|
|
63
|
+
const p = parseInt(r.slice(1, 3), 16), s = parseInt(r.slice(3, 5), 16), n = parseInt(r.slice(5, 7), 16), u = Math.round(t * 255).toString(16).padStart(2, "0");
|
|
39
64
|
return `#${p.toString(16).padStart(2, "0")}${s.toString(16).padStart(2, "0")}${n.toString(16).padStart(2, "0")}${u}`;
|
|
40
65
|
}
|
|
41
66
|
export {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ApFormDependencyProps } from '../interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
type ApFormDependencySlots = {
|
|
4
|
+
default(values: Record<string, any>): any;
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
slots: Readonly<ApFormDependencySlots> & ApFormDependencySlots;
|
|
8
|
+
refs: {};
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: DefineComponent<__VLS_TypePropsToOption<ApFormDependencyProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<ApFormDependencyProps>>>, {}, {}>;
|
|
13
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
+
type __VLS_TypePropsToOption<T> = {
|
|
17
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
+
} : {
|
|
20
|
+
type: PropType<T[K]>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|