@aplus-frontend/ui 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-download/hooks/index.mjs +4 -3
- package/es/src/ap-download/interface.d.ts +2 -2
- package/es/src/ap-field/date/helper.mjs +5 -5
- package/es/src/ap-field/date-range/index.vue.mjs +15 -15
- package/es/src/ap-form/ap-form-list.vue.mjs +29 -21
- package/es/src/ap-form/ap-form.vue2.mjs +77 -77
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/search-form/index.vue.mjs +123 -99
- package/es/src/ap-table/hooks/use-table-paging.mjs +23 -21
- package/es/src/ap-upload/apUpload.vue.d.ts +3 -11
- package/es/src/ap-upload/apUpload.vue.mjs +42 -36
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +115 -102
- package/es/src/ap-upload/components/Picture.vue2.mjs +121 -111
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +120 -109
- package/es/src/ap-upload/hooks/useOss.d.ts +9 -4
- package/es/src/ap-upload/hooks/useOss.mjs +52 -34
- package/es/src/ap-upload/utils/accept.d.ts +3 -0
- package/es/src/ap-upload/utils/accept.mjs +35 -30
- package/es/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
- package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +7 -6
- package/es/src/business/ap-status/interface.d.ts +4 -1
- package/es/src/business/index.d.ts +41 -8
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +10 -1
- package/es/src/config-provider/config-provider.mjs +9 -8
- package/es/src/config-provider/constants.d.ts +10 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +20 -1
- package/es/src/locale/lang/en.mjs +24 -0
- package/es/src/locale/lang/zh-cn.mjs +24 -0
- package/es/src/work-order-modal/createWorkOrder.d.ts +3 -1
- package/es/src/work-order-modal/interfaces.d.ts +3 -1
- package/es/src/work-order-modal/work-order-modal.vue.mjs +7 -7
- package/lib/src/ap-download/hooks/index.js +1 -1
- package/lib/src/ap-download/interface.d.ts +2 -2
- package/lib/src/ap-field/date/helper.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-list.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.d.ts +3 -11
- 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/ap-upload/hooks/useOss.d.ts +9 -4
- package/lib/src/ap-upload/hooks/useOss.js +1 -1
- package/lib/src/ap-upload/utils/accept.d.ts +3 -0
- package/lib/src/ap-upload/utils/accept.js +1 -1
- package/lib/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
- package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
- package/lib/src/business/ap-status/interface.d.ts +4 -1
- package/lib/src/business/index.d.ts +41 -8
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +10 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +10 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +20 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/work-order-modal/createWorkOrder.d.ts +3 -1
- package/lib/src/work-order-modal/interfaces.d.ts +3 -1
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +1 -1
|
@@ -1,71 +1,82 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, inject as n, ref as M, watch as $, nextTick as j, openBlock as v, createElementBlock as C, normalizeClass as W, unref as s, createVNode as _, withCtx as E, createElementVNode as b, createTextVNode as G, toDisplayString as L, withModifiers as H, createBlock as J, resolveDynamicComponent as K, createCommentVNode as Q } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as
|
|
4
|
-
import { useOss as
|
|
5
|
-
import { message as
|
|
6
|
-
import { UploadOutlined as
|
|
7
|
-
import { fileMatchesAccept as
|
|
3
|
+
import { getPath as V, getName as X, getReturnData as x } from "../utils/returnData.mjs";
|
|
4
|
+
import { useOss as Y, getOssInstance as Z } from "../hooks/useOss.mjs";
|
|
5
|
+
import { message as p, Upload as ee, Button as te } from "ant-design-vue";
|
|
6
|
+
import { UploadOutlined as oe } from "@ant-design/icons-vue";
|
|
7
|
+
import { fileMatchesAccept as ae, getAcceptText as se } from "../utils/accept.mjs";
|
|
8
8
|
import "../styles/multiple-file.css";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import { useLocale as ne } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as ie } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
const le = { class: "multiple-file-context" }, re = { key: 0 }, pe = { key: 1 }, ke = /* @__PURE__ */ D({
|
|
11
12
|
__name: "MultipleFile",
|
|
12
13
|
setup(ue) {
|
|
13
|
-
const {
|
|
14
|
-
|
|
15
|
-
() =>
|
|
14
|
+
const { t: i } = ne(), { b: U } = ie("ap-upload-multiple-file"), { put: R } = Y(), S = n("theme"), B = n("dirName"), y = n("accept") || "*", A = n("maxSize") ?? 500, I = n("title") || i("ap.apUpload.uploadFile"), g = n("subTitle"), l = n("maxCount") ?? 10, u = n("uploadingCount"), F = n("beforeUpload"), N = n("customRequest"), P = n("getOssAccess"), a = n("value"), d = [], c = n("needName"), f = M(null);
|
|
15
|
+
$(
|
|
16
|
+
() => a == null ? void 0 : a.value,
|
|
16
17
|
function(e) {
|
|
17
|
-
!
|
|
18
|
-
const t = e.map((
|
|
19
|
-
const r =
|
|
20
|
-
[
|
|
21
|
-
|
|
18
|
+
!f.value.fileList.length && e && j(() => {
|
|
19
|
+
const t = e.map((o) => {
|
|
20
|
+
const r = V(c, o), w = X(c, o), k = new File(
|
|
21
|
+
[o],
|
|
22
|
+
w,
|
|
22
23
|
{}
|
|
23
24
|
);
|
|
24
|
-
return
|
|
25
|
+
return k.response = r, k.uid = r, k;
|
|
25
26
|
});
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
if (l && t.length > l) {
|
|
28
|
+
p.warning(
|
|
29
|
+
i("ap.apUpload.fileInitializationException", {
|
|
30
|
+
maxCount: l
|
|
31
|
+
})
|
|
29
32
|
);
|
|
30
33
|
return;
|
|
31
34
|
}
|
|
32
|
-
t.forEach((
|
|
33
|
-
m.push(
|
|
34
|
-
uid:
|
|
35
|
-
path:
|
|
35
|
+
t.forEach((o) => {
|
|
36
|
+
m.push(o), d.push({
|
|
37
|
+
uid: o.uid,
|
|
38
|
+
path: o.response
|
|
36
39
|
});
|
|
37
|
-
}),
|
|
40
|
+
}), f.value.fileList = t;
|
|
38
41
|
});
|
|
39
42
|
}
|
|
40
43
|
);
|
|
41
|
-
let m = [],
|
|
42
|
-
function
|
|
44
|
+
let m = [], T;
|
|
45
|
+
function h(e) {
|
|
43
46
|
setTimeout(() => {
|
|
44
|
-
const t =
|
|
45
|
-
(
|
|
47
|
+
const t = f.value.fileList.findIndex(
|
|
48
|
+
(o) => o.uid === e.uid
|
|
46
49
|
);
|
|
47
|
-
t >= 0 &&
|
|
50
|
+
t >= 0 && f.value.fileList.splice(t, 1);
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
|
-
function
|
|
51
|
-
if (
|
|
52
|
-
return clearTimeout(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
function z(e) {
|
|
54
|
+
if (l && l > 1 && m.length >= l)
|
|
55
|
+
return clearTimeout(T), T = setTimeout(() => {
|
|
56
|
+
p.warning(
|
|
57
|
+
i("ap.apUpload.maxUploadFiles", {
|
|
58
|
+
maxCount: l
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
}), h(e), !1;
|
|
62
|
+
if (typeof F == "function") {
|
|
63
|
+
if (F(e) === !1)
|
|
64
|
+
return h(e), !1;
|
|
58
65
|
} else {
|
|
59
|
-
if (e.size >
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
if (e.size > A * 1024 * 1024)
|
|
67
|
+
return p.warning(
|
|
68
|
+
i("ap.apUpload.maxUploadFileSize", {
|
|
69
|
+
maxSize: A
|
|
70
|
+
})
|
|
71
|
+
), h(e), !1;
|
|
72
|
+
if (!ae(e, y))
|
|
73
|
+
return p.warning(i("ap.apUpload.fileFormatNotSupported")), h(e), !1;
|
|
63
74
|
}
|
|
64
|
-
|
|
75
|
+
l && l === 1 && (m = [], a.value = void 0), m.push(e);
|
|
65
76
|
}
|
|
66
|
-
async function
|
|
67
|
-
if (
|
|
68
|
-
|
|
77
|
+
async function O(e) {
|
|
78
|
+
if (u.value++, typeof N == "function") {
|
|
79
|
+
N({
|
|
69
80
|
onProgress: (t) => {
|
|
70
81
|
setTimeout(() => {
|
|
71
82
|
e.onProgress({
|
|
@@ -74,115 +85,117 @@ const ae = { class: "multiple-file-context" }, ie = { key: 0 }, re = { key: 1 },
|
|
|
74
85
|
});
|
|
75
86
|
},
|
|
76
87
|
onError: (t) => {
|
|
77
|
-
|
|
88
|
+
p.warning(t || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
78
89
|
e.onError({
|
|
79
90
|
name: t,
|
|
80
91
|
message: t
|
|
81
92
|
});
|
|
82
|
-
}),
|
|
93
|
+
}), u.value--;
|
|
83
94
|
},
|
|
84
95
|
onSuccess: (t) => {
|
|
85
96
|
setTimeout(() => {
|
|
86
97
|
e.onSuccess(t);
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
) :
|
|
90
|
-
|
|
91
|
-
],
|
|
98
|
+
}), a.value ? a.value.push(
|
|
99
|
+
x(c, t, e.file.name)
|
|
100
|
+
) : a.value = [
|
|
101
|
+
x(c, t, e.file.name)
|
|
102
|
+
], d.push({
|
|
92
103
|
uid: e.file.uid,
|
|
93
104
|
path: t
|
|
94
|
-
}),
|
|
105
|
+
}), u.value--;
|
|
95
106
|
},
|
|
96
107
|
file: e.file
|
|
97
108
|
});
|
|
98
109
|
return;
|
|
99
110
|
}
|
|
100
111
|
try {
|
|
101
|
-
const t = await
|
|
102
|
-
e.file.oss = t,
|
|
112
|
+
const t = await Z(P);
|
|
113
|
+
e.file.oss = t, R({
|
|
103
114
|
file: e.file,
|
|
104
|
-
dirName:
|
|
115
|
+
dirName: B,
|
|
105
116
|
oss: t,
|
|
106
|
-
successCallBack(
|
|
107
|
-
e.onSuccess(
|
|
108
|
-
|
|
109
|
-
) :
|
|
110
|
-
|
|
111
|
-
],
|
|
117
|
+
successCallBack(o) {
|
|
118
|
+
e.onSuccess(o), a.value ? a.value.push(
|
|
119
|
+
x(c, o, e.file.name)
|
|
120
|
+
) : a.value = [
|
|
121
|
+
x(c, o, e.file.name)
|
|
122
|
+
], d.push({
|
|
112
123
|
uid: e.file.uid,
|
|
113
|
-
path:
|
|
114
|
-
}),
|
|
124
|
+
path: o
|
|
125
|
+
}), u.value--;
|
|
115
126
|
},
|
|
116
|
-
errorCallBack(
|
|
117
|
-
|
|
118
|
-
name:
|
|
119
|
-
message:
|
|
120
|
-
}),
|
|
127
|
+
errorCallBack(o) {
|
|
128
|
+
p.warning(o || i("ap.apUpload.networkAnomaly")), e.onError({
|
|
129
|
+
name: o,
|
|
130
|
+
message: o
|
|
131
|
+
}), u.value--;
|
|
121
132
|
},
|
|
122
|
-
progressCallBack(
|
|
133
|
+
progressCallBack(o) {
|
|
123
134
|
e.onProgress({
|
|
124
|
-
percent:
|
|
135
|
+
percent: o
|
|
125
136
|
});
|
|
126
137
|
}
|
|
127
138
|
});
|
|
128
139
|
} catch (t) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
140
|
+
p.warning(
|
|
141
|
+
typeof (t == null ? void 0 : t.message) == "string" ? t.message : i("ap.apUpload.networkAnomaly")
|
|
142
|
+
), e.onError({
|
|
143
|
+
name: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly"),
|
|
144
|
+
message: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly")
|
|
145
|
+
}), u.value--;
|
|
133
146
|
}
|
|
134
147
|
}
|
|
135
|
-
function
|
|
136
|
-
var
|
|
148
|
+
function q(e) {
|
|
149
|
+
var o;
|
|
137
150
|
if (e.response) {
|
|
138
|
-
if (Array.isArray(
|
|
139
|
-
const r =
|
|
140
|
-
r >= 0 && (
|
|
151
|
+
if (Array.isArray(a.value)) {
|
|
152
|
+
const r = d.findIndex((w) => w.uid === e.uid);
|
|
153
|
+
r >= 0 && (a == null || a.value.splice(r, 1), d.splice(r, 1)), a.value.length === 0 && (a.value = void 0);
|
|
141
154
|
}
|
|
142
155
|
} else
|
|
143
|
-
(
|
|
156
|
+
(o = e == null ? void 0 : e.oss) == null || o.pauseUpload();
|
|
144
157
|
const t = m.findIndex(
|
|
145
158
|
(r) => r.uid === e.uid
|
|
146
159
|
);
|
|
147
160
|
return m.splice(t, 1), Promise.resolve(!0);
|
|
148
161
|
}
|
|
149
|
-
return (e, t) => (
|
|
162
|
+
return (e, t) => (v(), C("div", {
|
|
150
163
|
class: W({
|
|
151
|
-
[
|
|
152
|
-
[
|
|
164
|
+
[s(U)()]: !0,
|
|
165
|
+
[s(U)("admin")]: s(S) === "admin"
|
|
153
166
|
})
|
|
154
167
|
}, [
|
|
155
|
-
|
|
168
|
+
_(s(ee), {
|
|
156
169
|
ref_key: "uploadRef",
|
|
157
|
-
ref:
|
|
158
|
-
accept:
|
|
170
|
+
ref: f,
|
|
171
|
+
accept: s(y),
|
|
159
172
|
multiple: "",
|
|
160
|
-
maxCount:
|
|
173
|
+
maxCount: s(l),
|
|
161
174
|
progress: {
|
|
162
175
|
strokeWidth: 3,
|
|
163
176
|
showInfo: !1,
|
|
164
177
|
strokeColor: "#0070FF"
|
|
165
178
|
},
|
|
166
|
-
beforeUpload:
|
|
167
|
-
customRequest:
|
|
168
|
-
onRemove:
|
|
179
|
+
beforeUpload: z,
|
|
180
|
+
customRequest: O,
|
|
181
|
+
onRemove: q
|
|
169
182
|
}, {
|
|
170
|
-
default:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
default:
|
|
174
|
-
|
|
175
|
-
G(" " +
|
|
183
|
+
default: E(() => [
|
|
184
|
+
b("div", le, [
|
|
185
|
+
_(s(te), { class: "file-btn" }, {
|
|
186
|
+
default: E(() => [
|
|
187
|
+
_(s(oe)),
|
|
188
|
+
G(" " + L(s(I)), 1)
|
|
176
189
|
]),
|
|
177
190
|
_: 1
|
|
178
191
|
}),
|
|
179
|
-
|
|
192
|
+
b("div", {
|
|
180
193
|
class: "sub-title",
|
|
181
194
|
onClick: t[0] || (t[0] = H(() => {
|
|
182
195
|
}, ["stop"]))
|
|
183
196
|
}, [
|
|
184
|
-
typeof
|
|
185
|
-
(
|
|
197
|
+
typeof s(g) == "string" ? (v(), C("div", re, L(s(g) || `${s(i)("ap.apUpload.supportExtension")}:${s(se)(s(y))}`), 1)) : s(g) ? (v(), C("div", pe, [
|
|
198
|
+
(v(), J(K(s(g))))
|
|
186
199
|
])) : Q("", !0)
|
|
187
200
|
])
|
|
188
201
|
])
|
|
@@ -193,5 +206,5 @@ const ae = { class: "multiple-file-context" }, ie = { key: 0 }, re = { key: 1 },
|
|
|
193
206
|
}
|
|
194
207
|
});
|
|
195
208
|
export {
|
|
196
|
-
|
|
209
|
+
ke as default
|
|
197
210
|
};
|