@zhubangyun/lowcode-core 6.3.25 → 6.4.4

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.
Files changed (59) hide show
  1. package/es/index.d.ts +1 -1
  2. package/es/index.js +5 -5
  3. package/es/index.less +0 -1
  4. package/es/utils/api/form-api/form-api.utils.js +4 -0
  5. package/es/utils/api/form-api.d.ts +0 -1
  6. package/es/utils/api/form-api.js +4 -37
  7. package/es/utils/api/rest-api.d.ts +1 -0
  8. package/es/utils/api/rest-api.js +125 -108
  9. package/es/utils/api/script-api.d.ts +1 -1
  10. package/es/utils/cache/cache.load-data.d.ts +1 -0
  11. package/es/utils/cache/cache.load-data.js +41 -0
  12. package/es/utils/cache/cache.page-permission.d.ts +1 -0
  13. package/es/utils/cache/cache.page-permission.js +28 -0
  14. package/es/utils/cache/cache.page-print.d.ts +1 -0
  15. package/es/utils/cache/cache.page-print.js +25 -0
  16. package/es/utils/cache/cache.page-schema.d.ts +1 -0
  17. package/es/utils/cache/cache.page-schema.js +96 -0
  18. package/es/utils/cache/cache.print.js +0 -0
  19. package/es/utils/cache/index.d.ts +5 -6
  20. package/es/utils/cache/index.js +19 -32
  21. package/es/utils/cache/index_db_cache.d.ts +11 -6
  22. package/es/utils/cache/index_db_cache.js +57 -5
  23. package/es/utils/page/index.js +1 -1
  24. package/es/utils/page/page-form-data-manager.d.ts +2 -1
  25. package/es/utils/page/page-layout.d.ts +1 -1
  26. package/es/utils/page/page-load-schema.js +33 -15
  27. package/es/utils/page/page-render.js +5 -1
  28. package/es/utils/page/page-schema-utils.js +1 -1
  29. package/es/utils/page/print-form.js +2 -4
  30. package/lib/index.d.ts +1 -1
  31. package/lib/index.js +6 -6
  32. package/lib/index.less +0 -1
  33. package/lib/utils/api/form-api/form-api.utils.js +4 -0
  34. package/lib/utils/api/form-api.d.ts +0 -1
  35. package/lib/utils/api/form-api.js +4 -37
  36. package/lib/utils/api/rest-api.d.ts +1 -0
  37. package/lib/utils/api/rest-api.js +125 -108
  38. package/lib/utils/api/script-api.d.ts +1 -1
  39. package/lib/utils/cache/cache.load-data.d.ts +1 -0
  40. package/lib/utils/cache/cache.load-data.js +44 -0
  41. package/lib/utils/cache/cache.page-permission.d.ts +1 -0
  42. package/lib/utils/cache/cache.page-permission.js +33 -0
  43. package/lib/utils/cache/cache.page-print.d.ts +1 -0
  44. package/lib/utils/cache/cache.page-print.js +30 -0
  45. package/lib/utils/cache/cache.page-schema.d.ts +1 -0
  46. package/lib/utils/cache/cache.page-schema.js +101 -0
  47. package/lib/utils/cache/cache.print.js +1 -0
  48. package/lib/utils/cache/index.d.ts +5 -6
  49. package/lib/utils/cache/index.js +23 -35
  50. package/lib/utils/cache/index_db_cache.d.ts +11 -6
  51. package/lib/utils/cache/index_db_cache.js +61 -6
  52. package/lib/utils/page/index.js +1 -1
  53. package/lib/utils/page/page-form-data-manager.d.ts +2 -1
  54. package/lib/utils/page/page-layout.d.ts +1 -1
  55. package/lib/utils/page/page-load-schema.js +32 -14
  56. package/lib/utils/page/page-render.js +5 -1
  57. package/lib/utils/page/page-schema-utils.js +1 -1
  58. package/lib/utils/page/print-form.js +2 -4
  59. package/package.json +1 -1
package/es/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import "./index.less";
2
2
  import * as lodash from "lodash";
