@das-fed/ui 7.0.7-hot.67 → 7.0.7-hot.69
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/package.json +5 -5
- package/packages/business-components/import-button/index.js +248 -246
- package/packages/business-components/import-button/index.js.gz +0 -0
- package/packages/business-components/import-button/src/type.d.ts +2 -0
- package/packages/business-components/process-form/index.js +850 -814
- package/packages/business-components/process-form/index.js.gz +0 -0
- package/packages/business-components/process-form/style.css +1 -1
- package/packages/business-components/user-org-dialog/index.js +183 -183
- package/packages/business-components/user-org-dialog/index.js.gz +0 -0
- package/packages/business-components/user-org-dialog/style.css +1 -1
- package/packages/business-components/user-org-dialog/style.css.gz +0 -0
- package/packages/components/menu-aside/index.js +1 -1
- package/packages/components/menu-aside/index.js.gz +0 -0
- package/packages/components/select-input/index.js +9 -7
- package/packages/components/select-input/index.js.gz +0 -0
- package/packages/components/select-input/src/type.d.ts +3 -0
- package/packages/components/select-input/style.css +1 -1
- package/packages/components/select-input/style.css.gz +0 -0
|
@@ -1,176 +1,176 @@
|
|
|
1
1
|
import '@das-fed/ui/packages/business-components/import-button/style.css';
|
|
2
2
|
import { withInstall as fe } from "@das-fed/utils/with-install/index";
|
|
3
|
-
import { ref as
|
|
4
|
-
import { t as
|
|
5
|
-
import { DasDialog as
|
|
6
|
-
import { DasUpload as
|
|
7
|
-
import { DasProgress as
|
|
3
|
+
import { ref as x, defineComponent as ge, computed as ve, watch as he, createElementBlock as Ce, openBlock as we, createElementVNode as Y, createCommentVNode as se, createVNode as U, unref as o, renderSlot as le, withCtx as L, createTextVNode as J, toDisplayString as H, isRef as Q } from "vue";
|
|
4
|
+
import { t as p, currentLang as ke, i18n as B, setI18nRule as xe } from "@das-fed/web/packages/i18n/index";
|
|
5
|
+
import { DasDialog as ne } from "@das-fed/ui/packages/components/dialog/index";
|
|
6
|
+
import { DasUpload as be } from "@das-fed/ui/packages/components/upload/index";
|
|
7
|
+
import { DasProgress as ye } from "@das-fed/ui/packages/components/progress/index";
|
|
8
8
|
import { DasButton as W } from "@das-fed/ui/packages/components/button/index";
|
|
9
|
-
import { iotMinio as ae, iotProgress as
|
|
10
|
-
import { DasMessage as
|
|
9
|
+
import { iotMinio as ae, iotProgress as Ne } from "@das-fed/utils/api-services/modules/iot";
|
|
10
|
+
import { DasMessage as M } from "@das-fed/ui/packages/components/message/index";
|
|
11
11
|
import ze from "dayjs";
|
|
12
|
-
import { getConfig as
|
|
12
|
+
import { getConfig as ie } from "@das-fed/utils/config";
|
|
13
13
|
import { extractFilename as Te } from "@das-fed/utils/common-tools";
|
|
14
14
|
import { getUserInfo as Fe } from "@das-fed/utils/common-info/index";
|
|
15
|
-
import { pureImageSrc as
|
|
15
|
+
import { pureImageSrc as me } from "@das-fed/utils/pure-image-src";
|
|
16
16
|
let te = (e = 21) => {
|
|
17
|
-
let
|
|
17
|
+
let u = "", m = crypto.getRandomValues(new Uint8Array(e));
|
|
18
18
|
for (; e--; ) {
|
|
19
|
-
let
|
|
20
|
-
|
|
19
|
+
let s = m[e] & 63;
|
|
20
|
+
s < 36 ? u += s.toString(36) : s < 62 ? u += (s - 26).toString(36).toUpperCase() : s < 63 ? u += "_" : u += "-";
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return u;
|
|
23
23
|
};
|
|
24
|
-
const
|
|
25
|
-
let
|
|
24
|
+
const Ie = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), Pe = ae.post("upload-objects", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), Se = Ne.get("progress"), $e = (e) => {
|
|
25
|
+
let u = x(!1), m = x(!1), s = x(""), k = x(0), n = x("normal"), C = x(!1), b, N = x(""), _ = x(""), P = x(""), z = x(""), S = x(!1), j = x(""), F = "", I = x(""), $;
|
|
26
26
|
const E = () => {
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
const [r,
|
|
30
|
-
return r ? { stauts: !1 } : { status: !0, data:
|
|
31
|
-
},
|
|
27
|
+
_.value = "", P.value = "", z.value = "", S.value = !1, j.value = "";
|
|
28
|
+
}, y = async () => {
|
|
29
|
+
const [r, l] = await Ie().run();
|
|
30
|
+
return r ? { stauts: !1 } : { status: !0, data: l };
|
|
31
|
+
}, R = (r) => new Promise((l, g) => {
|
|
32
32
|
const i = [];
|
|
33
33
|
let t = 0;
|
|
34
34
|
for (; t < r.size; ) {
|
|
35
|
-
const
|
|
36
|
-
i.push(
|
|
35
|
+
const f = r.slice(t, t + 1048576);
|
|
36
|
+
i.push(f), t += 1048576;
|
|
37
37
|
}
|
|
38
38
|
const c = new Blob(i, { type: r.type });
|
|
39
|
-
|
|
40
|
-
}), A = async (r,
|
|
41
|
-
F = t,
|
|
42
|
-
const c = await
|
|
39
|
+
l(c);
|
|
40
|
+
}), A = async (r, l, g, a = !1, i = !0, t = "") => {
|
|
41
|
+
F = t, I.value = "import", i && (n.value = "normal", k.value = 0, s.value = p("导入进度"), m.value = !0, N.value = ""), $ = l;
|
|
42
|
+
const c = await y();
|
|
43
43
|
if (!c.status) return;
|
|
44
|
-
let
|
|
45
|
-
const
|
|
44
|
+
let f = c.data, v = null, { autoContentType: q, bucketName: D, importFileName: O } = g;
|
|
45
|
+
const re = a ? Pe : _e;
|
|
46
46
|
if (a) {
|
|
47
47
|
let X = [];
|
|
48
|
-
await
|
|
49
|
-
let ee = await
|
|
48
|
+
await l.forEach(async (G) => {
|
|
49
|
+
let ee = await R(G);
|
|
50
50
|
X.push(ee);
|
|
51
|
-
}),
|
|
52
|
-
|
|
53
|
-
}),
|
|
54
|
-
|
|
51
|
+
}), v = new FormData(), v.append("accessKeyId", f.accessKeyId), v.append("secretAccessKey", f.secretAccessKey), v.append("sessionToken", f.sessionToken), v.append("bucketName", D), l.forEach((G, ee) => {
|
|
52
|
+
v.append("file", X[ee]);
|
|
53
|
+
}), O.forEach((G) => {
|
|
54
|
+
v.append("filePaths", G);
|
|
55
55
|
});
|
|
56
56
|
} else {
|
|
57
|
-
const X = await
|
|
58
|
-
|
|
59
|
-
accessKeyId:
|
|
60
|
-
secretAccessKey:
|
|
61
|
-
sessionToken:
|
|
57
|
+
const X = await R(l);
|
|
58
|
+
v = {
|
|
59
|
+
accessKeyId: f.accessKeyId,
|
|
60
|
+
secretAccessKey: f.secretAccessKey,
|
|
61
|
+
sessionToken: f.sessionToken,
|
|
62
62
|
file: X,
|
|
63
|
-
bucketName:
|
|
64
|
-
filePath:
|
|
65
|
-
autoContentType:
|
|
63
|
+
bucketName: D,
|
|
64
|
+
filePath: O,
|
|
65
|
+
autoContentType: q
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
const [
|
|
69
|
-
if (
|
|
68
|
+
const [ue, ce] = await re(v).run();
|
|
69
|
+
if (ue) return;
|
|
70
70
|
const de = await Ue(ce.data), Z = await (r == null ? void 0 : r(de));
|
|
71
71
|
if (i) {
|
|
72
72
|
if (!Z.status) {
|
|
73
|
-
|
|
73
|
+
m.value = !1, n.value = "error";
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
s.value = p("导入进度"), m.value = !0, T(Z.taskId, "import", "");
|
|
77
77
|
} else {
|
|
78
78
|
if (!Z.status) return;
|
|
79
|
-
n.value = "success",
|
|
80
|
-
message:
|
|
79
|
+
n.value = "success", M.success({
|
|
80
|
+
message: p("导入成功"),
|
|
81
81
|
grouping: !0,
|
|
82
82
|
repeatNum: 1
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
},
|
|
86
|
-
n.value = "normal",
|
|
85
|
+
}, V = async (r, l = "", g = "") => {
|
|
86
|
+
n.value = "normal", k.value = 0, s.value = g || p("导出进度"), m.value = !0;
|
|
87
87
|
const a = await (r == null ? void 0 : r());
|
|
88
88
|
if (!a.status) {
|
|
89
|
-
|
|
89
|
+
m.value = !1, n.value = "error";
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
T(a.taskId, "action", "");
|
|
93
|
-
},
|
|
94
|
-
|
|
93
|
+
}, K = async (r, l = "", g = "xlsx") => {
|
|
94
|
+
I.value = "export", n.value = "normal", k.value = 0, s.value = p("导出进度"), m.value = !0;
|
|
95
95
|
const a = await (r == null ? void 0 : r());
|
|
96
96
|
if (!a.status) {
|
|
97
|
-
|
|
97
|
+
m.value = !1, n.value = "error";
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
ze().format("YYYYMMDDHHmmss") + "", T(a.taskId, "export",
|
|
101
|
-
}, T = async (r,
|
|
102
|
-
|
|
100
|
+
ze().format("YYYYMMDDHHmmss") + "", T(a.taskId, "export", l || "", g);
|
|
101
|
+
}, T = async (r, l, g, a = "") => {
|
|
102
|
+
C.value = !0, h(r, l, g, a), b = setTimeout(() => {
|
|
103
103
|
}, 50);
|
|
104
104
|
}, d = () => {
|
|
105
|
-
clearTimeout(
|
|
106
|
-
},
|
|
107
|
-
var
|
|
108
|
-
const [i, t] = await
|
|
105
|
+
clearTimeout(b), b = null, m.value = !1;
|
|
106
|
+
}, h = async (r, l = "export", g, a = "") => {
|
|
107
|
+
var f, v;
|
|
108
|
+
const [i, t] = await Se("", {
|
|
109
109
|
url: `progress/${r}`
|
|
110
110
|
}).run();
|
|
111
111
|
if (i) {
|
|
112
|
-
|
|
112
|
+
C.value = !1;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
|
|
116
|
-
const c =
|
|
117
|
-
if (
|
|
118
|
-
if (
|
|
119
|
-
t.status == 1 ? (n.value = "success", pe(`${
|
|
120
|
-
message: t.message || `${c}${
|
|
115
|
+
k.value = t.percentage;
|
|
116
|
+
const c = l == "export" ? p("导出") : p("导入");
|
|
117
|
+
if (k.value == 100)
|
|
118
|
+
if (N.value = t, C.value = !1, d(), l == "export")
|
|
119
|
+
t.status == 1 ? (n.value = "success", pe(`${ie().baseURL}/oss${t.filePath}`, g, a), C.value = !1) : t.status == 2 && (z.value = t.message || `${c}${p("失败")}`, M.error({
|
|
120
|
+
message: t.message || `${c}${p("失败")}`,
|
|
121
121
|
grouping: !0,
|
|
122
122
|
repeatNum: 1
|
|
123
123
|
}));
|
|
124
|
-
else if (
|
|
124
|
+
else if (l == "import") {
|
|
125
125
|
if (t.filePath) {
|
|
126
126
|
n.value = "error";
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
let
|
|
130
|
-
const
|
|
131
|
-
|
|
127
|
+
const q = (f = $.name) == null ? void 0 : f.match(/(.*?)(\.[^.]*$|$)/);
|
|
128
|
+
q.length && q[2], S.value = !0;
|
|
129
|
+
let D = await Te(`/oss/${t == null ? void 0 : t.filePath}`);
|
|
130
|
+
const O = ((v = D == null ? void 0 : D.split("/")) == null ? void 0 : v.pop()) || "";
|
|
131
|
+
_.value = F || O, P.value = $.sizeText, z.value = p("部分数据校验不通过,请下载附件并修改,重新导入!"), j.value = `${ie().baseURL}/oss/${t == null ? void 0 : t.filePath}`;
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
} else
|
|
133
|
+
w(t.status, c, t.message), t.status == 1 && (u.value = !1), e("success");
|
|
134
|
+
} else l == "action" && (n.value = "success");
|
|
135
135
|
else
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}, 50) : (
|
|
139
|
-
},
|
|
140
|
-
r == 1 ? (n.value = "success",
|
|
141
|
-
message:
|
|
136
|
+
b && t.status != 2 ? b = setTimeout(() => {
|
|
137
|
+
h(r, l, g, a);
|
|
138
|
+
}, 50) : (N.value = t, C.value = !1, w(t.status, c, t.message), d(), S.value = !0, z.value = (t == null ? void 0 : t.message) || "", e("error", t));
|
|
139
|
+
}, w = (r, l, g) => {
|
|
140
|
+
r == 1 ? (n.value = "success", M.success({
|
|
141
|
+
message: p("business-components_export-success-tip", l),
|
|
142
142
|
grouping: !0,
|
|
143
143
|
repeatNum: 1
|
|
144
|
-
}),
|
|
145
|
-
message:
|
|
144
|
+
}), _.value = "", P.value = "", z.value = "") : r == 2 ? (n.value = "error", M.error({
|
|
145
|
+
message: g || p("business-components_export-failure-tip", l),
|
|
146
146
|
grouping: !0,
|
|
147
147
|
repeatNum: 1
|
|
148
|
-
})) : r == 3 && (n.value = "error",
|
|
149
|
-
message:
|
|
148
|
+
})) : r == 3 && (n.value = "error", M.error({
|
|
149
|
+
message: p("business-components_export-partially-failure-tip", l),
|
|
150
150
|
grouping: !0,
|
|
151
151
|
repeatNum: 1
|
|
152
152
|
}));
|
|
153
153
|
};
|
|
154
154
|
return {
|
|
155
|
-
importDialog:
|
|
156
|
-
showProgressDialog:
|
|
157
|
-
progressTitle:
|
|
158
|
-
percent:
|
|
155
|
+
importDialog: u,
|
|
156
|
+
showProgressDialog: m,
|
|
157
|
+
progressTitle: s,
|
|
158
|
+
percent: k,
|
|
159
159
|
progressStatus: n,
|
|
160
|
-
progressLoading:
|
|
161
|
-
progressResult:
|
|
162
|
-
errorFileName:
|
|
163
|
-
errorFileSize:
|
|
160
|
+
progressLoading: C,
|
|
161
|
+
progressResult: N,
|
|
162
|
+
errorFileName: _,
|
|
163
|
+
errorFileSize: P,
|
|
164
164
|
errorMessage: z,
|
|
165
|
-
errorImport:
|
|
166
|
-
errorFilePath:
|
|
167
|
-
fileHandleType:
|
|
165
|
+
errorImport: S,
|
|
166
|
+
errorFilePath: j,
|
|
167
|
+
fileHandleType: I,
|
|
168
168
|
fileImport: A,
|
|
169
|
-
fileExport:
|
|
170
|
-
fileAction:
|
|
169
|
+
fileExport: K,
|
|
170
|
+
fileAction: V,
|
|
171
171
|
generateUniqueName: (r) => {
|
|
172
|
-
const
|
|
173
|
-
return `${
|
|
172
|
+
const l = r == null ? void 0 : r.match(/(.*?)(\.[^.]*$|$)/), g = l.length ? l[2] : "";
|
|
173
|
+
return `${l.length ? l[1] : r}${te()}${g}`;
|
|
174
174
|
},
|
|
175
175
|
downloadFile: pe,
|
|
176
176
|
resetStataus: E,
|
|
@@ -178,7 +178,7 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
178
178
|
clearTimer: d
|
|
179
179
|
};
|
|
180
180
|
}, De = (e) => {
|
|
181
|
-
let
|
|
181
|
+
let u = e == null ? void 0 : e.toLocaleLowerCase();
|
|
182
182
|
return {
|
|
183
183
|
excel: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
184
184
|
pdf: "application/pdf",
|
|
@@ -205,68 +205,68 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
205
205
|
crt: "application/x-x509-ca-cert",
|
|
206
206
|
der: "application/x-x509-ca-cert",
|
|
207
207
|
cer: "application/pkix-cert"
|
|
208
|
-
}[
|
|
209
|
-
}, pe = (e,
|
|
210
|
-
const
|
|
211
|
-
|
|
208
|
+
}[u];
|
|
209
|
+
}, pe = (e, u, m = "excel") => {
|
|
210
|
+
const s = new XMLHttpRequest();
|
|
211
|
+
s.open("get", e), s.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), s.responseType = "blob", s.onload = function(k) {
|
|
212
212
|
const n = new Blob([this.response], {
|
|
213
|
-
type: De(
|
|
214
|
-
}),
|
|
213
|
+
type: De(m)
|
|
214
|
+
}), C = URL.createObjectURL(n);
|
|
215
215
|
if (window.navigator.msSaveOrOpenBlob)
|
|
216
|
-
navigator.msSaveBlob(n,
|
|
216
|
+
navigator.msSaveBlob(n, u);
|
|
217
217
|
else {
|
|
218
|
-
const
|
|
219
|
-
|
|
218
|
+
const b = document.createElement("a");
|
|
219
|
+
b.href = C, b.download = u, b.click(), window.URL.revokeObjectURL(C);
|
|
220
220
|
}
|
|
221
|
-
},
|
|
222
|
-
}, Ue = (e) => new Promise((
|
|
223
|
-
var
|
|
224
|
-
|
|
221
|
+
}, s.send();
|
|
222
|
+
}, Ue = (e) => new Promise((u, m) => {
|
|
223
|
+
var s = new FileReader();
|
|
224
|
+
s.onload = function(k) {
|
|
225
225
|
let n = "";
|
|
226
|
-
typeof
|
|
227
|
-
},
|
|
228
|
-
}), Me = (e,
|
|
229
|
-
var
|
|
226
|
+
typeof s.result == "string" && (n = JSON.parse(s.result)), u(n);
|
|
227
|
+
}, s.readAsText(e);
|
|
228
|
+
}), Me = (e, u) => {
|
|
229
|
+
var g;
|
|
230
230
|
const {
|
|
231
|
-
importDialog:
|
|
232
|
-
showProgressDialog:
|
|
233
|
-
progressTitle:
|
|
231
|
+
importDialog: m,
|
|
232
|
+
showProgressDialog: s,
|
|
233
|
+
progressTitle: k,
|
|
234
234
|
percent: n,
|
|
235
|
-
progressStatus:
|
|
236
|
-
progressLoading:
|
|
237
|
-
errorFileName:
|
|
238
|
-
errorFileSize:
|
|
239
|
-
errorMessage:
|
|
235
|
+
progressStatus: C,
|
|
236
|
+
progressLoading: b,
|
|
237
|
+
errorFileName: N,
|
|
238
|
+
errorFileSize: _,
|
|
239
|
+
errorMessage: P,
|
|
240
240
|
errorImport: z,
|
|
241
|
-
errorFilePath:
|
|
242
|
-
fileHandleType:
|
|
241
|
+
errorFilePath: S,
|
|
242
|
+
fileHandleType: j,
|
|
243
243
|
fileImport: F,
|
|
244
|
-
fileExport:
|
|
245
|
-
downloadFile:
|
|
244
|
+
fileExport: I,
|
|
245
|
+
downloadFile: $,
|
|
246
246
|
clearTimer: E
|
|
247
|
-
} =
|
|
248
|
-
let
|
|
247
|
+
} = $e(u);
|
|
248
|
+
let y = x([]), R = (g = Fe()) == null ? void 0 : g.tenantId;
|
|
249
249
|
const A = () => {
|
|
250
|
-
|
|
250
|
+
y.value = [], z.value = !1, N.value = "", _.value = "", P.value = "", m.value = !0, S.value = "", u("open");
|
|
251
251
|
};
|
|
252
|
-
let
|
|
253
|
-
const
|
|
254
|
-
const i = e.fileType.split(","), t = a.name.substring(a.name.lastIndexOf(".")), c = T(a.sizeText),
|
|
252
|
+
let V;
|
|
253
|
+
const K = (a) => {
|
|
254
|
+
const i = e.fileType.split(","), t = a.name.substring(a.name.lastIndexOf(".")), c = T(a.sizeText), f = T(e.fileMaxSize);
|
|
255
255
|
if (!i.includes(t)) {
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
M.warning(p("文件格式错误,请重新上传!")), setTimeout(() => {
|
|
257
|
+
y.value = [];
|
|
258
258
|
});
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
|
-
if (c >
|
|
262
|
-
|
|
263
|
-
`${
|
|
261
|
+
if (c > f) {
|
|
262
|
+
M.warning(
|
|
263
|
+
`${p("文件大小不超过")}${ke.value === "zh-CN" ? e.fileMaxSize : " " + e.fileMaxSize}`
|
|
264
264
|
), setTimeout(() => {
|
|
265
|
-
|
|
265
|
+
y.value = [];
|
|
266
266
|
});
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
|
-
|
|
269
|
+
V = a.name;
|
|
270
270
|
}, T = (a) => {
|
|
271
271
|
let i = a.match(/\d+(\.\d+)?/)[0], t = a.match(/[a-zA-z]+/gi)[0], c = 0;
|
|
272
272
|
return i = parseFloat(i), t = t.toLowerCase(), t === "gb" || t === "g" ? c = (i * 1024 * 1024 * 1024).toFixed(2) : t === "mb" || t === "m" ? c = (i * 1024 * 1024).toFixed(2) : t === "kb" || t === "k" ? c = (i * 1024).toFixed(2) : t === "b" && (c = i), parseFloat(c);
|
|
@@ -276,49 +276,50 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
276
276
|
const c = {
|
|
277
277
|
fileName: i[i.length - 1],
|
|
278
278
|
filePath: a.value,
|
|
279
|
-
taskId: t,
|
|
280
279
|
...e.importParams
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
280
|
+
}, f = {}, v = {};
|
|
281
|
+
e.importParamsPosition === "params" ? Object.assign(f, c) : Object.assign(v, c), (e.taskIdPosition ?? e.importParamsPosition) === "params" ? f.taskId = t : v.taskId = t;
|
|
282
|
+
const D = Object.keys(v).length === 0 ? e.importFun("", { params: f }) : Object.keys(f).length === 0 ? e.importFun(v) : e.importFun(v, { params: f }), [O, re] = await D.run();
|
|
283
|
+
return O ? { status: !1 } : { status: !0, taskId: t };
|
|
284
|
+
}, h = async () => {
|
|
285
|
+
if (!y.value.length) return M.warning(p("请上传文件"));
|
|
285
286
|
const a = {
|
|
286
287
|
bucketName: e.bucketName,
|
|
287
|
-
importFileName: `${
|
|
288
|
+
importFileName: `${R}/${e.ossName}/${V}`
|
|
288
289
|
};
|
|
289
|
-
e.maxCount > 1 && (a.importFileName =
|
|
290
|
-
const i = e.maxCount > 1, t = e.maxCount > 1 ?
|
|
290
|
+
e.maxCount > 1 && (a.importFileName = y.value.map((c) => c.name));
|
|
291
|
+
const i = e.maxCount > 1, t = e.maxCount > 1 ? y.value : y.value[0];
|
|
291
292
|
await F(d, t, a, i);
|
|
292
|
-
},
|
|
293
|
-
|
|
293
|
+
}, w = () => {
|
|
294
|
+
$(S.value, N.value);
|
|
294
295
|
}, oe = () => {
|
|
295
|
-
|
|
296
|
+
I(r, e.templateName);
|
|
296
297
|
}, r = async () => {
|
|
297
298
|
let a = te();
|
|
298
299
|
const [i, t] = await e.templateFun({ taskId: a }).run();
|
|
299
300
|
return i ? { status: !1 } : { status: !0, taskId: a };
|
|
300
301
|
};
|
|
301
302
|
return {
|
|
302
|
-
showProgressDialog:
|
|
303
|
-
progressTitle:
|
|
303
|
+
showProgressDialog: s,
|
|
304
|
+
progressTitle: k,
|
|
304
305
|
percent: n,
|
|
305
|
-
progressStatus:
|
|
306
|
-
progressLoading:
|
|
307
|
-
errorFileName:
|
|
308
|
-
errorFileSize:
|
|
309
|
-
errorMessage:
|
|
306
|
+
progressStatus: C,
|
|
307
|
+
progressLoading: b,
|
|
308
|
+
errorFileName: N,
|
|
309
|
+
errorFileSize: _,
|
|
310
|
+
errorMessage: P,
|
|
310
311
|
errorImport: z,
|
|
311
|
-
importDialog:
|
|
312
|
-
fileList:
|
|
313
|
-
fileHandleType:
|
|
312
|
+
importDialog: m,
|
|
313
|
+
fileList: y,
|
|
314
|
+
fileHandleType: j,
|
|
314
315
|
showImportHandle: A,
|
|
315
|
-
confirmImport:
|
|
316
|
-
fileUpload:
|
|
317
|
-
errorFileDownload:
|
|
316
|
+
confirmImport: h,
|
|
317
|
+
fileUpload: K,
|
|
318
|
+
errorFileDownload: w,
|
|
318
319
|
downTemplate: async () => {
|
|
319
320
|
let a = "";
|
|
320
321
|
if (e.templateUrl)
|
|
321
|
-
a = e.templateUrl,
|
|
322
|
+
a = e.templateUrl, $(me(a), e.templateName);
|
|
322
323
|
else if (e.templateFun) {
|
|
323
324
|
if (e.templateType === "static") {
|
|
324
325
|
if (e.templateUrl)
|
|
@@ -327,14 +328,14 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
327
328
|
const [i, t] = await e.templateFun().run();
|
|
328
329
|
a = t;
|
|
329
330
|
}
|
|
330
|
-
|
|
331
|
+
$(me(a), e.templateName);
|
|
331
332
|
}
|
|
332
333
|
e.templateType === "dynamic" && e.templateFun && oe();
|
|
333
334
|
}
|
|
334
335
|
},
|
|
335
336
|
clearTimer: E
|
|
336
337
|
};
|
|
337
|
-
},
|
|
338
|
+
}, je = { class: "das-import-button" }, Ee = { class: "tip-box" }, Le = { class: "first-line" }, Be = { class: "second-line" }, Re = /* @__PURE__ */ ge({
|
|
338
339
|
__name: "App",
|
|
339
340
|
props: {
|
|
340
341
|
btnText: {},
|
|
@@ -348,6 +349,7 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
348
349
|
fileMaxSize: { default: "5MB" },
|
|
349
350
|
importParams: { default: {} },
|
|
350
351
|
importParamsPosition: { default: "params" },
|
|
352
|
+
taskIdPosition: {},
|
|
351
353
|
importDialogName: { default: "导入" },
|
|
352
354
|
confirmButtonName: { default: "确定导入" },
|
|
353
355
|
openDisabled: { type: Boolean, default: !0 },
|
|
@@ -358,44 +360,44 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
358
360
|
dialogSecondTip: {}
|
|
359
361
|
},
|
|
360
362
|
emits: ["open", "success", "error"],
|
|
361
|
-
setup(e, { expose:
|
|
362
|
-
const
|
|
363
|
-
showProgressDialog:
|
|
364
|
-
progressTitle:
|
|
365
|
-
percent:
|
|
366
|
-
progressStatus:
|
|
367
|
-
errorFileName:
|
|
363
|
+
setup(e, { expose: u, emit: m }) {
|
|
364
|
+
const s = e, k = m, n = ve(() => s.btnText ? s.btnText : p("导入")), {
|
|
365
|
+
showProgressDialog: C,
|
|
366
|
+
progressTitle: b,
|
|
367
|
+
percent: N,
|
|
368
|
+
progressStatus: _,
|
|
369
|
+
errorFileName: P,
|
|
368
370
|
errorFileSize: z,
|
|
369
|
-
errorMessage:
|
|
370
|
-
errorImport:
|
|
371
|
+
errorMessage: S,
|
|
372
|
+
errorImport: j,
|
|
371
373
|
importDialog: F,
|
|
372
|
-
fileList:
|
|
373
|
-
fileHandleType:
|
|
374
|
+
fileList: I,
|
|
375
|
+
fileHandleType: $,
|
|
374
376
|
showImportHandle: E,
|
|
375
|
-
confirmImport:
|
|
376
|
-
fileUpload:
|
|
377
|
+
confirmImport: y,
|
|
378
|
+
fileUpload: R,
|
|
377
379
|
errorFileDownload: A,
|
|
378
|
-
downTemplate:
|
|
379
|
-
clearTimer:
|
|
380
|
-
} = Me(
|
|
380
|
+
downTemplate: V,
|
|
381
|
+
clearTimer: K
|
|
382
|
+
} = Me(s, k);
|
|
381
383
|
let T;
|
|
382
|
-
return he(
|
|
383
|
-
d.includes("import") ? T = [
|
|
384
|
-
}),
|
|
385
|
-
confirmImport:
|
|
384
|
+
return he($, (d) => {
|
|
385
|
+
d.includes("import") ? T = [p("正在导入中..."), p("导入失败"), p("导入成功")] : T = [p("正在导出中..."), p("导出失败"), p("导出成功")];
|
|
386
|
+
}), u({
|
|
387
|
+
confirmImport: y,
|
|
386
388
|
showImportHandle: E
|
|
387
|
-
}), (d,
|
|
388
|
-
|
|
389
|
-
onClick:
|
|
390
|
-
(...
|
|
389
|
+
}), (d, h) => (we(), Ce("div", je, [
|
|
390
|
+
Y("div", {
|
|
391
|
+
onClick: h[0] || (h[0] = //@ts-ignore
|
|
392
|
+
(...w) => o(E) && o(E)(...w))
|
|
391
393
|
}, [
|
|
392
394
|
le(d.$slots, "default", {}, () => [
|
|
393
|
-
|
|
395
|
+
U(o(W), {
|
|
394
396
|
size: "middle",
|
|
395
397
|
"btn-type": "primary"
|
|
396
398
|
}, {
|
|
397
399
|
default: L(() => [
|
|
398
|
-
|
|
400
|
+
J(
|
|
399
401
|
H(n.value),
|
|
400
402
|
1
|
|
401
403
|
/* TEXT */
|
|
@@ -406,24 +408,24 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
406
408
|
})
|
|
407
409
|
], !0)
|
|
408
410
|
]),
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
title: o(
|
|
411
|
+
se(" 导入弹窗 "),
|
|
412
|
+
U(o(ne), {
|
|
413
|
+
title: o(B)(d.importDialogName).value,
|
|
412
414
|
modelValue: o(F),
|
|
413
|
-
"onUpdate:modelValue":
|
|
415
|
+
"onUpdate:modelValue": h[3] || (h[3] = (w) => Q(F) ? F.value = w : null),
|
|
414
416
|
customClass: "upload-dialog",
|
|
415
417
|
width: "610px",
|
|
416
418
|
height: "500px"
|
|
417
419
|
}, {
|
|
418
420
|
footer: L(() => [
|
|
419
|
-
|
|
420
|
-
|
|
421
|
+
Y("div", null, [
|
|
422
|
+
U(o(W), {
|
|
421
423
|
size: "middle",
|
|
422
|
-
onClick:
|
|
424
|
+
onClick: h[2] || (h[2] = (w) => F.value = !1)
|
|
423
425
|
}, {
|
|
424
426
|
default: L(() => [
|
|
425
|
-
|
|
426
|
-
H(o(
|
|
427
|
+
J(
|
|
428
|
+
H(o(B)("取消").value),
|
|
427
429
|
1
|
|
428
430
|
/* TEXT */
|
|
429
431
|
)
|
|
@@ -431,16 +433,16 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
431
433
|
_: 1
|
|
432
434
|
/* STABLE */
|
|
433
435
|
}),
|
|
434
|
-
|
|
436
|
+
U(o(W), {
|
|
435
437
|
size: "middle",
|
|
436
438
|
"btn-type": "primary",
|
|
437
|
-
disabled: d.openDisabled && o(
|
|
439
|
+
disabled: d.openDisabled && o(I).length === 0,
|
|
438
440
|
style: { "margin-left": "12px", width: "100%" },
|
|
439
|
-
onClick: o(
|
|
441
|
+
onClick: o(y)
|
|
440
442
|
}, {
|
|
441
443
|
default: L(() => [
|
|
442
|
-
|
|
443
|
-
H(o(
|
|
444
|
+
J(
|
|
445
|
+
H(o(B)(`${d.confirmButtonName}`).value),
|
|
444
446
|
1
|
|
445
447
|
/* TEXT */
|
|
446
448
|
)
|
|
@@ -452,22 +454,22 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
452
454
|
]),
|
|
453
455
|
default: L(() => [
|
|
454
456
|
le(d.$slots, "tip", {}, () => [
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
H(d.dialogFistTip || o(
|
|
457
|
+
Y("div", Ee, [
|
|
458
|
+
Y("div", Le, [
|
|
459
|
+
J(
|
|
460
|
+
H(d.dialogFistTip || o(B)("1、点击下载 ").value) + " ",
|
|
459
461
|
1
|
|
460
462
|
/* TEXT */
|
|
461
463
|
),
|
|
462
|
-
|
|
464
|
+
U(o(W), {
|
|
463
465
|
size: "large",
|
|
464
466
|
btnType: "primary-text",
|
|
465
467
|
block: "",
|
|
466
|
-
onClick: o(
|
|
468
|
+
onClick: o(V)
|
|
467
469
|
}, {
|
|
468
470
|
default: L(() => [
|
|
469
|
-
|
|
470
|
-
H(o(
|
|
471
|
+
J(
|
|
472
|
+
H(o(B)(`${d.templateName}`).value),
|
|
471
473
|
1
|
|
472
474
|
/* TEXT */
|
|
473
475
|
)
|
|
@@ -476,49 +478,49 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
476
478
|
/* STABLE */
|
|
477
479
|
}, 8, ["onClick"])
|
|
478
480
|
]),
|
|
479
|
-
|
|
481
|
+
Y(
|
|
480
482
|
"div",
|
|
481
483
|
Be,
|
|
482
|
-
H(d.dialogSecondTip || o(
|
|
484
|
+
H(d.dialogSecondTip || o(B)("2、仅支持上传Excel文件,重复数据以最后一条为准").value),
|
|
483
485
|
1
|
|
484
486
|
/* TEXT */
|
|
485
487
|
)
|
|
486
488
|
])
|
|
487
489
|
], !0),
|
|
488
|
-
|
|
489
|
-
modelValue: o(
|
|
490
|
-
"onUpdate:modelValue":
|
|
491
|
-
error: o(
|
|
492
|
-
"error-file-name": o(
|
|
490
|
+
U(o(be), {
|
|
491
|
+
modelValue: o(I),
|
|
492
|
+
"onUpdate:modelValue": h[1] || (h[1] = (w) => Q(I) ? I.value = w : null),
|
|
493
|
+
error: o(j),
|
|
494
|
+
"error-file-name": o(P),
|
|
493
495
|
"error-file-size": o(z),
|
|
494
|
-
"error-message": o(
|
|
496
|
+
"error-message": o(S),
|
|
495
497
|
accept: d.fileType,
|
|
496
498
|
maxCount: d.maxCount,
|
|
497
499
|
multiple: d.multiple,
|
|
498
500
|
onErrorFileDownload: o(A),
|
|
499
|
-
onFileUpload: o(
|
|
501
|
+
onFileUpload: o(R)
|
|
500
502
|
}, null, 8, ["modelValue", "error", "error-file-name", "error-file-size", "error-message", "accept", "maxCount", "multiple", "onErrorFileDownload", "onFileUpload"])
|
|
501
503
|
]),
|
|
502
504
|
_: 3
|
|
503
505
|
/* FORWARDED */
|
|
504
506
|
}, 8, ["title", "modelValue"]),
|
|
505
|
-
|
|
506
|
-
|
|
507
|
+
se(" 进度弹窗 "),
|
|
508
|
+
U(o(ne), {
|
|
507
509
|
size: "mini",
|
|
508
|
-
title: o(
|
|
510
|
+
title: o(B)(o(b)).value,
|
|
509
511
|
"is-feedback-img": !1,
|
|
510
|
-
modelValue: o(
|
|
511
|
-
"onUpdate:modelValue":
|
|
512
|
+
modelValue: o(C),
|
|
513
|
+
"onUpdate:modelValue": h[5] || (h[5] = (w) => Q(C) ? C.value = w : null),
|
|
512
514
|
type: "feedback",
|
|
513
|
-
onClose: o(
|
|
515
|
+
onClose: o(K)
|
|
514
516
|
}, {
|
|
515
517
|
default: L(() => [
|
|
516
|
-
|
|
517
|
-
modelValue: o(
|
|
518
|
-
"onUpdate:modelValue":
|
|
518
|
+
U(o(ye), {
|
|
519
|
+
modelValue: o(N),
|
|
520
|
+
"onUpdate:modelValue": h[4] || (h[4] = (w) => Q(N) ? N.value = w : null),
|
|
519
521
|
style: { "margin-top": "35px" },
|
|
520
522
|
type: "circle",
|
|
521
|
-
status: o(
|
|
523
|
+
status: o(_),
|
|
522
524
|
textMap: o(T)
|
|
523
525
|
}, null, 8, ["modelValue", "status", "textMap"])
|
|
524
526
|
]),
|
|
@@ -527,12 +529,12 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
527
529
|
}, 8, ["title", "modelValue", "onClose"])
|
|
528
530
|
]));
|
|
529
531
|
}
|
|
530
|
-
}), Ve = (e,
|
|
531
|
-
const
|
|
532
|
-
for (const [
|
|
533
|
-
|
|
534
|
-
return
|
|
535
|
-
},
|
|
532
|
+
}), Ve = (e, u) => {
|
|
533
|
+
const m = e.__vccOpts || e;
|
|
534
|
+
for (const [s, k] of u)
|
|
535
|
+
m[s] = k;
|
|
536
|
+
return m;
|
|
537
|
+
}, Oe = /* @__PURE__ */ Ve(Re, [["__scopeId", "data-v-49caa32f"]]), He = {
|
|
536
538
|
"1、点击下载 ": { "zh-CN": "1、点击下载 ", en: "1.Click to Download ", _appCode: "framework" },
|
|
537
539
|
"2、仅支持上传Excel文件,重复数据以最后一条为准": {
|
|
538
540
|
"zh-CN": "2、仅支持上传Excel文件,重复数据以最后一条为准",
|
|
@@ -580,8 +582,8 @@ const _e = ae.get("token"), Ie = ae.post("put-object", (e) => (e.headers || (e.h
|
|
|
580
582
|
_appCode: "framework"
|
|
581
583
|
}
|
|
582
584
|
};
|
|
583
|
-
|
|
584
|
-
const rt = fe(
|
|
585
|
+
xe(He);
|
|
586
|
+
const rt = fe(Oe);
|
|
585
587
|
export {
|
|
586
588
|
rt as DasImportButton,
|
|
587
589
|
rt as default
|