@ibiz-template/runtime 0.7.41-alpha.122 → 0.7.41-alpha.123
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.esm.js +7 -5
- package/dist/index.system.min.js +1 -1
- package/out/controller/utils/data-file-util/data-file-util.d.ts +11 -3
- package/out/controller/utils/data-file-util/data-file-util.d.ts.map +1 -1
- package/out/controller/utils/data-file-util/data-file-util.js +8 -6
- package/package.json +2 -2
- package/src/controller/utils/data-file-util/data-file-util.ts +20 -9
|
@@ -10,23 +10,31 @@ export type ImportDataResult = {
|
|
|
10
10
|
* 是否取消
|
|
11
11
|
*/
|
|
12
12
|
cancel?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 总数量
|
|
15
|
+
* @type {number}
|
|
16
|
+
*/
|
|
13
17
|
total?: number;
|
|
14
18
|
/**
|
|
15
19
|
* 成功导入的数量
|
|
16
20
|
*/
|
|
17
21
|
success?: number;
|
|
18
22
|
/**
|
|
19
|
-
*
|
|
23
|
+
* 返回内容(后台返回)
|
|
20
24
|
*/
|
|
21
25
|
message?: string;
|
|
22
26
|
/**
|
|
23
|
-
*
|
|
27
|
+
* 错误信息(后台返回)
|
|
24
28
|
*/
|
|
25
|
-
|
|
29
|
+
errormessage?: string;
|
|
26
30
|
/**
|
|
27
31
|
* 错误文件数据
|
|
28
32
|
*/
|
|
29
33
|
errorfile?: IData;
|
|
34
|
+
/**
|
|
35
|
+
* 是否显示导入结果头,后台返回message和errormessage时,前端不显示导入结果头(成功xxx,失败xxx),默认显示
|
|
36
|
+
*/
|
|
37
|
+
showTitle?: boolean;
|
|
30
38
|
};
|
|
31
39
|
export type IExportDataResult = {
|
|
32
40
|
ok: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-file-util.d.ts","sourceRoot":"","sources":["../../../../src/controller/utils/data-file-util/data-file-util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAIb,cAAc,EAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIpE,OAAO,EAAe,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AASrE,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"data-file-util.d.ts","sourceRoot":"","sources":["../../../../src/controller/utils/data-file-util/data-file-util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAIb,cAAc,EAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIpE,OAAO,EAAe,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AASrE,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAGjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG;IAE9B,EAAE,EAAE,OAAO,CAAC;IAEZ,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA6BF;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,cAAc,EAC7B,UAAU,CAAC,EAAE,gBAAgB,EAC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Ac,CAAC;IAC9B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,CAalC"}
|
|
@@ -103,6 +103,7 @@ export async function importData(file, appDataEntity, dataImport, context, param
|
|
|
103
103
|
}
|
|
104
104
|
const result = {
|
|
105
105
|
isAsync: false,
|
|
106
|
+
showTitle: true,
|
|
106
107
|
};
|
|
107
108
|
try {
|
|
108
109
|
const app = ibiz.hub.getApp(context === null || context === void 0 ? void 0 : context.srfappid);
|
|
@@ -116,18 +117,18 @@ export async function importData(file, appDataEntity, dataImport, context, param
|
|
|
116
117
|
ibiz.mc.command.send({ srfdecodename: appDataEntity.codeName }, 'OBJECTCREATED', 'DATAIMPORT');
|
|
117
118
|
if (res.ok && res.data) {
|
|
118
119
|
Object.assign(result, res.data);
|
|
119
|
-
// 如果有返回errormessage
|
|
120
|
-
if (res.data
|
|
121
|
-
result.
|
|
120
|
+
// 如果有返回message或者errormessage则不显示导入结果头
|
|
121
|
+
if (res.data.errormessage || res.data.message) {
|
|
122
|
+
result.showTitle = false;
|
|
122
123
|
}
|
|
123
|
-
// 如果没有返回message但是有errorinfo则拼接errorinfo作为
|
|
124
|
+
// 如果没有返回message和errormessage但是有errorinfo则拼接errorinfo作为errormessage
|
|
124
125
|
if (res.data &&
|
|
125
126
|
res.data.errorinfo &&
|
|
126
127
|
!res.data.message &&
|
|
127
128
|
!res.data.errormessage) {
|
|
128
129
|
const errorInfos = Object.values(res.data.errorinfo);
|
|
129
130
|
if (errorInfos.length > 0) {
|
|
130
|
-
result.
|
|
131
|
+
result.errormessage = errorInfos
|
|
131
132
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
132
133
|
.map((item) => item.errorInfo)
|
|
133
134
|
.join('\r\n');
|
|
@@ -137,7 +138,8 @@ export async function importData(file, appDataEntity, dataImport, context, param
|
|
|
137
138
|
}
|
|
138
139
|
catch (error) {
|
|
139
140
|
if (error instanceof Error) {
|
|
140
|
-
result.
|
|
141
|
+
result.errormessage = error.message;
|
|
142
|
+
result.showTitle = false;
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.123",
|
|
4
4
|
"description": "运行时逻辑库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"qx-util": "^0.4.8",
|
|
71
71
|
"ramda": "^0.29.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "f1cf42a4ab139d6ca4eab2f2a51f566744b446b2"
|
|
74
74
|
}
|
|
@@ -28,24 +28,33 @@ export type ImportDataResult = {
|
|
|
28
28
|
* 是否取消
|
|
29
29
|
*/
|
|
30
30
|
cancel?: boolean;
|
|
31
|
+
|
|
31
32
|
// 下面的是同步导入才有的属性
|
|
33
|
+
/**
|
|
34
|
+
* 总数量
|
|
35
|
+
* @type {number}
|
|
36
|
+
*/
|
|
32
37
|
total?: number;
|
|
33
38
|
/**
|
|
34
39
|
* 成功导入的数量
|
|
35
40
|
*/
|
|
36
41
|
success?: number;
|
|
37
42
|
/**
|
|
38
|
-
*
|
|
43
|
+
* 返回内容(后台返回)
|
|
39
44
|
*/
|
|
40
45
|
message?: string;
|
|
41
46
|
/**
|
|
42
|
-
*
|
|
47
|
+
* 错误信息(后台返回)
|
|
43
48
|
*/
|
|
44
|
-
|
|
49
|
+
errormessage?: string;
|
|
45
50
|
/**
|
|
46
51
|
* 错误文件数据
|
|
47
52
|
*/
|
|
48
53
|
errorfile?: IData;
|
|
54
|
+
/**
|
|
55
|
+
* 是否显示导入结果头,后台返回message和errormessage时,前端不显示导入结果头(成功xxx,失败xxx),默认显示
|
|
56
|
+
*/
|
|
57
|
+
showTitle?: boolean;
|
|
49
58
|
};
|
|
50
59
|
|
|
51
60
|
// 导出结果类型
|
|
@@ -176,6 +185,7 @@ export async function importData(
|
|
|
176
185
|
|
|
177
186
|
const result: ImportDataResult = {
|
|
178
187
|
isAsync: false,
|
|
188
|
+
showTitle: true,
|
|
179
189
|
};
|
|
180
190
|
try {
|
|
181
191
|
const app = ibiz.hub.getApp(context?.srfappid);
|
|
@@ -194,11 +204,11 @@ export async function importData(
|
|
|
194
204
|
);
|
|
195
205
|
if (res.ok && res.data) {
|
|
196
206
|
Object.assign(result, res.data);
|
|
197
|
-
// 如果有返回errormessage
|
|
198
|
-
if (res.data
|
|
199
|
-
result.
|
|
207
|
+
// 如果有返回message或者errormessage则不显示导入结果头
|
|
208
|
+
if (res.data.errormessage || res.data.message) {
|
|
209
|
+
result.showTitle = false;
|
|
200
210
|
}
|
|
201
|
-
// 如果没有返回message但是有errorinfo则拼接errorinfo作为
|
|
211
|
+
// 如果没有返回message和errormessage但是有errorinfo则拼接errorinfo作为errormessage
|
|
202
212
|
if (
|
|
203
213
|
res.data &&
|
|
204
214
|
res.data.errorinfo &&
|
|
@@ -207,7 +217,7 @@ export async function importData(
|
|
|
207
217
|
) {
|
|
208
218
|
const errorInfos = Object.values(res.data.errorinfo);
|
|
209
219
|
if (errorInfos.length > 0) {
|
|
210
|
-
result.
|
|
220
|
+
result.errormessage = errorInfos
|
|
211
221
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
212
222
|
.map((item: any) => item.errorInfo)
|
|
213
223
|
.join('\r\n');
|
|
@@ -216,7 +226,8 @@ export async function importData(
|
|
|
216
226
|
}
|
|
217
227
|
} catch (error) {
|
|
218
228
|
if (error instanceof Error) {
|
|
219
|
-
result.
|
|
229
|
+
result.errormessage = error.message;
|
|
230
|
+
result.showTitle = false;
|
|
220
231
|
}
|
|
221
232
|
}
|
|
222
233
|
|