@pisell/lowcode-renderer 1.0.47 → 1.0.49

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.
@@ -21,6 +21,7 @@ import React, { useEffect, useState } from "react";
21
21
  import ReactRenderer from "../ReactRenderer";
22
22
  import appHelper from "../appHelper";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
+ var isLoadAssets = false;
24
25
  var Render = function Render(props) {
25
26
  var packages = props.packages,
26
27
  projectSchema = props.projectSchema,
@@ -88,24 +89,29 @@ var Render = function Render(props) {
88
89
  // console.log(libraryMap,'libraryMap',libraryAsset);
89
90
  // const vendors = [assetBundle(libraryAsset, AssetLevel.Library)];
90
91
 
92
+ // 静态资源load后不再二次加载
93
+ if (isLoadAssets) {
94
+ _context.next = 15;
95
+ break;
96
+ }
91
97
  // TODO asset may cause pollution
92
98
  assetLoader = new AssetLoader();
93
- _context.next = 13;
99
+ _context.next = 14;
94
100
  return assetLoader.load(libraryAsset);
95
- case 13:
96
- _context.next = 15;
97
- return injectComponents(buildComponents(libraryMap, componentsMap));
101
+ case 14:
102
+ isLoadAssets = true;
98
103
  case 15:
104
+ _context.next = 17;
105
+ return injectComponents(buildComponents(libraryMap, componentsMap));
106
+ case 17:
99
107
  components = _context.sent;
100
- // console.log(components,'components');
101
-
102
108
  setData({
103
109
  schema: pageSchema,
104
110
  components: components,
105
111
  i18n: i18n,
106
112
  projectDataSource: projectDataSource
107
113
  });
108
- case 17:
114
+ case 19:
109
115
  case "end":
110
116
  return _context.stop();
111
117
  }
@@ -57,8 +57,8 @@ var getParams = function getParams(values, url) {
57
57
  }
58
58
 
59
59
  // 转换时间戳
60
- start_at = start_at.tz(timezone).unix();
61
- end_at = end_at.tz(timezone).unix();
60
+ start_at = dayjs.tz(start_at.format('YYYY-MM-DD HH:mm:ss'), timezone).unix();
61
+ end_at = dayjs.tz(end_at.format('YYYY-MM-DD HH:mm:ss'), timezone).unix();
62
62
  return _objectSpread(_objectSpread({
63
63
  shop_id: id,
64
64
  start_at: start_at,
@@ -39,6 +39,7 @@ var import_lodash_es = require("lodash-es");
39
39
  var import_react = __toESM(require("react"));
40
40
  var import_ReactRenderer = __toESM(require("../ReactRenderer"));
41
41
  var import_appHelper = __toESM(require("../appHelper"));
42
+ var isLoadAssets = false;
42
43
  var Render = (props) => {
43
44
  const {
44
45
  packages,
@@ -80,8 +81,11 @@ var Render = (props) => {
80
81
  libraryAsset.push(urls);
81
82
  }
82
83
  });
83
- const assetLoader = new import_lowcode_utils.AssetLoader();
84
- await assetLoader.load(libraryAsset);
84
+ if (!isLoadAssets) {
85
+ const assetLoader = new import_lowcode_utils.AssetLoader();
86
+ await assetLoader.load(libraryAsset);
87
+ isLoadAssets = true;
88
+ }
85
89
  const components3 = await (0, import_lowcode_plugin_inject.injectComponents)(
86
90
  (0, import_lowcode_utils.buildComponents)(libraryMap, componentsMap)
87
91
  );
@@ -72,8 +72,8 @@ var getParams = (values, url) => {
72
72
  start_at = (0, import_dayjs.default)().startOf("day");
73
73
  end_at = start_at.endOf("day");
74
74
  }
75
- start_at = start_at.tz(timezone2).unix();
76
- end_at = end_at.tz(timezone2).unix();
75
+ start_at = import_dayjs.default.tz(start_at.format("YYYY-MM-DD HH:mm:ss"), timezone2).unix();
76
+ end_at = import_dayjs.default.tz(end_at.format("YYYY-MM-DD HH:mm:ss"), timezone2).unix();
77
77
  return {
78
78
  shop_id: id,
79
79
  start_at,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/lowcode-renderer",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "sideEffects": false,
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",