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