@ibiz-template/runtime 0.7.41-alpha.121 → 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 +16 -3
- package/dist/index.system.min.js +1 -1
- package/out/controller/utils/data-file-util/data-file-util.d.ts +22 -1
- 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 +23 -2
- package/package.json +2 -2
- package/src/controller/utils/data-file-util/data-file-util.ts +48 -4
|
@@ -10,10 +10,31 @@ export type ImportDataResult = {
|
|
|
10
10
|
* 是否取消
|
|
11
11
|
*/
|
|
12
12
|
cancel?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 总数量
|
|
15
|
+
* @type {number}
|
|
16
|
+
*/
|
|
13
17
|
total?: number;
|
|
18
|
+
/**
|
|
19
|
+
* 成功导入的数量
|
|
20
|
+
*/
|
|
14
21
|
success?: number;
|
|
22
|
+
/**
|
|
23
|
+
* 返回内容(后台返回)
|
|
24
|
+
*/
|
|
15
25
|
message?: string;
|
|
16
|
-
|
|
26
|
+
/**
|
|
27
|
+
* 错误信息(后台返回)
|
|
28
|
+
*/
|
|
29
|
+
errormessage?: string;
|
|
30
|
+
/**
|
|
31
|
+
* 错误文件数据
|
|
32
|
+
*/
|
|
33
|
+
errorfile?: IData;
|
|
34
|
+
/**
|
|
35
|
+
* 是否显示导入结果头,后台返回message和errormessage时,前端不显示导入结果头(成功xxx,失败xxx),默认显示
|
|
36
|
+
*/
|
|
37
|
+
showTitle?: boolean;
|
|
17
38
|
};
|
|
18
39
|
export type IExportDataResult = {
|
|
19
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,EAC7B,OAAO,CAAC,EAAE,QAAQ,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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);
|
|
@@ -114,11 +115,31 @@ export async function importData(file, appDataEntity, dataImport, context, param
|
|
|
114
115
|
});
|
|
115
116
|
// 模拟表单通知 刷新表格
|
|
116
117
|
ibiz.mc.command.send({ srfdecodename: appDataEntity.codeName }, 'OBJECTCREATED', 'DATAIMPORT');
|
|
117
|
-
|
|
118
|
+
if (res.ok && res.data) {
|
|
119
|
+
Object.assign(result, res.data);
|
|
120
|
+
// 如果有返回message或者errormessage则不显示导入结果头
|
|
121
|
+
if (res.data.errormessage || res.data.message) {
|
|
122
|
+
result.showTitle = false;
|
|
123
|
+
}
|
|
124
|
+
// 如果没有返回message和errormessage但是有errorinfo则拼接errorinfo作为errormessage
|
|
125
|
+
if (res.data &&
|
|
126
|
+
res.data.errorinfo &&
|
|
127
|
+
!res.data.message &&
|
|
128
|
+
!res.data.errormessage) {
|
|
129
|
+
const errorInfos = Object.values(res.data.errorinfo);
|
|
130
|
+
if (errorInfos.length > 0) {
|
|
131
|
+
result.errormessage = errorInfos
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
133
|
+
.map((item) => item.errorInfo)
|
|
134
|
+
.join('\r\n');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
118
138
|
}
|
|
119
139
|
catch (error) {
|
|
120
140
|
if (error instanceof Error) {
|
|
121
|
-
result.
|
|
141
|
+
result.errormessage = error.message;
|
|
142
|
+
result.showTitle = false;
|
|
122
143
|
}
|
|
123
144
|
}
|
|
124
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,11 +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;
|
|
38
|
+
/**
|
|
39
|
+
* 成功导入的数量
|
|
40
|
+
*/
|
|
33
41
|
success?: number;
|
|
42
|
+
/**
|
|
43
|
+
* 返回内容(后台返回)
|
|
44
|
+
*/
|
|
34
45
|
message?: string;
|
|
35
|
-
|
|
46
|
+
/**
|
|
47
|
+
* 错误信息(后台返回)
|
|
48
|
+
*/
|
|
49
|
+
errormessage?: string;
|
|
50
|
+
/**
|
|
51
|
+
* 错误文件数据
|
|
52
|
+
*/
|
|
53
|
+
errorfile?: IData;
|
|
54
|
+
/**
|
|
55
|
+
* 是否显示导入结果头,后台返回message和errormessage时,前端不显示导入结果头(成功xxx,失败xxx),默认显示
|
|
56
|
+
*/
|
|
57
|
+
showTitle?: boolean;
|
|
36
58
|
};
|
|
37
59
|
|
|
38
60
|
// 导出结果类型
|
|
@@ -163,6 +185,7 @@ export async function importData(
|
|
|
163
185
|
|
|
164
186
|
const result: ImportDataResult = {
|
|
165
187
|
isAsync: false,
|
|
188
|
+
showTitle: true,
|
|
166
189
|
};
|
|
167
190
|
try {
|
|
168
191
|
const app = ibiz.hub.getApp(context?.srfappid);
|
|
@@ -179,11 +202,32 @@ export async function importData(
|
|
|
179
202
|
'OBJECTCREATED',
|
|
180
203
|
'DATAIMPORT',
|
|
181
204
|
);
|
|
182
|
-
|
|
183
|
-
|
|
205
|
+
if (res.ok && res.data) {
|
|
206
|
+
Object.assign(result, res.data);
|
|
207
|
+
// 如果有返回message或者errormessage则不显示导入结果头
|
|
208
|
+
if (res.data.errormessage || res.data.message) {
|
|
209
|
+
result.showTitle = false;
|
|
210
|
+
}
|
|
211
|
+
// 如果没有返回message和errormessage但是有errorinfo则拼接errorinfo作为errormessage
|
|
212
|
+
if (
|
|
213
|
+
res.data &&
|
|
214
|
+
res.data.errorinfo &&
|
|
215
|
+
!res.data.message &&
|
|
216
|
+
!res.data.errormessage
|
|
217
|
+
) {
|
|
218
|
+
const errorInfos = Object.values(res.data.errorinfo);
|
|
219
|
+
if (errorInfos.length > 0) {
|
|
220
|
+
result.errormessage = errorInfos
|
|
221
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
222
|
+
.map((item: any) => item.errorInfo)
|
|
223
|
+
.join('\r\n');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
184
227
|
} catch (error) {
|
|
185
228
|
if (error instanceof Error) {
|
|
186
|
-
result.
|
|
229
|
+
result.errormessage = error.message;
|
|
230
|
+
result.showTitle = false;
|
|
187
231
|
}
|
|
188
232
|
}
|
|
189
233
|
|