3
+ import utils from "./utils/index";
3
4
  export { LoadMaterials } from "./components/load-materials";
4
5
  export { PageLoading } from "./components/page-loading";
5
6
  export { RestApi, RestFormApi, apiRequest } from "./utils/api";
6
7
  export { Layout } from "./components/layout";
7
8
  export { ReactRender } from "./components/react-render";
8
- import utils from "./utils/index";
9
9
  export { utils, lodash };
package/es/index.js CHANGED
@@ -2,16 +2,16 @@ import _message from "antd/es/message";
2
2
  import "./index.less";
3
3
  import { ReactRender } from "./components/react-render";
4
4
  import * as lodash from "lodash";
5
- export { LoadMaterials } from "./components/load-materials";
6
- export { PageLoading } from "./components/page-loading";
7
- export { RestApi, RestFormApi, apiRequest } from "./utils/api";
8
- export { Layout } from "./components/layout";
9
- export { ReactRender } from "./components/react-render";
10
5
  import utils from "./utils/index";
11
6
  import { uniBridge } from "./utils/uni-bridge";
12
7
  import { initBarHeight } from "./init/init.bar-height";
13
8
  import { initScrollSize } from "./init/init.scroll-size";
14
9
  import { initMobileClass } from "./init/init.mobile-class";
10
+ export { LoadMaterials } from "./components/load-materials";
11
+ export { PageLoading } from "./components/page-loading";
12
+ export { RestApi, RestFormApi, apiRequest } from "./utils/api";
13
+ export { Layout } from "./components/layout";
14
+ export { ReactRender } from "./components/react-render";
15
15
  // @ts-ignore
16
16
  window.__ReactRender = ReactRender;
17
17
  // @ts-ignore
package/es/index.less CHANGED
@@ -12,7 +12,6 @@
12
12
  height: 100%;
13
13
  }
14
14
 
