@aplus-frontend/ui 0.1.25 → 0.1.27
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-download/ap-download.vue.d.ts +7 -3
- package/es/src/ap-download/ap-download.vue.mjs +50 -35
- package/es/src/ap-download/interface.d.ts +3 -11
- package/es/src/ap-download/style/ap-download.css +3 -0
- package/es/src/ap-form/ap-form-item.vue.mjs +26 -26
- package/es/src/ap-table/ap-table.vue.mjs +231 -183
- package/es/src/ap-table/components/interface.d.ts +33 -1
- package/es/src/ap-table/components/setting/images/icon_carst_down.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/images/icon_fill_right.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +152 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +96 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +51 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +140 -0
- package/es/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/es/src/ap-table/components/setting/sorter/context.mjs +20 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +199 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +75 -0
- package/es/src/ap-table/components/setting/utils.d.ts +17 -0
- package/es/src/ap-table/components/setting/utils.mjs +48 -0
- package/es/src/ap-table/components/style/setting/modal.css +39 -0
- package/es/src/ap-table/components/style/setting/select-group.css +7 -0
- package/es/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/es/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/es/src/ap-table/components/style/setting/sorter.css +26 -0
- package/es/src/ap-table/constants.d.ts +31 -8
- package/es/src/ap-table/constants.mjs +41 -53
- package/es/src/ap-table/context.d.ts +31 -0
- package/es/src/ap-table/context.mjs +20 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/es/src/ap-table/hooks/use-table-column-state.mjs +46 -0
- package/es/src/ap-table/hooks/use-table-content-height.mjs +19 -19
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging.mjs +87 -82
- package/es/src/ap-table/interface.d.ts +51 -1
- package/es/src/ap-table/style/ap-table.css +29 -1
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/ap-table/utils.mjs +82 -82
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +91 -89
- package/es/src/ap-upload/components/Picture.vue2.mjs +114 -112
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +10 -7
- package/es/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/es/src/business/ap-attachment/ApAttachment.mjs +45 -42
- package/es/src/business/ap-attachment/style.css +2 -0
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +114 -84
- package/es/src/business/ap-ladder/interface.d.ts +42 -0
- package/es/src/business/ap-ladder/interface.mjs +10 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +8 -3
- package/es/src/business/hooks/usePageListApTable.mjs +27 -17
- package/es/src/business/hooks/useTableRefresh.d.ts +3 -4
- package/es/src/business/hooks/useTableRefresh.mjs +9 -9
- package/es/src/business/index.d.ts +4 -4
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/locale/lang/en.mjs +14 -0
- package/es/src/locale/lang/zh-cn.mjs +14 -0
- package/es/src/theme/ap-attachment/ap-attachment.css +2 -0
- package/es/src/theme/ap-download/ap-download.css +3 -0
- package/es/src/theme/ap-table/ap-table.css +29 -1
- package/es/src/theme/ap-table/setting/modal.css +39 -0
- package/es/src/theme/ap-table/setting/select-group.css +7 -0
- package/es/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/es/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/es/src/theme/ap-table/setting/sorter.css +26 -0
- package/es/src/theme/css-var/index.mjs +22 -12
- package/lib/src/ap-download/ap-download.vue.d.ts +7 -3
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/interface.d.ts +3 -11
- package/lib/src/ap-download/style/ap-download.css +3 -0
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/interface.d.ts +33 -1
- package/lib/src/ap-table/components/setting/images/icon_carst_down.svg.js +1 -0
- package/lib/src/ap-table/components/setting/images/icon_fill_right.svg.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/lib/src/ap-table/components/setting/sorter/context.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/utils.d.ts +17 -0
- package/lib/src/ap-table/components/setting/utils.js +1 -0
- package/lib/src/ap-table/components/style/setting/modal.css +39 -0
- package/lib/src/ap-table/components/style/setting/select-group.css +7 -0
- package/lib/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/lib/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/lib/src/ap-table/components/style/setting/sorter.css +26 -0
- package/lib/src/ap-table/constants.d.ts +31 -8
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/context.d.ts +31 -0
- package/lib/src/ap-table/context.js +1 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -0
- package/lib/src/ap-table/hooks/use-table-content-height.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +51 -1
- package/lib/src/ap-table/style/ap-table.css +29 -1
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/style.css +2 -0
- package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
- package/lib/src/business/ap-ladder/interface.d.ts +42 -0
- package/lib/src/business/ap-ladder/interface.js +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +8 -3
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/lib/src/business/hooks/useTableRefresh.d.ts +3 -4
- package/lib/src/business/hooks/useTableRefresh.js +1 -1
- package/lib/src/business/index.d.ts +4 -4
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-attachment/ap-attachment.css +2 -0
- package/lib/src/theme/ap-download/ap-download.css +3 -0
- package/lib/src/theme/ap-table/ap-table.css +29 -1
- package/lib/src/theme/ap-table/setting/modal.css +39 -0
- package/lib/src/theme/ap-table/setting/select-group.css +7 -0
- package/lib/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/lib/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/lib/src/theme/ap-table/setting/sorter.css +26 -0
- package/lib/src/theme/css-var/index.js +1 -1
- package/package.json +3 -2
|
@@ -1,74 +1,76 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as J, inject as u, ref as R, watch as K, openBlock as f, createElementBlock as h, normalizeClass as Q, unref as i, createElementVNode as p, Fragment as W, renderList as X, withDirectives as Y, createVNode as C, createCommentVNode as $, vShow as Z, toDisplayString as U } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as
|
|
4
|
-
import { CloseOutlined as
|
|
5
|
-
import { useOss as
|
|
6
|
-
import { fileMatchesAccept as
|
|
7
|
-
import { message as
|
|
3
|
+
import { getPath as F, getName as ee, getReturnData as w } from "../utils/returnData.mjs";
|
|
4
|
+
import { CloseOutlined as te, PlusOutlined as ne } from "@ant-design/icons-vue";
|
|
5
|
+
import { useOss as ae, getOssInstance as D } from "../hooks/useOss.mjs";
|
|
6
|
+
import { fileMatchesAccept as se, getAcceptText as oe } from "../utils/accept.mjs";
|
|
7
|
+
import { message as d, Progress as ie } from "ant-design-vue";
|
|
8
8
|
import "../styles/picture.css";
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
const
|
|
9
|
+
import { useLocale as ce } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
const re = ["accept"], le = { class: "picture-context" }, pe = { class: "picture-item-box" }, de = ["src"], me = { class: "picture-item-shadow" }, fe = ["onClick"], he = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "picture-item-uploading"
|
|
14
|
-
},
|
|
14
|
+
}, ge = { class: "picture-title" }, ve = { key: 0 }, _e = { key: 1 }, ze = /* @__PURE__ */ J({
|
|
15
15
|
__name: "Picture",
|
|
16
|
-
setup(
|
|
17
|
-
const { t: r } =
|
|
18
|
-
let
|
|
16
|
+
setup(xe) {
|
|
17
|
+
const { t: r } = ce(), { b: A } = ue("ap-upload-picture"), { put: E } = ae(), O = u("theme"), T = u("dirName"), y = u("accept") || "image/*", k = u("maxSize") ?? 5, N = u("title"), l = u("maxCount") ?? 10, g = u("uploadingCount"), P = u("beforeUpload"), S = u("customRequest"), b = u("getOssAccess"), x = R(null), c = u("value"), v = u("needName");
|
|
18
|
+
let o = R([]);
|
|
19
19
|
const _ = [];
|
|
20
|
-
|
|
20
|
+
K(
|
|
21
21
|
() => c == null ? void 0 : c.value,
|
|
22
22
|
async function(e) {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
var a;
|
|
24
|
+
if (!((a = o == null ? void 0 : o.value) != null && a.length) && e) {
|
|
25
|
+
const n = [];
|
|
25
26
|
for (let t of e) {
|
|
26
|
-
const
|
|
27
|
-
...new File([t],
|
|
27
|
+
const s = F(v, t), m = ee(v, t), I = await D(b), G = await I.getSignatureUrl(s), H = {
|
|
28
|
+
...new File([t], m, {}),
|
|
28
29
|
uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
|
|
29
|
-
thumbUrl:
|
|
30
|
+
thumbUrl: G,
|
|
30
31
|
status: "success",
|
|
31
32
|
percent: 100,
|
|
32
|
-
path:
|
|
33
|
+
path: s
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
+
n.push(H), I.destroy();
|
|
35
36
|
}
|
|
36
|
-
if (l &&
|
|
37
|
-
|
|
37
|
+
if (l && n.length > l) {
|
|
38
|
+
d.warning(
|
|
38
39
|
r("ap.apUpload.fileInitializationException", {
|
|
39
40
|
maxCount: l
|
|
40
41
|
})
|
|
41
42
|
);
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
n.forEach((t) => {
|
|
46
|
+
o.value.push(t), _.push({
|
|
46
47
|
uid: t.uid,
|
|
47
48
|
path: t.path
|
|
48
49
|
});
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
|
-
}
|
|
52
|
+
},
|
|
53
|
+
{ immediate: !0 }
|
|
52
54
|
);
|
|
53
|
-
function
|
|
55
|
+
function B() {
|
|
54
56
|
var e;
|
|
55
57
|
(e = x.value) == null || e.click();
|
|
56
58
|
}
|
|
57
|
-
function
|
|
59
|
+
function q(e) {
|
|
58
60
|
const a = e.target;
|
|
59
61
|
L(a == null ? void 0 : a.files);
|
|
60
62
|
}
|
|
61
63
|
function L(e) {
|
|
62
64
|
if (e != null && e.length)
|
|
63
65
|
for (let a = 0; a < e.length; a++)
|
|
64
|
-
|
|
66
|
+
M(e[a]);
|
|
65
67
|
x.value && (x.value.value = "");
|
|
66
68
|
}
|
|
67
69
|
let z;
|
|
68
|
-
function
|
|
69
|
-
if (l && l > 1 &&
|
|
70
|
+
function M(e) {
|
|
71
|
+
if (l && l > 1 && o.value.length >= l)
|
|
70
72
|
return clearTimeout(z), z = setTimeout(() => {
|
|
71
|
-
|
|
73
|
+
d.warning(
|
|
72
74
|
r("ap.apUpload.maxUploadPicture", { maxCount: l })
|
|
73
75
|
);
|
|
74
76
|
}), !1;
|
|
@@ -77,45 +79,45 @@ const ue = ["accept"], re = { class: "picture-context" }, le = { class: "picture
|
|
|
77
79
|
return !1;
|
|
78
80
|
} else {
|
|
79
81
|
if (e.size > k * 1024 * 1024)
|
|
80
|
-
return
|
|
82
|
+
return d.warning(
|
|
81
83
|
r("ap.apUpload.maxUploadFileSize", { maxSize: k })
|
|
82
84
|
), !1;
|
|
83
|
-
if (!/image\/\w+/.test(e.type) || !
|
|
84
|
-
return
|
|
85
|
+
if (!/image\/\w+/.test(e.type) || !se(e, y))
|
|
86
|
+
return d.warning(r("ap.apUpload.pictureFormatNotSupported")), !1;
|
|
85
87
|
}
|
|
86
88
|
const a = new FileReader();
|
|
87
89
|
a.readAsDataURL(e), a.onload = function() {
|
|
88
|
-
const
|
|
90
|
+
const n = {
|
|
89
91
|
...e,
|
|
90
92
|
uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
|
|
91
93
|
thumbUrl: this.result,
|
|
92
94
|
status: "uploading",
|
|
93
95
|
percent: 0
|
|
94
96
|
};
|
|
95
|
-
|
|
97
|
+
V(n, e);
|
|
96
98
|
}, a.onerror = function() {
|
|
97
|
-
|
|
99
|
+
d.warning(r("ap.apUpload.imageParsingFailed"));
|
|
98
100
|
};
|
|
99
101
|
}
|
|
100
|
-
async function
|
|
102
|
+
async function V(e, a) {
|
|
101
103
|
if (g.value++, typeof S == "function") {
|
|
102
104
|
S({
|
|
103
|
-
onProgress: (
|
|
104
|
-
const
|
|
105
|
-
|
|
105
|
+
onProgress: (n) => {
|
|
106
|
+
const t = o.value.find((s) => s.uid === e.uid);
|
|
107
|
+
t && (t.percent = n);
|
|
106
108
|
},
|
|
107
|
-
onError: (
|
|
108
|
-
|
|
109
|
-
const
|
|
109
|
+
onError: (n) => {
|
|
110
|
+
d.warning(n || r("ap.apUpload.networkAnomaly"));
|
|
111
|
+
const t = o.value.findIndex(
|
|
110
112
|
(s) => s.uid === e.uid
|
|
111
113
|
);
|
|
112
|
-
|
|
114
|
+
t > -1 && o.value.splice(t, 1), g.value--;
|
|
113
115
|
},
|
|
114
|
-
onSuccess: (
|
|
115
|
-
const
|
|
116
|
-
|
|
116
|
+
onSuccess: (n) => {
|
|
117
|
+
const t = o.value.find((s) => s.uid === e.uid);
|
|
118
|
+
t && (t.status = "success", t.path = n), c.value ? c.value.push(w(v, n, a.name)) : c.value = [w(v, n, a.name)], _.push({
|
|
117
119
|
uid: e.uid,
|
|
118
|
-
path:
|
|
120
|
+
path: n
|
|
119
121
|
}), g.value--;
|
|
120
122
|
},
|
|
121
123
|
file: a
|
|
@@ -123,117 +125,117 @@ const ue = ["accept"], re = { class: "picture-context" }, le = { class: "picture
|
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
127
|
try {
|
|
126
|
-
const
|
|
127
|
-
e.oss =
|
|
128
|
+
const n = await D(b);
|
|
129
|
+
e.oss = n, o.value.push(e), E({
|
|
128
130
|
file: a,
|
|
129
|
-
dirName:
|
|
130
|
-
oss:
|
|
131
|
-
successCallBack(
|
|
132
|
-
const s =
|
|
133
|
-
s && (s.status = "success", s.path =
|
|
131
|
+
dirName: T,
|
|
132
|
+
oss: n,
|
|
133
|
+
successCallBack(t) {
|
|
134
|
+
const s = o.value.find((m) => m.uid === e.uid);
|
|
135
|
+
s && (s.status = "success", s.path = t), c.value ? c.value.push(w(v, t, a.name)) : c.value = [w(v, t, a.name)], _.push({
|
|
134
136
|
uid: e.uid,
|
|
135
|
-
path:
|
|
137
|
+
path: t
|
|
136
138
|
}), g.value--;
|
|
137
139
|
},
|
|
138
|
-
errorCallBack(
|
|
139
|
-
|
|
140
|
-
const s =
|
|
141
|
-
(
|
|
140
|
+
errorCallBack(t) {
|
|
141
|
+
d.warning(t || r("ap.apUpload.networkAnomaly"));
|
|
142
|
+
const s = o.value.findIndex(
|
|
143
|
+
(m) => m.uid === e.uid
|
|
142
144
|
);
|
|
143
|
-
s > -1 &&
|
|
145
|
+
s > -1 && o.value.splice(s, 1), g.value--;
|
|
144
146
|
},
|
|
145
|
-
progressCallBack(
|
|
146
|
-
const s =
|
|
147
|
-
s && (s.percent =
|
|
147
|
+
progressCallBack(t) {
|
|
148
|
+
const s = o.value.find((m) => m.uid === e.uid);
|
|
149
|
+
s && (s.percent = t);
|
|
148
150
|
}
|
|
149
151
|
});
|
|
150
|
-
} catch (
|
|
151
|
-
|
|
152
|
-
typeof (
|
|
152
|
+
} catch (n) {
|
|
153
|
+
d.warning(
|
|
154
|
+
typeof (n == null ? void 0 : n.message) == "string" ? n.message : r("ap.apUpload.networkAnomaly")
|
|
153
155
|
);
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
+
const t = o.value.findIndex((s) => s.uid === e.uid);
|
|
157
|
+
t > -1 && o.value.splice(t, 1), g.value--;
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
160
|
+
function j(e) {
|
|
161
|
+
var n;
|
|
160
162
|
if (e.path) {
|
|
161
163
|
if (Array.isArray(c.value)) {
|
|
162
|
-
const
|
|
164
|
+
const t = _.findIndex(
|
|
163
165
|
(s) => s.uid === e.uid
|
|
164
166
|
);
|
|
165
|
-
|
|
167
|
+
t >= 0 && (c == null || c.value.splice(t, 1), _.splice(t, 1)), c.value.length === 0 && (c.value = void 0);
|
|
166
168
|
}
|
|
167
169
|
} else
|
|
168
|
-
(
|
|
169
|
-
const a =
|
|
170
|
-
(
|
|
170
|
+
(n = e == null ? void 0 : e.oss) == null || n.pauseUpload();
|
|
171
|
+
const a = o.value.findIndex(
|
|
172
|
+
(t) => t.uid === e.uid
|
|
171
173
|
);
|
|
172
|
-
return
|
|
174
|
+
return o.value.splice(a, 1), Promise.resolve(!0);
|
|
173
175
|
}
|
|
174
176
|
return (e, a) => (f(), h("div", {
|
|
175
|
-
class:
|
|
176
|
-
[
|
|
177
|
-
[
|
|
177
|
+
class: Q({
|
|
178
|
+
[i(A)()]: !0,
|
|
179
|
+
[i(A)("admin")]: i(O) === "admin"
|
|
178
180
|
})
|
|
179
181
|
}, [
|
|
180
|
-
|
|
182
|
+
p("input", {
|
|
181
183
|
style: { display: "none" },
|
|
182
184
|
type: "file",
|
|
183
185
|
ref_key: "fileRef",
|
|
184
186
|
ref: x,
|
|
185
|
-
accept:
|
|
186
|
-
onChange:
|
|
187
|
-
}, null, 40,
|
|
188
|
-
|
|
189
|
-
(f(!0), h(
|
|
187
|
+
accept: i(y),
|
|
188
|
+
onChange: q
|
|
189
|
+
}, null, 40, re),
|
|
190
|
+
p("div", le, [
|
|
191
|
+
(f(!0), h(W, null, X(i(o), (n) => (f(), h("div", {
|
|
190
192
|
class: "picture-item",
|
|
191
|
-
key:
|
|
193
|
+
key: n.uid
|
|
192
194
|
}, [
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
src:
|
|
195
|
+
p("div", pe, [
|
|
196
|
+
p("img", {
|
|
197
|
+
src: n.thumbUrl,
|
|
196
198
|
alt: ""
|
|
197
|
-
}, null, 8,
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
}, null, 8, de),
|
|
200
|
+
Y(p("div", me, [
|
|
201
|
+
p("div", {
|
|
200
202
|
class: "picture-item-close",
|
|
201
|
-
onClick: (
|
|
203
|
+
onClick: (t) => j(n)
|
|
202
204
|
}, [
|
|
203
|
-
C(
|
|
204
|
-
], 8,
|
|
205
|
-
|
|
206
|
-
C(
|
|
207
|
-
percent:
|
|
205
|
+
C(i(te))
|
|
206
|
+
], 8, fe),
|
|
207
|
+
n.status === "uploading" ? (f(), h("div", he, [
|
|
208
|
+
C(i(ie), {
|
|
209
|
+
percent: n.percent,
|
|
208
210
|
strokeColor: "#ffffff",
|
|
209
211
|
trailColor: "rgba(255, 255, 255, 0.3)",
|
|
210
212
|
size: 4,
|
|
211
213
|
showInfo: !1
|
|
212
214
|
}, null, 8, ["percent"])
|
|
213
|
-
])) :
|
|
215
|
+
])) : $("", !0)
|
|
214
216
|
], 512), [
|
|
215
|
-
[
|
|
217
|
+
[Z, n.status === "uploading"]
|
|
216
218
|
])
|
|
217
219
|
])
|
|
218
220
|
]))), 128)),
|
|
219
|
-
|
|
221
|
+
i(l) === void 0 || i(o).length < i(l) ? (f(), h("div", {
|
|
220
222
|
key: 0,
|
|
221
223
|
class: "picture-upload",
|
|
222
|
-
onClick:
|
|
224
|
+
onClick: B
|
|
223
225
|
}, [
|
|
224
|
-
C(
|
|
225
|
-
|
|
226
|
-
])) :
|
|
226
|
+
C(i(ne)),
|
|
227
|
+
p("div", null, U(i(r)("ap.apUpload.update")), 1)
|
|
228
|
+
])) : $("", !0)
|
|
227
229
|
]),
|
|
228
|
-
|
|
229
|
-
|
|
230
|
+
p("div", ge, [
|
|
231
|
+
i(N) ? (f(), h("div", ve, U(i(N)), 1)) : (f(), h("div", _e, U(`${i(r)("ap.apUpload.supportExtension")}:${i(oe)(i(y))},${i(r)(
|
|
230
232
|
"ap.apUpload.maxUploadPictureSize",
|
|
231
|
-
{ maxSize:
|
|
233
|
+
{ maxSize: i(k) }
|
|
232
234
|
)}`), 1))
|
|
233
235
|
])
|
|
234
236
|
], 2));
|
|
235
237
|
}
|
|
236
238
|
});
|
|
237
239
|
export {
|
|
238
|
-
|
|
240
|
+
ze as default
|
|
239
241
|
};
|
|
@@ -22,13 +22,16 @@ const ge = ["accept"], he = {
|
|
|
22
22
|
ee(
|
|
23
23
|
() => n == null ? void 0 : n.value,
|
|
24
24
|
function(e) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
if (o.value === null && e) {
|
|
26
|
+
const t = re(F, e);
|
|
27
|
+
l.value = 3, o.value = new File(
|
|
28
|
+
[e],
|
|
29
|
+
t,
|
|
30
|
+
{}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{ immediate: !0 }
|
|
32
35
|
);
|
|
33
36
|
const l = h(1), f = h(0), m = h(null), P = te(() => o.value && (n == null ? void 0 : n.value));
|
|
34
37
|
function H() {
|
|
@@ -42,7 +42,7 @@ declare const _default: DefineComponent<{
|
|
|
42
42
|
toolTipBgColor: {
|
|
43
43
|
type: StringConstructor;
|
|
44
44
|
};
|
|
45
|
-
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
45
|
+
}, () => false | import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
46
46
|
attachmentList: {
|
|
47
47
|
type: PropType<Array<AttachmentItemProps>>;
|
|
48
48
|
default: never[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as O, useSlots as T, computed as
|
|
1
|
+
import { defineComponent as O, useSlots as T, computed as o, cloneVNode as P, unref as k, toRaw as u, createVNode as a, createTextVNode as S } from "vue";
|
|
2
2
|
import { Tooltip as V, Popover as b } from "ant-design-vue";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
4
|
import { ApAttachmentProps as z } from "./constans.mjs";
|
|
@@ -7,7 +7,7 @@ import "./style.css";
|
|
|
7
7
|
import { useOssInit as U } from "../../ap-download/hooks/index.mjs";
|
|
8
8
|
import { isArray as _ } from "lodash-unified";
|
|
9
9
|
import { useNamespace as B } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
-
import { useGlobalConfig as
|
|
10
|
+
import { useGlobalConfig as v } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
11
|
import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
12
|
const Y = /* @__PURE__ */ O({
|
|
13
13
|
name: "ApAttachment",
|
|
@@ -16,65 +16,68 @@ const Y = /* @__PURE__ */ O({
|
|
|
16
16
|
const {
|
|
17
17
|
b: p,
|
|
18
18
|
e: l
|
|
19
|
-
} = B("ap-attachment"), A =
|
|
19
|
+
} = B("ap-attachment"), A = v("uiMode"), g = v("apUpload"), {
|
|
20
20
|
lang: w,
|
|
21
21
|
t: i
|
|
22
|
-
} = G(), s = T(), C =
|
|
22
|
+
} = G(), s = T(), C = o(() => w.value === "zh-cn" ? "zh_CN" : "en_US"), n = o(() => t.attachmentList.length === 1), d = o(() => t.attachmentList.length > 0 ? t.attachmentList[0].fileName : ""), L = o(() => n.value ? d.value : i("ap.apAttachment.downloadall")), f = o(() => t.color ? t.color : A.value === "aplus" ? "#0070FF" : "#1890FF"), N = o(() => ({
|
|
23
23
|
width: n.value ? "auto" : "266px"
|
|
24
|
-
})),
|
|
24
|
+
})), h = o(() => ({
|
|
25
25
|
"--download-main-color": f.value,
|
|
26
26
|
"--download-main-color-opacity": I(f.value, 0.6)
|
|
27
|
-
})),
|
|
27
|
+
})), y = o(() => {
|
|
28
28
|
var e;
|
|
29
29
|
return t.getOssAccess || ((e = g.value) == null ? void 0 : e.getOssAccess);
|
|
30
|
-
}),
|
|
30
|
+
}), F = o(() => {
|
|
31
31
|
const e = s.default ? s.default()[0] : null;
|
|
32
32
|
return e ? P(e, {
|
|
33
33
|
style: {
|
|
34
34
|
"font-size": "16px"
|
|
35
35
|
}
|
|
36
36
|
}) : null;
|
|
37
|
-
}),
|
|
37
|
+
}), m = async (e) => {
|
|
38
38
|
if (!t.disabled) {
|
|
39
|
-
const c = await U(
|
|
40
|
-
await c.downloadFile(M(t.needName,
|
|
39
|
+
const c = await U(y.value, k(C)), r = _(u(e)) ? u(e) : [u(e)];
|
|
40
|
+
await c.downloadFile(M(t.needName, r));
|
|
41
41
|
}
|
|
42
|
-
}, x = (e) => e && e.length > 0 ?
|
|
42
|
+
}, x = (e) => e && e.length > 0 ? a("ul", {
|
|
43
43
|
class: [l("file-list")],
|
|
44
|
-
style:
|
|
45
|
-
}, [e.map((c,
|
|
46
|
-
key:
|
|
44
|
+
style: h.value
|
|
45
|
+
}, [e.map((c, r) => a("li", {
|
|
46
|
+
key: r,
|
|
47
47
|
class: [l("file-item")],
|
|
48
|
-
onClick: () =>
|
|
49
|
-
}, [c.fileName])),
|
|
48
|
+
onClick: () => m(c)
|
|
49
|
+
}, [c.fileName])), a("li", {
|
|
50
50
|
class: [l("down-load-all")],
|
|
51
|
-
onClick: () =>
|
|
51
|
+
onClick: () => m(t.attachmentList)
|
|
52
52
|
}, [i("ap.apAttachment.downloadall")])]) : null;
|
|
53
|
-
return () =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
53
|
+
return () => {
|
|
54
|
+
var e;
|
|
55
|
+
return ((e = t.attachmentList) == null ? void 0 : e.length) > 0 && a("div", {
|
|
56
|
+
class: [p()],
|
|
57
|
+
style: [N.value, h.value]
|
|
58
|
+
}, [a(V, {
|
|
59
|
+
title: L.value,
|
|
60
|
+
placement: t.textToolTipPlacement,
|
|
61
|
+
color: t.toolTipBgColor
|
|
62
|
+
}, {
|
|
63
|
+
default: () => [a("div", {
|
|
64
|
+
class: [l("content")],
|
|
65
|
+
onClick: () => m(n.value ? t.attachmentList[0] : t.attachmentList)
|
|
66
|
+
}, [s.default ? a("div", {
|
|
67
|
+
class: [l("text-render")]
|
|
68
|
+
}, [F.value, S(" ")]) : null, a("div", {
|
|
69
|
+
class: [l("text-inner")]
|
|
70
|
+
}, [d.value])])]
|
|
71
|
+
}), a(b, {
|
|
72
|
+
content: x(t.attachmentList),
|
|
73
|
+
placement: t.fileMorePopoverPlacement,
|
|
74
|
+
color: "#fff"
|
|
75
|
+
}, {
|
|
76
|
+
default: () => [!n.value && a("div", {
|
|
77
|
+
class: [l("more")]
|
|
78
|
+
}, [i("ap.apAttachment.more")])]
|
|
79
|
+
})]);
|
|
80
|
+
};
|
|
78
81
|
}
|
|
79
82
|
});
|
|
80
83
|
export {
|