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