15
-
16
15
  ul {
17
16
  margin-bottom: 0;
18
17
  padding-left: 0;
@@ -7,10 +7,14 @@ import { isLocalhost } from "../../common";
7
7
  import { formApiAssembleEntity } from "./form-api.assemble-entity";
8
8
  import { isTemplateHost } from "../../util.common";
9
9
  var SimpleSerialFieldNames = ["parent", "instance"];
10
+ var IgnoreFieldNames = ["createdAt", "createdBy", "updatedAt", "updatedBy"];
10
11
  export function convertSaveData(data) {
11
12
  if (!data) return data;
12
13
  var seen = new WeakSet(); // WeakSet 只存储对象,非常适合检测引用
13
14
  return JSON.parse(JSON.stringify(data, function (key, value) {
15
+ if (IgnoreFieldNames.includes(key)) {
16
+ return undefined;
17
+ }
14
18
  if (value == null) {
15
19
  return null;
16
20
  } else if (Array.isArray(value)) {
@@ -6,7 +6,6 @@ export declare class RestFormApi<DataType> extends RestApi<DataType> {
6
6
  private readonly fieldId?;
7
7
  private readonly mock;
8
8
  private initialized;
9
- private schema;
10
9
  constructor(formId: string, fieldId?: string, mock?: boolean);
11
10
  initialize(): Promise<boolean>;
12
11
  handleRequestConfig(config: AxiosRequestConfig): Promise<void>;
@@ -4,7 +4,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { RestApi } from "./rest-api";
5
5
  import { assembleAssociationField, convertSaveData, handleFilterRules } from "./form-api/form-api.utils";
6
6
  import { formApi } from "../cache";
7
- import { getSchemaFromCache } from "./schema-api";
8
7
  import { uuid, uuidVersion } from "../common";
9
8
  export function getFormApi(_x, _x2, _x3) {
10
9
  return _getFormApi.apply(this, arguments);
@@ -46,7 +45,6 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
46
45
  _this.fieldId = void 0;
47
46
  _this.mock = void 0;
48
47
  _this.initialized = false;
49
- _this.schema = void 0;
50
48
  _this.formId = formId;
51
49
  _this.fieldId = fieldId;
52
50
  _this.mock = !!mock;
@@ -56,41 +54,10 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
56
54
  var _proto = RestFormApi.prototype;
57
55
  _proto.initialize = /*#__PURE__*/function () {
58
56
  var _initialize = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
59
- var _this2 = this;
60
- var res, _this$schema, _this$schema$children, _this$schema$children2;
61
57
  return _regeneratorRuntime.wrap(function (_context) {
62
58
  while (1) switch (_context.prev = _context.next) {
63
59
  case 0:
64
- if (!this.initialized) {
65
- try {
66
- res = getSchemaFromCache(this.formId, this.mock);
67
- this.schema = res === null || res === void 0 ? void 0 : res.data;
68
- this.initialized = !!this.schema;
69
- if (this.initialized) {
70
- this.title = (_this$schema = this.schema) === null || _this$schema === void 0 ? void 0 : (_this$schema$children = _this$schema.children[0]) === null || _this$schema$children === void 0 ? void 0 : (_this$schema$children2 = _this$schema$children.props) === null || _this$schema$children2 === void 0 ? void 0 : _this$schema$children2.label;
71
- if (this.fieldId) {
72
- JSON.stringify(this.schema, function (key, value) {
73
- var _value$props;
74
- if (key == "fdmSchema") {
75
- return undefined;
76
- }
77
- if ((value === null || value === void 0 ? void 0 : (_value$props = value.props) === null || _value$props === void 0 ? void 0 : _value$props.fieldId) === _this2.fieldId) {
78
- if (value.props.label) {
79
- _this2.title += "." + value.props.label;
80
- }
81
- }
82
- return value;
83
- });
84
- }
85
- }
86
- } catch (e) {
87
- console.log("获取schema失败!", {
88
- formId: this.formId,
89
- field: this.fieldId,
90
- mock: this.mock
91
- }, e);
92
- }
93
- }
60
+ this.initialized = true;
94
61
  return _context.abrupt("return", this.initialized);
95
62
  case 1:
96
63
  case "end":
@@ -241,7 +208,7 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
241
208
  }();
242
209
  _proto.labelToValue = /*#__PURE__*/function () {
243
210
  var _labelToValue = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data, options) {
244
- var _this3 = this;
211
+ var _this2 = this;
245
212
  var config, res;
246
213
  return _regeneratorRuntime.wrap(function (_context5) {
247
214
  while (1) switch (_context5.prev = _context5.next) {
@@ -258,8 +225,8 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
258
225
  res.data.forEach(function (item) {
259
226
  item.id = uuid();
260
227
  item.form = {
261
- id: _this3.formId,
262
- fieldId: _this3.fieldId
228
+ id: _this2.formId,
229
+ fieldId: _this2.fieldId
263
230
  };
264
231
  });
265
232
  }
@@ -45,6 +45,7 @@ export declare abstract class BaseRestApi<DataType> {
45
45
  */
46
46
  getById(id: string, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
47
47
  save(data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
48
+ saveMany(data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
48
49
  /**
49
50
  * 创建
50
51
  */
@@ -146,6 +146,23 @@ export var BaseRestApi = /*#__PURE__*/function () {
146
146
  return _save.apply(this, arguments);
147
147
  }
148
148
  return save;
149
+ }();
150
+ _proto.saveMany = /*#__PURE__*/function () {
151
+ var _saveMany = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data, options) {
152
+ return _regeneratorRuntime.wrap(function (_context4) {
153
+ while (1) switch (_context4.prev = _context4.next) {
154
+ case 0:
155
+ return _context4.abrupt("return", this.save(data, options));
156
+ case 1:
157
+ case "end":
158
+ return _context4.stop();
159
+ }
160
+ }, _callee4, this);
161
+ }));
162
+ function saveMany(_x6, _x7) {
163
+ return _saveMany.apply(this, arguments);
164
+ }
165
+ return saveMany;
149
166
  }()
150
167
  /**
151
168
  * 创建
@@ -154,42 +171,42 @@ export var BaseRestApi = /*#__PURE__*/function () {
154
171
  _proto.create =
155
172
  /*#__PURE__*/
156
173
  function () {
157
- var _create = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data, options) {
174
+ var _create = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data, options) {
158
175
  var _this$handleRequestCo4;
159
176
  var config, res, _options$onError3, _options$onSuccess3;
160
- return _regeneratorRuntime.wrap(function (_context4) {
161
- while (1) switch (_context4.prev = _context4.next) {
177
+ return _regeneratorRuntime.wrap(function (_context5) {
178
+ while (1) switch (_context5.prev = _context5.next) {
162
179
  case 0:
163
180
  config = {};
164
- _context4.next = 1;
181
+ _context5.next = 1;
165
182
  return (_this$handleRequestCo4 = this.handleRequestConfig) === null || _this$handleRequestCo4 === void 0 ? void 0 : _this$handleRequestCo4.call(this, config);
166
183
  case 1:
167
- _context4.next = 2;
184
+ _context5.next = 2;
168
185
  return this.request.post("", data, config);
169
186
  case 2:
170
- res = _context4.sent;
187
+ res = _context5.sent;
171
188
  if (res.success) {
172
- _context4.next = 4;
189
+ _context5.next = 4;
173
190
  break;
174
191
  }
175
192
  this.showError("\u65B0\u589E\u5931\u8D25!", res).then();
176
- _context4.next = 3;
193
+ _context5.next = 3;
177
194
  return options === null || options === void 0 ? void 0 : (_options$onError3 = options.onError) === null || _options$onError3 === void 0 ? void 0 : _options$onError3.call(options, res);
178
195
  case 3:
179
- _context4.next = 5;
196
+ _context5.next = 5;
180
197
  break;
181
198
  case 4:
182
- _context4.next = 5;
199
+ _context5.next = 5;
183
200
  return options === null || options === void 0 ? void 0 : (_options$onSuccess3 = options.onSuccess) === null || _options$onSuccess3 === void 0 ? void 0 : _options$onSuccess3.call(options, res);
184
201
  case 5:
185
- return _context4.abrupt("return", res);
202
+ return _context5.abrupt("return", res);
186
203
  case 6:
187
204
  case "end":
188
- return _context4.stop();
205
+ return _context5.stop();
189
206
  }
190
- }, _callee4, this);
207
+ }, _callee5, this);
191
208
  }));
192
- function create(_x6, _x7) {
209
+ function create(_x8, _x9) {
193
210
  return _create.apply(this, arguments);
194
211
  }
195
212
  return create;
@@ -201,42 +218,42 @@ export var BaseRestApi = /*#__PURE__*/function () {
201
218
  _proto.update =
202
219
  /*#__PURE__*/
203
220
  function () {
204
- var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, data, options) {
221
+ var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id, data, options) {
205
222
  var _this$handleRequestCo5;
206
223
  var config, res, _options$onError4, _options$onSuccess4;
207
- return _regeneratorRuntime.wrap(function (_context5) {
208
- while (1) switch (_context5.prev = _context5.next) {
224
+ return _regeneratorRuntime.wrap(function (_context6) {
225
+ while (1) switch (_context6.prev = _context6.next) {
209
226
  case 0:
210
227
  config = {};
211
- _context5.next = 1;
228
+ _context6.next = 1;
212
229
  return (_this$handleRequestCo5 = this.handleRequestConfig) === null || _this$handleRequestCo5 === void 0 ? void 0 : _this$handleRequestCo5.call(this, config);
213
230
  case 1:
214
- _context5.next = 2;
231
+ _context6.next = 2;
215
232
  return this.request.put(String(id), data, config);
216
233
  case 2:
217
- res = _context5.sent;
234
+ res = _context6.sent;
218
235
  if (res.success) {
219
- _context5.next = 4;
236
+ _context6.next = 4;
220
237
  break;
221
238
  }
222
239
  this.showError("\u66F4\u65B0\u5931\u8D25!", res).then();
223
- _context5.next = 3;
240
+ _context6.next = 3;
224
241
  return options === null || options === void 0 ? void 0 : (_options$onError4 = options.onError) === null || _options$onError4 === void 0 ? void 0 : _options$onError4.call(options, res);
225
242
  case 3:
226
- _context5.next = 5;
243
+ _context6.next = 5;
227
244
  break;
228
245
  case 4:
229
- _context5.next = 5;
246
+ _context6.next = 5;
230
247
  return options === null || options === void 0 ? void 0 : (_options$onSuccess4 = options.onSuccess) === null || _options$onSuccess4 === void 0 ? void 0 : _options$onSuccess4.call(options, res);
231
248
  case 5:
232
- return _context5.abrupt("return", res);
249
+ return _context6.abrupt("return", res);
233
250
  case 6:
234
251
  case "end":
235
- return _context5.stop();
252
+ return _context6.stop();
236
253
  }
237
- }, _callee5, this);
254
+ }, _callee6, this);
238
255
  }));
239
- function update(_x8, _x9, _x0) {
256
+ function update(_x0, _x1, _x10) {
240
257
  return _update.apply(this, arguments);
241
258
  }
242
259
  return update;
@@ -248,55 +265,55 @@ export var BaseRestApi = /*#__PURE__*/function () {
248
265
  _proto.deleteById =
249
266
  /*#__PURE__*/
250
267
  function () {
251
- var _deleteById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id, options) {
268
+ var _deleteById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, options) {
252
269
  var _this$handleRequestCo6;
253
270
  var config, res, _options$onError5, _options$onSuccess5;
254
- return _regeneratorRuntime.wrap(function (_context6) {
255
- while (1) switch (_context6.prev = _context6.next) {
271
+ return _regeneratorRuntime.wrap(function (_context7) {
272
+ while (1) switch (_context7.prev = _context7.next) {
256
273
  case 0:
257
274
  config = {};
258
- _context6.next = 1;
275
+ _context7.next = 1;
259
276
  return (_this$handleRequestCo6 = this.handleRequestConfig) === null || _this$handleRequestCo6 === void 0 ? void 0 : _this$handleRequestCo6.call(this, config);
260
277
  case 1:
261
- _context6.next = 2;
278
+ _context7.next = 2;
262
279
  return this.request["delete"](String(id), config);
263
280
  case 2:
264
- res = _context6.sent;
281
+ res = _context7.sent;
265
282
  if (res.success) {
266
- _context6.next = 4;
283
+ _context7.next = 4;
267
284
  break;
268
285
  }
269
286
  this.showError("\u5220\u9664{" + id + "}\u5931\u8D25!", res).then();
270
- _context6.next = 3;
287
+ _context7.next = 3;
271
288
  return options === null || options === void 0 ? void 0 : (_options$onError5 = options.onError) === null || _options$onError5 === void 0 ? void 0 : _options$onError5.call(options, res);
272
289
  case 3:
273
- _context6.next = 5;
290
+ _context7.next = 5;
274
291
  break;
275
292
  case 4:
276
- _context6.next = 5;
293
+ _context7.next = 5;
277
294
  return options === null || options === void 0 ? void 0 : (_options$onSuccess5 = options.onSuccess) === null || _options$onSuccess5 === void 0 ? void 0 : _options$onSuccess5.call(options, res);
278
295
  case 5:
279
- return _context6.abrupt("return", res);
296
+ return _context7.abrupt("return", res);
280
297
  case 6:
281
298
  case "end":
282
- return _context6.stop();
299
+ return _context7.stop();
283
300
  }
284
- }, _callee6, this);
301
+ }, _callee7, this);
285
302
  }));
286
- function deleteById(_x1, _x10) {
303
+ function deleteById(_x11, _x12) {
287
304
  return _deleteById.apply(this, arguments);
288
305
  }
289
306
  return deleteById;
290
307
  }();
291
308
  _proto["delete"] = /*#__PURE__*/function () {
292
- var _delete2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data, options) {
309
+ var _delete2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data, options) {
293
310
  var _this$handleRequestCo7;
294
311
  var config, arrayData, idValue, res, _options$onError6, _options$onSuccess6;
295
- return _regeneratorRuntime.wrap(function (_context7) {
296
- while (1) switch (_context7.prev = _context7.next) {
312
+ return _regeneratorRuntime.wrap(function (_context8) {
313
+ while (1) switch (_context8.prev = _context8.next) {
297
314
  case 0:
298
315
  config = {};
299
- _context7.next = 1;
316
+ _context8.next = 1;
300
317
  return (_this$handleRequestCo7 = this.handleRequestConfig) === null || _this$handleRequestCo7 === void 0 ? void 0 : _this$handleRequestCo7.call(this, config);
301
318
  case 1:
302
319
  arrayData = [];
@@ -310,133 +327,133 @@ export var BaseRestApi = /*#__PURE__*/function () {
310
327
  return !!item;
311
328
  });
312
329
  if (!(arrayData.length == 0)) {
313
- _context7.next = 2;
330
+ _context8.next = 2;
314
331
  break;
315
332
  }
316
333
  throw new Error("删除对象不可为空!");
317
334
  case 2:
318
- _context7.next = 3;
335
+ _context8.next = 3;
319
336
  return this.request.post("remove", arrayData, config);
320
337
  case 3:
321
- res = _context7.sent;
338
+ res = _context8.sent;
322
339
  if (res.success) {
323
- _context7.next = 5;
340
+ _context8.next = 5;
324
341
  break;
325
342
  }
326
343
  this.showError("\u5220\u9664\u5931\u8D25!", res).then();
327
- _context7.next = 4;
344
+ _context8.next = 4;
328
345
  return options === null || options === void 0 ? void 0 : (_options$onError6 = options.onError) === null || _options$onError6 === void 0 ? void 0 : _options$onError6.call(options, res);
329
346
  case 4:
330
- _context7.next = 6;
347
+ _context8.next = 6;
331
348
  break;
332
349
  case 5:
333
- _context7.next = 6;
350
+ _context8.next = 6;
334
351
  return options === null || options === void 0 ? void 0 : (_options$onSuccess6 = options.onSuccess) === null || _options$onSuccess6 === void 0 ? void 0 : _options$onSuccess6.call(options, res);
335
352
  case 6:
336
- return _context7.abrupt("return", res);
353
+ return _context8.abrupt("return", res);
337
354
  case 7:
338
355
  case "end":
339
- return _context7.stop();
356
+ return _context8.stop();
340
357
  }
341
- }, _callee7, this);
358
+ }, _callee8, this);
342
359
  }));
343
- function _delete(_x11, _x12) {
360
+ function _delete(_x13, _x14) {
344
361
  return _delete2.apply(this, arguments);
345
362
  }
346
363
  return _delete;
347
364
  }();
348
365
  _proto["export"] = /*#__PURE__*/function () {
349
- var _export2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data, options) {
366
+ var _export2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data, options) {
350
367
  var _this$handleRequestCo8;
351
368
  var config, res, _options$onError7, _options$onSuccess7;
352
- return _regeneratorRuntime.wrap(function (_context8) {
353
- while (1) switch (_context8.prev = _context8.next) {
369
+ return _regeneratorRuntime.wrap(function (_context9) {
370
+ while (1) switch (_context9.prev = _context9.next) {
354
371
  case 0:
355
372
  config = {};
356
- _context8.next = 1;
373
+ _context9.next = 1;
357
374
  return (_this$handleRequestCo8 = this.handleRequestConfig) === null || _this$handleRequestCo8 === void 0 ? void 0 : _this$handleRequestCo8.call(this, config);
358
375
  case 1:
359
- _context8.next = 2;
376
+ _context9.next = 2;
360
377
  return this.request.post("/export", data, config);
361
378
  case 2:
362
- res = _context8.sent;
379
+ res = _context9.sent;
363
380
  if (res.success) {
364
- _context8.next = 4;
381
+ _context9.next = 4;
365
382
  break;
366
383
  }
367
384
  this.showError("\u5BFC\u51FA\u5931\u8D25!", res).then();
368
- _context8.next = 3;
385
+ _context9.next = 3;
369
386
  return options === null || options === void 0 ? void 0 : (_options$onError7 = options.onError) === null || _options$onError7 === void 0 ? void 0 : _options$onError7.call(options, res);
370
387
  case 3:
371
- _context8.next = 5;
388
+ _context9.next = 5;
372
389
  break;
373
390
  case 4:
374
- _context8.next = 5;
391
+ _context9.next = 5;
375
392
  return options === null || options === void 0 ? void 0 : (_options$onSuccess7 = options.onSuccess) === null || _options$onSuccess7 === void 0 ? void 0 : _options$onSuccess7.call(options, res);
376
393
  case 5:
377
- return _context8.abrupt("return", res);
394
+ return _context9.abrupt("return", res);
378
395
  case 6:
379
396
  case "end":
380
- return _context8.stop();
397
+ return _context9.stop();
381
398
  }
382
- }, _callee8, this);
399
+ }, _callee9, this);
383
400
  }));
384
- function _export(_x13, _x14) {
401
+ function _export(_x15, _x16) {
385
402
  return _export2.apply(this, arguments);
386
403
  }
387
404
  return _export;
388
405
  }();
389
406
  _proto["import"] = /*#__PURE__*/function () {
390
- var _import2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data, options) {
407
+ var _import2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(data, options) {
391
408
  var _this$handleRequestCo9;
392
409
  var config, res, _options$onError8, _options$onSuccess8;
393
- return _regeneratorRuntime.wrap(function (_context9) {
394
- while (1) switch (_context9.prev = _context9.next) {
410
+ return _regeneratorRuntime.wrap(function (_context0) {
411
+ while (1) switch (_context0.prev = _context0.next) {
395
412
  case 0:
396
413
  config = {};
397
- _context9.next = 1;
414
+ _context0.next = 1;
398
415
  return (_this$handleRequestCo9 = this.handleRequestConfig) === null || _this$handleRequestCo9 === void 0 ? void 0 : _this$handleRequestCo9.call(this, config);
399
416
  case 1:
400
- _context9.next = 2;
417
+ _context0.next = 2;
401
418
  return this.request.post("import", data, config);
402
419
  case 2:
403
- res = _context9.sent;
420
+ res = _context0.sent;
404
421
  if (res.success) {
405
- _context9.next = 4;
422
+ _context0.next = 4;
406
423
  break;
407
424
  }
408
425
  this.showError("\u5BFC\u5165\u5931\u8D25!", res).then();
409
- _context9.next = 3;
426
+ _context0.next = 3;
410
427
  return options === null || options === void 0 ? void 0 : (_options$onError8 = options.onError) === null || _options$onError8 === void 0 ? void 0 : _options$onError8.call(options, res);
411
428
  case 3:
412
- _context9.next = 5;
429
+ _context0.next = 5;
413
430
  break;
414
431
  case 4:
415
- _context9.next = 5;
432
+ _context0.next = 5;
416
433
  return options === null || options === void 0 ? void 0 : (_options$onSuccess8 = options.onSuccess) === null || _options$onSuccess8 === void 0 ? void 0 : _options$onSuccess8.call(options, res);
417
434
  case 5:
418
- return _context9.abrupt("return", res);
435
+ return _context0.abrupt("return", res);
419
436
  case 6:
420
437
  case "end":
421
- return _context9.stop();
438
+ return _context0.stop();
422
439
  }
423
- }, _callee9, this);
440
+ }, _callee0, this);
424
441
  }));
425
- function _import(_x15, _x16) {
442
+ function _import(_x17, _x18) {
426
443
  return _import2.apply(this, arguments);
427
444
  }
428
445
  return _import;
429
446
  }();
430
447
  _proto.showError = /*#__PURE__*/function () {
431
- var _showError = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(type, res) {
448
+ var _showError = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(type, res) {
432
449
  var msg, props, _t;
433
- return _regeneratorRuntime.wrap(function (_context0) {
434
- while (1) switch (_context0.prev = _context0.next) {
450
+ return _regeneratorRuntime.wrap(function (_context1) {
451
+ while (1) switch (_context1.prev = _context1.next) {
435
452
  case 0:
436
453
  msg = res.message;
437
- _context0.prev = 1;
454
+ _context1.prev = 1;
438
455
  if (!msg) {
439
- _context0.next = 4;
456
+ _context1.next = 4;
440
457
  break;
441
458
  }
442
459
  props = JSON.parse(msg);
@@ -445,31 +462,31 @@ export var BaseRestApi = /*#__PURE__*/function () {
445
462
  props.title = "" + this.title + type;
446
463
  }
447
464
  if (!(props.type == "message")) {
448
- _context0.next = 2;
465
+ _context1.next = 2;
449
466
  break;
450
467
  }
451
468
  _message.error(props);
452
- return _context0.abrupt("return");
469
+ return _context1.abrupt("return");
453
470
  case 2:
454
471
  if (!(props.type == "modal")) {
455
- _context0.next = 3;
472
+ _context1.next = 3;
456
473
  break;
457
474
  }
458
475
  _Modal.error(props);
459
- return _context0.abrupt("return");
476
+ return _context1.abrupt("return");
460
477
  case 3:
461
478
  if (!(props.type == "notification")) {
462
- _context0.next = 4;
479
+ _context1.next = 4;
463
480
  break;
464
481
  }
465
482
  _notification.error(props);
466
- return _context0.abrupt("return");
483
+ return _context1.abrupt("return");
467
484
  case 4:
468
- _context0.next = 6;
485
+ _context1.next = 6;
469
486
  break;
470
487
  case 5:
471
- _context0.prev = 5;
472
- _t = _context0["catch"](1);
488
+ _context1.prev = 5;
489
+ _t = _context1["catch"](1);
473
490
  console.error("" + this.title + type + (msg || ""));
474
491
  _Modal.error({
475
492
  title: "" + this.title + type,
@@ -481,11 +498,11 @@ export var BaseRestApi = /*#__PURE__*/function () {
481
498
  });
482
499
  case 6:
483
500
  case "end":
484
- return _context0.stop();
501
+ return _context1.stop();
485
502
  }
486
- }, _callee0, this, [[1, 5]]);
503
+ }, _callee1, this, [[1, 5]]);
487
504
  }));
488
- function showError(_x17, _x18) {
505
+ function showError(_x19, _x20) {
489
506
  return _showError.apply(this, arguments);
490
507
  }
491
508
  return showError;
@@ -507,16 +524,16 @@ export var RestApi = /*#__PURE__*/function (_BaseRestApi2) {
507
524
  _inheritsLoose(RestApi, _BaseRestApi2);
508
525
  var _proto2 = RestApi.prototype;
509
526
  _proto2.handleRequestConfig = /*#__PURE__*/function () {
510
- var _handleRequestConfig = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(config) {
511
- return _regeneratorRuntime.wrap(function (_context1) {
512
- while (1) switch (_context1.prev = _context1.next) {
527
+ var _handleRequestConfig = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(config) {
528
+ return _regeneratorRuntime.wrap(function (_context10) {
529
+ while (1) switch (_context10.prev = _context10.next) {
513
530
  case 0:
514
531
  case "end":
515
- return _context1.stop();
532
+ return _context10.stop();
516
533
  }
517
- }, _callee1);
534
+ }, _callee10);
518
535
  }));
519
- function handleRequestConfig(_x19) {
536
+ function handleRequestConfig(_x21) {
520
537
  return _handleRequestConfig.apply(this, arguments);
521
538
  }
522
539
  return handleRequestConfig;
@@ -1 +1 @@
1
- export declare function loadDts(): Promise<any[]>;
1
+ export declare function loadDts(): Promise<any>;
@@ -0,0 +1 @@
1
+ declare function cacheLoadSchemas(): Promise<any>;