@ibiz-template/vue3-components 0.7.41-alpha.115 → 0.7.41-alpha.116
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/dist/{index-B3O6yu1f.js → index-B_sVovOS.js} +1 -1
- package/dist/{index-qO4rCmKY.js → index-Qf-i9QxK.js} +1 -1
- package/dist/{index-B4MZRULw.js → index-Y8vfJMwO.js} +4 -4
- package/dist/{index.es-D9o2oz4Y.js → index.es-BTS66Tgw.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-4yBz8Mkf.js → wang-editor-DIWzhDy7.js} +1 -1
- package/dist/{xlsx-util-3sCwAhs0.js → xlsx-util-BA1RWGAh.js} +1 -1
- package/es/common/data-import/data-import.css +1 -1
- package/es/common/data-import/data-import.mjs +35 -8
- package/es/locale/en/index.mjs +3 -1
- package/es/locale/zh-CN/index.mjs +3 -1
- package/lib/common/data-import/data-import.cjs +35 -8
- package/lib/common/data-import/data-import.css +1 -1
- package/lib/locale/en/index.cjs +3 -1
- package/lib/locale/zh-CN/index.cjs +3 -1
- package/package.json +5 -5
- package/src/common/data-import/data-import.scss +5 -6
- package/src/common/data-import/data-import.tsx +48 -14
- package/src/locale/en/index.ts +2 -0
- package/src/locale/zh-CN/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:var(--ibiz-spacing-base-loose);background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:var(--ibiz-spaceing-base);font-size:var(--ibiz-font-size-large);font-weight:var(--ibiz-font-weight-bold);color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) var(--ibiz-spacing-none);margin-bottom:var(--ibiz-spacing-base)}.ibiz-data-
|
|
1
|
+
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:var(--ibiz-spacing-base-loose);background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:var(--ibiz-spaceing-base);font-size:var(--ibiz-font-size-large);font-weight:var(--ibiz-font-weight-bold);color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) var(--ibiz-spacing-none);margin-bottom:var(--ibiz-spacing-base)}.ibiz-data-import__file-link{display:flex;align-items:center;color:var(--ibiz-color-secondary);cursor:pointer}.ibiz-data-import__link-icon{margin-right:var(--ibiz-spacing-super-tight);font-size:var(--ibiz-width-icon-large)}.ibiz-data-import__button-bar{margin-right:var(--ibiz-spacing-base-loose);text-align:right}.ibiz-data-import__button-bar .ivu-btn{margin-left:var(--ibiz-spacing-tight)}.ibiz-data-import-upload{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;flex-grow:1;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:var(--ibiz-border-radius-small)}.ibiz-data-import-upload__img{width:50px;height:50px;margin-bottom:var(--ibiz-spacing-base-loose)}.ibiz-data-import-message{display:flex;flex-flow:column nowrap;flex-grow:1;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base);overflow:auto;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:var(--ibiz-border-radius-small)}.ibiz-data-import-message__title{display:flex;gap:var(--ibiz-spacing-tight);font-size:var(--ibiz-font-size-medium);font-weight:var(--ibiz-font-weight-bold)}.ibiz-data-import-message__content{padding-left:var(--ibiz-spacing-base);white-space:pre-line}.ibiz-data-import-error-message{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) 0;color:var(--ibiz-color-danger)}
|
|
@@ -36,7 +36,8 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
const ns = useNamespace("data-import");
|
|
37
37
|
const message = ref({
|
|
38
38
|
state: "ready",
|
|
39
|
-
message: ""
|
|
39
|
+
message: "",
|
|
40
|
+
errorfile: void 0
|
|
40
41
|
});
|
|
41
42
|
const errorMessage = ref("");
|
|
42
43
|
const isLoading = ref(false);
|
|
@@ -47,11 +48,23 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
47
48
|
const onLinkClick = async () => {
|
|
48
49
|
downloadImportTemplate(props.appDataEntity, props.dataImport, props.context, props.params, ibiz.config.common.importTemplNameMode === "custom" ? importTemplName : void 0);
|
|
49
50
|
};
|
|
51
|
+
const onErrorInfoClick = async () => {
|
|
52
|
+
if (!message.value.errorfile)
|
|
53
|
+
return;
|
|
54
|
+
let {
|
|
55
|
+
downloadUrl
|
|
56
|
+
} = ibiz.util.file.calcFileUpDownUrl(props.context, props.params, {}, {
|
|
57
|
+
osscat: message.value.errorfile.folder
|
|
58
|
+
});
|
|
59
|
+
downloadUrl = downloadUrl.replace("%fileId%", message.value.errorfile.fileid);
|
|
60
|
+
ibiz.util.file.fileDownload(downloadUrl, "".concat(ibiz.i18n.t("component.dataImport.importError"), ".xlsx"));
|
|
61
|
+
};
|
|
50
62
|
const selectFile = async () => {
|
|
51
63
|
isLoading.value = true;
|
|
52
64
|
errorMessage.value = "";
|
|
53
65
|
message.value.message = "";
|
|
54
66
|
message.value.state = "ready";
|
|
67
|
+
message.value.errorfile = void 0;
|
|
55
68
|
const result = await selectAndImport({
|
|
56
69
|
appDataEntity: props.appDataEntity,
|
|
57
70
|
dataImport: props.dataImport,
|
|
@@ -69,17 +82,24 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
69
82
|
const {
|
|
70
83
|
success,
|
|
71
84
|
total,
|
|
72
|
-
message: _message
|
|
85
|
+
message: _message,
|
|
86
|
+
errorfile
|
|
73
87
|
} = result;
|
|
74
88
|
const totalNum = total ? Number(total) : 0;
|
|
75
89
|
const successNum = success ? Number(success) : 0;
|
|
76
|
-
const errorNum =
|
|
90
|
+
const errorNum = totalNum - successNum;
|
|
77
91
|
message.value.state = _message ? "error" : "over";
|
|
78
|
-
message.value.message =
|
|
92
|
+
message.value.message = ibiz.i18n.t("component.dataImport.importSuccess", {
|
|
79
93
|
totalNum,
|
|
80
94
|
successNum,
|
|
81
95
|
errorNum
|
|
82
96
|
});
|
|
97
|
+
if (_message) {
|
|
98
|
+
message.value.message += "\r\n".concat(_message);
|
|
99
|
+
}
|
|
100
|
+
if (errorfile) {
|
|
101
|
+
message.value.errorfile = errorfile;
|
|
102
|
+
}
|
|
83
103
|
}
|
|
84
104
|
}
|
|
85
105
|
isLoading.value = false;
|
|
@@ -95,7 +115,8 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
95
115
|
importTemplName,
|
|
96
116
|
selectFile,
|
|
97
117
|
onLinkClick,
|
|
98
|
-
onCancelButtonClick
|
|
118
|
+
onCancelButtonClick,
|
|
119
|
+
onErrorInfoClick
|
|
99
120
|
};
|
|
100
121
|
},
|
|
101
122
|
render() {
|
|
@@ -116,8 +137,14 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
116
137
|
"class": [this.ns.b("message")]
|
|
117
138
|
}, [createVNode("div", {
|
|
118
139
|
"class": this.ns.be("message", "title")
|
|
119
|
-
}, [ibiz.i18n.t("component.dataImport.importResults")]), createVNode("div", {
|
|
120
|
-
"class":
|
|
140
|
+
}, [createVNode("div", null, [ibiz.i18n.t("component.dataImport.importResults")]), this.message.errorfile && createVNode("div", {
|
|
141
|
+
"class": this.ns.e("file-link"),
|
|
142
|
+
"onClick": this.onErrorInfoClick
|
|
143
|
+
}, [createVNode("ion-icon", {
|
|
144
|
+
"class": this.ns.e("link-icon"),
|
|
145
|
+
"name": "link"
|
|
146
|
+
}, null), ibiz.i18n.t("component.dataImport.detailedLogs")])]), createVNode("div", {
|
|
147
|
+
"class": [this.ns.be("message", "content")]
|
|
121
148
|
}, [this.message.message])]), this.errorMessage && createVNode("div", {
|
|
122
149
|
"class": this.ns.b("error-message")
|
|
123
150
|
}, [this.errorMessage]), createVNode("div", {
|
|
@@ -125,7 +152,7 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
125
152
|
}, [createVNode("div", {
|
|
126
153
|
"class": this.ns.e("template-description")
|
|
127
154
|
}, [ibiz.i18n.t("component.dataImport.downloadTemplate")]), createVNode("div", {
|
|
128
|
-
"class": this.ns.e("
|
|
155
|
+
"class": this.ns.e("file-link"),
|
|
129
156
|
"onClick": this.onLinkClick
|
|
130
157
|
}, [createVNode("ion-icon", {
|
|
131
158
|
"class": this.ns.e("link-icon"),
|
package/es/locale/en/index.mjs
CHANGED
|
@@ -545,7 +545,9 @@ var index = {
|
|
|
545
545
|
downloadTemplate: "Download the import template and fill in as required:",
|
|
546
546
|
templateFile: "Data import template file",
|
|
547
547
|
template: "Template",
|
|
548
|
-
continue: "Continue importing"
|
|
548
|
+
continue: "Continue importing",
|
|
549
|
+
detailedLogs: "Detailed logs",
|
|
550
|
+
importError: "Import Error"
|
|
549
551
|
},
|
|
550
552
|
dataImport2: {
|
|
551
553
|
atLastOne: "Select at least one mapping attribute",
|
|
@@ -541,7 +541,9 @@ var index = {
|
|
|
541
541
|
downloadTemplate: "\u4E0B\u8F7D\u5BFC\u5165\u6A21\u7248\uFF0C\u5E76\u6309\u8981\u6C42\u586B\u5199\uFF1A",
|
|
542
542
|
templateFile: "\u6570\u636E\u5BFC\u5165\u6A21\u677F\u6587\u4EF6",
|
|
543
543
|
template: "\u6A21\u677F",
|
|
544
|
-
continue: "\u7EE7\u7EED\u5BFC\u5165"
|
|
544
|
+
continue: "\u7EE7\u7EED\u5BFC\u5165",
|
|
545
|
+
detailedLogs: "\u8BE6\u7EC6\u65E5\u5FD7",
|
|
546
|
+
importError: "\u5BFC\u5165\u9519\u8BEF"
|
|
545
547
|
},
|
|
546
548
|
dataImport2: {
|
|
547
549
|
atLastOne: "\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6620\u5C04\u5C5E\u6027",
|
|
@@ -38,7 +38,8 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
38
38
|
const ns = vue3Util.useNamespace("data-import");
|
|
39
39
|
const message = vue.ref({
|
|
40
40
|
state: "ready",
|
|
41
|
-
message: ""
|
|
41
|
+
message: "",
|
|
42
|
+
errorfile: void 0
|
|
42
43
|
});
|
|
43
44
|
const errorMessage = vue.ref("");
|
|
44
45
|
const isLoading = vue.ref(false);
|
|
@@ -49,11 +50,23 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
49
50
|
const onLinkClick = async () => {
|
|
50
51
|
runtime.downloadImportTemplate(props.appDataEntity, props.dataImport, props.context, props.params, ibiz.config.common.importTemplNameMode === "custom" ? importTemplName : void 0);
|
|
51
52
|
};
|
|
53
|
+
const onErrorInfoClick = async () => {
|
|
54
|
+
if (!message.value.errorfile)
|
|
55
|
+
return;
|
|
56
|
+
let {
|
|
57
|
+
downloadUrl
|
|
58
|
+
} = ibiz.util.file.calcFileUpDownUrl(props.context, props.params, {}, {
|
|
59
|
+
osscat: message.value.errorfile.folder
|
|
60
|
+
});
|
|
61
|
+
downloadUrl = downloadUrl.replace("%fileId%", message.value.errorfile.fileid);
|
|
62
|
+
ibiz.util.file.fileDownload(downloadUrl, "".concat(ibiz.i18n.t("component.dataImport.importError"), ".xlsx"));
|
|
63
|
+
};
|
|
52
64
|
const selectFile = async () => {
|
|
53
65
|
isLoading.value = true;
|
|
54
66
|
errorMessage.value = "";
|
|
55
67
|
message.value.message = "";
|
|
56
68
|
message.value.state = "ready";
|
|
69
|
+
message.value.errorfile = void 0;
|
|
57
70
|
const result = await runtime.selectAndImport({
|
|
58
71
|
appDataEntity: props.appDataEntity,
|
|
59
72
|
dataImport: props.dataImport,
|
|
@@ -71,17 +84,24 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
71
84
|
const {
|
|
72
85
|
success,
|
|
73
86
|
total,
|
|
74
|
-
message: _message
|
|
87
|
+
message: _message,
|
|
88
|
+
errorfile
|
|
75
89
|
} = result;
|
|
76
90
|
const totalNum = total ? Number(total) : 0;
|
|
77
91
|
const successNum = success ? Number(success) : 0;
|
|
78
|
-
const errorNum =
|
|
92
|
+
const errorNum = totalNum - successNum;
|
|
79
93
|
message.value.state = _message ? "error" : "over";
|
|
80
|
-
message.value.message =
|
|
94
|
+
message.value.message = ibiz.i18n.t("component.dataImport.importSuccess", {
|
|
81
95
|
totalNum,
|
|
82
96
|
successNum,
|
|
83
97
|
errorNum
|
|
84
98
|
});
|
|
99
|
+
if (_message) {
|
|
100
|
+
message.value.message += "\r\n".concat(_message);
|
|
101
|
+
}
|
|
102
|
+
if (errorfile) {
|
|
103
|
+
message.value.errorfile = errorfile;
|
|
104
|
+
}
|
|
85
105
|
}
|
|
86
106
|
}
|
|
87
107
|
isLoading.value = false;
|
|
@@ -97,7 +117,8 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
97
117
|
importTemplName,
|
|
98
118
|
selectFile,
|
|
99
119
|
onLinkClick,
|
|
100
|
-
onCancelButtonClick
|
|
120
|
+
onCancelButtonClick,
|
|
121
|
+
onErrorInfoClick
|
|
101
122
|
};
|
|
102
123
|
},
|
|
103
124
|
render() {
|
|
@@ -118,8 +139,14 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
118
139
|
"class": [this.ns.b("message")]
|
|
119
140
|
}, [vue.createVNode("div", {
|
|
120
141
|
"class": this.ns.be("message", "title")
|
|
121
|
-
}, [ibiz.i18n.t("component.dataImport.importResults")]), vue.createVNode("div", {
|
|
122
|
-
"class":
|
|
142
|
+
}, [vue.createVNode("div", null, [ibiz.i18n.t("component.dataImport.importResults")]), this.message.errorfile && vue.createVNode("div", {
|
|
143
|
+
"class": this.ns.e("file-link"),
|
|
144
|
+
"onClick": this.onErrorInfoClick
|
|
145
|
+
}, [vue.createVNode("ion-icon", {
|
|
146
|
+
"class": this.ns.e("link-icon"),
|
|
147
|
+
"name": "link"
|
|
148
|
+
}, null), ibiz.i18n.t("component.dataImport.detailedLogs")])]), vue.createVNode("div", {
|
|
149
|
+
"class": [this.ns.be("message", "content")]
|
|
123
150
|
}, [this.message.message])]), this.errorMessage && vue.createVNode("div", {
|
|
124
151
|
"class": this.ns.b("error-message")
|
|
125
152
|
}, [this.errorMessage]), vue.createVNode("div", {
|
|
@@ -127,7 +154,7 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
127
154
|
}, [vue.createVNode("div", {
|
|
128
155
|
"class": this.ns.e("template-description")
|
|
129
156
|
}, [ibiz.i18n.t("component.dataImport.downloadTemplate")]), vue.createVNode("div", {
|
|
130
|
-
"class": this.ns.e("
|
|
157
|
+
"class": this.ns.e("file-link"),
|
|
131
158
|
"onClick": this.onLinkClick
|
|
132
159
|
}, [vue.createVNode("ion-icon", {
|
|
133
160
|
"class": this.ns.e("link-icon"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:var(--ibiz-spacing-base-loose);background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:var(--ibiz-spaceing-base);font-size:var(--ibiz-font-size-large);font-weight:var(--ibiz-font-weight-bold);color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) var(--ibiz-spacing-none);margin-bottom:var(--ibiz-spacing-base)}.ibiz-data-
|
|
1
|
+
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:var(--ibiz-spacing-base-loose);background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:var(--ibiz-spaceing-base);font-size:var(--ibiz-font-size-large);font-weight:var(--ibiz-font-weight-bold);color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) var(--ibiz-spacing-none);margin-bottom:var(--ibiz-spacing-base)}.ibiz-data-import__file-link{display:flex;align-items:center;color:var(--ibiz-color-secondary);cursor:pointer}.ibiz-data-import__link-icon{margin-right:var(--ibiz-spacing-super-tight);font-size:var(--ibiz-width-icon-large)}.ibiz-data-import__button-bar{margin-right:var(--ibiz-spacing-base-loose);text-align:right}.ibiz-data-import__button-bar .ivu-btn{margin-left:var(--ibiz-spacing-tight)}.ibiz-data-import-upload{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;flex-grow:1;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:var(--ibiz-border-radius-small)}.ibiz-data-import-upload__img{width:50px;height:50px;margin-bottom:var(--ibiz-spacing-base-loose)}.ibiz-data-import-message{display:flex;flex-flow:column nowrap;flex-grow:1;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base);overflow:auto;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:var(--ibiz-border-radius-small)}.ibiz-data-import-message__title{display:flex;gap:var(--ibiz-spacing-tight);font-size:var(--ibiz-font-size-medium);font-weight:var(--ibiz-font-weight-bold)}.ibiz-data-import-message__content{padding-left:var(--ibiz-spacing-base);white-space:pre-line}.ibiz-data-import-error-message{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) 0;color:var(--ibiz-color-danger)}
|
package/lib/locale/en/index.cjs
CHANGED
|
@@ -549,7 +549,9 @@ var index = {
|
|
|
549
549
|
downloadTemplate: "Download the import template and fill in as required:",
|
|
550
550
|
templateFile: "Data import template file",
|
|
551
551
|
template: "Template",
|
|
552
|
-
continue: "Continue importing"
|
|
552
|
+
continue: "Continue importing",
|
|
553
|
+
detailedLogs: "Detailed logs",
|
|
554
|
+
importError: "Import Error"
|
|
553
555
|
},
|
|
554
556
|
dataImport2: {
|
|
555
557
|
atLastOne: "Select at least one mapping attribute",
|
|
@@ -545,7 +545,9 @@ var index = {
|
|
|
545
545
|
downloadTemplate: "\u4E0B\u8F7D\u5BFC\u5165\u6A21\u7248\uFF0C\u5E76\u6309\u8981\u6C42\u586B\u5199\uFF1A",
|
|
546
546
|
templateFile: "\u6570\u636E\u5BFC\u5165\u6A21\u677F\u6587\u4EF6",
|
|
547
547
|
template: "\u6A21\u677F",
|
|
548
|
-
continue: "\u7EE7\u7EED\u5BFC\u5165"
|
|
548
|
+
continue: "\u7EE7\u7EED\u5BFC\u5165",
|
|
549
|
+
detailedLogs: "\u8BE6\u7EC6\u65E5\u5FD7",
|
|
550
|
+
importError: "\u5BFC\u5165\u9519\u8BEF"
|
|
549
551
|
},
|
|
550
552
|
dataImport2: {
|
|
551
553
|
atLastOne: "\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6620\u5C04\u5C5E\u6027",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-components",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.116",
|
|
4
4
|
"description": "web端组件库(vue3)",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
33
33
|
"@floating-ui/dom": "^1.5.3",
|
|
34
|
-
"@ibiz-template-plugin/ai-chat": "^0.0.
|
|
34
|
+
"@ibiz-template-plugin/ai-chat": "^0.0.90",
|
|
35
35
|
"@ibiz-template-plugin/gantt": "0.1.8-alpha.468",
|
|
36
36
|
"@ibiz-template-plugin/bi-report": "0.0.32",
|
|
37
37
|
"@ibiz-template-plugin/data-view": "0.0.7",
|
|
38
38
|
"@ibiz-template/core": "0.7.41-alpha.119",
|
|
39
39
|
"@ibiz-template/devtool": "0.0.16",
|
|
40
|
-
"@ibiz-template/model-helper": "0.7.41-alpha.
|
|
41
|
-
"@ibiz-template/runtime": "0.7.41-alpha.
|
|
40
|
+
"@ibiz-template/model-helper": "0.7.41-alpha.122",
|
|
41
|
+
"@ibiz-template/runtime": "0.7.41-alpha.122",
|
|
42
42
|
"@ibiz-template/theme": "0.7.39",
|
|
43
|
-
"@ibiz-template/vue3-util": "0.7.41-alpha.
|
|
43
|
+
"@ibiz-template/vue3-util": "0.7.41-alpha.122",
|
|
44
44
|
"@ibiz-template/web-theme": "3.16.0",
|
|
45
45
|
"@ibiz/model-core": "^0.1.89",
|
|
46
46
|
"@imengyu/vue3-context-menu": "^1.3.5",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
margin-bottom: getCssVar('spacing','base');
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
@include e(
|
|
21
|
+
@include e(file-link) {
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
color: getCssVar('color','secondary');
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
font-size: getCssVar('width-icon','large');
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
@include e(button-bar) {
|
|
34
34
|
margin-right: getCssVar('spacing','base-loose');
|
|
35
35
|
text-align: right;
|
|
@@ -69,16 +69,15 @@
|
|
|
69
69
|
border-radius: getCssVar(border, radius,small);
|
|
70
70
|
|
|
71
71
|
@include e(title) {
|
|
72
|
+
display: flex;
|
|
73
|
+
gap: getCssVar('spacing','tight');
|
|
72
74
|
font-size: getCssVar('font-size', 'medium');
|
|
73
75
|
font-weight: getCssVar('font-weight', 'bold');
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
@include e(content) {
|
|
77
79
|
padding-left: getCssVar('spacing','base');
|
|
78
|
-
|
|
79
|
-
@include when(error) {
|
|
80
|
-
color: getCssVar(color, danger);
|
|
81
|
-
}
|
|
80
|
+
white-space: pre-line;
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
|
|
@@ -36,9 +36,11 @@ export const DataImport = defineComponent({
|
|
|
36
36
|
const message = ref<{
|
|
37
37
|
state: 'ready' | 'over' | 'error';
|
|
38
38
|
message: string;
|
|
39
|
+
errorfile: IData | undefined;
|
|
39
40
|
}>({
|
|
40
41
|
state: 'ready',
|
|
41
42
|
message: '',
|
|
43
|
+
errorfile: undefined,
|
|
42
44
|
});
|
|
43
45
|
|
|
44
46
|
const errorMessage = ref('');
|
|
@@ -67,12 +69,32 @@ export const DataImport = defineComponent({
|
|
|
67
69
|
);
|
|
68
70
|
};
|
|
69
71
|
|
|
72
|
+
// 下载错误文件
|
|
73
|
+
const onErrorInfoClick = async () => {
|
|
74
|
+
if (!message.value.errorfile) return;
|
|
75
|
+
let { downloadUrl } = ibiz.util.file.calcFileUpDownUrl(
|
|
76
|
+
props.context!,
|
|
77
|
+
props.params!,
|
|
78
|
+
{},
|
|
79
|
+
{ osscat: message.value.errorfile.folder },
|
|
80
|
+
);
|
|
81
|
+
downloadUrl = downloadUrl.replace(
|
|
82
|
+
'%fileId%',
|
|
83
|
+
message.value.errorfile.fileid,
|
|
84
|
+
);
|
|
85
|
+
ibiz.util.file.fileDownload(
|
|
86
|
+
downloadUrl,
|
|
87
|
+
`${ibiz.i18n.t('component.dataImport.importError')}.xlsx`,
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
70
91
|
const selectFile = async () => {
|
|
71
92
|
isLoading.value = true;
|
|
72
93
|
// 重置提示信息
|
|
73
94
|
errorMessage.value = '';
|
|
74
95
|
message.value.message = '';
|
|
75
96
|
message.value.state = 'ready';
|
|
97
|
+
message.value.errorfile = undefined;
|
|
76
98
|
const result = await selectAndImport({
|
|
77
99
|
appDataEntity: props.appDataEntity,
|
|
78
100
|
dataImport: props.dataImport,
|
|
@@ -90,18 +112,25 @@ export const DataImport = defineComponent({
|
|
|
90
112
|
if (result.errorMessage) {
|
|
91
113
|
errorMessage.value = result.errorMessage;
|
|
92
114
|
} else {
|
|
93
|
-
const { success, total, message: _message } = result;
|
|
115
|
+
const { success, total, message: _message, errorfile } = result;
|
|
94
116
|
const totalNum = total ? Number(total) : 0;
|
|
95
117
|
const successNum = success ? Number(success) : 0;
|
|
96
|
-
const errorNum =
|
|
118
|
+
const errorNum = totalNum - successNum;
|
|
97
119
|
message.value.state = _message ? 'error' : 'over';
|
|
98
|
-
message.value.message =
|
|
99
|
-
|
|
100
|
-
|
|
120
|
+
message.value.message = ibiz.i18n.t(
|
|
121
|
+
'component.dataImport.importSuccess',
|
|
122
|
+
{
|
|
101
123
|
totalNum,
|
|
102
124
|
successNum,
|
|
103
125
|
errorNum,
|
|
104
|
-
}
|
|
126
|
+
},
|
|
127
|
+
);
|
|
128
|
+
if (_message) {
|
|
129
|
+
message.value.message += `\r\n${_message}`;
|
|
130
|
+
}
|
|
131
|
+
if (errorfile) {
|
|
132
|
+
message.value.errorfile = errorfile;
|
|
133
|
+
}
|
|
105
134
|
}
|
|
106
135
|
}
|
|
107
136
|
isLoading.value = false;
|
|
@@ -119,6 +148,7 @@ export const DataImport = defineComponent({
|
|
|
119
148
|
selectFile,
|
|
120
149
|
onLinkClick,
|
|
121
150
|
onCancelButtonClick,
|
|
151
|
+
onErrorInfoClick,
|
|
122
152
|
};
|
|
123
153
|
},
|
|
124
154
|
render() {
|
|
@@ -140,14 +170,18 @@ export const DataImport = defineComponent({
|
|
|
140
170
|
) : (
|
|
141
171
|
<div class={[this.ns.b('message')]}>
|
|
142
172
|
<div class={this.ns.be('message', 'title')}>
|
|
143
|
-
{ibiz.i18n.t('component.dataImport.importResults')}
|
|
173
|
+
<div>{ibiz.i18n.t('component.dataImport.importResults')}</div>
|
|
174
|
+
{this.message.errorfile && (
|
|
175
|
+
<div
|
|
176
|
+
class={this.ns.e('file-link')}
|
|
177
|
+
onClick={this.onErrorInfoClick}
|
|
178
|
+
>
|
|
179
|
+
<ion-icon class={this.ns.e('link-icon')} name='link' />
|
|
180
|
+
{ibiz.i18n.t('component.dataImport.detailedLogs')}
|
|
181
|
+
</div>
|
|
182
|
+
)}
|
|
144
183
|
</div>
|
|
145
|
-
<div
|
|
146
|
-
class={[
|
|
147
|
-
this.ns.be('message', 'content'),
|
|
148
|
-
this.ns.is('error', this.message.state === 'error'),
|
|
149
|
-
]}
|
|
150
|
-
>
|
|
184
|
+
<div class={[this.ns.be('message', 'content')]}>
|
|
151
185
|
{this.message.message}
|
|
152
186
|
</div>
|
|
153
187
|
</div>
|
|
@@ -159,7 +193,7 @@ export const DataImport = defineComponent({
|
|
|
159
193
|
<div class={this.ns.e('template-description')}>
|
|
160
194
|
{ibiz.i18n.t('component.dataImport.downloadTemplate')}
|
|
161
195
|
</div>
|
|
162
|
-
<div class={this.ns.e('
|
|
196
|
+
<div class={this.ns.e('file-link')} onClick={this.onLinkClick}>
|
|
163
197
|
<ion-icon class={this.ns.e('link-icon')} name='link' />
|
|
164
198
|
{this.importTemplName}
|
|
165
199
|
</div>
|
package/src/locale/en/index.ts
CHANGED
|
@@ -589,6 +589,8 @@ export default {
|
|
|
589
589
|
templateFile: 'Data import template file',
|
|
590
590
|
template: 'Template',
|
|
591
591
|
continue: 'Continue importing',
|
|
592
|
+
detailedLogs: 'Detailed logs',
|
|
593
|
+
importError: 'Import Error',
|
|
592
594
|
},
|
|
593
595
|
dataImport2: {
|
|
594
596
|
atLastOne: 'Select at least one mapping attribute',
|