@aplus-frontend/ui 0.0.28 → 0.0.30
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-form/style/search-form.css +6 -0
- 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/styles/multiple-file.css +1 -1
- 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/editable-table/style/index.css +3 -0
- package/es/src/locale/lang/en.mjs +24 -0
- package/es/src/locale/lang/zh-cn.mjs +24 -0
- package/es/src/theme/ap-form/search-form.css +6 -0
- package/es/src/theme/ap-upload/multiple-file.css +1 -1
- package/es/src/theme/editable-table/index.css +3 -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-form/style/search-form.css +6 -0
- 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/styles/multiple-file.css +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/editable-table/style/index.css +3 -0
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-form/search-form.css +6 -0
- package/lib/src/theme/ap-upload/multiple-file.css +1 -1
- package/lib/src/theme/editable-table/index.css +3 -0
- 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,45 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent as H, inject as u, ref as I, watch as J, openBlock as f, createElementBlock as h, normalizeClass as K, unref as o, createElementVNode as d, Fragment as Q, renderList as W, withDirectives as X, createVNode as C, createCommentVNode as R, vShow as Y, toDisplayString as U } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as
|
|
4
|
-
import { CloseOutlined as
|
|
5
|
-
import { useOss as
|
|
6
|
-
import { fileMatchesAccept as
|
|
7
|
-
import { message as
|
|
3
|
+
import { getPath as Z, getName as F, getReturnData as w } from "../utils/returnData.mjs";
|
|
4
|
+
import { CloseOutlined as ee, PlusOutlined as te } from "@ant-design/icons-vue";
|
|
5
|
+
import { useOss as ne, getOssInstance as $ } from "../hooks/useOss.mjs";
|
|
6
|
+
import { fileMatchesAccept as ae, getAcceptText as se } from "../utils/accept.mjs";
|
|
7
|
+
import { message as m, Progress as oe } from "ant-design-vue";
|
|
8
8
|
import "../styles/picture.css";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import { useLocale as ie } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
const ue = ["accept"], re = { class: "picture-context" }, le = { class: "picture-item-box" }, pe = ["src"], de = { class: "picture-item-shadow" }, me = ["onClick"], fe = {
|
|
11
12
|
key: 0,
|
|
12
13
|
class: "picture-item-uploading"
|
|
13
|
-
},
|
|
14
|
+
}, he = { class: "picture-title" }, ge = { key: 0 }, ve = { key: 1 }, be = /* @__PURE__ */ H({
|
|
14
15
|
__name: "Picture",
|
|
15
|
-
setup(
|
|
16
|
-
const { b:
|
|
17
|
-
let
|
|
18
|
-
const
|
|
19
|
-
|
|
16
|
+
setup(_e) {
|
|
17
|
+
const { t: r } = ie(), { b: A } = ce("ap-upload-picture"), { put: D } = ne(), E = u("theme"), O = u("dirName"), y = u("accept") || "image/*", k = u("maxSize") ?? 5, N = u("title"), l = u("maxCount") ?? 10, g = u("uploadingCount"), P = u("beforeUpload"), S = u("customRequest"), b = u("getOssAccess"), x = I(null), c = u("value"), v = u("needName");
|
|
18
|
+
let i = I([]);
|
|
19
|
+
const _ = [];
|
|
20
|
+
J(
|
|
20
21
|
() => c == null ? void 0 : c.value,
|
|
21
22
|
async function(e) {
|
|
22
|
-
if (!
|
|
23
|
-
const
|
|
23
|
+
if (!i.value.length && e) {
|
|
24
|
+
const a = [];
|
|
24
25
|
for (let t of e) {
|
|
25
|
-
const n =
|
|
26
|
-
...new File([t],
|
|
26
|
+
const n = Z(v, t), s = F(v, t), p = await $(b), j = await p.getSignatureUrl(n), G = {
|
|
27
|
+
...new File([t], s, {}),
|
|
27
28
|
uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
|
|
28
|
-
thumbUrl:
|
|
29
|
+
thumbUrl: j,
|
|
29
30
|
status: "success",
|
|
30
31
|
percent: 100,
|
|
31
32
|
path: n
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
+
a.push(G), p.destroy();
|
|
34
35
|
}
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
if (l && a.length > l) {
|
|
37
|
+
m.warning(
|
|
38
|
+
r("ap.apUpload.fileInitializationException", {
|
|
39
|
+
maxCount: l
|
|
40
|
+
})
|
|
38
41
|
);
|
|
39
42
|
return;
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
a.forEach((t) => {
|
|
45
|
+
i.value.push(t), _.push({
|
|
43
46
|
uid: t.uid,
|
|
44
47
|
path: t.path
|
|
45
48
|
});
|
|
@@ -47,37 +50,39 @@ const oe = ["accept"], ce = { class: "picture-context" }, ue = { class: "picture
|
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
);
|
|
50
|
-
function
|
|
53
|
+
function T() {
|
|
51
54
|
var e;
|
|
52
|
-
(e =
|
|
55
|
+
(e = x.value) == null || e.click();
|
|
53
56
|
}
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
+
function B(e) {
|
|
58
|
+
const a = e.target;
|
|
59
|
+
L(a == null ? void 0 : a.files);
|
|
57
60
|
}
|
|
58
|
-
function
|
|
61
|
+
function L(e) {
|
|
59
62
|
if (e != null && e.length)
|
|
60
|
-
for (let
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
for (let a = 0; a < e.length; a++)
|
|
64
|
+
q(e[a]);
|
|
65
|
+
x.value && (x.value.value = "");
|
|
63
66
|
}
|
|
64
|
-
let
|
|
65
|
-
function
|
|
66
|
-
if (
|
|
67
|
-
return clearTimeout(
|
|
68
|
-
|
|
67
|
+
let z;
|
|
68
|
+
function q(e) {
|
|
69
|
+
if (l && l > 1 && i.value.length >= l)
|
|
70
|
+
return clearTimeout(z), z = setTimeout(() => {
|
|
71
|
+
m.warning(
|
|
72
|
+
r("ap.apUpload.maxUploadPicture", { maxCount: l })
|
|
73
|
+
);
|
|
69
74
|
}), !1;
|
|
70
|
-
if (typeof
|
|
71
|
-
if (
|
|
75
|
+
if (typeof P == "function") {
|
|
76
|
+
if (P(e) === !1)
|
|
72
77
|
return !1;
|
|
73
78
|
} else {
|
|
74
|
-
if (e.size >
|
|
75
|
-
return
|
|
76
|
-
if (!/image\/\w+/.test(e.type) || !
|
|
77
|
-
return
|
|
79
|
+
if (e.size > k * 1024 * 1024)
|
|
80
|
+
return m.warning(r("ap.apUpload.maxUploadFileSize", { maxSize: k })), !1;
|
|
81
|
+
if (!/image\/\w+/.test(e.type) || !ae(e, y))
|
|
82
|
+
return m.warning(r("ap.apUpload.pictureFormatNotSupported")), !1;
|
|
78
83
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
84
|
+
const a = new FileReader();
|
|
85
|
+
a.readAsDataURL(e), a.onload = function() {
|
|
81
86
|
const t = {
|
|
82
87
|
...e,
|
|
83
88
|
uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
|
|
@@ -85,135 +90,140 @@ const oe = ["accept"], ce = { class: "picture-context" }, ue = { class: "picture
|
|
|
85
90
|
status: "uploading",
|
|
86
91
|
percent: 0
|
|
87
92
|
};
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
93
|
+
M(t, e);
|
|
94
|
+
}, a.onerror = function() {
|
|
95
|
+
m.warning(r("ap.apUpload.imageParsingFailed"));
|
|
91
96
|
};
|
|
92
97
|
}
|
|
93
|
-
async function
|
|
94
|
-
if (
|
|
95
|
-
|
|
98
|
+
async function M(e, a) {
|
|
99
|
+
if (g.value++, typeof S == "function") {
|
|
100
|
+
S({
|
|
96
101
|
onProgress: (t) => {
|
|
97
|
-
const n =
|
|
102
|
+
const n = i.value.find((s) => s.uid === e.uid);
|
|
98
103
|
n && (n.percent = t);
|
|
99
104
|
},
|
|
100
105
|
onError: (t) => {
|
|
101
|
-
|
|
102
|
-
const n =
|
|
103
|
-
n > -1 &&
|
|
106
|
+
m.warning(t || r("ap.apUpload.networkAnomaly"));
|
|
107
|
+
const n = i.value.findIndex((s) => s.uid === e.uid);
|
|
108
|
+
n > -1 && i.value.splice(n, 1), g.value--;
|
|
104
109
|
},
|
|
105
110
|
onSuccess: (t) => {
|
|
106
|
-
const n =
|
|
107
|
-
n && (n.status = "success", n.path = t), c.value ? c.value.push(w(
|
|
111
|
+
const n = i.value.find((s) => s.uid === e.uid);
|
|
112
|
+
n && (n.status = "success", n.path = t), c.value ? c.value.push(w(v, t, a.name)) : c.value = [w(v, t, a.name)], _.push({
|
|
108
113
|
uid: e.uid,
|
|
109
114
|
path: t
|
|
110
|
-
}),
|
|
115
|
+
}), g.value--;
|
|
111
116
|
},
|
|
112
|
-
file:
|
|
117
|
+
file: a
|
|
113
118
|
});
|
|
114
119
|
return;
|
|
115
120
|
}
|
|
116
121
|
try {
|
|
117
|
-
const t = await
|
|
118
|
-
e.oss = t,
|
|
119
|
-
file:
|
|
120
|
-
dirName:
|
|
122
|
+
const t = await $(b);
|
|
123
|
+
e.oss = t, i.value.push(e), D({
|
|
124
|
+
file: a,
|
|
125
|
+
dirName: O,
|
|
121
126
|
oss: t,
|
|
122
127
|
successCallBack(n) {
|
|
123
|
-
const
|
|
124
|
-
|
|
128
|
+
const s = i.value.find((p) => p.uid === e.uid);
|
|
129
|
+
s && (s.status = "success", s.path = n), c.value ? c.value.push(w(v, n, a.name)) : c.value = [w(v, n, a.name)], _.push({
|
|
125
130
|
uid: e.uid,
|
|
126
131
|
path: n
|
|
127
|
-
}),
|
|
132
|
+
}), g.value--;
|
|
128
133
|
},
|
|
129
134
|
errorCallBack(n) {
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
135
|
+
m.warning(n || r("ap.apUpload.networkAnomaly"));
|
|
136
|
+
const s = i.value.findIndex((p) => p.uid === e.uid);
|
|
137
|
+
s > -1 && i.value.splice(s, 1), g.value--;
|
|
133
138
|
},
|
|
134
139
|
progressCallBack(n) {
|
|
135
|
-
const
|
|
136
|
-
|
|
140
|
+
const s = i.value.find((p) => p.uid === e.uid);
|
|
141
|
+
s && (s.percent = n);
|
|
137
142
|
}
|
|
138
143
|
});
|
|
139
144
|
} catch (t) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
m.warning(
|
|
146
|
+
typeof (t == null ? void 0 : t.message) == "string" ? t.message : r("ap.apUpload.networkAnomaly")
|
|
147
|
+
);
|
|
148
|
+
const n = i.value.findIndex((s) => s.uid === e.uid);
|
|
149
|
+
n > -1 && i.value.splice(n, 1), g.value--;
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
|
-
function
|
|
152
|
+
function V(e) {
|
|
146
153
|
var t;
|
|
147
154
|
if (e.path) {
|
|
148
155
|
if (Array.isArray(c.value)) {
|
|
149
|
-
const n =
|
|
150
|
-
n >= 0 && (c == null || c.value.splice(n, 1),
|
|
156
|
+
const n = _.findIndex((s) => s.uid === e.uid);
|
|
157
|
+
n >= 0 && (c == null || c.value.splice(n, 1), _.splice(n, 1)), c.value.length === 0 && (c.value = void 0);
|
|
151
158
|
}
|
|
152
159
|
} else
|
|
153
160
|
(t = e == null ? void 0 : e.oss) == null || t.pauseUpload();
|
|
154
|
-
const
|
|
155
|
-
return
|
|
161
|
+
const a = i.value.findIndex((n) => n.uid === e.uid);
|
|
162
|
+
return i.value.splice(a, 1), Promise.resolve(!0);
|
|
156
163
|
}
|
|
157
|
-
return (e,
|
|
158
|
-
class:
|
|
159
|
-
[o(
|
|
160
|
-
[o(
|
|
164
|
+
return (e, a) => (f(), h("div", {
|
|
165
|
+
class: K({
|
|
166
|
+
[o(A)()]: !0,
|
|
167
|
+
[o(A)("admin")]: o(E) === "admin"
|
|
161
168
|
})
|
|
162
169
|
}, [
|
|
163
|
-
|
|
170
|
+
d("input", {
|
|
164
171
|
style: { display: "none" },
|
|
165
172
|
type: "file",
|
|
166
173
|
ref_key: "fileRef",
|
|
167
|
-
ref:
|
|
174
|
+
ref: x,
|
|
168
175
|
accept: o(y),
|
|
169
|
-
onChange:
|
|
170
|
-
}, null, 40,
|
|
171
|
-
|
|
172
|
-
(
|
|
176
|
+
onChange: B
|
|
177
|
+
}, null, 40, ue),
|
|
178
|
+
d("div", re, [
|
|
179
|
+
(f(!0), h(Q, null, W(o(i), (t) => (f(), h("div", {
|
|
173
180
|
class: "picture-item",
|
|
174
181
|
key: t.uid
|
|
175
182
|
}, [
|
|
176
|
-
|
|
177
|
-
|
|
183
|
+
d("div", le, [
|
|
184
|
+
d("img", {
|
|
178
185
|
src: t.thumbUrl,
|
|
179
186
|
alt: ""
|
|
180
|
-
}, null, 8,
|
|
181
|
-
|
|
182
|
-
|
|
187
|
+
}, null, 8, pe),
|
|
188
|
+
X(d("div", de, [
|
|
189
|
+
d("div", {
|
|
183
190
|
class: "picture-item-close",
|
|
184
|
-
onClick: (n) =>
|
|
191
|
+
onClick: (n) => V(t)
|
|
185
192
|
}, [
|
|
186
|
-
C(o(
|
|
187
|
-
], 8,
|
|
188
|
-
t.status === "uploading" ? (
|
|
189
|
-
C(o(
|
|
193
|
+
C(o(ee))
|
|
194
|
+
], 8, me),
|
|
195
|
+
t.status === "uploading" ? (f(), h("div", fe, [
|
|
196
|
+
C(o(oe), {
|
|
190
197
|
percent: t.percent,
|
|
191
198
|
strokeColor: "#ffffff",
|
|
192
199
|
trailColor: "rgba(255, 255, 255, 0.3)",
|
|
193
200
|
size: 4,
|
|
194
201
|
showInfo: !1
|
|
195
202
|
}, null, 8, ["percent"])
|
|
196
|
-
])) :
|
|
203
|
+
])) : R("", !0)
|
|
197
204
|
], 512), [
|
|
198
|
-
[
|
|
205
|
+
[Y, t.status === "uploading"]
|
|
199
206
|
])
|
|
200
207
|
])
|
|
201
208
|
]))), 128)),
|
|
202
|
-
o(
|
|
209
|
+
o(l) === void 0 || o(i).length < o(l) ? (f(), h("div", {
|
|
203
210
|
key: 0,
|
|
204
211
|
class: "picture-upload",
|
|
205
|
-
onClick:
|
|
212
|
+
onClick: T
|
|
206
213
|
}, [
|
|
207
|
-
C(o(
|
|
208
|
-
|
|
209
|
-
])) :
|
|
214
|
+
C(o(te)),
|
|
215
|
+
d("div", null, U(o(r)("ap.apUpload.update")), 1)
|
|
216
|
+
])) : R("", !0)
|
|
210
217
|
]),
|
|
211
|
-
|
|
212
|
-
o(N) ? (
|
|
218
|
+
d("div", he, [
|
|
219
|
+
o(N) ? (f(), h("div", ge, U(o(N)), 1)) : (f(), h("div", ve, U(`${o(r)("ap.apUpload.supportExtension")}:${o(se)(o(y))},${o(r)(
|
|
220
|
+
"ap.apUpload.maxUploadPictureSize",
|
|
221
|
+
{ maxSize: o(k) }
|
|
222
|
+
)}`), 1))
|
|
213
223
|
])
|
|
214
224
|
], 2));
|
|
215
225
|
}
|
|
216
226
|
});
|
|
217
227
|
export {
|
|
218
|
-
|
|
228
|
+
be as default
|
|
219
229
|
};
|