yahee-components 0.0.74 → 0.0.75

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.
@@ -1,8 +1,665 @@
1
- import o from "./common-import.vue2.js";
2
- /* empty css */
3
- import "E:/工作/项目代码/common_componentsweb/packages/components/src/common-import/common-import.vue?vue&type=style&index=1&lang.scss";
4
- import m from "../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ m(o, [["__scopeId", "data-v-46984973"]]);
1
+ import { defineComponent, mergeDefaults, toRefs, ref, watch, reactive, onMounted, onUnmounted, createElementBlock, openBlock, Fragment, createVNode, unref, isRef, withCtx, withDirectives, createElementVNode, createCommentVNode, renderSlot, createTextVNode, toDisplayString, renderList, createBlock } from "vue";
2
+ import { M2, translateEmployeeName } from "../utils/translate.js";
3
+ import { get } from "../packages/components/api/log-server.js";
4
+ import { getDomainBaseUrl } from "../utils/get-domain-base-url.js";
5
+ import { processFiles } from "../packages/components/api/common/index.js";
6
+ import { getUploadRecord } from "../packages/components/api/common-import/index.js";
7
+ import { defaultCommonImportProps } from "./props.js";
8
+ import { ElDialog, ElRow, ElUpload, ElButton, ElCol, ElLink, ElProgress, ElCard, vLoading, ElTable, ElTableColumn, ElPagination, ElMessage, ElMessageBox } from "element-plus";
9
+ import "element-plus/theme-chalk/src/base.scss";
10
+ import "element-plus/theme-chalk/src/dialog.scss";
11
+ import "element-plus/theme-chalk/src/overlay.scss";
12
+ import "element-plus/theme-chalk/src/row.scss";
13
+ import "element-plus/theme-chalk/src/button.scss";
14
+ import "element-plus/theme-chalk/src/link.scss";
15
+ import "element-plus/theme-chalk/src/col.scss";
16
+ import "element-plus/theme-chalk/src/table.scss";
17
+ import "element-plus/theme-chalk/src/checkbox.scss";
18
+ import "element-plus/theme-chalk/src/tooltip.scss";
19
+ import "element-plus/theme-chalk/src/popper.scss";
20
+ import "element-plus/theme-chalk/src/scrollbar.scss";
21
+ import "element-plus/theme-chalk/src/table-column.scss";
22
+ import "element-plus/theme-chalk/src/tag.scss";
23
+ import "element-plus/theme-chalk/src/upload.scss";
24
+ import "element-plus/theme-chalk/src/progress.scss";
25
+ import "element-plus/theme-chalk/src/card.scss";
26
+ import "element-plus/theme-chalk/src/pagination.scss";
27
+ import "element-plus/theme-chalk/src/option.scss";
28
+ import "element-plus/theme-chalk/src/option-group.scss";
29
+ import "element-plus/theme-chalk/src/select.scss";
30
+ import "element-plus/theme-chalk/src/input.scss";
31
+ import "element-plus/theme-chalk/src/badge.scss";
32
+ import "element-plus/theme-chalk/src/message.scss";
33
+ import "element-plus/theme-chalk/src/message-box.scss";
34
+ const _hoisted_1 = { class: "form-slot" }, _hoisted_2 = { key: 0 }, _hoisted_3 = { key: 0 }, _hoisted_4 = { key: 1 }, _hoisted_5 = { style: { color: "red" } }, _hoisted_6 = {
35
+ key: 0,
36
+ class: "card-header"
37
+ }, _hoisted_7 = ["innerHTML"], _hoisted_8 = {
38
+ key: 0,
39
+ class: "ellipsis-cell"
40
+ }, __default__ = {
41
+ name: "YaheeCommonImport",
42
+ inheritAttrs: !1
43
+ }, _sfc_main = /* @__PURE__ */ defineComponent({
44
+ ...__default__,
45
+ name: "YaheeCommonImport",
46
+ props: /* @__PURE__ */ mergeDefaults({
47
+ isShowDialog: { type: Boolean },
48
+ title: {},
49
+ importId: {},
50
+ multiple: { type: Boolean },
51
+ ProcessRequestData: {},
52
+ AutoCompleteResult: { type: Boolean },
53
+ displayGetTemplate: { type: Boolean },
54
+ processImportUrl: {},
55
+ requestData: {},
56
+ uploadRecord: { type: Function },
57
+ uploadFile: { type: Function },
58
+ uploadDisabled: { type: Boolean }
59
+ }, defaultCommonImportProps()),
60
+ emits: ["setIsShowDialog", "submit", "reloadTableData"],
61
+ setup(__props, { emit: __emit }) {
62
+ const props = __props, { isShowDialog, title, importId, processImportUrl, requestData } = toRefs(props), isShowCoreImportRecordDialog = ref(!1), tableLoading = ref(!1), initWebRootUrlLoading = ref(!1), tableData = ref([]), importProgress = ref({}), pageNo = ref(1), totalNum = ref(1), pageSize = ref(50), sessionIds = ref({}), problemFiles = ref({}), socket = {}, eventData = ref({}), errorMessage = ref({}), allWebRoot = ref({}), webRoot = ref(""), localRequestData = ref({
63
+ siteId: null,
64
+ reportTime: null,
65
+ fileName: ""
66
+ }), emit = __emit, handleClose = () => {
67
+ emit("setIsShowDialog", !1);
68
+ }, triggerSubmit = () => {
69
+ emit("submit");
70
+ }, getProgressPercentage = (e) => {
71
+ var t, o, l;
72
+ return Number(
73
+ ((((t = importProgress.value[e]) == null ? void 0 : t.successRowCount) + ((o = importProgress.value[e]) == null ? void 0 : o.failedRowCount)) / ((l = importProgress.value[e]) == null ? void 0 : l.totalRowCount) * 100).toFixed(0)
74
+ );
75
+ }, getFormattedDate = (row) => {
76
+ const utcDate = eval(
77
+ `new Date(${row.CreateOn.replace(/\d+(?=-[^-]+$)/, (e) => parseInt(e, 10) - 1).match(/\d+/g)})`
78
+ ), localDate = new Date(utcDate.getTime() - utcDate.getTimezoneOffset() * 6e4);
79
+ return LongDate(localDate, "---");
80
+ }, LongDate = (e, t) => {
81
+ const o = new Date(e);
82
+ let l = 0, r = 0, s = 0, a = 0, i = 0, n = "";
83
+ return l = o.getFullYear(), l === 1 || l === 1970 || l === 1900 || isNaN(l) ? t !== void 0 ? t : "---" : (r = o.getMonth() + 1, s = o.getDate(), a = o.getHours(), i = o.getMinutes(), n = `${l}-`, n += r >= 10 ? `${r}-` : `0${r}-`, n += s >= 10 ? s : `0${s}`, n += a >= 10 ? ` ${a}` : ` 0${a}`, n += i >= 10 ? `:${i}` : `:0${i}`, n);
84
+ }, getTemplateFile = () => {
85
+ if (!eventData.value) return;
86
+ let e = "";
87
+ eventData.value.TemplateType == 1 ? e = getFileServiceUrl(
88
+ `${eventData.value.Template}?dispositionType=attachment&t=${(/* @__PURE__ */ new Date()).getTime()}`
89
+ ) : eventData.value.TemplateType == 2 && console.log("获取模板文件失败,暂不支持报表导出"), window.open(e, "_self");
90
+ }, displayRecords = () => {
91
+ isShowCoreImportRecordDialog.value = !0, handleSizeChange(pageSize.value);
92
+ }, handleCloseRecord = () => {
93
+ isShowCoreImportRecordDialog.value = !1;
94
+ }, handleOpen = () => {
95
+ fileNames.value = /* @__PURE__ */ new Set();
96
+ }, getFile = (e) => {
97
+ e && window.open(`https://imgs.yaheecloud.com//${e}`, "_self");
98
+ }, handleSizeChange = async (e) => {
99
+ getUploadRecordDataList(JSON.stringify({ rows: pageSize.value, page: e }));
100
+ };
101
+ watch(
102
+ () => requestData,
103
+ (e) => {
104
+ e && (localRequestData.value = requestData.value);
105
+ },
106
+ { immediate: !0, deep: !0 }
107
+ );
108
+ const getUploadRecordDataList = (e) => {
109
+ getUploadRecord(`/ExcelImport/GetExcelImportRecords?importId=${importId.value}`, e).then((t) => {
110
+ var o, l;
111
+ t.status !== 200 && (ElMessage.error(M2("获取上传记录失败!")), console.log(`获取上传记录失败!${JSON.stringify(t)}`)), tableData.value = (o = t.data) == null ? void 0 : o.rows, totalNum.value = (l = t.data) == null ? void 0 : l.total;
112
+ }).catch((t) => {
113
+ console.log(t);
114
+ });
115
+ }, handleCurrentChange = (e) => {
116
+ getUploadRecordDataList(JSON.stringify({ rows: e, page: pageNo.value }));
117
+ }, fetchExcelImportEvent = async (e) => {
118
+ const t = `${getCommonUrl("/ExcelImport/GetExcelImportEvent")}?origin=${window.location.host}&importId=${e}`;
119
+ try {
120
+ const o = await fetch(t, {
121
+ method: "GET",
122
+ credentials: "include"
123
+ });
124
+ return o.ok || ElMessage.error(`Network response was not ok: ${o.statusText}`), await o.json();
125
+ } catch (o) {
126
+ return console.error("Failed to fetch Excel import event:", o), {};
127
+ }
128
+ }, getFileServiceUrl = (e) => {
129
+ let t = "";
130
+ const o = window.location.hostname;
131
+ return o.includes("localhost") || o.includes("127.0.0.1") || o.includes("yahee.com") ? t = "http://qas-service.yahee.com.cn:8088/FMSService/Latest/" : t = webRoot.value, `${t}${e}`;
132
+ }, getCommonUrl = (e) => getDomainBaseUrl() + e, getWebRoot = (e) => {
133
+ if (initWebRootUrlLoading.value = !0, !allWebRoot.value[e])
134
+ try {
135
+ fetch(`${getCommonUrl("/Common/GetAllWebRoot")}?origin=${window.location.host}`, {
136
+ method: "GET",
137
+ credentials: "include"
138
+ }).then((t) => {
139
+ if (!t.ok)
140
+ throw new Error("Network response was not ok");
141
+ let o = {};
142
+ t.json().then((l) => {
143
+ if (o = l, allWebRoot.value = o, !allWebRoot.value) {
144
+ console.error("GetWebRoot 失败");
145
+ return;
146
+ }
147
+ webRoot.value = allWebRoot.value[e], webRoot.value || console.error(`GetWebRoot未找到key为${e}的数据`);
148
+ });
149
+ }).finally(() => {
150
+ initWebRootUrlLoading.value = !1;
151
+ });
152
+ } catch (t) {
153
+ initWebRootUrlLoading.value = !1, console.error("GetWebRoot 失败", t);
154
+ }
155
+ }, fileNames = ref(/* @__PURE__ */ new Set()), uploadProgress = reactive({}), handleFileUpload = (e) => {
156
+ const { file: t } = e, o = 100 * 1024 * 1024;
157
+ if (t.size > o) {
158
+ console.error("文件大小不能超过 1GB"), ElMessage.success("文件大小不能超过 1GB");
159
+ return;
160
+ }
161
+ setupWebSocket(t.name), readFileAsBase64(t).then((l) => {
162
+ uploadConfigFile(t, l);
163
+ });
164
+ }, readFileAsBase64 = (e) => new Promise((t, o) => {
165
+ const l = new FileReader();
166
+ l.onload = () => t(l.result), l.onerror = (r) => o(r), l.readAsDataURL(e);
167
+ }), uploadConfigFile = (e, t) => {
168
+ triggerSubmit(), fileNames.value.has(e.name) ? (delete uploadProgress[e.name], delete importProgress.value[e.name], delete sessionIds.value[e.name], delete problemFiles.value[e.name], delete socket[e.name], delete errorMessage.value[e.name]) : fileNames.value.add(e.name);
169
+ const o = new FormData();
170
+ o.append("FileType", "115"), o.append("FileName", e.name), o.append("Base64Content", t), o.append("CreatedBy", "0"), o.append("Offset", "0"), o.append("IsOver", "true");
171
+ const l = new XMLHttpRequest();
172
+ l.open("POST", `${getFileServiceUrl("fragmentupload?t=")}${Math.random()}`, !0), l.upload.onprogress = (r) => {
173
+ r.lengthComputable && (uploadProgress[e.name] = Math.round(r.loaded / r.total * 100));
174
+ }, l.onload = () => {
175
+ if (l.status === 200)
176
+ try {
177
+ const r = JSON.parse(l.responseText);
178
+ if (console.log("服务器返回值:", r), r.ACK !== "Success" || !r.FileId) {
179
+ ElMessage.error(`${e.name} 上传失败`);
180
+ return;
181
+ }
182
+ ElMessage.success(`${e.name} 上传成功`), uploadProgress[e.name] = 100, setTimeout(() => {
183
+ localRequestData.value = {
184
+ ...localRequestData.value,
185
+ // 保留原有字段
186
+ fileName: (e == null ? void 0 : e.name) || ""
187
+ // ES6可选链避免报错
188
+ }, sessionIds.value[e.name] || (sessionIds.value[e.name] = getRandomStr(20)), processFile({
189
+ importId: importId.value,
190
+ fileId: r.FileId,
191
+ wsSessionId: sessionIds.value[e.name],
192
+ file: e,
193
+ requestData: localRequestData.value
194
+ });
195
+ }, 500);
196
+ } catch (r) {
197
+ console.error("解析服务器返回值失败:", r), ElMessage.error(`${e.name} 上传完成,但解析返回值失败`);
198
+ }
199
+ else
200
+ ElMessage.error(`${e.name} 上传失败`);
201
+ }, l.onerror = () => {
202
+ ElMessage.error(`${e.name} 上传异常`);
203
+ }, l.send(o);
204
+ }, processFile = (e) => {
205
+ processFiles(processImportUrl.value, e, {}).then((t) => {
206
+ var r;
207
+ if (console.log("processFiles 返回值:", t), t != null && t.success) {
208
+ ElMessageBox.alert("文件导入成功", "操作成功", {
209
+ confirmButtonText: "确定",
210
+ callback: () => {
211
+ var s;
212
+ t != null && t.fileId && (problemFiles.value[(s = e == null ? void 0 : e.file) == null ? void 0 : s.name] = t.fileId);
213
+ }
214
+ });
215
+ return;
216
+ }
217
+ const l = (Array.isArray(t == null ? void 0 : t.messages) ? t.messages : ["未知错误"]).join(`
218
+ `) + `
219
+
220
+ (可使用鼠标滚轮滚动查看)`;
221
+ ElMessageBox.alert(l, "导入错误", {
222
+ confirmButtonText: "知道了",
223
+ customClass: "custom-common-import-alert",
224
+ dangerouslyUseHTMLString: !0
225
+ }), t != null && t.fileId && (problemFiles.value[(r = e == null ? void 0 : e.file) == null ? void 0 : r.name] = t.fileId);
226
+ }).catch((t) => {
227
+ var l;
228
+ console.error("processFiles 失败", t);
229
+ let o = t == null ? void 0 : t.exMsg;
230
+ o || (o = M2("处理过程中发生错误!")), errorMessage.value[(l = e == null ? void 0 : e.file) == null ? void 0 : l.name] = o;
231
+ });
232
+ }, getRandomStr = (e, t) => {
233
+ t || (t = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
234
+ let o = "";
235
+ for (let l = e; l > 0; --l)
236
+ o += t[Math.floor(Math.random() * t.length)];
237
+ return o;
238
+ }, getWebSocketServerUrl = (e) => {
239
+ let t = "";
240
+ const { domain: o } = document;
241
+ return o.indexOf("localhost") >= 0 || o.indexOf("yahee.com") >= 0 ? t = "ws://qas-newerp.yahee.com.cn:8306" : t = "wss://websocket.yaheecloud.com:10001", t + e;
242
+ }, getAuthCode = async () => await get(getCommonUrl("/Common/GetWsAuthCode")), setupWebSocket = (e) => {
243
+ socket[e] = new WebSocket(getWebSocketServerUrl("/excel-import/")), socket[e].onmessage = (t) => {
244
+ var l, r;
245
+ if (t.data == "get-auth") {
246
+ getAuthCode().then((s) => {
247
+ var a;
248
+ console.log("发送authCode:", s), (a = socket[e]) == null || a.send(`auth:${s}`);
249
+ });
250
+ return;
251
+ }
252
+ const o = JSON.parse(t.data);
253
+ if (console.log("接收普通消息", o), !!o)
254
+ if (o.MessageType === 0) {
255
+ const s = o.MessageIndex || 0, a = JSON.parse(o == null ? void 0 : o.Content);
256
+ if ((a == null ? void 0 : a.error) == !0) {
257
+ errorMessage.value[e] = a.message;
258
+ return;
259
+ }
260
+ (!importProgress.value[e] || s > ((l = importProgress.value[e]) == null ? void 0 : l.MessageIndex)) && (importProgress.value[e] = a, importProgress.value[e].MessageIndex = s, a != null && a.finished && ((r = socket[e]) == null || r.close()));
261
+ } else o.MessageType === 1 ? sessionIds.value[e] = o.Content : console.log("进度:", o);
262
+ }, socket[e].onerror = (t) => {
263
+ console.error("WebSocket 错误:", t), t instanceof ErrorEvent ? console.error("Error message:", t.message) : console.error("Unknown WebSocket error:", t);
264
+ }, socket[e].onclose = () => {
265
+ console.log("WebSocket 连接关闭");
266
+ };
267
+ };
268
+ return onMounted(() => {
269
+ if (!processImportUrl.value) {
270
+ console.error("processImportUrl不能为空!");
271
+ return;
272
+ }
273
+ if (!importId.value) {
274
+ console.error("importId不能为空!");
275
+ return;
276
+ }
277
+ fetchExcelImportEvent(importId.value).then((t) => {
278
+ eventData.value = t;
279
+ });
280
+ const e = window.location.hostname;
281
+ e.includes("localhost") || e.includes("127.0.0.1") || e.includes("yahee.com") || getWebRoot("PictureUrlRoot");
282
+ }), onUnmounted(() => {
283
+ fileNames.value.forEach((e) => {
284
+ var t;
285
+ (t = socket[e]) == null || t.close();
286
+ });
287
+ }), (e, t) => (openBlock(), createElementBlock(Fragment, null, [
288
+ createVNode(unref(ElDialog), {
289
+ modelValue: unref(isShowDialog),
290
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => isRef(isShowDialog) ? isShowDialog.value = o : null),
291
+ title: unref(M2)(unref(title)),
292
+ width: "900",
293
+ "before-close": handleClose,
294
+ draggable: "",
295
+ onOpen: handleOpen
296
+ }, {
297
+ default: withCtx(() => {
298
+ var o;
299
+ return [
300
+ withDirectives((openBlock(), createElementBlock("div", null, [
301
+ createElementVNode("div", _hoisted_1, [
302
+ renderSlot(e.$slots, "form")
303
+ ]),
304
+ createVNode(unref(ElRow), null, {
305
+ default: withCtx(() => [
306
+ createVNode(unref(ElUpload), {
307
+ class: "upload-record",
308
+ "http-request": handleFileUpload,
309
+ accept: ".xls,.xlsx,.txt,.csv",
310
+ "show-file-list": !1,
311
+ multiple: e.multiple,
312
+ drag: "",
313
+ style: { width: "20%", height: "100%" },
314
+ disabled: e.uploadDisabled
315
+ }, {
316
+ default: withCtx(() => [
317
+ createVNode(unref(ElButton), {
318
+ style: { "background-color": "rgba(0, 183, 238, 1)", "font-weight": "bold" },
319
+ size: "large",
320
+ type: "primary",
321
+ disabled: e.uploadDisabled
322
+ }, {
323
+ default: withCtx(() => [
324
+ createTextVNode(toDisplayString(unref(M2)("上传文件")), 1)
325
+ ]),
326
+ _: 1
327
+ }, 8, ["disabled"])
328
+ ]),
329
+ _: 1
330
+ }, 8, ["multiple", "disabled"])
331
+ ]),
332
+ _: 1
333
+ }),
334
+ (o = fileNames.value) != null && o.size ? (openBlock(), createElementBlock("div", _hoisted_2, [
335
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(fileNames.value, (l) => {
336
+ var r, s;
337
+ return openBlock(), createElementBlock("div", {
338
+ key: l,
339
+ class: "uploadProgress"
340
+ }, [
341
+ createVNode(unref(ElRow), { style: { "margin-bottom": "5px" } }, {
342
+ default: withCtx(() => [
343
+ createVNode(unref(ElCol), { span: 18 }, {
344
+ default: withCtx(() => [
345
+ createVNode(unref(ElLink), {
346
+ type: "primary",
347
+ underline: !1,
348
+ style: { font: "inherit" },
349
+ onClick: t[0] || (t[0] = (a) => getFile(eventData.value.Template))
350
+ }, {
351
+ default: withCtx(() => [
352
+ createTextVNode(toDisplayString(l), 1)
353
+ ]),
354
+ _: 2
355
+ }, 1024)
356
+ ]),
357
+ _: 2
358
+ }, 1024),
359
+ uploadProgress[l] ? (openBlock(), createBlock(unref(ElCol), {
360
+ key: 0,
361
+ span: 6
362
+ }, {
363
+ default: withCtx(() => [
364
+ uploadProgress[l] == 100 ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(unref(M2)("文件上传完成")), 1)) : (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(unref(M2)("文件正在上传,进度") + `${uploadProgress[l]}% ...`), 1))
365
+ ]),
366
+ _: 2
367
+ }, 1024)) : createCommentVNode("", !0)
368
+ ]),
369
+ _: 2
370
+ }, 1024),
371
+ sessionIds.value[l] ? (openBlock(), createBlock(unref(ElRow), {
372
+ key: 0,
373
+ style: { "margin-bottom": "5px" }
374
+ }, {
375
+ default: withCtx(() => [
376
+ createTextVNode(toDisplayString(unref(M2)("导入ID")) + ":" + toDisplayString(sessionIds.value[l]), 1)
377
+ ]),
378
+ _: 2
379
+ }, 1024)) : createCommentVNode("", !0),
380
+ errorMessage.value[l] ? (openBlock(), createBlock(unref(ElRow), {
381
+ key: 1,
382
+ style: { "margin-bottom": "5px" }
383
+ }, {
384
+ default: withCtx(() => [
385
+ createElementVNode("span", _hoisted_5, toDisplayString(unref(M2)(errorMessage.value[l])), 1)
386
+ ]),
387
+ _: 2
388
+ }, 1024)) : createCommentVNode("", !0),
389
+ (r = importProgress.value[l]) != null && r.totalRowCount ? (openBlock(), createBlock(unref(ElRow), {
390
+ key: 2,
391
+ style: { "margin-bottom": "5px" }
392
+ }, {
393
+ default: withCtx(() => {
394
+ var a, i;
395
+ return [
396
+ createVNode(unref(ElCol), { span: 6 }, {
397
+ default: withCtx(() => {
398
+ var n, c;
399
+ return [
400
+ createTextVNode(toDisplayString(unref(M2)("工作簿")) + ":" + toDisplayString((n = importProgress.value[l]) == null ? void 0 : n.currentSheet) + "/" + toDisplayString((c = importProgress.value[l]) == null ? void 0 : c.sheetCount), 1)
401
+ ];
402
+ }),
403
+ _: 2
404
+ }, 1024),
405
+ createVNode(unref(ElCol), { span: 6 }, {
406
+ default: withCtx(() => {
407
+ var n;
408
+ return [
409
+ createTextVNode(toDisplayString(unref(M2)("总行数")) + ":" + toDisplayString((n = importProgress.value[l]) == null ? void 0 : n.totalRowCount), 1)
410
+ ];
411
+ }),
412
+ _: 2
413
+ }, 1024),
414
+ createVNode(unref(ElCol), { span: 6 }, {
415
+ default: withCtx(() => {
416
+ var n;
417
+ return [
418
+ createTextVNode(toDisplayString(unref(M2)("成功行数")) + ":" + toDisplayString((n = importProgress.value[l]) == null ? void 0 : n.successRowCount), 1)
419
+ ];
420
+ }),
421
+ _: 2
422
+ }, 1024),
423
+ (a = importProgress.value[l]) != null && a.failedRowCount ? createCommentVNode("", !0) : (openBlock(), createBlock(unref(ElCol), {
424
+ key: 0,
425
+ span: 6
426
+ }, {
427
+ default: withCtx(() => [
428
+ createTextVNode(toDisplayString(unref(M2)("失败行数")) + ":0 ", 1)
429
+ ]),
430
+ _: 1
431
+ })),
432
+ (i = importProgress.value[l]) != null && i.failedRowCount ? (openBlock(), createBlock(unref(ElCol), {
433
+ key: 1,
434
+ span: 6,
435
+ style: { display: "flex" }
436
+ }, {
437
+ default: withCtx(() => [
438
+ createTextVNode(toDisplayString(unref(M2)("失败行数")) + ": ", 1),
439
+ createVNode(unref(ElLink), {
440
+ type: "primary",
441
+ underline: !1,
442
+ title: problemFiles.value[l],
443
+ onClick: (n) => getFile(problemFiles.value[l])
444
+ }, {
445
+ default: withCtx(() => {
446
+ var n;
447
+ return [
448
+ createTextVNode(toDisplayString((n = importProgress.value[l]) == null ? void 0 : n.failedRowCount), 1)
449
+ ];
450
+ }),
451
+ _: 2
452
+ }, 1032, ["title", "onClick"])
453
+ ]),
454
+ _: 2
455
+ }, 1024)) : createCommentVNode("", !0)
456
+ ];
457
+ }),
458
+ _: 2
459
+ }, 1024)) : createCommentVNode("", !0),
460
+ t[3] || (t[3] = createElementVNode("br", null, null, -1)),
461
+ (s = importProgress.value[l]) != null && s.totalRowCount ? (openBlock(), createBlock(unref(ElProgress), {
462
+ key: 3,
463
+ percentage: getProgressPercentage(l)
464
+ }, null, 8, ["percentage"])) : createCommentVNode("", !0)
465
+ ]);
466
+ }), 128))
467
+ ])) : createCommentVNode("", !0),
468
+ createVNode(unref(ElRow), { style: { "margin-top": "10px" } }, {
469
+ default: withCtx(() => [
470
+ createVNode(unref(ElCard), { style: { width: "860px" } }, {
471
+ header: withCtx(() => [
472
+ e.displayGetTemplate ? (openBlock(), createElementBlock("div", _hoisted_6, [
473
+ createElementVNode("span", null, toDisplayString(unref(M2)("说明")), 1)
474
+ ])) : createCommentVNode("", !0)
475
+ ]),
476
+ footer: withCtx(() => [
477
+ createVNode(unref(ElRow), null, {
478
+ default: withCtx(() => [
479
+ createVNode(unref(ElCol), { span: 10 }),
480
+ createVNode(unref(ElCol), {
481
+ span: 14,
482
+ style: { display: "flex", "justify-content": "flex-end" }
483
+ }, {
484
+ default: withCtx(() => [
485
+ e.displayGetTemplate && eventData.value.TemplateType != 0 ? (openBlock(), createBlock(unref(ElButton), {
486
+ key: 0,
487
+ style: { "background-color": "rgba(89, 191, 87, 1)", color: "white", "font-weight": "bold" },
488
+ size: "large",
489
+ onClick: getTemplateFile
490
+ }, {
491
+ default: withCtx(() => [
492
+ createTextVNode(toDisplayString(unref(M2)("获取模板")), 1)
493
+ ]),
494
+ _: 1
495
+ })) : createCommentVNode("", !0),
496
+ createVNode(unref(ElButton), {
497
+ style: { "background-color": "rgba(89, 191, 87, 1)", color: "white", "font-weight": "bold" },
498
+ size: "large",
499
+ onClick: displayRecords
500
+ }, {
501
+ default: withCtx(() => [
502
+ createTextVNode(toDisplayString(unref(M2)("导入记录")), 1)
503
+ ]),
504
+ _: 1
505
+ }),
506
+ createVNode(unref(ElButton), {
507
+ style: { color: "#949592", "font-weight": "bold" },
508
+ size: "large",
509
+ onClick: handleClose
510
+ }, {
511
+ default: withCtx(() => [
512
+ createTextVNode(toDisplayString(unref(M2)("关闭")), 1)
513
+ ]),
514
+ _: 1
515
+ })
516
+ ]),
517
+ _: 1
518
+ })
519
+ ]),
520
+ _: 1
521
+ })
522
+ ]),
523
+ default: withCtx(() => [
524
+ e.displayGetTemplate ? (openBlock(), createElementBlock("div", {
525
+ key: 0,
526
+ innerHTML: eventData.value.Description
527
+ }, null, 8, _hoisted_7)) : createCommentVNode("", !0)
528
+ ]),
529
+ _: 1
530
+ })
531
+ ]),
532
+ _: 1
533
+ })
534
+ ])), [
535
+ [unref(vLoading), initWebRootUrlLoading.value]
536
+ ])
537
+ ];
538
+ }),
539
+ _: 3
540
+ }, 8, ["modelValue", "title"]),
541
+ createVNode(unref(ElDialog), {
542
+ modelValue: isShowCoreImportRecordDialog.value,
543
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => isShowCoreImportRecordDialog.value = o),
544
+ title: unref(M2)("导入记录"),
545
+ width: "1400",
546
+ "before-close": handleCloseRecord,
547
+ draggable: ""
548
+ }, {
549
+ default: withCtx(() => [
550
+ createElementVNode("div", null, [
551
+ withDirectives((openBlock(), createBlock(unref(ElTable), {
552
+ border: "",
553
+ "row-key": "id",
554
+ data: tableData.value,
555
+ "max-height": "500",
556
+ style: { width: "100%" },
557
+ "empty-text": unref(M2)("暂无数据")
558
+ }, {
559
+ default: withCtx(() => [
560
+ createVNode(unref(ElTableColumn), {
561
+ align: "center",
562
+ label: unref(M2)("记录ID"),
563
+ "min-width": "220",
564
+ prop: "TaskId"
565
+ }, null, 8, ["label"]),
566
+ createVNode(unref(ElTableColumn), {
567
+ align: "center",
568
+ label: unref(M2)("导入时间"),
569
+ "min-width": "100"
570
+ }, {
571
+ default: withCtx((o) => [
572
+ createTextVNode(toDisplayString(getFormattedDate(o.row)), 1)
573
+ ]),
574
+ _: 1
575
+ }, 8, ["label"]),
576
+ createVNode(unref(ElTableColumn), {
577
+ align: "center",
578
+ label: unref(M2)("导入人")
579
+ }, {
580
+ default: withCtx((o) => [
581
+ createTextVNode(toDisplayString(unref(translateEmployeeName)(o.row.CreatedBy)), 1)
582
+ ]),
583
+ _: 1
584
+ }, 8, ["label"]),
585
+ createVNode(unref(ElTableColumn), {
586
+ align: "center",
587
+ label: unref(M2)("上传文件"),
588
+ "min-width": "160"
589
+ }, {
590
+ default: withCtx((o) => [
591
+ createVNode(unref(ElLink), {
592
+ type: "primary",
593
+ underline: !1,
594
+ style: { font: "inherit" },
595
+ onClick: (l) => getFile(o.row.InFileId)
596
+ }, {
597
+ default: withCtx(() => [
598
+ createTextVNode(toDisplayString(o.row.InFileId), 1)
599
+ ]),
600
+ _: 2
601
+ }, 1032, ["onClick"])
602
+ ]),
603
+ _: 1
604
+ }, 8, ["label"]),
605
+ createVNode(unref(ElTableColumn), {
606
+ align: "center",
607
+ label: unref(M2)("输出文件"),
608
+ "min-width": "160"
609
+ }, {
610
+ default: withCtx((o) => [
611
+ createVNode(unref(ElLink), {
612
+ type: "primary",
613
+ underline: !1,
614
+ style: { font: "inherit" },
615
+ onClick: (l) => getFile(o.row.OutFileId)
616
+ }, {
617
+ default: withCtx(() => [
618
+ createTextVNode(toDisplayString(o.row.OutFileId), 1)
619
+ ]),
620
+ _: 2
621
+ }, 1032, ["onClick"])
622
+ ]),
623
+ _: 1
624
+ }, 8, ["label"]),
625
+ createVNode(unref(ElTableColumn), {
626
+ align: "center",
627
+ label: unref(M2)("错误信息"),
628
+ prop: "ErrorMessage",
629
+ width: "200"
630
+ }, {
631
+ default: withCtx((o) => [
632
+ o.row.ErrorMessage ? (openBlock(), createElementBlock("div", _hoisted_8, toDisplayString(o.row.ErrorMessage), 1)) : createCommentVNode("", !0)
633
+ ]),
634
+ _: 1
635
+ }, 8, ["label"]),
636
+ createVNode(unref(ElTableColumn), {
637
+ align: "center",
638
+ label: unref(M2)("备注"),
639
+ prop: "Remark"
640
+ }, null, 8, ["label"])
641
+ ]),
642
+ _: 1
643
+ }, 8, ["data", "empty-text"])), [
644
+ [unref(vLoading), tableLoading.value]
645
+ ]),
646
+ createVNode(unref(ElPagination), {
647
+ "current-page": pageNo.value,
648
+ "page-sizes": [50, 100, 150, 200],
649
+ "page-size": pageSize.value,
650
+ layout: "total, sizes, prev, pager, next, jumper",
651
+ total: totalNum.value,
652
+ class: "page-pagination",
653
+ onSizeChange: handleSizeChange,
654
+ onCurrentChange: handleCurrentChange
655
+ }, null, 8, ["current-page", "page-size", "total"])
656
+ ])
657
+ ]),
658
+ _: 1
659
+ }, 8, ["modelValue", "title"])
660
+ ], 64));
661
+ }
662
+ });
6
663
  export {
7
- a as default
664
+ _sfc_main as default
8
665
  };