@aplus-frontend/ui 7.10.6 → 7.11.1
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-download/ap-download.vue.d.ts +1 -0
- package/es/src/business/ap-download/ap-download.vue.mjs +86 -45
- package/es/src/business/ap-download/interface.d.ts +4 -0
- package/es/src/business/ap-download/style/index.mjs +8 -4
- 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 +104 -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 +45 -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-download/ap-download.vue.d.ts +1 -0
- package/lib/src/business/ap-download/ap-download.vue.js +1 -1
- package/lib/src/business/ap-download/interface.d.ts +4 -0
- package/lib/src/business/ap-download/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 +45 -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,40 @@
|
|
|
1
|
+
import { defineComponent as u, createVNode as r, computed as c, createElementBlock as v, openBlock as a, normalizeClass as t, unref as o, createElementVNode as s, createBlock as f, resolveDynamicComponent as d, h as x, Fragment as w, toDisplayString as y } from "vue";
|
|
2
|
+
import "../../../../config-provider/index.mjs";
|
|
3
|
+
import E from "../../icons/not-exist-icon.vue.mjs";
|
|
4
|
+
import C from "../../icons/not-preview-icon.vue.mjs";
|
|
5
|
+
import { useNamespace as N } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
6
|
+
import { useLocale as P } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
7
|
+
const V = /* @__PURE__ */ u({
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: {
|
|
10
|
+
type: {
|
|
11
|
+
default: "notExist"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(n) {
|
|
15
|
+
const {
|
|
16
|
+
b: e
|
|
17
|
+
} = N("ap-file-preview"), {
|
|
18
|
+
t: i
|
|
19
|
+
} = P(), l = {
|
|
20
|
+
notExist: {
|
|
21
|
+
icon: r(E, null, null),
|
|
22
|
+
title: i("ap.apFilePreview.notExist")
|
|
23
|
+
},
|
|
24
|
+
notPreview: {
|
|
25
|
+
icon: r(C, null, null),
|
|
26
|
+
title: i("ap.apFilePreview.notPreview")
|
|
27
|
+
}
|
|
28
|
+
}, p = c(() => l[n.type]?.title), m = c(() => l[n.type]?.icon);
|
|
29
|
+
return (_, k) => (a(), v("div", {
|
|
30
|
+
class: t([o(e)("result")])
|
|
31
|
+
}, [s("div", {
|
|
32
|
+
class: t([o(e)("result-icon")])
|
|
33
|
+
}, [(a(), f(d(x(w, [m.value]))))], 2), s("div", {
|
|
34
|
+
class: t([o(e)("result-title")])
|
|
35
|
+
}, y(p.value), 3)], 2));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
V as default
|
|
40
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createElementBlock as e, openBlock as o, createStaticVNode as l } from "vue";
|
|
2
|
+
import r from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
3
|
+
const C = {}, i = {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
6
|
+
fill: "none",
|
|
7
|
+
version: "1.1",
|
|
8
|
+
width: "36",
|
|
9
|
+
height: "36",
|
|
10
|
+
viewBox: "0 0 36 36"
|
|
11
|
+
};
|
|
12
|
+
function s(L, t) {
|
|
13
|
+
return o(), e("svg", i, [...t[0] || (t[0] = [
|
|
14
|
+
l('<defs><clipPath id="master_svg0_1279_004842"><rect x="0" y="0" width="36" height="36" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_1279_004842)"><g><path d="M34.40176053125,31.784765L31.22363453125,28.606639899999998C32.74590153125,26.3460922,32.50683753125,23.2523422,30.506446831250003,21.2519531C29.37089923125,20.11640549,27.88027383125,19.546875,26.389648431250002,19.546875C24.89902303125,19.546875,23.41191483125,20.11640549,22.27285193125,21.2519531C19.99824333125,23.5230465,19.99824333125,27.2074223,22.27285193125,29.4785156C23.40839963125,30.614063,24.89902303125,31.183594,26.389648431250002,31.183594C27.52167893125,31.183594,28.65371133125,30.853125,29.63105393125,30.199219L32.80917953125,33.377342C33.03066253125,33.59531,33.315429531250004,33.707809,33.60371053125,33.707809C33.89199053125,33.707809,34.18027153125,33.598824,34.39824253125,33.377342C34.84121353125,32.934371999999996,34.84121353125,32.224216,34.40176053125,31.784765ZM26.389648431250002,28.9335938C25.43691443125,28.9335938,24.54043003125,28.5609379,23.86542893125,27.8894539C22.47324183125,26.4972668,22.47324183125,24.2332039,23.86542893125,22.844532C24.54042813125,22.1695328,25.43691253125,21.8003922,26.389648431250002,21.8003922C27.34238243125,21.8003922,28.23886683125,22.173048,28.91386793125,22.844532C30.30605503125,24.236719100000002,30.30605503125,26.500782,28.91386793125,27.8894539C28.23886873125,28.5609379,27.34238433125,28.9335938,26.389648431250002,28.9335938Z" fill="currentColor" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M29.024608125,18L29.024608125,4.5C29.024608125,3.2589843,28.099998125,2.25,26.960937125,2.25L6.331249925,2.25C5.192187545,2.25,4.267578125,3.2589843,4.267578125,4.5L4.267578125,33.75L8.391406025,31.5L12.518749225,33.75L16.656640125,31.5L20.773437125,33.75L20.773437125,31.187109L17.735937125,29.527735L16.660156125,28.937109L15.580859125,29.524218L12.522265425,31.187109L9.470703125,29.524218L8.391406025,28.937109L7.312108725,29.524218L6.517577425,29.95664L6.517577425,5.625C6.517577425,5.0027342,7.020311625,4.5,7.642577425,4.5L25.649608125,4.5C26.271873125,4.5,26.774608125,5.0027342,26.774608125,5.625L26.774608125,18.028126L29.024608125,18Z" fill="currentColor" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g><g><path d="M22.27451109375,11.25L11.02099609375,11.25C10.398730273750001,11.25,9.89599609375,10.747265800000001,9.89599609375,10.125C9.89599609375,9.502734180000001,10.398730273750001,9,11.02099609375,9L22.27451109375,9C22.89677609375,9,23.39951109375,9.502734180000001,23.39951109375,10.125C23.39951109375,10.747265800000001,22.89677609375,11.25,22.27451109375,11.25ZM22.27451109375,16.875L11.02099609375,16.875C10.398730273750001,16.875,9.89599609375,16.3722649,9.89599609375,15.75C9.89599609375,15.127735099999999,10.398730273750001,14.625,11.02099609375,14.625L22.27451109375,14.625C22.89677609375,14.625,23.39951109375,15.127734199999999,23.39951109375,15.75C23.39951109375,16.3722649,22.89677609375,16.875,22.27451109375,16.875ZM20.02451109375,22.5L11.02099609375,22.5C10.398730273750001,22.5,9.89599609375,21.997265,9.89599609375,21.375C9.89599609375,20.752735,10.398730273750001,20.25,11.02099609375,20.25L20.02451109375,20.25C20.64677609375,20.25,21.14951109375,20.752735,21.14951109375,21.375C21.14951109375,21.997265,20.64326109375,22.5,20.02451109375,22.5Z" fill="currentColor" fill-opacity="1" style="mix-blend-mode:passthrough;"></path></g></g>', 2)
|
|
15
|
+
])]);
|
|
16
|
+
}
|
|
17
|
+
const h = /* @__PURE__ */ r(C, [["render", s]]);
|
|
18
|
+
export {
|
|
19
|
+
h as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createElementBlock as C, openBlock as r, createStaticVNode as e } from "vue";
|
|
2
|
+
import o from "../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
3
|
+
const i = {}, l = {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
6
|
+
fill: "none",
|
|
7
|
+
version: "1.1",
|
|
8
|
+
width: "38",
|
|
9
|
+
height: "38",
|
|
10
|
+
viewBox: "0 0 38 38"
|
|
11
|
+
};
|
|
12
|
+
function c(n, t) {
|
|
13
|
+
return r(), C("svg", l, [...t[0] || (t[0] = [
|
|
14
|
+
e('<defs><clipPath id="master_svg0_1279_004593"><rect x="0" y="0" width="38" height="38" rx="0"></rect></clipPath></defs><g clip-path="url(#master_svg0_1279_004593)"><g><path d="M18.9999355625,30.01997946875C9.3732690625,30.01997946875,1.7732691725,20.01331146875,1.4566015724999999,19.56997946875C1.2032681925,19.25331346875,1.2032681925,18.74664546875,1.4566015724999999,18.42998046875C1.5199349225,18.303313468749998,3.4199347625,15.76997946875,6.5232677625,13.23664566875C6.9032678625,12.91997956875,7.5366010625,12.98331166875,7.8532681625,13.36331176875C8.169935262500001,13.74331186875,8.1066012625,14.37664556875,7.7266011625,14.693311668749999C5.6366009625,16.40331176875,4.1166009625,18.11331146875,3.4199342625,18.99997846875C5.129935762500001,21.08998046875,11.5899355625,28.11997946875,18.9999355625,28.11997946875C20.0132695625,28.11997946875,21.0899375625,27.99331246875,22.1032715625,27.73998046875C22.6099375625,27.61331346875,23.1166055625,27.92997946875,23.2432705625,28.43664746875C23.3699375625,28.94331546875,23.0532705625,29.44997946875,22.5466045625,29.57664846875C21.4066025625,29.89331446875,20.1399365625,30.01997946875,18.9999355625,30.01997946875ZM30.8432675625,25.01664746875C30.5899395625,25.01664746875,30.2732655625,24.88997846875,30.0832675625,24.69997946875C29.7666035625,24.31998046875,29.8299385625,23.68664446875,30.2099375625,23.36998046875C32.2999385625,21.65998046875,33.8199385625,19.94997846875,34.5166015625,19.06331346875C32.8699375625,16.90997986875,26.4099365625,9.87998046875,18.9999365625,9.87998046875C17.9866025625,9.87998046875,16.973270562499998,10.00664736875,15.8966035625,10.25998046875C15.3899375625,10.38664726875,14.8832705625,10.06998036875,14.7566035625,9.56331346875C14.6299375625,9.05664666875,14.9466025625,8.54998045875,15.4532685625,8.42331355875C16.656603562500003,8.10664665875,17.8599375625,7.97998046875,18.9999355625,7.97998046875C28.6266045625,7.97998046875,36.2266045625,17.98664646875,36.5432735625,18.42998046875C36.7966005625,18.74664546875,36.7966005625,19.25331346875,36.5432735625,19.56997946875C36.4799385625,19.69664546875,34.5799365625,22.229979468750003,31.4766045625,24.76331346875C31.2866015625,24.88997846875,31.0966035625,25.01664546875,30.8432675625,25.01664746875Z" fill="currentColor" fill-opacity="1"></path></g><g><path d="M19.000116787499998,24.129969546875C16.1501171875,24.129969546875,13.8701171875,21.849969346875,13.8701171875,18.999969446875C13.8701171875,17.733303346875,14.3767833675,16.466635846875,15.2001170875,15.516635656875C15.5801171875,15.136635660875,16.1501171875,15.073301846875,16.5301169875,15.453301846875C16.9101171875,15.833301896875,16.9734511875,16.403301946875,16.5934509875,16.783301946875C16.0234508875,17.353302046875,15.7701171875,18.176635946875,15.7701171875,18.999968246875C15.7701171875,20.773302046875,17.226783287499998,22.229968546875,19.000116787499998,22.229968546875C19.8234510875,22.229968546875,20.6467833875,21.913302446875,21.2801169875,21.279968246875C21.6601171875,20.899968146875,22.2301168875,20.899968146875,22.6101169875,21.279968246875C22.9901170875,21.659968346875,22.9901170875,22.229968546875,22.6101169875,22.609968646875C21.6601171875,23.623302446875,20.3301171875,24.129968646875,19.000116787499998,24.129969546875Z" fill="currentColor" fill-opacity="1"></path></g><g><path d="M34.07315421875,35.023399359375C33.819822218750005,35.023399359375,33.56648621875,34.960067359375,33.37648821875,34.770067359375L3.22982418875,4.560068359375C2.84982422775,4.180068359375,2.84982422775,3.610068319375,3.22982418875,3.230068359375C3.6098241187499998,2.850068360375,4.17982411875,2.850068360375,4.55982411875,3.230068359375L34.769821218749996,33.440067359375C35.14981821875,33.820068359375,35.14981821875,34.390066359375,34.769821218749996,34.770067359375C34.579822218749996,34.960067359375,34.326490218749996,35.023399359375,34.07315421875,35.023399359375Z" fill="currentColor" fill-opacity="1"></path></g></g>', 2)
|
|
15
|
+
])]);
|
|
16
|
+
}
|
|
17
|
+
const s = /* @__PURE__ */ o(i, [["render", c]]);
|
|
18
|
+
export {
|
|
19
|
+
s as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as _ApFilePreview } from './ap-file-preview.vue';
|
|
2
|
+
import { CreateFilePreviewModal } from './interface';
|
|
3
|
+
export type ApFilePreviewType = typeof _ApFilePreview & {
|
|
4
|
+
createFilePreviewModal: CreateFilePreviewModal;
|
|
5
|
+
};
|
|
6
|
+
declare const ApFilePreview: ApFilePreviewType;
|
|
7
|
+
export { ApFilePreview };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { accessCreate } from '@aplus-frontend/oss';
|
|
2
|
+
import { VNodeChild } from 'vue';
|
|
3
|
+
import { CreateModalFuncProps } from '../../ap-modal';
|
|
4
|
+
export type ApFilePreviewParser = {
|
|
5
|
+
/**
|
|
6
|
+
* 文件格式
|
|
7
|
+
*/
|
|
8
|
+
format: string[];
|
|
9
|
+
/**
|
|
10
|
+
* 文件解析
|
|
11
|
+
* @param option.src 文件地址
|
|
12
|
+
* @param option.originalSrc 原始文件地址
|
|
13
|
+
* @param option.format 文件格式
|
|
14
|
+
* @param option.fileName 文件名
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
parser: (option: {
|
|
18
|
+
src: string;
|
|
19
|
+
originalSrc: string;
|
|
20
|
+
format: string;
|
|
21
|
+
fileName?: string;
|
|
22
|
+
}) => VNodeChild;
|
|
23
|
+
};
|
|
24
|
+
export interface ApFilePreviewProps {
|
|
25
|
+
/**
|
|
26
|
+
* 文件地址,支持网络地址和Oss路径
|
|
27
|
+
*/
|
|
28
|
+
src?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 文件名
|
|
31
|
+
*/
|
|
32
|
+
fileName?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 文件格式,默认为文件后缀
|
|
35
|
+
*/
|
|
36
|
+
format?: string;
|
|
37
|
+
/**
|
|
38
|
+
* 文件解析器,默认支持PDF和图片
|
|
39
|
+
*/
|
|
40
|
+
parserPlugin?: ApFilePreviewParser[];
|
|
41
|
+
getOssAccess?: (bucket?: string) => Promise<accessCreate>;
|
|
42
|
+
}
|
|
43
|
+
export type CreateFilePreviewModal = (option: ApFilePreviewProps & {
|
|
44
|
+
modalProps?: CreateModalFuncProps;
|
|
45
|
+
}) => void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { genComponentStyleHook as i } from "../../../utils/cssinjs/index.mjs";
|
|
2
|
+
const n = (e) => {
|
|
3
|
+
const { componentCls: t } = e;
|
|
4
|
+
return {
|
|
5
|
+
[`${t}`]: {
|
|
6
|
+
width: "100%",
|
|
7
|
+
height: "100%",
|
|
8
|
+
overflow: "hidden",
|
|
9
|
+
[`${t}-spin`]: {
|
|
10
|
+
display: "flex",
|
|
11
|
+
"align-items": "center",
|
|
12
|
+
"justify-content": "center",
|
|
13
|
+
width: "100%",
|
|
14
|
+
height: "100%"
|
|
15
|
+
},
|
|
16
|
+
[`${t}-result`]: {
|
|
17
|
+
display: "flex",
|
|
18
|
+
"align-items": "center",
|
|
19
|
+
"justify-content": "center",
|
|
20
|
+
"flex-direction": "column",
|
|
21
|
+
width: "100%",
|
|
22
|
+
height: "100%",
|
|
23
|
+
color: e.textColor3,
|
|
24
|
+
"&-icon": {
|
|
25
|
+
width: "64px",
|
|
26
|
+
height: "64px",
|
|
27
|
+
background: e.calc(e.antdv.colorTextPlaceholder).colorMix(10),
|
|
28
|
+
borderRadius: "100%",
|
|
29
|
+
display: "flex",
|
|
30
|
+
"align-items": "center",
|
|
31
|
+
"justify-content": "center"
|
|
32
|
+
},
|
|
33
|
+
"&-title": {
|
|
34
|
+
marginTop: e.spaceXL,
|
|
35
|
+
fontSize: e.fontSizeLG
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}, l = i("ApFilePreview", (e) => [
|
|
41
|
+
n(e)
|
|
42
|
+
]);
|
|
43
|
+
export {
|
|
44
|
+
l as default,
|
|
45
|
+
n as genApFilePreviewStyle
|
|
46
|
+
};
|
|
@@ -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
|
*/
|