@aplus-frontend/ui 7.10.4 → 7.10.6
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 +1 -1
- package/es/src/ap-field/slider/index.vue.d.ts +196 -412
- package/es/src/ap-field/slider/index.vue.mjs +50 -39
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +68 -67
- package/es/src/business/ap-attachment/ApAttachment.d.ts +2 -8
- package/es/src/business/ap-attachment/ApAttachment.mjs +46 -40
- package/es/src/business/ap-attachment/constans.d.ts +1 -4
- package/es/src/business/ap-attachment/constans.mjs +3 -6
- package/es/src/business/ap-attachment/index.d.ts +3 -12
- package/es/src/business/ap-ladder/components/RenderValue.mjs +25 -22
- package/es/src/business/ap-ladder/utils.d.ts +1 -0
- package/es/src/business/ap-ladder/utils.mjs +10 -9
- package/es/src/business/ap-title/ApTitle.vue.d.ts +1 -1
- package/es/src/business/ap-title/index.d.ts +3 -3
- package/es/src/business/ap-title/interface.d.ts +1 -1
- package/es/src/business/ap-upload/apUpload.vue.d.ts +9 -0
- package/es/src/business/ap-upload/apUpload.vue.mjs +22 -18
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -123
- package/es/src/business/ap-upload/components/Picture.vue2.mjs +150 -147
- package/es/src/business/ap-upload/components/SingleFile.vue2.mjs +130 -127
- package/es/src/business/ap-upload/hooks/useOss.d.ts +2 -1
- package/es/src/business/ap-upload/hooks/useOss.mjs +52 -51
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +11 -10
- package/es/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
- package/es/src/business/ap-upload-file/hook/useOss.mjs +19 -16
- package/es/src/business/ap-upload-file/interface.d.ts +3 -1
- package/es/src/business/ap-upload-file/utils/upload.mjs +22 -20
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-field/interface.d.ts +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +196 -412
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +2 -8
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/constans.d.ts +1 -4
- package/lib/src/business/ap-attachment/constans.js +1 -1
- package/lib/src/business/ap-attachment/index.d.ts +3 -12
- package/lib/src/business/ap-ladder/components/RenderValue.js +1 -1
- package/lib/src/business/ap-ladder/utils.d.ts +1 -0
- package/lib/src/business/ap-ladder/utils.js +1 -1
- package/lib/src/business/ap-title/ApTitle.vue.d.ts +1 -1
- package/lib/src/business/ap-title/index.d.ts +3 -3
- package/lib/src/business/ap-title/interface.d.ts +1 -1
- package/lib/src/business/ap-upload/apUpload.vue.d.ts +9 -0
- package/lib/src/business/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/hooks/useOss.d.ts +2 -1
- package/lib/src/business/ap-upload/hooks/useOss.js +1 -1
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
- package/lib/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
- package/lib/src/business/ap-upload-file/hook/useOss.js +1 -1
- package/lib/src/business/ap-upload-file/interface.d.ts +3 -1
- package/lib/src/business/ap-upload-file/utils/upload.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,65 +1,76 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as x, shallowRef as
|
|
2
|
-
import { Slider as
|
|
3
|
-
import { isNil as
|
|
1
|
+
import { defineComponent as B, useSlots as x, shallowRef as C, computed as b, unref as t, createElementBlock as g, createBlock as k, openBlock as n, Fragment as F, createTextVNode as S, toDisplayString as h, mergeProps as T, createSlots as V, renderList as _, withCtx as P, renderSlot as R, normalizeProps as N, guardReactiveProps as U } from "vue";
|
|
2
|
+
import { Slider as A } from "@aplus-frontend/antdv";
|
|
3
|
+
import { isNil as H, isArray as L, omit as $ } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { useControllableValue as
|
|
6
|
-
const
|
|
5
|
+
import { useControllableValue as w } from "../../hooks/useControllableValue.mjs";
|
|
6
|
+
const G = /* @__PURE__ */ B({
|
|
7
7
|
name: "ApFieldSlider",
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
10
10
|
mode: {},
|
|
11
11
|
class: {},
|
|
12
12
|
style: {},
|
|
13
|
-
|
|
13
|
+
range: { type: [Boolean, Object] },
|
|
14
|
+
value: {},
|
|
15
|
+
defaultValue: {},
|
|
16
|
+
onChange: {},
|
|
17
|
+
"onUpdate:value": {},
|
|
18
|
+
onAfterChange: {},
|
|
19
|
+
onChangeComplete: {},
|
|
20
|
+
handleStyle: {},
|
|
21
|
+
trackStyle: {},
|
|
14
22
|
prefixCls: {},
|
|
15
|
-
tooltipPrefixCls: {},
|
|
16
|
-
range: {},
|
|
17
23
|
reverse: { type: Boolean },
|
|
18
24
|
min: { default: 0 },
|
|
19
25
|
max: { default: 100 },
|
|
20
26
|
step: { default: 1 },
|
|
21
27
|
marks: {},
|
|
22
28
|
dots: { type: Boolean },
|
|
23
|
-
value: {},
|
|
24
|
-
defaultValue: {},
|
|
25
29
|
included: { type: Boolean, default: !0 },
|
|
26
30
|
disabled: { type: Boolean, default: void 0 },
|
|
31
|
+
keyboard: { type: Boolean },
|
|
27
32
|
vertical: { type: Boolean },
|
|
33
|
+
className: {},
|
|
34
|
+
rootClassName: {},
|
|
35
|
+
id: {},
|
|
36
|
+
tooltip: {},
|
|
37
|
+
autoFocus: { type: Boolean },
|
|
38
|
+
styles: {},
|
|
39
|
+
classNames: {},
|
|
40
|
+
onFocus: {},
|
|
41
|
+
onBlur: {},
|
|
42
|
+
tooltipPrefixCls: {},
|
|
28
43
|
tipFormatter: {},
|
|
29
|
-
tooltipOpen: { type: Boolean, default: void 0 },
|
|
30
44
|
tooltipVisible: { type: Boolean, default: void 0 },
|
|
31
|
-
tooltipPlacement: {},
|
|
32
45
|
getTooltipPopupContainer: {},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onBlur: {},
|
|
40
|
-
"onUpdate:value": {},
|
|
46
|
+
tooltipPlacement: {},
|
|
47
|
+
tabIndex: {},
|
|
48
|
+
ariaLabelForHandle: {},
|
|
49
|
+
ariaLabelledByForHandle: {},
|
|
50
|
+
ariaRequired: { type: Boolean },
|
|
51
|
+
ariaValueTextFormatterForHandle: {},
|
|
41
52
|
emptyText: { default: "--" }
|
|
42
53
|
},
|
|
43
54
|
emits: ["update:value"],
|
|
44
|
-
setup(
|
|
45
|
-
const p = x(), o =
|
|
46
|
-
const e = t(
|
|
47
|
-
return
|
|
55
|
+
setup(s, { expose: u, emit: i }) {
|
|
56
|
+
const p = x(), o = C(), a = s, d = i, { value: l, updateValue: m } = w(a, d), c = b(() => {
|
|
57
|
+
const e = t(l);
|
|
58
|
+
return H(e) ? a.emptyText : L(e) ? `${e[0]}-${e[1]}` : e;
|
|
48
59
|
});
|
|
49
|
-
function
|
|
60
|
+
function f() {
|
|
50
61
|
o.value?.focus?.();
|
|
51
62
|
}
|
|
52
|
-
function
|
|
63
|
+
function y() {
|
|
53
64
|
o.value?.blur?.();
|
|
54
65
|
}
|
|
55
|
-
return
|
|
56
|
-
focus:
|
|
57
|
-
blur:
|
|
58
|
-
}), (e,
|
|
59
|
-
h(
|
|
60
|
-
], 64)) : (n(),
|
|
66
|
+
return u({
|
|
67
|
+
focus: f,
|
|
68
|
+
blur: y
|
|
69
|
+
}), (e, j) => e.mode === "read" ? (n(), g(F, { key: 0 }, [
|
|
70
|
+
S(h(c.value), 1)
|
|
71
|
+
], 64)) : (n(), k(t(A), T(
|
|
61
72
|
{ key: 1 },
|
|
62
|
-
t(
|
|
73
|
+
t($)(a, [
|
|
63
74
|
"value",
|
|
64
75
|
"onUpdate:value",
|
|
65
76
|
"mode",
|
|
@@ -69,19 +80,19 @@ const I = /* @__PURE__ */ B({
|
|
|
69
80
|
{
|
|
70
81
|
ref_key: "sliderRef",
|
|
71
82
|
ref: o,
|
|
72
|
-
value: t(
|
|
73
|
-
"onUpdate:value": t(
|
|
83
|
+
value: t(l),
|
|
84
|
+
"onUpdate:value": t(m)
|
|
74
85
|
}
|
|
75
86
|
), V({ _: 2 }, [
|
|
76
|
-
|
|
87
|
+
_(p, (q, r) => ({
|
|
77
88
|
name: r,
|
|
78
|
-
fn:
|
|
79
|
-
|
|
89
|
+
fn: P((v) => [
|
|
90
|
+
R(e.$slots, r, N(U(v || {})))
|
|
80
91
|
])
|
|
81
92
|
}))
|
|
82
93
|
]), 1040, ["value", "onUpdate:value"]));
|
|
83
94
|
}
|
|
84
95
|
});
|
|
85
96
|
export {
|
|
86
|
-
|
|
97
|
+
G as default
|
|
87
98
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as O, computed as
|
|
1
|
+
import { defineComponent as O, computed as f, ref as S, createElementBlock as A, openBlock as r, mergeProps as T, unref as e, renderSlot as c, createCommentVNode as N, createVNode as p, withCtx as d, createElementVNode as s, normalizeClass as i, createBlock as C, Fragment as V, renderList as D, createSlots as j, createTextVNode as P, toDisplayString as G } from "vue";
|
|
2
2
|
import { LoadingOutlined as M } from "@ant-design/icons-vue";
|
|
3
3
|
import { Tooltip as U, TypographyText as z, Empty as $ } from "@aplus-frontend/antdv";
|
|
4
4
|
import { IconVariantDownload as R, IconApAdLineCloseAttachments as q } from "@aplus-frontend/icon";
|
|
@@ -24,114 +24,115 @@ const Y = ["onClick"], de = /* @__PURE__ */ O({
|
|
|
24
24
|
isFileAreaBorder: { type: Boolean, default: !1 }
|
|
25
25
|
},
|
|
26
26
|
setup(E) {
|
|
27
|
-
const { b: F, e:
|
|
27
|
+
const { b: F, e: a, em: k } = K("ap-appendix"), { t: u } = Q(), I = H("ap-appendix"), t = E, h = w("apUpload"), _ = w(
|
|
28
28
|
"downloadCenterTriggerConfig"
|
|
29
|
-
),
|
|
29
|
+
), v = f(
|
|
30
30
|
() => J(
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
t?.needName ?? h?.value?.needName,
|
|
32
|
+
t?.fileList ?? []
|
|
33
33
|
)
|
|
34
|
-
), x =
|
|
35
|
-
() =>
|
|
36
|
-
), g =
|
|
37
|
-
() => !(Array.isArray(
|
|
38
|
-
), o = S([]), B =
|
|
39
|
-
async function b(
|
|
40
|
-
if (!(o.value.findIndex((
|
|
41
|
-
o.value = [...o.value,
|
|
34
|
+
), x = f(
|
|
35
|
+
() => t.getOssAccess || h.value?.getOssAccess
|
|
36
|
+
), g = f(
|
|
37
|
+
() => !(Array.isArray(v.value) && v.value.length)
|
|
38
|
+
), o = S([]), B = f(() => t.title || u("ap.apAppendix.appendix"));
|
|
39
|
+
async function b(n, m) {
|
|
40
|
+
if (!(o.value.findIndex((l) => l === m) > -1)) {
|
|
41
|
+
o.value = [...o.value, m];
|
|
42
42
|
try {
|
|
43
43
|
if (_.value?.trigger) {
|
|
44
|
-
let
|
|
45
|
-
objectName:
|
|
46
|
-
fileName:
|
|
44
|
+
let l = [n].map((L) => ({
|
|
45
|
+
objectName: L.path,
|
|
46
|
+
fileName: L.fileName
|
|
47
47
|
}));
|
|
48
|
-
await _.value?.trigger(
|
|
48
|
+
await _.value?.trigger(l);
|
|
49
49
|
}
|
|
50
50
|
} finally {
|
|
51
|
-
o.value = o.value.filter((
|
|
51
|
+
o.value = o.value.filter((l) => l !== m);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
return (
|
|
55
|
+
return (n, m) => (r(), A("div", T({
|
|
56
56
|
class: [e(F)(), e(I)]
|
|
57
57
|
}, {
|
|
58
|
-
...
|
|
58
|
+
...n.$attrs
|
|
59
59
|
}, {
|
|
60
60
|
style: {
|
|
61
|
-
"--ap-appendix-column": `repeat(${Number(
|
|
61
|
+
"--ap-appendix-column": `repeat(${Number(t?.column || 2)}, 1fr)`
|
|
62
62
|
}
|
|
63
63
|
}), [
|
|
64
|
-
c(
|
|
65
|
-
fileList:
|
|
64
|
+
c(n.$slots, "title", {
|
|
65
|
+
fileList: t.fileList
|
|
66
66
|
}, () => [
|
|
67
67
|
p(W, {
|
|
68
68
|
title: B.value,
|
|
69
|
-
"help-message":
|
|
69
|
+
"help-message": t?.tooltip
|
|
70
70
|
}, {
|
|
71
|
-
suffix:
|
|
72
|
-
|
|
73
|
-
class: i([e(
|
|
71
|
+
suffix: d(() => [
|
|
72
|
+
s("div", {
|
|
73
|
+
class: i([e(a)("suffix")])
|
|
74
74
|
}, [
|
|
75
|
-
c(
|
|
76
|
-
fileList:
|
|
75
|
+
c(n.$slots, "titleSuffix", {
|
|
76
|
+
fileList: t.fileList
|
|
77
77
|
}),
|
|
78
|
-
c(
|
|
79
|
-
fileList:
|
|
78
|
+
c(n.$slots, "titleDownloadAllBtn", {
|
|
79
|
+
fileList: t.fileList
|
|
80
80
|
}, () => [
|
|
81
|
-
g.value ?
|
|
81
|
+
g.value ? N("", !0) : (r(), C(X, {
|
|
82
82
|
key: 0,
|
|
83
|
-
class: i([e(
|
|
84
|
-
text: e(
|
|
83
|
+
class: i([e(a)("download-all")]),
|
|
84
|
+
text: e(u)("ap.apAppendix.downloadAll"),
|
|
85
85
|
"get-oss-access": x.value,
|
|
86
|
-
"file-name":
|
|
86
|
+
"file-name": t?.fileList ?? [],
|
|
87
|
+
"need-name": t.needName
|
|
87
88
|
}, {
|
|
88
|
-
icon:
|
|
89
|
+
icon: d(() => [
|
|
89
90
|
p(e(R))
|
|
90
91
|
]),
|
|
91
92
|
_: 1
|
|
92
|
-
}, 8, ["class", "text", "get-oss-access", "file-name"]))
|
|
93
|
+
}, 8, ["class", "text", "get-oss-access", "file-name", "need-name"]))
|
|
93
94
|
])
|
|
94
95
|
], 2)
|
|
95
96
|
]),
|
|
96
97
|
_: 3
|
|
97
98
|
}, 8, ["title", "help-message"])
|
|
98
99
|
]),
|
|
99
|
-
g.value ?
|
|
100
|
+
g.value ? N("", !0) : c(n.$slots, "fileArea", {
|
|
100
101
|
key: 0,
|
|
101
|
-
fileList:
|
|
102
|
+
fileList: t.fileList
|
|
102
103
|
}, () => [
|
|
103
|
-
|
|
104
|
+
s("div", {
|
|
104
105
|
class: i({
|
|
105
|
-
[e(
|
|
106
|
-
[e(k)("file-area", "border")]: !!
|
|
106
|
+
[e(a)("file-area")]: !0,
|
|
107
|
+
[e(k)("file-area", "border")]: !!t.isFileAreaBorder
|
|
107
108
|
})
|
|
108
109
|
}, [
|
|
109
|
-
|
|
110
|
-
class: i([e(
|
|
110
|
+
s("div", {
|
|
111
|
+
class: i([e(a)("file-area-content")])
|
|
111
112
|
}, [
|
|
112
|
-
(r(!0),
|
|
113
|
-
key:
|
|
113
|
+
(r(!0), A(V, null, D(v.value, (y, l) => (r(), A("div", {
|
|
114
|
+
key: l,
|
|
114
115
|
class: i({
|
|
115
|
-
[e(
|
|
116
|
-
[e(k)("file-area-content-item", "loading")]: o.value.includes(
|
|
116
|
+
[e(a)("file-area-content-item")]: !0,
|
|
117
|
+
[e(k)("file-area-content-item", "loading")]: o.value.includes(l)
|
|
117
118
|
})
|
|
118
119
|
}, [
|
|
119
120
|
p(e(U), null, j({
|
|
120
|
-
default:
|
|
121
|
-
|
|
121
|
+
default: d(() => [
|
|
122
|
+
s("div", {
|
|
122
123
|
class: i({
|
|
123
|
-
[e(
|
|
124
|
-
[e(
|
|
124
|
+
[e(a)("file-area-content-item-content")]: !0,
|
|
125
|
+
[e(a)("file-area-content-item--loading-content")]: o.value.includes(l)
|
|
125
126
|
}),
|
|
126
|
-
onClick: (
|
|
127
|
+
onClick: (L) => b(y, l)
|
|
127
128
|
}, [
|
|
128
|
-
|
|
129
|
-
class: i([e(
|
|
129
|
+
s("div", {
|
|
130
|
+
class: i([e(a)("file-area-content-item-icon")])
|
|
130
131
|
}, [
|
|
131
|
-
o.value.includes(
|
|
132
|
+
o.value.includes(l) ? (r(), C(e(M), { key: 0 })) : (r(), C(e(q), { key: 1 }))
|
|
132
133
|
], 2),
|
|
133
|
-
|
|
134
|
-
class: i([e(
|
|
134
|
+
s("div", {
|
|
135
|
+
class: i([e(a)("file-area-content-item-file-name")])
|
|
135
136
|
}, [
|
|
136
137
|
p(e(z), {
|
|
137
138
|
ellipsis: "",
|
|
@@ -142,10 +143,10 @@ const Y = ["onClick"], de = /* @__PURE__ */ O({
|
|
|
142
143
|
]),
|
|
143
144
|
_: 2
|
|
144
145
|
}, [
|
|
145
|
-
o.value.includes(
|
|
146
|
+
o.value.includes(l) ? void 0 : {
|
|
146
147
|
name: "title",
|
|
147
|
-
fn:
|
|
148
|
-
P(G(e(
|
|
148
|
+
fn: d(() => [
|
|
149
|
+
P(G(e(u)("ap.apAppendix.downloadFile")), 1)
|
|
149
150
|
]),
|
|
150
151
|
key: "0"
|
|
151
152
|
}
|
|
@@ -154,19 +155,19 @@ const Y = ["onClick"], de = /* @__PURE__ */ O({
|
|
|
154
155
|
], 2)
|
|
155
156
|
], 2)
|
|
156
157
|
]),
|
|
157
|
-
g.value ? c(
|
|
158
|
-
|
|
159
|
-
class: i([e(
|
|
158
|
+
g.value ? c(n.$slots, "empty", { key: 1 }, () => [
|
|
159
|
+
s("div", {
|
|
160
|
+
class: i([e(a)("empty")])
|
|
160
161
|
}, [
|
|
161
|
-
|
|
162
|
-
class: i([e(
|
|
162
|
+
s("div", {
|
|
163
|
+
class: i([e(a)("empty-content")])
|
|
163
164
|
}, [
|
|
164
165
|
p(e($), {
|
|
165
166
|
image: e($).PRESENTED_IMAGE_SIMPLE
|
|
166
167
|
}, null, 8, ["image"])
|
|
167
168
|
], 2)
|
|
168
169
|
], 2)
|
|
169
|
-
]) :
|
|
170
|
+
]) : N("", !0)
|
|
170
171
|
], 16));
|
|
171
172
|
}
|
|
172
173
|
});
|
|
@@ -31,10 +31,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
31
31
|
nameKey?: string;
|
|
32
32
|
pathKey?: string;
|
|
33
33
|
}>;
|
|
34
|
-
default:
|
|
35
|
-
nameKey: string;
|
|
36
|
-
pathKey: string;
|
|
37
|
-
};
|
|
34
|
+
default: undefined;
|
|
38
35
|
};
|
|
39
36
|
getOssAccess: {
|
|
40
37
|
type: PropType< ApAttachmentProps["getOssAccess"]>;
|
|
@@ -76,10 +73,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
76
73
|
nameKey?: string;
|
|
77
74
|
pathKey?: string;
|
|
78
75
|
}>;
|
|
79
|
-
default:
|
|
80
|
-
nameKey: string;
|
|
81
|
-
pathKey: string;
|
|
82
|
-
};
|
|
76
|
+
default: undefined;
|
|
83
77
|
};
|
|
84
78
|
getOssAccess: {
|
|
85
79
|
type: PropType< ApAttachmentProps["getOssAccess"]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { LoadingOutlined as
|
|
1
|
+
import { defineComponent as U, ref as k, useSlots as W, computed as o, cloneVNode as _, toRaw as g, unref as j, createVNode as t, createTextVNode as R } from "vue";
|
|
2
|
+
import { LoadingOutlined as p } from "@ant-design/icons-vue";
|
|
3
3
|
import { Tooltip as B, Popover as G } from "@aplus-frontend/antdv";
|
|
4
4
|
import { debounce as H, isArray as M } from "lodash-unified";
|
|
5
5
|
import { useToken as q } from "../../config-provider/hooks/use-token.mjs";
|
|
@@ -12,44 +12,50 @@ import X from "./style/index.mjs";
|
|
|
12
12
|
import { useNamespace as Y } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
13
|
import { useGlobalConfig as T } from "../../config-provider/hooks/use-global-config.mjs";
|
|
14
14
|
import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
|
|
15
|
-
const fe = /* @__PURE__ */
|
|
15
|
+
const fe = /* @__PURE__ */ U({
|
|
16
16
|
name: "ApAttachment",
|
|
17
17
|
props: Q(),
|
|
18
18
|
setup(e, {
|
|
19
|
-
emit:
|
|
19
|
+
emit: N
|
|
20
20
|
}) {
|
|
21
21
|
const {
|
|
22
22
|
b: x,
|
|
23
23
|
e: a
|
|
24
|
-
} = Y("ap-attachment"),
|
|
25
|
-
token:
|
|
24
|
+
} = Y("ap-attachment"), y = X("ap-attachment"), r = T("apUpload"), L = T("downloadCenterTriggerConfig"), {
|
|
25
|
+
token: C
|
|
26
26
|
} = q(), {
|
|
27
27
|
lang: O,
|
|
28
|
-
t:
|
|
29
|
-
} = Z(), i = k(!1), c = k(""),
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
t: d
|
|
29
|
+
} = Z(), i = k(!1), c = k(""), f = W(), K = o(() => O.value === "zh-cn" ? "zh_CN" : "en_US"), s = o(() => e.needName ?? (r?.value?.needName === !0 ? {
|
|
30
|
+
nameKey: "fileName",
|
|
31
|
+
pathKey: "path"
|
|
32
|
+
} : r?.value?.needName ?? {
|
|
33
|
+
nameKey: "fileName",
|
|
34
|
+
pathKey: "filePath"
|
|
35
|
+
})), v = o(() => e.attachmentList.length === 1), w = o(() => s.value ? e.attachmentList.length > 0 && s.value && s.value?.nameKey ? e.attachmentList[0][s.value.nameKey] : "" : e.attachmentList.length > 0 ? e.attachmentList[0].fileName : ""), P = o(() => v.value ? w.value : d("ap.apAttachment.downloadall")), A = o(() => ({
|
|
36
|
+
"--download-main-color": C.value?.colorLink,
|
|
37
|
+
"--download-main-color-opacity": J(C.value?.colorLink, 0.6)
|
|
38
|
+
})), I = o(() => e.getOssAccess || r.value?.getOssAccess), S = o(() => {
|
|
39
|
+
const l = f.default ? f.default()[0] : null;
|
|
40
|
+
return l ? _(l, {
|
|
35
41
|
style: {
|
|
36
42
|
"font-size": "16px"
|
|
37
43
|
}
|
|
38
44
|
}) : null;
|
|
39
|
-
}),
|
|
45
|
+
}), h = H(async (l, u) => {
|
|
40
46
|
if (!e.disabled) {
|
|
41
|
-
i.value = !0,
|
|
47
|
+
i.value = !0, u && (c.value = u);
|
|
42
48
|
try {
|
|
43
|
-
const n = M(
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
49
|
+
const n = M(g(l)) ? g(l) : [g(l)];
|
|
50
|
+
if (L.value?.trigger) {
|
|
51
|
+
const m = F(s.value, n).map((b) => ({
|
|
46
52
|
objectName: b.path,
|
|
47
53
|
fileName: b.fileName
|
|
48
54
|
}));
|
|
49
|
-
|
|
55
|
+
L.value?.trigger(m), N("downloadCallback", m);
|
|
50
56
|
} else {
|
|
51
|
-
const
|
|
52
|
-
|
|
57
|
+
const m = await (await E(I.value, j(K))).downloadFile(F(e.needName, n));
|
|
58
|
+
N("downloadCallback", m);
|
|
53
59
|
}
|
|
54
60
|
} catch (n) {
|
|
55
61
|
D(!1, n);
|
|
@@ -57,56 +63,56 @@ const fe = /* @__PURE__ */ W({
|
|
|
57
63
|
i.value = !1, c.value = "";
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
|
-
}, 500),
|
|
61
|
-
class: [a("file-list"),
|
|
66
|
+
}, 500), V = (l) => l && l.length > 0 ? t("ul", {
|
|
67
|
+
class: [a("file-list"), y.value],
|
|
62
68
|
style: A.value
|
|
63
|
-
}, [l.map((
|
|
69
|
+
}, [l.map((u, n) => t("li", {
|
|
64
70
|
key: n,
|
|
65
71
|
class: [a("file-item")],
|
|
66
|
-
onClick: () =>
|
|
72
|
+
onClick: () => h(u, n + 1)
|
|
67
73
|
}, [i.value && c.value === n + 1 ? t("span", {
|
|
68
74
|
class: [a("spin")]
|
|
69
|
-
}, [t(
|
|
75
|
+
}, [t(p, {
|
|
70
76
|
spin: !0
|
|
71
|
-
}, null)]) : null,
|
|
77
|
+
}, null)]) : null, u.fileName])), t("li", {
|
|
72
78
|
class: [a("download-all")],
|
|
73
|
-
onClick: () =>
|
|
79
|
+
onClick: () => h(e.attachmentList, "all")
|
|
74
80
|
}, [i.value && c.value === "all" ? t("span", {
|
|
75
81
|
class: [a("spin")]
|
|
76
|
-
}, [t(
|
|
82
|
+
}, [t(p, {
|
|
77
83
|
spin: !0
|
|
78
|
-
}, null)]) : null,
|
|
84
|
+
}, null)]) : null, d("ap.apAttachment.downloadall")])]) : null;
|
|
79
85
|
return () => e.attachmentList?.length > 0 && t("div", {
|
|
80
|
-
class: [x(),
|
|
86
|
+
class: [x(), y.value],
|
|
81
87
|
style: [A.value]
|
|
82
88
|
}, [t(B, {
|
|
83
|
-
title:
|
|
89
|
+
title: P.value,
|
|
84
90
|
placement: e.textToolTipPlacement,
|
|
85
91
|
color: e.toolTipBgColor
|
|
86
92
|
}, {
|
|
87
93
|
default: () => [t("div", {
|
|
88
94
|
class: [a("content")],
|
|
89
|
-
onClick: () => v
|
|
95
|
+
onClick: () => h(v.value ? e.attachmentList[0] : e.attachmentList, "global")
|
|
90
96
|
}, [i.value && c.value === "global" ? t("div", {
|
|
91
97
|
class: [a("spin")]
|
|
92
|
-
}, [t(
|
|
98
|
+
}, [t(p, {
|
|
93
99
|
spin: !0
|
|
94
|
-
}, null)]) : null,
|
|
100
|
+
}, null)]) : null, f.default ? t("div", {
|
|
95
101
|
class: [a("text-render")]
|
|
96
|
-
}, [
|
|
102
|
+
}, [S.value, R(" ")]) : null, t("div", {
|
|
97
103
|
class: [a("text-inner")],
|
|
98
104
|
style: {
|
|
99
105
|
"max-width": e.maxWidth ? e.maxWidth + "px" : "auto"
|
|
100
106
|
}
|
|
101
|
-
}, [
|
|
107
|
+
}, [w.value])])]
|
|
102
108
|
}), t(G, {
|
|
103
|
-
content:
|
|
109
|
+
content: V(e.attachmentList),
|
|
104
110
|
placement: e.fileMorePopoverPlacement,
|
|
105
111
|
color: "#fff"
|
|
106
112
|
}, {
|
|
107
|
-
default: () => [!
|
|
113
|
+
default: () => [!v.value && t("div", {
|
|
108
114
|
class: [a("more")]
|
|
109
|
-
}, [
|
|
115
|
+
}, [d("ap.apAttachment.more")])]
|
|
110
116
|
})]);
|
|
111
117
|
}
|
|
112
118
|
});
|
|
@@ -30,10 +30,7 @@ export declare const ApAttachmentProps: () => {
|
|
|
30
30
|
nameKey?: string;
|
|
31
31
|
pathKey?: string;
|
|
32
32
|
}>;
|
|
33
|
-
default:
|
|
34
|
-
nameKey: string;
|
|
35
|
-
pathKey: string;
|
|
36
|
-
};
|
|
33
|
+
default: undefined;
|
|
37
34
|
};
|
|
38
35
|
getOssAccess: {
|
|
39
36
|
type: PropType<_ApAttachmentProps["getOssAccess"]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t = () => ({
|
|
2
2
|
attachmentList: {
|
|
3
3
|
type: Array,
|
|
4
4
|
default: [],
|
|
@@ -25,10 +25,7 @@ const e = () => ({
|
|
|
25
25
|
},
|
|
26
26
|
needName: {
|
|
27
27
|
type: Object,
|
|
28
|
-
default:
|
|
29
|
-
nameKey: "fileName",
|
|
30
|
-
pathKey: "filePath"
|
|
31
|
-
})
|
|
28
|
+
default: void 0
|
|
32
29
|
},
|
|
33
30
|
getOssAccess: {
|
|
34
31
|
type: Function
|
|
@@ -42,5 +39,5 @@ const e = () => ({
|
|
|
42
39
|
}
|
|
43
40
|
});
|
|
44
41
|
export {
|
|
45
|
-
|
|
42
|
+
t as ApAttachmentProps
|
|
46
43
|
};
|
|
@@ -33,10 +33,7 @@ declare const ApAttachment: {
|
|
|
33
33
|
nameKey?: string;
|
|
34
34
|
pathKey?: string;
|
|
35
35
|
}>;
|
|
36
|
-
default:
|
|
37
|
-
nameKey: string;
|
|
38
|
-
pathKey: string;
|
|
39
|
-
};
|
|
36
|
+
default: undefined;
|
|
40
37
|
};
|
|
41
38
|
getOssAccess: {
|
|
42
39
|
type: PropType< ApAttachmentProps["getOssAccess"]>;
|
|
@@ -96,10 +93,7 @@ declare const ApAttachment: {
|
|
|
96
93
|
nameKey?: string;
|
|
97
94
|
pathKey?: string;
|
|
98
95
|
}>;
|
|
99
|
-
default:
|
|
100
|
-
nameKey: string;
|
|
101
|
-
pathKey: string;
|
|
102
|
-
};
|
|
96
|
+
default: undefined;
|
|
103
97
|
};
|
|
104
98
|
getOssAccess: {
|
|
105
99
|
type: PropType< ApAttachmentProps["getOssAccess"]>;
|
|
@@ -156,10 +150,7 @@ declare const ApAttachment: {
|
|
|
156
150
|
nameKey?: string;
|
|
157
151
|
pathKey?: string;
|
|
158
152
|
}>;
|
|
159
|
-
default:
|
|
160
|
-
nameKey: string;
|
|
161
|
-
pathKey: string;
|
|
162
|
-
};
|
|
153
|
+
default: undefined;
|
|
163
154
|
};
|
|
164
155
|
getOssAccess: {
|
|
165
156
|
type: PropType< ApAttachmentProps["getOssAccess"]>;
|