@aplus-frontend/ui 7.10.6 → 7.11.0
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 +93 -91
- package/es/src/ag-grid/editable/form-item.vue.mjs +75 -63
- package/es/src/ag-grid/editable/index.vue.mjs +80 -72
- package/es/src/ag-grid/editable/interface.d.ts +2 -1
- package/es/src/ag-grid/editable/utils.d.ts +7 -0
- package/es/src/ag-grid/editable/utils.mjs +32 -17
- package/es/src/ap-form/ap-form.vue2.mjs +144 -153
- package/es/src/ap-form/utils/transform.d.ts +6 -0
- package/es/src/ap-form/utils/transform.mjs +30 -0
- package/es/src/ap-pro-card/components/card/index.vue.d.ts +1 -1
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +129 -93
- package/es/src/business/ap-appendix/interface.d.ts +4 -0
- package/es/src/business/ap-appendix/style/index.mjs +56 -34
- package/es/src/business/ap-attachment/ApAttachment.mjs +112 -89
- package/es/src/business/ap-attachment/style/index.mjs +21 -7
- package/es/src/business/ap-file-preview/ap-file-preview.vue.d.ts +4 -0
- package/es/src/business/ap-file-preview/ap-file-preview.vue.mjs +4 -0
- package/es/src/business/ap-file-preview/ap-file-preview.vue2.mjs +103 -0
- package/es/src/business/ap-file-preview/components/error-result/index.vue.d.ts +6 -0
- package/es/src/business/ap-file-preview/components/error-result/index.vue.mjs +4 -0
- package/es/src/business/ap-file-preview/components/error-result/index.vue2.mjs +40 -0
- package/es/src/business/ap-file-preview/icons/not-exist-icon.vue.d.ts +3 -0
- package/es/src/business/ap-file-preview/icons/not-exist-icon.vue.mjs +20 -0
- package/es/src/business/ap-file-preview/icons/not-preview-icon.vue.d.ts +3 -0
- package/es/src/business/ap-file-preview/icons/not-preview-icon.vue.mjs +20 -0
- package/es/src/business/ap-file-preview/index.d.ts +7 -0
- package/es/src/business/ap-file-preview/index.mjs +8 -0
- package/es/src/business/ap-file-preview/interface.d.ts +43 -0
- package/es/src/business/ap-file-preview/style/index.d.ts +5 -0
- package/es/src/business/ap-file-preview/style/index.mjs +46 -0
- package/es/src/business/ap-file-preview/utils/create-file-preview-modal.d.ts +2 -0
- package/es/src/business/ap-file-preview/utils/create-file-preview-modal.mjs +18 -0
- package/es/src/business/ap-file-preview/utils/default-parser-plugin.d.ts +4 -0
- package/es/src/business/ap-file-preview/utils/default-parser-plugin.mjs +48 -0
- package/es/src/business/ap-image/ApImage.vue2.mjs +16 -16
- package/es/src/business/ap-upload/apUpload.vue.d.ts +1 -1
- package/es/src/business/ap-upload/apUploadTypes.d.ts +2 -2
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +94 -82
- package/es/src/business/ap-upload/style/multiple-file.mjs +6 -3
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +16 -14
- package/es/src/config-provider/config-provider-props.d.ts +6 -0
- package/es/src/config-provider/config-provider-props.mjs +6 -2
- package/es/src/config-provider/config-provider.d.ts +17 -1
- package/es/src/config-provider/config-provider.mjs +24 -23
- package/es/src/config-provider/hooks/use-global-config.d.ts +7 -0
- package/es/src/config-provider/index.d.ts +31 -3
- package/es/src/index.mjs +74 -72
- package/es/src/locale/lang/en.mjs +5 -0
- package/es/src/locale/lang/zh-cn.mjs +5 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +2 -1
- package/lib/src/ag-grid/editable/utils.d.ts +7 -0
- package/lib/src/ag-grid/editable/utils.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/utils/transform.d.ts +6 -0
- package/lib/src/ap-form/utils/transform.js +1 -0
- package/lib/src/ap-pro-card/components/card/index.vue.d.ts +1 -1
- package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
- package/lib/src/business/ap-appendix/interface.d.ts +4 -0
- package/lib/src/business/ap-appendix/style/index.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/style/index.js +1 -1
- package/lib/src/business/ap-file-preview/ap-file-preview.vue.d.ts +4 -0
- package/lib/src/business/ap-file-preview/ap-file-preview.vue.js +1 -0
- package/lib/src/business/ap-file-preview/ap-file-preview.vue2.js +1 -0
- package/lib/src/business/ap-file-preview/components/error-result/index.vue.d.ts +6 -0
- package/lib/src/business/ap-file-preview/components/error-result/index.vue.js +1 -0
- package/lib/src/business/ap-file-preview/components/error-result/index.vue2.js +1 -0
- package/lib/src/business/ap-file-preview/icons/not-exist-icon.vue.d.ts +3 -0
- package/lib/src/business/ap-file-preview/icons/not-exist-icon.vue.js +1 -0
- package/lib/src/business/ap-file-preview/icons/not-preview-icon.vue.d.ts +3 -0
- package/lib/src/business/ap-file-preview/icons/not-preview-icon.vue.js +1 -0
- package/lib/src/business/ap-file-preview/index.d.ts +7 -0
- package/lib/src/business/ap-file-preview/index.js +1 -0
- package/lib/src/business/ap-file-preview/interface.d.ts +43 -0
- package/lib/src/business/ap-file-preview/style/index.d.ts +5 -0
- package/lib/src/business/ap-file-preview/style/index.js +1 -0
- package/lib/src/business/ap-file-preview/utils/create-file-preview-modal.d.ts +2 -0
- package/lib/src/business/ap-file-preview/utils/create-file-preview-modal.js +1 -0
- package/lib/src/business/ap-file-preview/utils/default-parser-plugin.d.ts +4 -0
- package/lib/src/business/ap-file-preview/utils/default-parser-plugin.js +1 -0
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-upload/apUpload.vue.d.ts +1 -1
- package/lib/src/business/ap-upload/apUploadTypes.d.ts +2 -2
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/style/multiple-file.js +1 -1
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +6 -0
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +17 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/hooks/use-global-config.d.ts +7 -0
- package/lib/src/config-provider/index.d.ts +31 -3
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createVNode as r } from "vue";
|
|
2
|
+
import { omit as o } from "lodash-unified";
|
|
3
|
+
import { ApModal as t } from "../../../ap-modal/index.mjs";
|
|
4
|
+
import { ApFilePreview as l } from "../index.mjs";
|
|
5
|
+
const f = (e) => {
|
|
6
|
+
t.createModal({
|
|
7
|
+
title: e?.fileName ?? "File Preview",
|
|
8
|
+
width: "90%",
|
|
9
|
+
wrapperOffset: !0,
|
|
10
|
+
wrapperFullHeight: !0,
|
|
11
|
+
footer: null,
|
|
12
|
+
content: r(l, o(e, "modalProps"), null),
|
|
13
|
+
...e?.modalProps
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
f as createFilePreviewModal
|
|
18
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createVNode as r } from "vue";
|
|
2
|
+
import { ApImage as t } from "../../ap-image/index.mjs";
|
|
3
|
+
const a = {
|
|
4
|
+
format: [
|
|
5
|
+
// DPF
|
|
6
|
+
"pdf",
|
|
7
|
+
// 视频
|
|
8
|
+
"mp4",
|
|
9
|
+
"webm",
|
|
10
|
+
"ogg",
|
|
11
|
+
"ogv",
|
|
12
|
+
// 音频
|
|
13
|
+
"mp3",
|
|
14
|
+
"wav",
|
|
15
|
+
"ogg",
|
|
16
|
+
"oga",
|
|
17
|
+
"m4a",
|
|
18
|
+
"aac"
|
|
19
|
+
],
|
|
20
|
+
parser: ({
|
|
21
|
+
src: e
|
|
22
|
+
}) => r("iframe", {
|
|
23
|
+
src: e,
|
|
24
|
+
style: {
|
|
25
|
+
width: "100%",
|
|
26
|
+
height: "100%",
|
|
27
|
+
border: "none"
|
|
28
|
+
}
|
|
29
|
+
}, null)
|
|
30
|
+
}, i = {
|
|
31
|
+
format: ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp", "ico", "tiff", "tif", "avif", "heif", "heic"],
|
|
32
|
+
parser: ({
|
|
33
|
+
src: e
|
|
34
|
+
}) => r(t, {
|
|
35
|
+
src: e,
|
|
36
|
+
width: "100%",
|
|
37
|
+
height: "100%",
|
|
38
|
+
preview: !1,
|
|
39
|
+
style: {
|
|
40
|
+
"object-fit": "contain"
|
|
41
|
+
}
|
|
42
|
+
}, null)
|
|
43
|
+
}, g = [a, i];
|
|
44
|
+
export {
|
|
45
|
+
g as defaultParserPlugins,
|
|
46
|
+
a as iframeParser,
|
|
47
|
+
i as imgParser
|
|
48
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as S, computed as
|
|
1
|
+
import { defineComponent as S, computed as l, ref as W, watchEffect as j, createBlock as h, openBlock as i, unref as o, mergeProps as b, withCtx as B, renderSlot as E, normalizeProps as F, guardReactiveProps as L, createElementVNode as v, normalizeClass as U, createElementBlock as x, Fragment as D, renderList as P, resolveDynamicComponent as R, createVNode as T } from "vue";
|
|
2
2
|
import { DownloadOutlined as z } from "@ant-design/icons-vue";
|
|
3
3
|
import { Image as V } from "@aplus-frontend/antdv";
|
|
4
4
|
import { omit as $ } from "lodash-unified";
|
|
@@ -29,28 +29,28 @@ const ue = /* @__PURE__ */ S({
|
|
|
29
29
|
admin: J
|
|
30
30
|
}, w = m("apImage", { uiMode: "aplus" }), C = m("apUpload"), f = m(
|
|
31
31
|
"downloadCenterTriggerConfig"
|
|
32
|
-
), O =
|
|
32
|
+
), O = l(
|
|
33
33
|
() => e.uiMode || w.value?.uiMode
|
|
34
|
-
), { t: y, lang: A } = Y(), g =
|
|
34
|
+
), { t: y, lang: A } = Y(), g = l(
|
|
35
35
|
() => e.getOssAccess || C.value?.getOssAccess
|
|
36
|
-
), N =
|
|
36
|
+
), N = l(
|
|
37
37
|
() => d[O.value] || d.aplus
|
|
38
|
-
), I =
|
|
39
|
-
G(y, A),
|
|
38
|
+
), I = l(() => e?.fallback || N.value), s = W("");
|
|
39
|
+
G(y, A), j(async () => {
|
|
40
40
|
if (!e?.src) {
|
|
41
41
|
s.value = "";
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
if (e.src?.startsWith("http") || e.src?.startsWith("data:")) {
|
|
44
|
+
if (e.src?.startsWith("http") || e.src?.startsWith("data:") || e.src?.startsWith("blob:")) {
|
|
45
45
|
s.value = e.src;
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
const a = e.src?.match(/^([^:]+):(.*)$/), r = a?.[1], t = a?.[2] ?? e.src,
|
|
49
|
+
const a = e.src?.match(/^([^:]+):(.*)$/), r = a?.[1], t = a?.[2] ?? e.src, n = await q(
|
|
50
50
|
() => r ? g.value?.(r) : g.value?.(),
|
|
51
51
|
r
|
|
52
52
|
), c = await H({
|
|
53
|
-
oss:
|
|
53
|
+
oss: n,
|
|
54
54
|
fileName: t
|
|
55
55
|
});
|
|
56
56
|
c && (s.value = c);
|
|
@@ -80,20 +80,20 @@ const ue = /* @__PURE__ */ S({
|
|
|
80
80
|
const t = document.createElement("a");
|
|
81
81
|
t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download", r), document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
82
82
|
};
|
|
83
|
-
return (a, r) => (i(), h(o(V),
|
|
83
|
+
return (a, r) => (i(), h(o(V), b({
|
|
84
84
|
class: [o(u)(), o(p)]
|
|
85
85
|
}, {
|
|
86
86
|
...o($)(e, ["src", "getOssAccess"]),
|
|
87
87
|
fallback: I.value,
|
|
88
88
|
src: s.value
|
|
89
89
|
}), {
|
|
90
|
-
toolbarRender:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
class:
|
|
90
|
+
toolbarRender: B((t) => [
|
|
91
|
+
E(a.$slots, "toolbarRender", F(L({ ...t })), () => [
|
|
92
|
+
v("div", {
|
|
93
|
+
class: U([o(u)("toolbar"), o(p)])
|
|
94
94
|
}, [
|
|
95
|
-
(i(!0), x(D, null, P(t.originalNodes, (
|
|
96
|
-
|
|
95
|
+
(i(!0), x(D, null, P(t.originalNodes, (n, c) => (i(), h(R(n), b({ ref_for: !0 }, e, { key: c }), null, 16))), 128)),
|
|
96
|
+
v("div", {
|
|
97
97
|
class: "ant-image-preview-operations-operation",
|
|
98
98
|
onClick: _
|
|
99
99
|
}, [
|
|
@@ -189,8 +189,8 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
|
189
189
|
value: string | unknown[] | Record<string, any>;
|
|
190
190
|
maxCount: number;
|
|
191
191
|
maxSize: number;
|
|
192
|
-
needName: boolean | Record<string, any>;
|
|
193
192
|
getOssAccess: GetOssAccess;
|
|
193
|
+
needName: boolean | Record<string, any>;
|
|
194
194
|
accept: string;
|
|
195
195
|
beforeUpload: BeforeUpload;
|
|
196
196
|
onRemove: Function;
|
|
@@ -70,7 +70,7 @@ export type SingleFileProps = FileUploadProps & {
|
|
|
70
70
|
/**
|
|
71
71
|
* 副标题
|
|
72
72
|
*/
|
|
73
|
-
subTitle?: string;
|
|
73
|
+
subTitle?: string | null;
|
|
74
74
|
};
|
|
75
75
|
export type MultipleFileProps = FileUploadProps & {
|
|
76
76
|
/**
|
|
@@ -80,7 +80,7 @@ export type MultipleFileProps = FileUploadProps & {
|
|
|
80
80
|
/**
|
|
81
81
|
* 副标题
|
|
82
82
|
*/
|
|
83
|
-
subTitle?: string | VNode;
|
|
83
|
+
subTitle?: string | VNode | null;
|
|
84
84
|
/**
|
|
85
85
|
* 限制上传数量
|
|
86
86
|
*/
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { UploadOutlined as
|
|
1
|
+
import { defineComponent as Z, inject as a, ref as ee, watch as oe, nextTick as te, createElementBlock as C, openBlock as x, normalizeClass as ae, unref as n, createVNode as y, withCtx as N, createElementVNode as P, createTextVNode as se, toDisplayString as L, withModifiers as ne, createCommentVNode as re, createBlock as ie, resolveDynamicComponent as le } from "vue";
|
|
2
|
+
import { UploadOutlined as ce } from "@ant-design/icons-vue";
|
|
3
3
|
import { message as p, Upload as ue, Button as pe } from "@aplus-frontend/antdv";
|
|
4
|
+
import { IconApAdLineDownload as me } from "@aplus-frontend/icon";
|
|
5
|
+
import { ApFilePreview as de } from "../../ap-file-preview/index.mjs";
|
|
4
6
|
import "../../../config-provider/index.mjs";
|
|
5
|
-
import { useOss as
|
|
6
|
-
import
|
|
7
|
-
import { fileMatchesAccept as
|
|
8
|
-
import { getPath as he, getName as
|
|
9
|
-
import { useGlobalConfig as
|
|
10
|
-
import { useLocale as
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
const
|
|
7
|
+
import { useOss as fe, getOssInstance as S } from "../hooks/useOss.mjs";
|
|
8
|
+
import ge from "../style/index.mjs";
|
|
9
|
+
import { fileMatchesAccept as ve, getAcceptText as we } from "../utils/accept.mjs";
|
|
10
|
+
import { getPath as he, getName as xe, getReturnData as D } from "../utils/returnData.mjs";
|
|
11
|
+
import { useGlobalConfig as ye } from "../../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import { useLocale as ke } from "../../../config-provider/hooks/use-locale.mjs";
|
|
13
|
+
import { useNamespace as be } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
const Ce = { class: "multiple-file-context" }, Ne = { key: 0 }, Ue = { key: 1 }, Oe = /* @__PURE__ */ Z({
|
|
13
15
|
__name: "MultipleFile",
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
+
setup(Ee, { expose: z }) {
|
|
17
|
+
const U = ye(
|
|
16
18
|
"downloadCenterTriggerConfig"
|
|
17
|
-
), { t:
|
|
18
|
-
|
|
19
|
+
), { t: i } = ke(), { b: B } = be("ap-upload-multiple-file"), O = ge("ap-upload"), { put: V } = fe(), q = a("dirName"), j = a("baseDirName"), k = a("accept") || "*", E = a("maxSize") ?? 500, $ = a("title") || i("ap.apUpload.uploadFile"), f = a("subTitle"), l = a("maxCount") ?? 10, m = a("uploadingCount"), F = a("beforeUpload"), A = a("customRequest"), g = a("getOssAccess"), G = a("maxSizeErrorMsg"), W = a("maxCountErrorMsg"), H = a("acceptErrorMsg"), _ = a("onRemove"), b = a("showUploadErrorMsg"), T = a("bucket"), r = a("value"), c = [], v = a("needName"), d = ee(null);
|
|
20
|
+
oe(
|
|
19
21
|
() => r?.value,
|
|
20
22
|
function(e) {
|
|
21
|
-
!
|
|
23
|
+
!d?.value?.fileList?.length && e && I(e);
|
|
22
24
|
},
|
|
23
25
|
{ immediate: !0 }
|
|
24
26
|
);
|
|
25
|
-
function
|
|
27
|
+
function I(e) {
|
|
26
28
|
if (!e) {
|
|
27
|
-
u = [],
|
|
29
|
+
u = [], d.value.fileList = [], r.value = void 0, c.splice(0, c.length);
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
30
|
-
|
|
32
|
+
te(() => {
|
|
31
33
|
const o = e.map((t) => {
|
|
32
|
-
const s = he(
|
|
34
|
+
const s = he(v, t), M = xe(v, t), h = new File(
|
|
33
35
|
[t],
|
|
34
36
|
M,
|
|
35
37
|
{}
|
|
36
38
|
);
|
|
37
|
-
return
|
|
39
|
+
return h.response = s, h.uid = s, h.status = "done", h;
|
|
38
40
|
});
|
|
39
|
-
if (
|
|
41
|
+
if (l && o.length > l) {
|
|
40
42
|
p.warning(
|
|
41
|
-
|
|
42
|
-
maxCount:
|
|
43
|
+
i("ap.apUpload.fileInitializationException", {
|
|
44
|
+
maxCount: l
|
|
43
45
|
})
|
|
44
46
|
);
|
|
45
47
|
return;
|
|
@@ -49,45 +51,45 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
|
|
|
49
51
|
uid: t.uid,
|
|
50
52
|
path: t.response
|
|
51
53
|
});
|
|
52
|
-
}),
|
|
54
|
+
}), d.value.fileList = o, r.value = e;
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
let u = [],
|
|
57
|
-
function
|
|
57
|
+
z({ setValue: I });
|
|
58
|
+
let u = [], R;
|
|
59
|
+
function w(e) {
|
|
58
60
|
setTimeout(() => {
|
|
59
|
-
const o =
|
|
61
|
+
const o = d.value.fileList.findIndex(
|
|
60
62
|
(t) => t.uid === e.uid
|
|
61
63
|
);
|
|
62
|
-
o >= 0 &&
|
|
64
|
+
o >= 0 && d.value.fileList.splice(o, 1);
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
67
|
async function J(e) {
|
|
66
|
-
if (
|
|
67
|
-
return clearTimeout(
|
|
68
|
+
if (l && l > 1 && u.length >= l)
|
|
69
|
+
return clearTimeout(R), R = setTimeout(() => {
|
|
68
70
|
p.warning(
|
|
69
|
-
W ||
|
|
70
|
-
maxCount:
|
|
71
|
+
W || i("ap.apUpload.maxUploadFiles", {
|
|
72
|
+
maxCount: l
|
|
71
73
|
})
|
|
72
74
|
);
|
|
73
|
-
}),
|
|
75
|
+
}), w(e), !1;
|
|
74
76
|
if (e.size > E * 1024 * 1024)
|
|
75
77
|
return p.warning(
|
|
76
|
-
G ||
|
|
78
|
+
G || i("ap.apUpload.maxUploadFileSize", {
|
|
77
79
|
maxSize: E
|
|
78
80
|
})
|
|
79
|
-
),
|
|
80
|
-
if (!
|
|
81
|
+
), w(e), !1;
|
|
82
|
+
if (!ve(e, k))
|
|
81
83
|
return p.warning(
|
|
82
|
-
H ||
|
|
83
|
-
),
|
|
84
|
-
if (typeof
|
|
85
|
-
return
|
|
86
|
-
|
|
84
|
+
H || i("ap.apUpload.fileFormatNotSupported")
|
|
85
|
+
), w(e), !1;
|
|
86
|
+
if (typeof F == "function" && await F(e) === !1)
|
|
87
|
+
return w(e), !1;
|
|
88
|
+
l && l === 1 && (u = [], r.value = void 0), u.push(e);
|
|
87
89
|
}
|
|
88
90
|
async function K(e) {
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
+
if (m.value++, typeof A == "function") {
|
|
92
|
+
A({
|
|
91
93
|
onProgress: (o) => {
|
|
92
94
|
setTimeout(() => {
|
|
93
95
|
e.onProgress({
|
|
@@ -96,30 +98,30 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
|
|
|
96
98
|
});
|
|
97
99
|
},
|
|
98
100
|
onError: (o) => {
|
|
99
|
-
|
|
101
|
+
b && p.warning(o || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
100
102
|
e.onError({
|
|
101
103
|
name: o,
|
|
102
104
|
message: o
|
|
103
105
|
});
|
|
104
|
-
}),
|
|
106
|
+
}), m.value--;
|
|
105
107
|
},
|
|
106
108
|
onSuccess: (o) => {
|
|
107
109
|
setTimeout(() => {
|
|
108
110
|
e.onSuccess(o);
|
|
109
111
|
}), r.value = [
|
|
110
112
|
...r.value || [],
|
|
111
|
-
|
|
113
|
+
D(v, o, e.file.name)
|
|
112
114
|
], c.push({
|
|
113
115
|
uid: e.file.uid,
|
|
114
116
|
path: o
|
|
115
|
-
}),
|
|
117
|
+
}), m.value--;
|
|
116
118
|
},
|
|
117
119
|
file: e.file
|
|
118
120
|
});
|
|
119
121
|
return;
|
|
120
122
|
}
|
|
121
123
|
try {
|
|
122
|
-
const o = await (
|
|
124
|
+
const o = await (T ? g(T) : g()), t = await S(async () => o);
|
|
123
125
|
e.file.oss = t, V({
|
|
124
126
|
file: e.file,
|
|
125
127
|
dirName: q,
|
|
@@ -127,17 +129,17 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
|
|
|
127
129
|
successCallBack(s) {
|
|
128
130
|
e.onSuccess(s), r.value = [
|
|
129
131
|
...r.value || [],
|
|
130
|
-
|
|
132
|
+
D(v, s, e.file.name)
|
|
131
133
|
], c.push({
|
|
132
134
|
uid: e.file.uid,
|
|
133
135
|
path: s
|
|
134
|
-
}),
|
|
136
|
+
}), m.value--;
|
|
135
137
|
},
|
|
136
138
|
errorCallBack(s) {
|
|
137
|
-
|
|
139
|
+
b && p.warning(s || i("ap.apUpload.networkAnomaly")), e.onError({
|
|
138
140
|
name: s,
|
|
139
141
|
message: s
|
|
140
|
-
}),
|
|
142
|
+
}), m.value--;
|
|
141
143
|
},
|
|
142
144
|
progressCallBack(s) {
|
|
143
145
|
e.onProgress({
|
|
@@ -148,16 +150,16 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
|
|
|
148
150
|
bucket: o?.bucket
|
|
149
151
|
});
|
|
150
152
|
} catch (o) {
|
|
151
|
-
|
|
152
|
-
typeof o?.message == "string" ? o.message :
|
|
153
|
+
b && p.warning(
|
|
154
|
+
typeof o?.message == "string" ? o.message : i("ap.apUpload.networkAnomaly")
|
|
153
155
|
), e.onError({
|
|
154
|
-
name: o?.message ||
|
|
155
|
-
message: o?.message ||
|
|
156
|
-
}),
|
|
156
|
+
name: o?.message || i("ap.apUpload.networkAnomaly"),
|
|
157
|
+
message: o?.message || i("ap.apUpload.networkAnomaly")
|
|
158
|
+
}), m.value--;
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
161
|
function Q(e) {
|
|
160
|
-
if (
|
|
162
|
+
if (_ && _?.(e), e.response) {
|
|
161
163
|
if (Array.isArray(r.value)) {
|
|
162
164
|
const t = c.findIndex((s) => s.uid === e.uid);
|
|
163
165
|
t >= 0 && (r?.value.splice(t, 1), c.splice(t, 1)), r.value.length === 0 && (r.value = void 0);
|
|
@@ -170,15 +172,15 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
|
|
|
170
172
|
return u.splice(o, 1), Promise.resolve(!0);
|
|
171
173
|
}
|
|
172
174
|
const X = async (e) => {
|
|
173
|
-
if (
|
|
175
|
+
if (U.value?.trigger) {
|
|
174
176
|
let o = [e].map((t) => ({
|
|
175
177
|
objectName: t.response,
|
|
176
178
|
fileName: t.name
|
|
177
179
|
}));
|
|
178
|
-
|
|
180
|
+
U.value?.trigger?.(o);
|
|
179
181
|
} else {
|
|
180
182
|
const o = e.response?.match(/^([^:]+):(.*)$/), t = o?.[1], s = o?.[2] ?? e.response;
|
|
181
|
-
(await
|
|
183
|
+
(await S(
|
|
182
184
|
() => t ? g?.(t) : g?.()
|
|
183
185
|
)).downloadFile([
|
|
184
186
|
{
|
|
@@ -187,19 +189,24 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
|
|
|
187
189
|
}
|
|
188
190
|
]);
|
|
189
191
|
}
|
|
192
|
+
}, Y = (e) => {
|
|
193
|
+
de.createFilePreviewModal({
|
|
194
|
+
src: e.response,
|
|
195
|
+
fileName: e.name
|
|
196
|
+
});
|
|
190
197
|
};
|
|
191
|
-
return (e, o) => (x(),
|
|
192
|
-
class:
|
|
193
|
-
[n(
|
|
194
|
-
[n(
|
|
198
|
+
return (e, o) => (x(), C("div", {
|
|
199
|
+
class: ae({
|
|
200
|
+
[n(B)()]: !0,
|
|
201
|
+
[n(O) ?? ""]: !0
|
|
195
202
|
})
|
|
196
203
|
}, [
|
|
197
204
|
y(n(ue), {
|
|
198
205
|
ref_key: "uploadRef",
|
|
199
|
-
ref:
|
|
206
|
+
ref: d,
|
|
200
207
|
accept: n(k),
|
|
201
208
|
multiple: "",
|
|
202
|
-
"max-count": n(
|
|
209
|
+
"max-count": n(l),
|
|
203
210
|
progress: {
|
|
204
211
|
strokeWidth: 3,
|
|
205
212
|
showInfo: !1,
|
|
@@ -207,30 +214,35 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
|
|
|
207
214
|
},
|
|
208
215
|
"before-upload": J,
|
|
209
216
|
"custom-request": K,
|
|
210
|
-
"show-upload-list": {
|
|
217
|
+
"show-upload-list": {
|
|
218
|
+
showDownloadIcon: !0,
|
|
219
|
+
showRemoveIcon: !0,
|
|
220
|
+
showPreviewIcon: !0
|
|
221
|
+
},
|
|
222
|
+
onPreview: Y,
|
|
211
223
|
onRemove: Q,
|
|
212
224
|
onDownload: X
|
|
213
225
|
}, {
|
|
214
|
-
downloadIcon:
|
|
215
|
-
y(n(
|
|
226
|
+
downloadIcon: N(() => [
|
|
227
|
+
y(n(me), { class: "anticon anticon-vertical-align-bottom" })
|
|
216
228
|
]),
|
|
217
|
-
default:
|
|
218
|
-
|
|
229
|
+
default: N(() => [
|
|
230
|
+
P("div", Ce, [
|
|
219
231
|
y(n(pe), { class: "file-btn" }, {
|
|
220
|
-
default:
|
|
221
|
-
y(n(
|
|
222
|
-
|
|
232
|
+
default: N(() => [
|
|
233
|
+
y(n(ce)),
|
|
234
|
+
se(" " + L(n($)), 1)
|
|
223
235
|
]),
|
|
224
236
|
_: 1
|
|
225
237
|
}),
|
|
226
|
-
|
|
238
|
+
P("div", {
|
|
227
239
|
class: "sub-title",
|
|
228
|
-
onClick: o[0] || (o[0] =
|
|
240
|
+
onClick: o[0] || (o[0] = ne(() => {
|
|
229
241
|
}, ["stop"]))
|
|
230
242
|
}, [
|
|
231
|
-
typeof n(f) == "string" ? (x(),
|
|
232
|
-
(x(),
|
|
233
|
-
])) :
|
|
243
|
+
typeof n(f) == "string" ? (x(), C("div", Ne, L(n(f) || `${n(i)("ap.apUpload.supportExtension")}:${n(we)(n(k))}`), 1)) : n(f) ? (x(), C("div", Ue, [
|
|
244
|
+
(x(), ie(le(n(f))))
|
|
245
|
+
])) : re("", !0)
|
|
234
246
|
])
|
|
235
247
|
])
|
|
236
248
|
]),
|
|
@@ -240,5 +252,5 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
|
|
|
240
252
|
}
|
|
241
253
|
});
|
|
242
254
|
export {
|
|
243
|
-
|
|
255
|
+
Oe as default
|
|
244
256
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i = (l) => {
|
|
2
2
|
const { componentCls: o } = l;
|
|
3
3
|
return {
|
|
4
4
|
[`${o}-multiple-file`]: {
|
|
@@ -54,7 +54,10 @@ const t = (l) => {
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
".ant-upload-list-item-done": {
|
|
57
|
-
color: l.colorLink
|
|
57
|
+
color: l.colorLink,
|
|
58
|
+
".ant-upload-list-item-name": {
|
|
59
|
+
cursor: "pointer"
|
|
60
|
+
}
|
|
58
61
|
},
|
|
59
62
|
".ant-upload-list-item-undefined": {
|
|
60
63
|
color: l.colorLink
|
|
@@ -63,5 +66,5 @@ const t = (l) => {
|
|
|
63
66
|
};
|
|
64
67
|
};
|
|
65
68
|
export {
|
|
66
|
-
|
|
69
|
+
i as multipleFileStyle
|
|
67
70
|
};
|
|
@@ -8,13 +8,13 @@ import "./ap-expand-alert/index.mjs";
|
|
|
8
8
|
import { ApExportGroup as h } from "./ap-export-group/index.mjs";
|
|
9
9
|
import { ApImage as B } from "./ap-image/index.mjs";
|
|
10
10
|
import { ApInputRadio as T } from "./ap-input-radio/index.mjs";
|
|
11
|
-
import { ApLabel as
|
|
12
|
-
import { ApLadder as
|
|
13
|
-
import { ApSelectLayout as
|
|
14
|
-
import { ApStatus as
|
|
15
|
-
import { ApTitle as
|
|
11
|
+
import { ApLabel as w, ApLabelGroup as D } from "./ap-label/index.mjs";
|
|
12
|
+
import { ApLadder as R } from "./ap-ladder/index.mjs";
|
|
13
|
+
import { ApSelectLayout as z } from "./ap-select-layout/index.mjs";
|
|
14
|
+
import { ApStatus as F, ApStatusGroup as H } from "./ap-status/index.mjs";
|
|
15
|
+
import { ApTitle as M } from "./ap-title/index.mjs";
|
|
16
16
|
import "./hooks/index.mjs";
|
|
17
|
-
import { ApSummary as
|
|
17
|
+
import { ApSummary as k } from "./ap-summary/index.mjs";
|
|
18
18
|
import { ApAppendix as J } from "./ap-appendix/index.mjs";
|
|
19
19
|
import "./ap-upload-file/index.mjs";
|
|
20
20
|
import "./batch-input-group/index.mjs";
|
|
@@ -32,6 +32,7 @@ import "./ap-tag/index.mjs";
|
|
|
32
32
|
import "./ap-upload/index.mjs";
|
|
33
33
|
import "./ap-download/index.mjs";
|
|
34
34
|
import "./ap-descriptions/index.mjs";
|
|
35
|
+
import { ApFilePreview as ao } from "./ap-file-preview/index.mjs";
|
|
35
36
|
export {
|
|
36
37
|
J as ApAppendix,
|
|
37
38
|
d as ApAttachment,
|
|
@@ -42,21 +43,22 @@ export {
|
|
|
42
43
|
X as ApCopy,
|
|
43
44
|
to as ApDraggableGrid,
|
|
44
45
|
h as ApExportGroup,
|
|
46
|
+
ao as ApFilePreview,
|
|
45
47
|
B as ApImage,
|
|
46
48
|
T as ApInputRadio,
|
|
47
49
|
ro as ApKeepAlive,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
w as ApLabel,
|
|
51
|
+
D as ApLabelGroup,
|
|
52
|
+
R as ApLadder,
|
|
51
53
|
U as ApProductInfo,
|
|
52
54
|
$ as ApRadioGroup,
|
|
53
|
-
|
|
55
|
+
z as ApSelectLayout,
|
|
54
56
|
O as ApSizeInput,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
F as ApStatus,
|
|
58
|
+
H as ApStatusGroup,
|
|
59
|
+
k as ApSummary,
|
|
58
60
|
u as ApTableModal,
|
|
59
|
-
|
|
61
|
+
M as ApTitle,
|
|
60
62
|
fo as ApTransformDataHelper,
|
|
61
63
|
mo as ApValueSelectCard,
|
|
62
64
|
Z as ApView
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { ApFilePreviewProps } from '../business/ap-file-preview/interface';
|
|
2
3
|
import { AgGridProps } from '../ag-grid';
|
|
3
4
|
import { ApGridProps } from '../ap-grid';
|
|
4
5
|
import { ApImageProps, ApTitleProps, ViewCacheOption } from '../business';
|
|
@@ -19,6 +20,7 @@ type ApProCardConfig = {
|
|
|
19
20
|
};
|
|
20
21
|
type ApImageConfig = Pick<ApImageProps, 'uiMode'>;
|
|
21
22
|
type ApTitleConfig = Pick<ApTitleProps, 'uiMode'>;
|
|
23
|
+
type ApFilePreviewConfig = Pick<ApFilePreviewProps, 'parserPlugin'>;
|
|
22
24
|
export declare const configProviderProps: () => {
|
|
23
25
|
iconPrefixCls: StringConstructor;
|
|
24
26
|
getTargetContainer: {
|
|
@@ -178,6 +180,10 @@ export declare const configProviderProps: () => {
|
|
|
178
180
|
type: PropType<ApDescriptionsConfig>;
|
|
179
181
|
default: () => {};
|
|
180
182
|
};
|
|
183
|
+
apFilePreview: {
|
|
184
|
+
type: PropType<ApFilePreviewConfig>;
|
|
185
|
+
default: () => {};
|
|
186
|
+
};
|
|
181
187
|
/**
|
|
182
188
|
* @description aplus-ui的locale
|
|
183
189
|
*/
|
|
@@ -26,8 +26,12 @@ const t = () => ({
|
|
|
26
26
|
apDescriptions: {
|
|
27
27
|
type: Object,
|
|
28
28
|
default: () => ({})
|
|
29
|
+
},
|
|
30
|
+
apFilePreview: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => ({})
|
|
29
33
|
}
|
|
30
|
-
}),
|
|
34
|
+
}), a = () => ({
|
|
31
35
|
/**
|
|
32
36
|
* @description aplus-ui的locale
|
|
33
37
|
*/
|
|
@@ -76,5 +80,5 @@ const t = () => ({
|
|
|
76
80
|
...e()
|
|
77
81
|
});
|
|
78
82
|
export {
|
|
79
|
-
|
|
83
|
+
a as configProviderProps
|
|
80
84
|
};
|