@aplus-frontend/ui 6.26.5 → 6.28.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/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/es/src/ag-grid/hooks/use-columns-def.mjs +29 -29
- package/es/src/ag-grid/hooks/use-columns.d.ts +3 -2
- package/es/src/ag-grid/hooks/use-columns.mjs +16 -12
- package/es/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
- package/es/src/ag-grid/hooks/use-pinned-row.mjs +32 -0
- package/es/src/ag-grid/hooks/use-selection-col-def.d.ts +5 -0
- package/es/src/ag-grid/hooks/use-selection-col-def.mjs +34 -0
- package/es/src/ag-grid/index.vue.mjs +240 -227
- package/es/src/ag-grid/interface.d.ts +10 -7
- package/es/src/ag-grid/theme.mjs +6 -5
- package/es/src/ap-form/ap-form.vue.d.ts +2 -8
- package/es/src/ap-form/ap-form.vue2.mjs +3 -3
- package/es/src/ap-form/hooks/use-watch.mjs +25 -28
- package/es/src/ap-form/interface.d.ts +1 -1
- package/es/src/ap-grid/interface.d.ts +1 -1
- package/es/src/ap-modal/utils/createModal.mjs +14 -14
- package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
- package/es/src/ap-upload/apUpload.vue.mjs +38 -34
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +59 -59
- package/es/src/ap-upload/components/Picture.vue2.mjs +74 -74
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +95 -95
- package/es/src/business/ap-value-select-card/index.vue2.mjs +120 -123
- package/es/src/business/hooks/usePageListAgGrid.d.ts +1 -1
- package/es/src/business/hooks/usePageListAgGrid.mjs +4 -4
- package/es/src/business/hooks/usePageListApGrid.mjs +14 -14
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns.d.ts +3 -2
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
- package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -0
- package/lib/src/ag-grid/hooks/use-selection-col-def.d.ts +5 -0
- package/lib/src/ag-grid/hooks/use-selection-col-def.js +1 -0
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +10 -7
- package/lib/src/ag-grid/theme.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -8
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/hooks/use-watch.js +1 -1
- package/lib/src/ap-form/interface.d.ts +1 -1
- package/lib/src/ap-grid/interface.d.ts +1 -1
- package/lib/src/ap-modal/utils/createModal.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
- package/lib/src/ap-upload/apUpload.vue.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-value-select-card/index.vue2.js +1 -1
- package/lib/src/business/hooks/usePageListAgGrid.d.ts +1 -1
- package/lib/src/business/hooks/usePageListAgGrid.js +1 -1
- package/lib/src/business/hooks/usePageListApGrid.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ap-value-select-card/index.css +3 -4
- package/theme/ap-value-select-card/index.less +3 -4
- package/theme/index.css +3 -4
package/es/src/ag-grid/theme.mjs
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { useToken as
|
|
1
|
+
import { useToken as c } from "@aplus-frontend/antdv/es/theme/internal";
|
|
2
2
|
import { themeQuartz as n } from "ag-grid-community";
|
|
3
3
|
import { computed as d } from "vue";
|
|
4
4
|
const m = (r, e) => {
|
|
5
|
-
const [,
|
|
5
|
+
const [, a] = c();
|
|
6
6
|
return d(() => {
|
|
7
|
-
const
|
|
7
|
+
const t = r.value === "mini", o = a.value;
|
|
8
8
|
return n.withParams({
|
|
9
9
|
headerHeight: "36px",
|
|
10
10
|
headerFontSize: "12px",
|
|
11
11
|
dataFontSize: "12px",
|
|
12
12
|
rowHeight: e.value,
|
|
13
|
-
spacing:
|
|
13
|
+
spacing: t ? "5px" : "6.5px",
|
|
14
14
|
foregroundColor: o.colorTextBase,
|
|
15
15
|
wrapperBorder: !1,
|
|
16
16
|
rowBorder: { color: o.colorBorderSecondary },
|
|
17
17
|
headerRowBorder: { color: o.colorBorderSecondary },
|
|
18
18
|
selectedRowBackgroundColor: o.controlItemBgActive,
|
|
19
19
|
checkboxCheckedBackgroundColor: o.colorPrimary,
|
|
20
|
-
rowHoverColor: "var(--ap-color-bg-2)"
|
|
20
|
+
rowHoverColor: "var(--ap-color-bg-2)",
|
|
21
|
+
headerBackgroundColor: "var(--ap-table-header-bg)"
|
|
21
22
|
});
|
|
22
23
|
});
|
|
23
24
|
};
|
|
@@ -359,10 +359,7 @@ declare function __VLS_template(): {
|
|
|
359
359
|
};
|
|
360
360
|
md: {
|
|
361
361
|
type: PropType<string | number | ColSize>;
|
|
362
|
-
default: string | number |
|
|
363
|
-
* 注册表单项
|
|
364
|
-
* @param field
|
|
365
|
-
*/).ColSize;
|
|
362
|
+
default: string | number | ColSize;
|
|
366
363
|
};
|
|
367
364
|
lg: {
|
|
368
365
|
type: PropType<string | number | ColSize>;
|
|
@@ -1032,10 +1029,7 @@ declare const __VLS_component: DefineComponent<ApFormProps, {
|
|
|
1032
1029
|
};
|
|
1033
1030
|
md: {
|
|
1034
1031
|
type: PropType<string | number | ColSize>;
|
|
1035
|
-
default: string | number |
|
|
1036
|
-
* 注册表单项
|
|
1037
|
-
* @param field
|
|
1038
|
-
*/).ColSize;
|
|
1032
|
+
default: string | number | ColSize;
|
|
1039
1033
|
};
|
|
1040
1034
|
lg: {
|
|
1041
1035
|
type: PropType<string | number | ColSize>;
|
|
@@ -107,9 +107,9 @@ const we = /* @__PURE__ */ z({
|
|
|
107
107
|
}, I = (e, t, r = !0, o) => {
|
|
108
108
|
V(e, t, r, o), y();
|
|
109
109
|
};
|
|
110
|
-
function U(e
|
|
111
|
-
return
|
|
112
|
-
p = p.filter((
|
|
110
|
+
function U(e) {
|
|
111
|
+
return e(P(l)), p.push(e), () => {
|
|
112
|
+
p = p.filter((t) => t !== e);
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
function J(e, t) {
|
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
import { useInjectForm as
|
|
2
|
-
import { ref as
|
|
3
|
-
import { INTERNAL_FORM_INSTANCE_MARK as
|
|
4
|
-
import { getModelValue as
|
|
5
|
-
function o(
|
|
1
|
+
import { useInjectForm as h } from "../context.mjs";
|
|
2
|
+
import { ref as w, computed as I, watchEffect as S, unref as c, watch as N } from "vue";
|
|
3
|
+
import { INTERNAL_FORM_INSTANCE_MARK as M } from "../constant.mjs";
|
|
4
|
+
import { getModelValue as v } from "../utils/get.mjs";
|
|
5
|
+
function o(t) {
|
|
6
6
|
try {
|
|
7
|
-
return JSON.stringify(
|
|
7
|
+
return JSON.stringify(t);
|
|
8
8
|
} catch {
|
|
9
9
|
return Math.random();
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const { internalInstance: d, model: g } =
|
|
14
|
-
let
|
|
15
|
-
const
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
if (!t) {
|
|
19
|
-
s = !1;
|
|
12
|
+
function _(t, e, V) {
|
|
13
|
+
const { internalInstance: d, model: g } = h(), i = V?.initialValue || e?.initialValue || void 0, u = w(i);
|
|
14
|
+
let n = o(i);
|
|
15
|
+
const f = I(() => (e && "value" in e ? e : void 0)?.value?.getInternalInstance(M) || d);
|
|
16
|
+
return S((a) => {
|
|
17
|
+
if (!f.value)
|
|
20
18
|
return;
|
|
19
|
+
const r = f.value.registerWatch((l) => {
|
|
20
|
+
const s = v(l, c(t)), m = o(s);
|
|
21
|
+
m !== n && (u.value = s, n = m);
|
|
22
|
+
});
|
|
23
|
+
a(r);
|
|
24
|
+
}), N(
|
|
25
|
+
() => c(t),
|
|
26
|
+
(a) => {
|
|
27
|
+
const r = v(c(g), a), l = o(r);
|
|
28
|
+
l !== n && (u.value = r, n = l);
|
|
21
29
|
}
|
|
22
|
-
|
|
23
|
-
const f = m(w, c(e)), V = o(f);
|
|
24
|
-
V !== a && (l.value = f, a = V);
|
|
25
|
-
}, s);
|
|
26
|
-
i(r);
|
|
27
|
-
}), M(
|
|
28
|
-
() => c(e),
|
|
29
|
-
(i) => {
|
|
30
|
-
const t = m(c(g), i), r = o(t);
|
|
31
|
-
r !== a && (l.value = t, a = r);
|
|
32
|
-
}
|
|
33
|
-
), l;
|
|
30
|
+
), u;
|
|
34
31
|
}
|
|
35
32
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
_ as default,
|
|
34
|
+
_ as useWatch
|
|
38
35
|
};
|
|
@@ -114,7 +114,7 @@ export type ApFormInternalInstance = {
|
|
|
114
114
|
* @param inner
|
|
115
115
|
* @returns
|
|
116
116
|
*/
|
|
117
|
-
registerWatch: (callback: WatchFunc, inner
|
|
117
|
+
registerWatch: (callback: WatchFunc, inner?: boolean) => () => void;
|
|
118
118
|
/**
|
|
119
119
|
* 注册表单项
|
|
120
120
|
* @param field
|
|
@@ -8,7 +8,7 @@ import { VxeTablePropTypes, VxeColumnPropTypes, VxeTableProps, VxeTableDefines,
|
|
|
8
8
|
import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
|
|
9
9
|
export type ColConfigType = VxeTableDefines.ColumnOptions;
|
|
10
10
|
export type ApGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ExtraProColumnType<RecordType>, 'sorter' | 'rowSpan' | 'customCell' | 'customHeaderCell' | 'minWidth' | 'className' | 'class'> & {
|
|
11
|
-
children?: ApGridColumnType<RecordType, ExtraValueType, ValueType
|
|
11
|
+
children?: ApGridColumnType<RecordType, ExtraValueType, ValueType>[];
|
|
12
12
|
/**
|
|
13
13
|
* 表单项所占据的格子数(1-24格)
|
|
14
14
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { render as m, defineComponent as y, createVNode as d, mergeProps as
|
|
2
|
-
import { Modal as
|
|
1
|
+
import { render as m, defineComponent as y, createVNode as d, mergeProps as x, h as k } from "vue";
|
|
2
|
+
import { Modal as w } from "@aplus-frontend/antdv";
|
|
3
3
|
import { ConfigProvider as P, globalConfigCached as l } from "../../config-provider/config-provider.mjs";
|
|
4
4
|
import { omit as b } from "lodash-unified";
|
|
5
5
|
import { isNumeric as N } from "@aplus-frontend/utils";
|
|
@@ -13,9 +13,9 @@ const q = (s) => {
|
|
|
13
13
|
destroyOnClose: a = !0,
|
|
14
14
|
wrapperOffset: t = !1
|
|
15
15
|
} = s, {
|
|
16
|
-
b:
|
|
16
|
+
b: p
|
|
17
17
|
} = E("ap-modal");
|
|
18
|
-
function
|
|
18
|
+
function i() {
|
|
19
19
|
o && o(!1), setTimeout(() => {
|
|
20
20
|
m(null, r), r.parentElement?.removeChild(r);
|
|
21
21
|
}, 500);
|
|
@@ -52,7 +52,7 @@ const q = (s) => {
|
|
|
52
52
|
const e = this.props?.content?.component?.exposed ?? void 0;
|
|
53
53
|
await this.props?.onCancel(e);
|
|
54
54
|
}
|
|
55
|
-
a ?
|
|
55
|
+
a ? i() : c();
|
|
56
56
|
},
|
|
57
57
|
async handleOk() {
|
|
58
58
|
try {
|
|
@@ -64,7 +64,7 @@ const q = (s) => {
|
|
|
64
64
|
}
|
|
65
65
|
n({
|
|
66
66
|
confirmLoading: !1
|
|
67
|
-
}), a ?
|
|
67
|
+
}), a ? i() : c();
|
|
68
68
|
} catch {
|
|
69
69
|
n({
|
|
70
70
|
confirmLoading: !1
|
|
@@ -75,10 +75,10 @@ const q = (s) => {
|
|
|
75
75
|
render() {
|
|
76
76
|
const e = b(this.props, ["onCancel", "onOk", "open", "onUpdate:open", "getContainer", "icon"]);
|
|
77
77
|
return d(P, l.value, {
|
|
78
|
-
default: () => [d(
|
|
78
|
+
default: () => [d(w, x({
|
|
79
79
|
class: {
|
|
80
|
-
[
|
|
81
|
-
[
|
|
80
|
+
[p()]: !0,
|
|
81
|
+
[p("wrapper")]: t
|
|
82
82
|
},
|
|
83
83
|
open: this.open,
|
|
84
84
|
onCancel: this.handleCancel,
|
|
@@ -87,18 +87,18 @@ const q = (s) => {
|
|
|
87
87
|
}, e), {
|
|
88
88
|
default: () => [d("div", {
|
|
89
89
|
class: {
|
|
90
|
-
[
|
|
90
|
+
[p("body-wrapper")]: t
|
|
91
91
|
},
|
|
92
92
|
style: t === !1 ? {} : {
|
|
93
|
-
maxHeight:
|
|
93
|
+
maxHeight: `calc(100vh - ${(t === !0 ? 100 : N(t) ? Number(t) : 100) * 2}px)`
|
|
94
94
|
}
|
|
95
95
|
}, [this.props?.content])]
|
|
96
96
|
})]
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
}), g = f(l?.value?.getPopupContainer), O = f(s.getContainer),
|
|
100
|
-
return
|
|
101
|
-
destroy:
|
|
99
|
+
}), g = f(l?.value?.getPopupContainer), O = f(s.getContainer), v = g || O || L().document.body, r = document.createElement("div");
|
|
100
|
+
return v.appendChild(r), m(k(C), r), {
|
|
101
|
+
destroy: i,
|
|
102
102
|
update: h,
|
|
103
103
|
open: u,
|
|
104
104
|
close: c
|
|
@@ -81,6 +81,10 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
|
81
81
|
type: FunctionConstructor;
|
|
82
82
|
default: undefined;
|
|
83
83
|
};
|
|
84
|
+
showUploadErrorMsg: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
84
88
|
}>, {
|
|
85
89
|
done: ComputedRef<boolean>;
|
|
86
90
|
clear: typeof clear;
|
|
@@ -156,6 +160,10 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
|
156
160
|
type: FunctionConstructor;
|
|
157
161
|
default: undefined;
|
|
158
162
|
};
|
|
163
|
+
showUploadErrorMsg: {
|
|
164
|
+
type: BooleanConstructor;
|
|
165
|
+
default: boolean;
|
|
166
|
+
};
|
|
159
167
|
}>> & Readonly<{
|
|
160
168
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
161
169
|
}>, {
|
|
@@ -177,6 +185,7 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
|
177
185
|
subTitle: string | VNode< RendererNode, RendererElement, {
|
|
178
186
|
[key: string]: any;
|
|
179
187
|
}>;
|
|
188
|
+
showUploadErrorMsg: boolean;
|
|
180
189
|
maxCountErrorMsg: string;
|
|
181
190
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
182
191
|
uploadRef: unknown;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as _, ref as u, computed as p, provide as t, createElementBlock as h, openBlock as m, normalizeClass as U, unref as O, createBlock as R, resolveDynamicComponent as z, mergeProps as j, createSlots as A, renderList as $, withCtx as k, renderSlot as B, normalizeProps as T, guardReactiveProps as w } from "vue";
|
|
2
2
|
import "../config-provider/index.mjs";
|
|
3
3
|
import "./components/SingleFile.vue.mjs";
|
|
4
4
|
import "./components/MultipleFile.vue.mjs";
|
|
5
5
|
import "./components/Picture.vue.mjs";
|
|
6
|
-
import { injectLocaleToAccept as
|
|
7
|
-
import { injectLocaleToOss as
|
|
8
|
-
import { Form as
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useNamespace as
|
|
6
|
+
import { injectLocaleToAccept as L } from "./utils/accept.mjs";
|
|
7
|
+
import { injectLocaleToOss as q } from "./hooks/useOss.mjs";
|
|
8
|
+
import { Form as I } from "@aplus-frontend/antdv";
|
|
9
|
+
import { useLocale as P } from "../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as V } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
11
|
import D from "./components/Picture.vue2.mjs";
|
|
12
12
|
import G from "./components/MultipleFile.vue2.mjs";
|
|
13
13
|
import H from "./components/SingleFile.vue2.mjs";
|
|
14
14
|
import { useGlobalConfig as c } from "../config-provider/hooks/use-global-config.mjs";
|
|
15
|
-
const
|
|
15
|
+
const le = /* @__PURE__ */ _({
|
|
16
16
|
name: "AplusFileUpload",
|
|
17
17
|
__name: "apUpload",
|
|
18
18
|
props: {
|
|
@@ -83,54 +83,58 @@ const ue = /* @__PURE__ */ E({
|
|
|
83
83
|
onRemove: {
|
|
84
84
|
type: Function,
|
|
85
85
|
default: void 0
|
|
86
|
+
},
|
|
87
|
+
showUploadErrorMsg: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: !0
|
|
86
90
|
}
|
|
87
91
|
},
|
|
88
92
|
emits: ["update:value"],
|
|
89
93
|
setup(d, { expose: f, emit: g }) {
|
|
90
|
-
const { t:
|
|
91
|
-
|
|
92
|
-
const { b: y } =
|
|
94
|
+
const { t: a, lang: v } = P();
|
|
95
|
+
L(a), q(a, v);
|
|
96
|
+
const { b: y } = V("ap-upload"), n = u(null), e = d, C = g, S = {
|
|
93
97
|
singleFile: H,
|
|
94
98
|
multipleFile: G,
|
|
95
99
|
picture: D
|
|
96
|
-
}, x =
|
|
100
|
+
}, x = I.useInjectFormItemContext(), b = p({
|
|
97
101
|
get() {
|
|
98
102
|
return e.value;
|
|
99
103
|
},
|
|
100
104
|
set(o) {
|
|
101
105
|
C("update:value", o), x?.onFieldChange(), e.onChange?.(o);
|
|
102
106
|
}
|
|
103
|
-
}),
|
|
104
|
-
t("theme",
|
|
107
|
+
}), M = c("uiMode"), r = c("apUpload");
|
|
108
|
+
t("theme", M.value), t("value", b), t("dirName", e.dirName ?? r.value?.dirName), t(
|
|
105
109
|
"needName",
|
|
106
|
-
e.needName ??
|
|
107
|
-
), t("accept", e.accept ??
|
|
110
|
+
e.needName ?? r.value?.needName ?? !1
|
|
111
|
+
), t("accept", e.accept ?? r.value?.accept ?? ""), t("maxSize", e.maxSize), t("title", e.title), t("subTitle", e.subTitle), t("maxCount", e.maxCount), t("beforeUpload", e.beforeUpload), t("customRequest", e.customRequest), t(
|
|
108
112
|
"getOssAccess",
|
|
109
|
-
e.getOssAccess ??
|
|
110
|
-
), t("maxSizeErrorMsg", e.maxSizeErrorMsg), t("maxCountErrorMsg", e.maxCountErrorMsg), t("acceptErrorMsg", e.acceptErrorMsg), t("onRemove", e.onRemove);
|
|
111
|
-
const
|
|
112
|
-
t("uploadingCount",
|
|
113
|
-
function
|
|
114
|
-
|
|
113
|
+
e.getOssAccess ?? r.value?.getOssAccess
|
|
114
|
+
), t("maxSizeErrorMsg", e.maxSizeErrorMsg), t("maxCountErrorMsg", e.maxCountErrorMsg), t("acceptErrorMsg", e.acceptErrorMsg), t("onRemove", e.onRemove), t("showUploadErrorMsg", e.showUploadErrorMsg);
|
|
115
|
+
const E = p(() => s.value === 0), s = u(0);
|
|
116
|
+
t("uploadingCount", s);
|
|
117
|
+
function F() {
|
|
118
|
+
i(void 0);
|
|
115
119
|
}
|
|
116
|
-
function
|
|
120
|
+
function i(o) {
|
|
117
121
|
n?.value?.setValue?.(o);
|
|
118
122
|
}
|
|
119
123
|
return f({
|
|
120
|
-
done:
|
|
121
|
-
clear:
|
|
122
|
-
setValue:
|
|
123
|
-
}), (o, J) => (m(),
|
|
124
|
-
class:
|
|
124
|
+
done: E,
|
|
125
|
+
clear: F,
|
|
126
|
+
setValue: i
|
|
127
|
+
}), (o, J) => (m(), h("div", {
|
|
128
|
+
class: U(O(y)())
|
|
125
129
|
}, [
|
|
126
|
-
(m(),
|
|
130
|
+
(m(), R(z(S[e.type]), j(o.$attrs, {
|
|
127
131
|
ref_key: "uploadRef",
|
|
128
132
|
ref: n
|
|
129
|
-
}),
|
|
130
|
-
$(Object.keys(o.$slots), (
|
|
131
|
-
name:
|
|
132
|
-
fn: k((
|
|
133
|
-
|
|
133
|
+
}), A({ _: 2 }, [
|
|
134
|
+
$(Object.keys(o.$slots), (l) => ({
|
|
135
|
+
name: l,
|
|
136
|
+
fn: k((N) => [
|
|
137
|
+
B(o.$slots, l, T(w(N || {})))
|
|
134
138
|
])
|
|
135
139
|
}))
|
|
136
140
|
]), 1040))
|
|
@@ -138,5 +142,5 @@ const ue = /* @__PURE__ */ E({
|
|
|
138
142
|
}
|
|
139
143
|
});
|
|
140
144
|
export {
|
|
141
|
-
|
|
145
|
+
le as default
|
|
142
146
|
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as H, inject as a, ref as J, watch as K, nextTick as Q, createElementBlock as U, openBlock as h, normalizeClass as X, unref as s, createVNode as k, withCtx as T, createElementVNode as b, createTextVNode as Y, toDisplayString as M, withModifiers as Z, createCommentVNode as ee, createBlock as te, resolveDynamicComponent as oe } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as
|
|
4
|
-
import { useOss as
|
|
5
|
-
import { message as c, Upload as
|
|
6
|
-
import { UploadOutlined as
|
|
7
|
-
import { fileMatchesAccept as
|
|
8
|
-
import { useLocale as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
const
|
|
3
|
+
import { getPath as ae, getName as se, getReturnData as S } from "../utils/returnData.mjs";
|
|
4
|
+
import { useOss as ne, getOssInstance as re } from "../hooks/useOss.mjs";
|
|
5
|
+
import { message as c, Upload as ie, Button as le } from "@aplus-frontend/antdv";
|
|
6
|
+
import { UploadOutlined as ue } from "@ant-design/icons-vue";
|
|
7
|
+
import { fileMatchesAccept as ce, getAcceptText as pe } from "../utils/accept.mjs";
|
|
8
|
+
import { useLocale as me } from "../../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
const fe = { class: "multiple-file-context" }, ge = { key: 0 }, ve = { key: 1 }, Fe = /* @__PURE__ */ H({
|
|
11
11
|
__name: "MultipleFile",
|
|
12
|
-
setup(
|
|
13
|
-
const { t: r } =
|
|
14
|
-
|
|
12
|
+
setup(he, { expose: L }) {
|
|
13
|
+
const { t: r } = me(), { b: C } = de("ap-upload-multiple-file"), { put: z } = ne(), B = a("theme"), I = a("dirName"), x = a("accept") || "*", E = a("maxSize") ?? 500, P = a("title") || r("ap.apUpload.uploadFile"), d = a("subTitle"), i = a("maxCount") ?? 10, p = a("uploadingCount"), _ = a("beforeUpload"), A = a("customRequest"), O = a("getOssAccess"), V = a("maxSizeErrorMsg"), q = a("maxCountErrorMsg"), D = a("acceptErrorMsg"), F = a("onRemove"), w = a("showUploadErrorMsg"), n = a("value"), l = [], f = a("needName"), m = J(null);
|
|
14
|
+
K(
|
|
15
15
|
() => n?.value,
|
|
16
16
|
function(e) {
|
|
17
|
-
!m?.value?.fileList?.length && e &&
|
|
17
|
+
!m?.value?.fileList?.length && e && N(e);
|
|
18
18
|
},
|
|
19
19
|
{ immediate: !0 }
|
|
20
20
|
);
|
|
21
|
-
function
|
|
21
|
+
function N(e) {
|
|
22
22
|
if (!e) {
|
|
23
23
|
u = [], m.value.fileList = [], n.value = void 0, l.splice(0, l.length);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
Q(() => {
|
|
27
27
|
const t = e.map((o) => {
|
|
28
|
-
const v =
|
|
28
|
+
const v = ae(f, o), G = se(f, o), y = new File(
|
|
29
29
|
[o],
|
|
30
|
-
|
|
30
|
+
G,
|
|
31
31
|
{}
|
|
32
32
|
);
|
|
33
33
|
return y.response = v, y.uid = v, y;
|
|
@@ -48,8 +48,8 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
48
48
|
}), m.value.fileList = t, n.value = e;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
L({ setValue:
|
|
52
|
-
let u = [],
|
|
51
|
+
L({ setValue: N });
|
|
52
|
+
let u = [], R;
|
|
53
53
|
function g(e) {
|
|
54
54
|
setTimeout(() => {
|
|
55
55
|
const t = m.value.fileList.findIndex(
|
|
@@ -58,32 +58,32 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
58
58
|
t >= 0 && m.value.fileList.splice(t, 1);
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
async function
|
|
61
|
+
async function $(e) {
|
|
62
62
|
if (i && i > 1 && u.length >= i)
|
|
63
|
-
return clearTimeout(
|
|
63
|
+
return clearTimeout(R), R = setTimeout(() => {
|
|
64
64
|
c.warning(
|
|
65
|
-
|
|
65
|
+
q || r("ap.apUpload.maxUploadFiles", {
|
|
66
66
|
maxCount: i
|
|
67
67
|
})
|
|
68
68
|
);
|
|
69
69
|
}), g(e), !1;
|
|
70
|
-
if (e.size >
|
|
70
|
+
if (e.size > E * 1024 * 1024)
|
|
71
71
|
return c.warning(
|
|
72
|
-
|
|
73
|
-
maxSize:
|
|
72
|
+
V || r("ap.apUpload.maxUploadFileSize", {
|
|
73
|
+
maxSize: E
|
|
74
74
|
})
|
|
75
75
|
), g(e), !1;
|
|
76
|
-
if (!
|
|
76
|
+
if (!ce(e, x))
|
|
77
77
|
return c.warning(
|
|
78
|
-
|
|
78
|
+
D || r("ap.apUpload.fileFormatNotSupported")
|
|
79
79
|
), g(e), !1;
|
|
80
|
-
if (typeof
|
|
80
|
+
if (typeof _ == "function" && await _(e) === !1)
|
|
81
81
|
return g(e), !1;
|
|
82
82
|
i && i === 1 && (u = [], n.value = void 0), u.push(e);
|
|
83
83
|
}
|
|
84
|
-
async function
|
|
85
|
-
if (p.value++, typeof
|
|
86
|
-
|
|
84
|
+
async function j(e) {
|
|
85
|
+
if (p.value++, typeof A == "function") {
|
|
86
|
+
A({
|
|
87
87
|
onProgress: (t) => {
|
|
88
88
|
setTimeout(() => {
|
|
89
89
|
e.onProgress({
|
|
@@ -92,7 +92,7 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
94
|
onError: (t) => {
|
|
95
|
-
c.warning(t || r("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
95
|
+
w && c.warning(t || r("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
96
96
|
e.onError({
|
|
97
97
|
name: t,
|
|
98
98
|
message: t
|
|
@@ -115,10 +115,10 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
try {
|
|
118
|
-
const t = await
|
|
119
|
-
e.file.oss = t,
|
|
118
|
+
const t = await re(O);
|
|
119
|
+
e.file.oss = t, z({
|
|
120
120
|
file: e.file,
|
|
121
|
-
dirName:
|
|
121
|
+
dirName: I,
|
|
122
122
|
oss: t,
|
|
123
123
|
successCallBack(o) {
|
|
124
124
|
e.onSuccess(o), n.value = [
|
|
@@ -130,7 +130,7 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
130
130
|
}), p.value--;
|
|
131
131
|
},
|
|
132
132
|
errorCallBack(o) {
|
|
133
|
-
c.warning(o || r("ap.apUpload.networkAnomaly")), e.onError({
|
|
133
|
+
w && c.warning(o || r("ap.apUpload.networkAnomaly")), e.onError({
|
|
134
134
|
name: o,
|
|
135
135
|
message: o
|
|
136
136
|
}), p.value--;
|
|
@@ -142,7 +142,7 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
} catch (t) {
|
|
145
|
-
c.warning(
|
|
145
|
+
w && c.warning(
|
|
146
146
|
typeof t?.message == "string" ? t.message : r("ap.apUpload.networkAnomaly")
|
|
147
147
|
), e.onError({
|
|
148
148
|
name: t?.message || r("ap.apUpload.networkAnomaly"),
|
|
@@ -150,8 +150,8 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
150
150
|
}), p.value--;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (
|
|
153
|
+
function W(e) {
|
|
154
|
+
if (F && F?.(e), e.response) {
|
|
155
155
|
if (Array.isArray(n.value)) {
|
|
156
156
|
const o = l.findIndex((v) => v.uid === e.uid);
|
|
157
157
|
o >= 0 && (n?.value.splice(o, 1), l.splice(o, 1)), n.value.length === 0 && (n.value = void 0);
|
|
@@ -163,16 +163,16 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
163
163
|
);
|
|
164
164
|
return u.splice(t, 1), Promise.resolve(!0);
|
|
165
165
|
}
|
|
166
|
-
return (e, t) => (
|
|
167
|
-
class:
|
|
166
|
+
return (e, t) => (h(), U("div", {
|
|
167
|
+
class: X({
|
|
168
168
|
[s(C)()]: !0,
|
|
169
|
-
[s(C)("admin")]: s(
|
|
169
|
+
[s(C)("admin")]: s(B) === "admin"
|
|
170
170
|
})
|
|
171
171
|
}, [
|
|
172
|
-
k(s(
|
|
172
|
+
k(s(ie), {
|
|
173
173
|
ref_key: "uploadRef",
|
|
174
174
|
ref: m,
|
|
175
|
-
accept: s(
|
|
175
|
+
accept: s(x),
|
|
176
176
|
multiple: "",
|
|
177
177
|
"max-count": s(i),
|
|
178
178
|
progress: {
|
|
@@ -180,27 +180,27 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
180
180
|
showInfo: !1,
|
|
181
181
|
strokeColor: "#0070FF"
|
|
182
182
|
},
|
|
183
|
-
"before-upload":
|
|
184
|
-
"custom-request":
|
|
185
|
-
onRemove:
|
|
183
|
+
"before-upload": $,
|
|
184
|
+
"custom-request": j,
|
|
185
|
+
onRemove: W
|
|
186
186
|
}, {
|
|
187
|
-
default:
|
|
188
|
-
|
|
189
|
-
k(s(
|
|
190
|
-
default:
|
|
191
|
-
k(s(
|
|
192
|
-
|
|
187
|
+
default: T(() => [
|
|
188
|
+
b("div", fe, [
|
|
189
|
+
k(s(le), { class: "file-btn" }, {
|
|
190
|
+
default: T(() => [
|
|
191
|
+
k(s(ue)),
|
|
192
|
+
Y(" " + M(s(P)), 1)
|
|
193
193
|
]),
|
|
194
194
|
_: 1
|
|
195
195
|
}),
|
|
196
|
-
|
|
196
|
+
b("div", {
|
|
197
197
|
class: "sub-title",
|
|
198
|
-
onClick: t[0] || (t[0] =
|
|
198
|
+
onClick: t[0] || (t[0] = Z(() => {
|
|
199
199
|
}, ["stop"]))
|
|
200
200
|
}, [
|
|
201
|
-
typeof s(d) == "string" ? (
|
|
202
|
-
(
|
|
203
|
-
])) :
|
|
201
|
+
typeof s(d) == "string" ? (h(), U("div", ge, M(s(d) || `${s(r)("ap.apUpload.supportExtension")}:${s(pe)(s(x))}`), 1)) : s(d) ? (h(), U("div", ve, [
|
|
202
|
+
(h(), te(oe(s(d))))
|
|
203
|
+
])) : ee("", !0)
|
|
204
204
|
])
|
|
205
205
|
])
|
|
206
206
|
]),
|
|
@@ -210,5 +210,5 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
export {
|
|
213
|
-
|
|
213
|
+
Fe as default
|
|
214
214
|
};
|