@lingxiteam/ebe-utils 0.0.2 → 0.0.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.
package/es/index.d.ts CHANGED
@@ -49,7 +49,7 @@ export declare const fetchData: ({ appId, services, platform, baseUrl, onProgres
49
49
  frontendHookList: any;
50
50
  };
51
51
  attrSpecPage: any;
52
- themeCss: string;
52
+ themeCss: any;
53
53
  models: Record<string, any>;
54
54
  appInfo: Record<string, any>;
55
55
  };
package/es/index.js CHANGED
@@ -311,31 +311,38 @@ export var fetchData = /*#__PURE__*/function () {
311
311
  themeCss = '';
312
312
  _context2.prev = 16;
313
313
  _context2.next = 19;
314
- return Promise.race([services.getThemeCss({
315
- appId: appId,
316
- terminalType: platform
317
- }), new Promise(function (resolve) {
318
- return setTimeout(resolve, 3000);
314
+ return Promise.race([new Promise(function (resolve, reject) {
315
+ services.getThemeCss({
316
+ appId: appId,
317
+ terminalType: platform
318
+ }).then(function (res) {
319
+ resolve(res);
320
+ });
321
+ }), new Promise(function (resolve, reject) {
322
+ setTimeout(function () {
323
+ resolve('');
324
+ }, 3000);
319
325
  })]);
320
326
  case 19:
321
327
  themeCss = _context2.sent;
322
- _context2.next = 25;
328
+ console.log('====获取主题成功', themeCss);
329
+ _context2.next = 26;
323
330
  break;
324
- case 22:
325
- _context2.prev = 22;
331
+ case 23:
332
+ _context2.prev = 23;
326
333
  _context2.t0 = _context2["catch"](16);
327
334
  console.error('====获取主题失败', _context2.t0);
328
- case 25:
335
+ case 26:
329
336
  // 根据 appId 获取当前应用的使用的自定义组件
330
337
  onProgress({
331
338
  log: '获取当前应用的使用的自定义组件',
332
339
  progress: 3
333
340
  });
334
- _context2.next = 28;
341
+ _context2.next = 29;
335
342
  return services.qryPageCompAssetList({
336
343
  appId: appId
337
344
  });
338
- case 28:
345
+ case 29:
339
346
  temCompAssetList = _context2.sent;
340
347
  // 兼容下割接数据,数组前面的自定义组件是新的
341
348
  compAssetList = temCompAssetList.reduce(function (acc, current) {
@@ -351,12 +358,12 @@ export var fetchData = /*#__PURE__*/function () {
351
358
  log: '获取全局数据源',
352
359
  progress: 4
353
360
  });
354
- _context2.next = 33;
361
+ _context2.next = 34;
355
362
  return services.queryFrontendDatasourcePage({
356
363
  appId: appId,
357
364
  pageSize: 10000
358
365
  });
359
- case 33:
366
+ case 34:
360
367
  globalDataInfo = _context2.sent;
361
368
  dataSourceList = (globalDataInfo === null || globalDataInfo === void 0 ? void 0 : globalDataInfo.list) || [];
362
369
  globalDataMap = {};
@@ -381,7 +388,7 @@ export var fetchData = /*#__PURE__*/function () {
381
388
  log: '获取所有页面dsl',
382
389
  progress: 5
383
390
  });
384
- _context2.next = 44;
391
+ _context2.next = 45;
385
392
  return Promise.all(appPageList.map(function (i) {
386
393
  lastPageId = i.pageId;
387
394
  return services.findPageInstByVersionId({
@@ -389,7 +396,7 @@ export var fetchData = /*#__PURE__*/function () {
389
396
  pageId: i.pageId
390
397
  });
391
398
  }));
392
- case 44:
399
+ case 45:
393
400
  data = _context2.sent;
394
401
  pages = getPageDsls(data); // busiCompId 过滤重复
395
402
  itemHash = {}; // 找到所有页面使用到的 业务组件
@@ -401,7 +408,7 @@ export var fetchData = /*#__PURE__*/function () {
401
408
  log: '获取所有业务组件dsl',
402
409
  progress: 6
403
410
  });
404
- _context2.next = 52;
411
+ _context2.next = 53;
405
412
  return Promise.all(itemLists.map(function (i) {
406
413
  return services.findBusiCompById({
407
414
  busiCompId: i,
@@ -409,7 +416,7 @@ export var fetchData = /*#__PURE__*/function () {
409
416
  pageId: lastPageId
410
417
  });
411
418
  }));
412
- case 52:
419
+ case 53:
413
420
  busiData = _context2.sent;
414
421
  busiCompMapping = {};
415
422
  busiPages = busiData.map(function (i, index) {
@@ -447,11 +454,11 @@ export var fetchData = /*#__PURE__*/function () {
447
454
  options: options,
448
455
  cleanedTree: cleanedTree
449
456
  });
450
- case 61:
457
+ case 62:
451
458
  case "end":
452
459
  return _context2.stop();
453
460
  }
454
- }, _callee2, null, [[16, 22]]);
461
+ }, _callee2, null, [[16, 23]]);
455
462
  }));
456
463
  return function fetchData(_x) {
457
464
  return _ref5.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxiteam/ebe-utils",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -17,7 +17,7 @@
17
17
  "@babel/parser": "^7.12.12",
18
18
  "@babel/traverse": "^7.12.12",
19
19
  "@babel/types": "^7.12.12",
20
- "@lingxiteam/ebe": "0.0.2",
20
+ "@lingxiteam/ebe": "0.0.4",
21
21
  "cac": "^6.7.14",
22
22
  "fs-extra": "9.x"
23
23
  },