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