@aplus-frontend/ui 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-field/date-range/index.vue.mjs +46 -42
- package/es/src/ap-field/hooks/use-default-presets.d.ts +11 -0
- package/es/src/ap-field/hooks/use-default-presets.mjs +15 -0
- package/es/src/ap-field/interface.d.ts +2 -1
- package/es/src/ap-table/ap-table.vue2.mjs +87 -85
- package/es/src/ap-table/components/dynamic-component/diff.d.ts +2 -0
- package/es/src/ap-table/components/dynamic-component/index.vue.d.ts +4 -0
- package/es/src/ap-table/components/dynamic-component/index.vue.mjs +4 -0
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +14 -0
- package/es/src/ap-table/components/interface.d.ts +3 -0
- package/es/src/ap-table/utils.d.ts +1549 -1539
- package/es/src/ap-table/utils.mjs +115 -104
- package/es/src/ap-upload/components/Picture.vue2.mjs +59 -55
- package/es/src/business/batch-input-group/form-item.vue.d.ts +0 -1
- package/es/src/business/batch-input-group/form-item.vue.mjs +43 -39
- package/es/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/es/src/locale/lang/en.mjs +10 -1
- package/es/src/locale/lang/zh-cn.mjs +10 -1
- package/es/src/utils/data-range-persets.d.ts +87 -0
- package/es/src/utils/data-range-persets.mjs +107 -0
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/hooks/use-default-presets.d.ts +11 -0
- package/lib/src/ap-field/hooks/use-default-presets.js +1 -0
- package/lib/src/ap-field/interface.d.ts +2 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/dynamic-component/diff.d.ts +2 -0
- package/lib/src/ap-table/components/dynamic-component/index.vue.d.ts +4 -0
- package/lib/src/ap-table/components/dynamic-component/index.vue.js +1 -0
- package/lib/src/ap-table/components/dynamic-component/index.vue2.js +1 -0
- package/lib/src/ap-table/components/interface.d.ts +3 -0
- package/lib/src/ap-table/utils.d.ts +1549 -1539
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/business/batch-input-group/form-item.vue.d.ts +0 -1
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/utils/data-range-persets.d.ts +87 -0
- package/lib/src/utils/data-range-persets.js +1 -0
- package/package.json +3 -3
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { isObject as a, isArray as
|
|
3
|
-
import { apTableRenderItemMap as
|
|
4
|
-
import { isType as
|
|
1
|
+
import { isVNode as E, createVNode as l, mergeProps as y, cloneVNode as j, Fragment as O } from "vue";
|
|
2
|
+
import { isObject as a, isArray as c, isUndefined as g, isFunction as T, omit as C, isBoolean as F, isString as N, isEqual as S, sortBy as p, isPlainObject as m, every as I, isEmpty as v } from "lodash-unified";
|
|
3
|
+
import { apTableRenderItemMap as P, apTableFormItemMap as V } from "./constants.mjs";
|
|
4
|
+
import { isType as _ } from "@fruits-chain/utils";
|
|
5
5
|
import "../ap-form/index.mjs";
|
|
6
6
|
import { Tooltip as w } from "@aplus-frontend/antdv";
|
|
7
|
-
import { QuestionCircleOutlined as
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { QuestionCircleOutlined as x } from "@ant-design/icons-vue";
|
|
8
|
+
import "./components/dynamic-component/index.vue.mjs";
|
|
9
|
+
import d from "./components/dynamic-component/index.vue2.mjs";
|
|
10
|
+
import A from "../ap-form/item/index.vue.mjs";
|
|
11
|
+
function R(t) {
|
|
12
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !E(t);
|
|
11
13
|
}
|
|
12
14
|
const q = (t, e, n) => {
|
|
13
15
|
let o = {};
|
|
14
|
-
return a(t) ? Object.keys(t).forEach((
|
|
15
|
-
a(t[
|
|
16
|
+
return a(t) ? Object.keys(t).forEach((i) => {
|
|
17
|
+
a(t[i]) ? o[i] = q(t[i], e[i], n) : o[i] = n(t[i], e);
|
|
16
18
|
}) : o = n(t, e), o;
|
|
17
|
-
},
|
|
19
|
+
}, k = (t, e) => {
|
|
18
20
|
switch (t) {
|
|
19
21
|
case "dayjs":
|
|
20
22
|
return e.valueOf();
|
|
@@ -26,7 +28,7 @@ const q = (t, e, n) => {
|
|
|
26
28
|
}
|
|
27
29
|
case "multiple":
|
|
28
30
|
case "multipleNumber":
|
|
29
|
-
return
|
|
31
|
+
return c(e) ? e : [e];
|
|
30
32
|
case "boolean":
|
|
31
33
|
return e;
|
|
32
34
|
case "object":
|
|
@@ -35,103 +37,112 @@ const q = (t, e, n) => {
|
|
|
35
37
|
return e;
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
|
-
function
|
|
39
|
-
return
|
|
40
|
+
function H(t) {
|
|
41
|
+
return c(t) ? t.join(".") : t;
|
|
40
42
|
}
|
|
41
43
|
function W(t) {
|
|
42
44
|
const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
|
|
43
45
|
return e === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : e;
|
|
44
46
|
}
|
|
45
|
-
const
|
|
46
|
-
const e = [], n =
|
|
47
|
-
return n.forEach((o,
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
if (typeof
|
|
47
|
+
const $ = (t) => W(t) === "map" ? t : new Map(Object.entries(t || {})), b = (t) => {
|
|
48
|
+
const e = [], n = $(t);
|
|
49
|
+
return n.forEach((o, i) => {
|
|
50
|
+
const r = n.get(i) || n.get(`${i}`);
|
|
51
|
+
if (r) {
|
|
52
|
+
if (typeof r == "object" && (r != null && r.text)) {
|
|
51
53
|
e.push({
|
|
52
|
-
text:
|
|
53
|
-
value:
|
|
54
|
-
label:
|
|
55
|
-
disabled:
|
|
54
|
+
text: r == null ? void 0 : r.text,
|
|
55
|
+
value: i,
|
|
56
|
+
label: r == null ? void 0 : r.text,
|
|
57
|
+
disabled: r.disabled
|
|
56
58
|
});
|
|
57
59
|
return;
|
|
58
60
|
}
|
|
59
61
|
e.push({
|
|
60
|
-
text:
|
|
61
|
-
label:
|
|
62
|
-
value:
|
|
62
|
+
text: r,
|
|
63
|
+
label: r,
|
|
64
|
+
value: i
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
67
|
}), e;
|
|
66
|
-
},
|
|
67
|
-
function
|
|
68
|
-
return !t || !
|
|
68
|
+
}, M = (t) => g(t) || t < 0 ? 0 : t;
|
|
69
|
+
function B(t, e) {
|
|
70
|
+
return !t || !T(t) ? t : t(e);
|
|
69
71
|
}
|
|
70
|
-
function
|
|
72
|
+
function tt(t) {
|
|
71
73
|
let e = t.valueType || "text";
|
|
72
74
|
return t.valueEnum && (e = "status"), e;
|
|
73
75
|
}
|
|
74
|
-
function
|
|
75
|
-
var
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
return
|
|
76
|
+
function et(t, e, n, o) {
|
|
77
|
+
var u;
|
|
78
|
+
const i = P[t];
|
|
79
|
+
if (i)
|
|
80
|
+
return l(i, y(e, {
|
|
79
81
|
mode: "read"
|
|
80
82
|
}), null);
|
|
81
|
-
const
|
|
82
|
-
return ((
|
|
83
|
+
const r = o == null ? void 0 : o[t];
|
|
84
|
+
return ((u = r == null ? void 0 : r.render) == null ? void 0 : u.call(r, e.value, n, e)) || e.value;
|
|
83
85
|
}
|
|
84
|
-
function
|
|
86
|
+
function nt(t, e) {
|
|
85
87
|
if (t.customRenderFormItem)
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
return {
|
|
89
|
+
Comp: d,
|
|
90
|
+
render: function(u) {
|
|
91
|
+
const s = u.item.customRenderFormItem(u.item);
|
|
92
|
+
return j(s, {
|
|
93
|
+
...u.item.fieldProps,
|
|
94
|
+
span: u.item.span,
|
|
95
|
+
...s.props || {}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
93
98
|
};
|
|
94
|
-
const n =
|
|
99
|
+
const n = V[t.valueType];
|
|
95
100
|
if (n)
|
|
96
|
-
return
|
|
101
|
+
return {
|
|
102
|
+
Comp: n
|
|
103
|
+
};
|
|
97
104
|
const o = e == null ? void 0 : e[t.valueType];
|
|
98
|
-
|
|
99
|
-
var
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
span:
|
|
103
|
-
}),
|
|
104
|
-
default: () => [
|
|
105
|
+
function i(r) {
|
|
106
|
+
var s;
|
|
107
|
+
const u = (s = o == null ? void 0 : o.renderFormItem) == null ? void 0 : s.call(o, r.item.fieldProps.field);
|
|
108
|
+
return u ? l(A, y(r.item.fieldProps, {
|
|
109
|
+
span: r.item.fieldProps
|
|
110
|
+
}), R(u) ? u : {
|
|
111
|
+
default: () => [u]
|
|
105
112
|
}) : null;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
Comp: d,
|
|
116
|
+
render: i
|
|
106
117
|
};
|
|
107
118
|
}
|
|
108
|
-
function
|
|
109
|
-
const n =
|
|
119
|
+
function rt(t, e) {
|
|
120
|
+
const n = B(t.fieldProps, e), o = (n == null ? void 0 : n.field) || n || {}, i = t.valueType === "switch", r = t.valueType === "index", u = i ? {
|
|
110
121
|
checked: e.value
|
|
111
122
|
} : {
|
|
112
|
-
value:
|
|
123
|
+
value: r ? e.index + 1 : e.value
|
|
113
124
|
};
|
|
114
125
|
return t.valueEnum && (o.valueEnum = t.valueEnum), {
|
|
115
|
-
...
|
|
116
|
-
...
|
|
126
|
+
...C(o, ["request"]),
|
|
127
|
+
...u
|
|
117
128
|
};
|
|
118
129
|
}
|
|
119
|
-
function
|
|
130
|
+
function ot(t) {
|
|
120
131
|
const e = {
|
|
121
132
|
...t
|
|
122
133
|
};
|
|
123
|
-
return F(t.filters) && t.filters && t.valueEnum && (e.filters =
|
|
134
|
+
return F(t.filters) && t.filters && t.valueEnum && (e.filters = b(t.valueEnum)), e;
|
|
124
135
|
}
|
|
125
|
-
function
|
|
136
|
+
function it(t, e) {
|
|
126
137
|
var o;
|
|
127
138
|
const n = e || {};
|
|
128
139
|
return t.valueEnum && !((o = n.field) != null && o.options) && (n.field = {
|
|
129
140
|
...n.field,
|
|
130
|
-
options:
|
|
141
|
+
options: b(t.valueEnum)
|
|
131
142
|
}), n;
|
|
132
143
|
}
|
|
133
|
-
function
|
|
134
|
-
if (!
|
|
144
|
+
function ut(t) {
|
|
145
|
+
if (!_("Object")(t))
|
|
135
146
|
return t;
|
|
136
147
|
try {
|
|
137
148
|
return JSON.stringify(t);
|
|
@@ -139,75 +150,75 @@ function rt(t) {
|
|
|
139
150
|
return t;
|
|
140
151
|
}
|
|
141
152
|
}
|
|
142
|
-
function
|
|
143
|
-
const
|
|
153
|
+
function st(t, e, n, o) {
|
|
154
|
+
const i = n == null ? void 0 : n({
|
|
144
155
|
title: t.title,
|
|
145
156
|
column: t
|
|
146
|
-
}),
|
|
147
|
-
if (
|
|
148
|
-
return
|
|
149
|
-
const
|
|
157
|
+
}), r = (i == null ? void 0 : i.filter((h) => h.type !== Symbol.for("v-cmt"))) || [];
|
|
158
|
+
if (i && r.length > 0)
|
|
159
|
+
return i;
|
|
160
|
+
const s = N(t.title) ? l("span", {
|
|
150
161
|
class: e,
|
|
151
162
|
title: t.title
|
|
152
|
-
}, [t.title]) : t.title, f = t.tooltip ?
|
|
153
|
-
return f ?
|
|
163
|
+
}, [t.title]) : t.title, f = t.tooltip ? T(t.tooltip) ? t.tooltip(t) : l(O, null, [t.tooltip]) : null;
|
|
164
|
+
return f ? l("span", {
|
|
154
165
|
style: {
|
|
155
166
|
display: "inline-flex",
|
|
156
167
|
alignItems: "center",
|
|
157
168
|
maxWidth: "100%"
|
|
158
169
|
}
|
|
159
|
-
}, [
|
|
170
|
+
}, [s, l(w, {
|
|
160
171
|
title: f,
|
|
161
172
|
placement: "bottom"
|
|
162
173
|
}, {
|
|
163
|
-
default: () => [
|
|
174
|
+
default: () => [l(x, {
|
|
164
175
|
style: {
|
|
165
176
|
padding: "4px",
|
|
166
177
|
color: o,
|
|
167
178
|
verticalAlign: "middle"
|
|
168
179
|
}
|
|
169
180
|
}, null)]
|
|
170
|
-
})]) :
|
|
181
|
+
})]) : s;
|
|
171
182
|
}
|
|
172
|
-
function
|
|
183
|
+
function lt(t, e) {
|
|
173
184
|
const n = [];
|
|
174
|
-
function o(
|
|
175
|
-
var
|
|
176
|
-
for (const
|
|
177
|
-
(
|
|
185
|
+
function o(i) {
|
|
186
|
+
var r;
|
|
187
|
+
for (const u of i)
|
|
188
|
+
(r = u.children) != null && r.length ? o(u.children) : n.push(e(u));
|
|
178
189
|
}
|
|
179
190
|
return o(t), n;
|
|
180
191
|
}
|
|
181
|
-
function
|
|
182
|
-
if (
|
|
192
|
+
function ct(t, e) {
|
|
193
|
+
if (c(t) && c(e))
|
|
183
194
|
return S(p(t), p(e));
|
|
184
|
-
if (
|
|
185
|
-
const n = (o) => I(o, (
|
|
195
|
+
if (m(t) && m(e)) {
|
|
196
|
+
const n = (o) => I(o, (i) => i == null) || v(o);
|
|
186
197
|
if (n(t) && n(e))
|
|
187
198
|
return !0;
|
|
188
199
|
}
|
|
189
200
|
}
|
|
190
|
-
function
|
|
201
|
+
function ft(t) {
|
|
191
202
|
if (t !== !1)
|
|
192
203
|
return t;
|
|
193
204
|
}
|
|
194
205
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
206
|
+
ot as apColumnToColumn,
|
|
207
|
+
H as dataIndexToStr,
|
|
208
|
+
ft as falseToUndefined,
|
|
198
209
|
q as formatParamsValueType,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
M as getColumnOrder,
|
|
211
|
+
B as getFieldProps,
|
|
212
|
+
nt as getSearchFormItemRenderNode,
|
|
213
|
+
et as getTableCellRenderNode,
|
|
214
|
+
rt as getTableRenderProps,
|
|
215
|
+
tt as getTableRenderType,
|
|
216
|
+
st as getTableTitle,
|
|
217
|
+
ct as isEqualCustom,
|
|
218
|
+
$ as objectToMap,
|
|
219
|
+
ut as objectToString,
|
|
220
|
+
k as parseFieldValue,
|
|
221
|
+
lt as recursionApColumns,
|
|
222
|
+
it as updateFormProps,
|
|
223
|
+
b as valueEnumToArray
|
|
213
224
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as X, inject as
|
|
1
|
+
import { defineComponent as X, inject as u, ref as R, watch as Y, nextTick as Z, openBlock as g, createElementBlock as h, normalizeClass as F, unref as i, createElementVNode as d, renderSlot as ee, Fragment as te, renderList as ne, withDirectives as ae, createVNode as U, createCommentVNode as $, vShow as se, toDisplayString as k } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as oe, getName as ie, getReturnData as
|
|
3
|
+
import { getPath as oe, getName as ie, getReturnData as I } from "../utils/returnData.mjs";
|
|
4
4
|
import { CloseOutlined as re, PlusOutlined as ce } from "@ant-design/icons-vue";
|
|
5
|
-
import { useOss as ue, getOssInstance as
|
|
5
|
+
import { useOss as ue, getOssInstance as M } from "../hooks/useOss.mjs";
|
|
6
6
|
import { fileMatchesAccept as le, getAcceptText as pe } from "../utils/accept.mjs";
|
|
7
7
|
import { message as m, Progress as de } from "@aplus-frontend/antdv";
|
|
8
8
|
import { omit as me } from "lodash-unified";
|
|
@@ -14,46 +14,46 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
14
14
|
}, ke = { class: "picture-title" }, Ce = { key: 0 }, Se = { key: 1 }, De = /* @__PURE__ */ X({
|
|
15
15
|
__name: "Picture",
|
|
16
16
|
setup(Ee, { expose: T }) {
|
|
17
|
-
const { t:
|
|
18
|
-
let
|
|
17
|
+
const { t: l } = fe(), { b: C } = ge("ap-upload-picture"), { put: D } = ue(), O = u("theme"), B = u("dirName"), _ = u("accept") || "image/*", w = u("maxSize") ?? 5, S = u("title"), p = u("maxCount") ?? 10, v = u("uploadingCount"), E = u("beforeUpload"), b = u("customRequest"), z = u("getOssAccess"), L = u("maxSizeErrorMsg"), q = u("maxCountErrorMsg"), V = u("acceptErrorMsg"), x = R(null), r = u("value"), y = u("needName");
|
|
18
|
+
let o = R([]);
|
|
19
19
|
const f = [];
|
|
20
20
|
Y(
|
|
21
21
|
() => r == null ? void 0 : r.value,
|
|
22
22
|
async function(e) {
|
|
23
23
|
var a;
|
|
24
|
-
!((a =
|
|
24
|
+
!((a = o == null ? void 0 : o.value) != null && a.length) && e && A(e);
|
|
25
25
|
},
|
|
26
26
|
{ immediate: !0 }
|
|
27
27
|
);
|
|
28
28
|
function A(e) {
|
|
29
29
|
if (!e) {
|
|
30
|
-
r.value = void 0, f.splice(0, f.length),
|
|
30
|
+
r.value = void 0, f.splice(0, f.length), o.value = [];
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
Z(async () => {
|
|
34
34
|
const a = [];
|
|
35
35
|
for (let t of e) {
|
|
36
|
-
const n = oe(y, t),
|
|
36
|
+
const n = oe(y, t), s = ie(y, t), c = await M(z), Q = await c.getSignatureUrl(n), W = {
|
|
37
37
|
...typeof t == "string" ? {} : t,
|
|
38
|
-
...new File([t],
|
|
38
|
+
...new File([t], s, {}),
|
|
39
39
|
uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
|
|
40
40
|
thumbUrl: Q,
|
|
41
41
|
status: "success",
|
|
42
42
|
percent: 100,
|
|
43
43
|
path: n
|
|
44
44
|
};
|
|
45
|
-
a.push(W),
|
|
45
|
+
a.push(W), c.destroy();
|
|
46
46
|
}
|
|
47
|
-
if (
|
|
47
|
+
if (p && a.length > p) {
|
|
48
48
|
m.warning(
|
|
49
|
-
|
|
50
|
-
maxCount:
|
|
49
|
+
l("ap.apUpload.fileInitializationException", {
|
|
50
|
+
maxCount: p
|
|
51
51
|
})
|
|
52
52
|
);
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
a.forEach((t) => {
|
|
56
|
-
|
|
56
|
+
o.value.push(t), f.push({
|
|
57
57
|
uid: t.uid,
|
|
58
58
|
path: t.path
|
|
59
59
|
});
|
|
@@ -77,19 +77,19 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
77
77
|
}
|
|
78
78
|
let N;
|
|
79
79
|
async function J(e) {
|
|
80
|
-
if (
|
|
80
|
+
if (p && p > 1 && o.value.length >= p)
|
|
81
81
|
return clearTimeout(N), N = setTimeout(() => {
|
|
82
82
|
m.warning(
|
|
83
|
-
q ||
|
|
83
|
+
q || l("ap.apUpload.maxUploadPicture", { maxCount: p })
|
|
84
84
|
);
|
|
85
85
|
}), !1;
|
|
86
86
|
if (e.size > w * 1024 * 1024)
|
|
87
87
|
return m.warning(
|
|
88
|
-
L ||
|
|
88
|
+
L || l("ap.apUpload.maxUploadFileSize", { maxSize: w })
|
|
89
89
|
), !1;
|
|
90
90
|
if (!/image\/\w+/.test(e.type) || !le(e, _))
|
|
91
91
|
return m.warning(
|
|
92
|
-
V ||
|
|
92
|
+
V || l("ap.apUpload.pictureFormatNotSupported")
|
|
93
93
|
), !1;
|
|
94
94
|
if (typeof E == "function" && await E(e) === !1)
|
|
95
95
|
return !1;
|
|
@@ -104,28 +104,28 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
104
104
|
};
|
|
105
105
|
K(t, e);
|
|
106
106
|
}, a.onerror = function() {
|
|
107
|
-
m.warning(
|
|
107
|
+
m.warning(l("ap.apUpload.imageParsingFailed"));
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
async function K(e, a) {
|
|
111
111
|
if (v.value++, typeof b == "function") {
|
|
112
112
|
b({
|
|
113
113
|
onProgress: (t) => {
|
|
114
|
-
const n =
|
|
114
|
+
const n = o.value.find((s) => s.uid === e.uid);
|
|
115
115
|
n && (n.percent = t);
|
|
116
116
|
},
|
|
117
117
|
onError: (t) => {
|
|
118
|
-
m.warning(t ||
|
|
119
|
-
const n =
|
|
120
|
-
(
|
|
118
|
+
m.warning(t || l("ap.apUpload.networkAnomaly"));
|
|
119
|
+
const n = o.value.findIndex(
|
|
120
|
+
(s) => s.uid === e.uid
|
|
121
121
|
);
|
|
122
|
-
n > -1 &&
|
|
122
|
+
n > -1 && o.value.splice(n, 1), v.value--;
|
|
123
123
|
},
|
|
124
124
|
onSuccess: (t) => {
|
|
125
|
-
const n =
|
|
125
|
+
const n = o.value.find((s) => s.uid === e.uid);
|
|
126
126
|
n && (n.status = "success", n.path = t), r.value = [
|
|
127
127
|
...r.value || [],
|
|
128
|
-
|
|
128
|
+
I(y, t, a.name)
|
|
129
129
|
], f.push({
|
|
130
130
|
uid: e.uid,
|
|
131
131
|
path: t
|
|
@@ -136,56 +136,60 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
try {
|
|
139
|
-
const t = await
|
|
140
|
-
e.oss = t,
|
|
139
|
+
const t = await M(z);
|
|
140
|
+
e.oss = t, o.value.push(e), D({
|
|
141
141
|
file: a,
|
|
142
142
|
dirName: B,
|
|
143
143
|
oss: t,
|
|
144
144
|
successCallBack(n) {
|
|
145
|
-
const
|
|
146
|
-
|
|
145
|
+
const s = o.value.find((c) => c.uid === e.uid);
|
|
146
|
+
s && (s.status = "success", s.path = n), r.value = [
|
|
147
147
|
...r.value || [],
|
|
148
|
-
|
|
148
|
+
I(y, n, a.name)
|
|
149
149
|
], f.push({
|
|
150
150
|
uid: e.uid,
|
|
151
151
|
path: n
|
|
152
152
|
}), v.value--;
|
|
153
153
|
},
|
|
154
154
|
errorCallBack(n) {
|
|
155
|
-
m.warning(n ||
|
|
156
|
-
const
|
|
157
|
-
(
|
|
155
|
+
m.warning(n || l("ap.apUpload.networkAnomaly"));
|
|
156
|
+
const s = o.value.findIndex(
|
|
157
|
+
(c) => c.uid === e.uid
|
|
158
158
|
);
|
|
159
|
-
|
|
159
|
+
s > -1 && o.value.splice(s, 1), v.value--;
|
|
160
160
|
},
|
|
161
161
|
progressCallBack(n) {
|
|
162
|
-
const
|
|
163
|
-
|
|
162
|
+
const s = o.value.find((c) => c.uid === e.uid);
|
|
163
|
+
s && (s.percent = n);
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
} catch (t) {
|
|
167
167
|
m.warning(
|
|
168
|
-
typeof (t == null ? void 0 : t.message) == "string" ? t.message :
|
|
168
|
+
typeof (t == null ? void 0 : t.message) == "string" ? t.message : l("ap.apUpload.networkAnomaly")
|
|
169
169
|
);
|
|
170
|
-
const n =
|
|
171
|
-
n > -1 &&
|
|
170
|
+
const n = o.value.findIndex((s) => s.uid === e.uid);
|
|
171
|
+
n > -1 && o.value.splice(n, 1), v.value--;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
function P(e) {
|
|
175
|
-
var t;
|
|
175
|
+
var t, n;
|
|
176
176
|
if (e.path && r) {
|
|
177
177
|
if (Array.isArray(r.value)) {
|
|
178
|
-
const
|
|
179
|
-
(
|
|
178
|
+
const s = f.findIndex(
|
|
179
|
+
(c) => c.uid === e.uid
|
|
180
180
|
);
|
|
181
|
-
|
|
181
|
+
if (s >= 0) {
|
|
182
|
+
const c = ((t = r == null ? void 0 : r.value) == null ? void 0 : t.slice()) ?? [];
|
|
183
|
+
c == null || c.splice(s, 1), r.value = c, f.splice(s, 1);
|
|
184
|
+
}
|
|
185
|
+
r.value.length === 0 && (r.value = void 0);
|
|
182
186
|
}
|
|
183
187
|
} else
|
|
184
|
-
(
|
|
185
|
-
const a =
|
|
186
|
-
(
|
|
188
|
+
(n = e == null ? void 0 : e.oss) == null || n.pauseUpload();
|
|
189
|
+
const a = o.value.findIndex(
|
|
190
|
+
(s) => s.uid === e.uid
|
|
187
191
|
);
|
|
188
|
-
return
|
|
192
|
+
return o.value.splice(a, 1), Promise.resolve(!0);
|
|
189
193
|
}
|
|
190
194
|
return (e, a) => (g(), h("div", {
|
|
191
195
|
class: F({
|
|
@@ -203,7 +207,7 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
203
207
|
}, null, 40, he),
|
|
204
208
|
d("div", ve, [
|
|
205
209
|
ee(e.$slots, "pictureContext", {
|
|
206
|
-
fileList: i(
|
|
210
|
+
fileList: i(o).map((t) => {
|
|
207
211
|
var n;
|
|
208
212
|
return {
|
|
209
213
|
...i(me)(t, "oss"),
|
|
@@ -214,7 +218,7 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
214
218
|
}),
|
|
215
219
|
remove: P
|
|
216
220
|
}, () => [
|
|
217
|
-
(g(!0), h(te, null, ne(i(
|
|
221
|
+
(g(!0), h(te, null, ne(i(o), (t) => (g(), h("div", {
|
|
218
222
|
key: t.uid,
|
|
219
223
|
class: "picture-item"
|
|
220
224
|
}, [
|
|
@@ -238,24 +242,24 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
238
242
|
size: 4,
|
|
239
243
|
"show-info": !1
|
|
240
244
|
}, null, 8, ["percent"])
|
|
241
|
-
])) :
|
|
245
|
+
])) : $("", !0)
|
|
242
246
|
], 512), [
|
|
243
247
|
[se, t.status === "uploading"]
|
|
244
248
|
])
|
|
245
249
|
])
|
|
246
250
|
]))), 128))
|
|
247
251
|
]),
|
|
248
|
-
i(
|
|
252
|
+
i(p) === void 0 || i(o).length < i(p) ? (g(), h("div", {
|
|
249
253
|
key: 0,
|
|
250
254
|
class: "picture-upload",
|
|
251
255
|
onClick: j
|
|
252
256
|
}, [
|
|
253
257
|
U(i(ce)),
|
|
254
|
-
d("div", null, k(i(
|
|
255
|
-
])) :
|
|
258
|
+
d("div", null, k(i(l)("ap.apUpload.update")), 1)
|
|
259
|
+
])) : $("", !0)
|
|
256
260
|
]),
|
|
257
261
|
d("div", ke, [
|
|
258
|
-
i(S) ? (g(), h("div", Ce, k(i(S)), 1)) : (g(), h("div", Se, k(`${i(
|
|
262
|
+
i(S) ? (g(), h("div", Ce, k(i(S)), 1)) : (g(), h("div", Se, k(`${i(l)("ap.apUpload.supportExtension")}:${i(pe)(i(_))},${i(l)(
|
|
259
263
|
"ap.apUpload.maxUploadPictureSize",
|
|
260
264
|
{ maxSize: i(w) }
|
|
261
265
|
)}`), 1))
|
|
@@ -10,6 +10,5 @@ declare const _default: DefineComponent<ApFormItemBatchInputProps, {}, {}, {}, {
|
|
|
10
10
|
hasFeedback: boolean;
|
|
11
11
|
autoLink: boolean;
|
|
12
12
|
validateFirst: boolean;
|
|
13
|
-
defaultSelectedAllKey: boolean;
|
|
14
13
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
15
14
|
export default _default;
|