@zhubangyun/lowcode-core 5.4.103 → 5.4.105
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.js +1 -1
- package/es/style.js +1 -0
- package/es/utils/common/SingletonInstanceMap.js +15 -17
- package/es/utils/page/page.form.js +11 -5
- package/es/utils/page/page.load-schema.js +16 -9
- package/lib/index.js +1 -1
- package/lib/style.js +1 -0
- package/lib/utils/common/SingletonInstanceMap.js +15 -17
- package/lib/utils/page/page.form.js +11 -5
- package/lib/utils/page/page.load-schema.js +16 -9
- package/package.json +1 -1
- package/es/utils/page/page.render.d.ts +0 -2
- package/es/utils/page/page.render.js +0 -6
- package/es/utils/page/page.utils.js +0 -0
- package/lib/utils/page/page.render.d.ts +0 -2
- package/lib/utils/page/page.render.js +0 -10
- package/lib/utils/page/page.utils.js +0 -1
package/es/index.js
CHANGED
package/es/style.js
CHANGED
|
@@ -12,16 +12,15 @@ export var SingletonInstanceMap = /*#__PURE__*/function () {
|
|
|
12
12
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
13
13
|
while (1) switch (_context2.prev = _context2.next) {
|
|
14
14
|
case 0:
|
|
15
|
-
console.log("getInstance", key, options);
|
|
16
15
|
self = this;
|
|
17
16
|
if (!this.valueMap.has(key)) {
|
|
18
|
-
_context2.next =
|
|
17
|
+
_context2.next = 5;
|
|
19
18
|
break;
|
|
20
19
|
}
|
|
21
20
|
return _context2.abrupt("return", Promise.resolve(this.valueMap.get(key)));
|
|
22
|
-
case
|
|
21
|
+
case 5:
|
|
23
22
|
if (!this.lockMap.get(key)) {
|
|
24
|
-
_context2.next =
|
|
23
|
+
_context2.next = 9;
|
|
25
24
|
break;
|
|
26
25
|
}
|
|
27
26
|
return _context2.abrupt("return", new Promise(function (resolve, reject) {
|
|
@@ -37,30 +36,29 @@ export var SingletonInstanceMap = /*#__PURE__*/function () {
|
|
|
37
36
|
}, _callee);
|
|
38
37
|
})), 500);
|
|
39
38
|
}));
|
|
40
|
-
case
|
|
41
|
-
_context2.prev =
|
|
39
|
+
case 9:
|
|
40
|
+
_context2.prev = 9;
|
|
42
41
|
this.lockMap.set(key, true);
|
|
43
|
-
|
|
44
|
-
_context2.next = 15;
|
|
42
|
+
_context2.next = 13;
|
|
45
43
|
return this.createInstance(key, options);
|
|
46
|
-
case
|
|
44
|
+
case 13:
|
|
47
45
|
value = _context2.sent;
|
|
48
46
|
this.valueMap.set(key, value);
|
|
49
47
|
this.lockMap.set(key, false);
|
|
50
48
|
return _context2.abrupt("return", Promise.resolve(value));
|
|
51
|
-
case
|
|
52
|
-
_context2.prev =
|
|
53
|
-
_context2.t0 = _context2["catch"](
|
|
49
|
+
case 19:
|
|
50
|
+
_context2.prev = 19;
|
|
51
|
+
_context2.t0 = _context2["catch"](9);
|
|
54
52
|
throw _context2.t0;
|
|
55
|
-
case
|
|
56
|
-
_context2.prev =
|
|
53
|
+
case 22:
|
|
54
|
+
_context2.prev = 22;
|
|
57
55
|
this.lockMap.set(key, false);
|
|
58
|
-
return _context2.finish(
|
|
59
|
-
case
|
|
56
|
+
return _context2.finish(22);
|
|
57
|
+
case 25:
|
|
60
58
|
case "end":
|
|
61
59
|
return _context2.stop();
|
|
62
60
|
}
|
|
63
|
-
}, _callee2, this, [[
|
|
61
|
+
}, _callee2, this, [[9, 19, 22, 25]]);
|
|
64
62
|
}));
|
|
65
63
|
function getInstance(_x, _x2) {
|
|
66
64
|
return _getInstance.apply(this, arguments);
|
|
@@ -2,7 +2,8 @@ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
5
|
-
var _excluded = ["container", "onClose"]
|
|
5
|
+
var _excluded = ["container", "onClose"],
|
|
6
|
+
_excluded2 = ["layout", "form"];
|
|
6
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
8
|
import { PageLayout } from "./page.layout";
|
|
8
9
|
import ReactDOM from "react-dom";
|
|
@@ -52,14 +53,19 @@ var FormRender = /*#__PURE__*/function (_Component) {
|
|
|
52
53
|
_inheritsLoose(FormRender, _Component);
|
|
53
54
|
var _proto = FormRender.prototype;
|
|
54
55
|
_proto.render = function render() {
|
|
55
|
-
var _this = this
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
var _this$props = this.props,
|
|
57
|
+
layout = _this$props.layout,
|
|
58
|
+
form = _this$props.form,
|
|
59
|
+
restProps = _objectWithoutPropertiesLoose(_this$props, _excluded2);
|
|
60
|
+
return /*#__PURE__*/React.createElement(PageLayout, {
|
|
61
|
+
layout: layout
|
|
62
|
+
}, /*#__PURE__*/React.createElement(PageLoadSchema, {
|
|
63
|
+
pageId: form.id
|
|
58
64
|
}, function (schema) {
|
|
59
65
|
return /*#__PURE__*/React.createElement(ReactRender, _extends({
|
|
60
66
|
schema: schema,
|
|
61
67
|
components: window.__components
|
|
62
|
-
},
|
|
68
|
+
}, restProps));
|
|
63
69
|
}));
|
|
64
70
|
};
|
|
65
71
|
return FormRender;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _Result from "antd/es/result";
|
|
2
2
|
import _Spin from "antd/es/spin";
|
|
3
|
+
import _message from "antd/es/message";
|
|
3
4
|
import { useEffect, useState } from "react";
|
|
4
5
|
import { getSchema } from "../api";
|
|
5
6
|
export function PageLoadSchema(props) {
|
|
7
|
+
var pageId = props.pageId,
|
|
8
|
+
children = props.children;
|
|
6
9
|
var _useState = useState(true),
|
|
7
10
|
loading = _useState[0],
|
|
8
11
|
setLoading = _useState[1];
|
|
@@ -13,14 +16,18 @@ export function PageLoadSchema(props) {
|
|
|
13
16
|
errorMsg = _useState3[0],
|
|
14
17
|
setErrorMsg = _useState3[1];
|
|
15
18
|
useEffect(function () {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
if (pageId) {
|
|
20
|
+
getSchema(pageId).then(function (res) {
|
|
21
|
+
if (res.success) {
|
|
22
|
+
setLoading(false);
|
|
23
|
+
setSchema(res.data);
|
|
24
|
+
} else {
|
|
25
|
+
setErrorMsg(res.message);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
_message.error("页面id不可为空!").then();
|
|
30
|
+
}
|
|
24
31
|
}, []);
|
|
25
32
|
if (loading) {
|
|
26
33
|
return /*#__PURE__*/React.createElement(_Spin, {
|
|
@@ -33,5 +40,5 @@ export function PageLoadSchema(props) {
|
|
|
33
40
|
title: errorMsg
|
|
34
41
|
});
|
|
35
42
|
}
|
|
36
|
-
return
|
|
43
|
+
return children(schema);
|
|
37
44
|
}
|
package/lib/index.js
CHANGED
package/lib/style.js
CHANGED
|
@@ -17,16 +17,15 @@ var SingletonInstanceMap = exports.SingletonInstanceMap = /*#__PURE__*/function
|
|
|
17
17
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
18
18
|
while (1) switch (_context2.prev = _context2.next) {
|
|
19
19
|
case 0:
|
|
20
|
-
console.log("getInstance", key, options);
|
|
21
20
|
self = this;
|
|
22
21
|
if (!this.valueMap.has(key)) {
|
|
23
|
-
_context2.next =
|
|
22
|
+
_context2.next = 5;
|
|
24
23
|
break;
|
|
25
24
|
}
|
|
26
25
|
return _context2.abrupt("return", Promise.resolve(this.valueMap.get(key)));
|
|
27
|
-
case
|
|
26
|
+
case 5:
|
|
28
27
|
if (!this.lockMap.get(key)) {
|
|
29
|
-
_context2.next =
|
|
28
|
+
_context2.next = 9;
|
|
30
29
|
break;
|
|
31
30
|
}
|
|
32
31
|
return _context2.abrupt("return", new Promise(function (resolve, reject) {
|
|
@@ -42,30 +41,29 @@ var SingletonInstanceMap = exports.SingletonInstanceMap = /*#__PURE__*/function
|
|
|
42
41
|
}, _callee);
|
|
43
42
|
})), 500);
|
|
44
43
|
}));
|
|
45
|
-
case
|
|
46
|
-
_context2.prev =
|
|
44
|
+
case 9:
|
|
45
|
+
_context2.prev = 9;
|
|
47
46
|
this.lockMap.set(key, true);
|
|
48
|
-
|
|
49
|
-
_context2.next = 15;
|
|
47
|
+
_context2.next = 13;
|
|
50
48
|
return this.createInstance(key, options);
|
|
51
|
-
case
|
|
49
|
+
case 13:
|
|
52
50
|
value = _context2.sent;
|
|
53
51
|
this.valueMap.set(key, value);
|
|
54
52
|
this.lockMap.set(key, false);
|
|
55
53
|
return _context2.abrupt("return", Promise.resolve(value));
|
|
56
|
-
case
|
|
57
|
-
_context2.prev =
|
|
58
|
-
_context2.t0 = _context2["catch"](
|
|
54
|
+
case 19:
|
|
55
|
+
_context2.prev = 19;
|
|
56
|
+
_context2.t0 = _context2["catch"](9);
|
|
59
57
|
throw _context2.t0;
|
|
60
|
-
case
|
|
61
|
-
_context2.prev =
|
|
58
|
+
case 22:
|
|
59
|
+
_context2.prev = 22;
|
|
62
60
|
this.lockMap.set(key, false);
|
|
63
|
-
return _context2.finish(
|
|
64
|
-
case
|
|
61
|
+
return _context2.finish(22);
|
|
62
|
+
case 25:
|
|
65
63
|
case "end":
|
|
66
64
|
return _context2.stop();
|
|
67
65
|
}
|
|
68
|
-
}, _callee2, this, [[
|
|
66
|
+
}, _callee2, this, [[9, 19, 22, 25]]);
|
|
69
67
|
}));
|
|
70
68
|
function getInstance(_x, _x2) {
|
|
71
69
|
return _getInstance.apply(this, arguments);
|
|
@@ -13,7 +13,8 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
13
13
|
var _react = require("react");
|
|
14
14
|
var _page2 = require("./page.load-schema");
|
|
15
15
|
var _reactRender = require("../../components/react-render");
|
|
16
|
-
var _excluded = ["container", "onClose"]
|
|
16
|
+
var _excluded = ["container", "onClose"],
|
|
17
|
+
_excluded2 = ["layout", "form"];
|
|
17
18
|
function showForm(options) {
|
|
18
19
|
var container = options.container,
|
|
19
20
|
onClose = options.onClose,
|
|
@@ -57,14 +58,19 @@ var FormRender = /*#__PURE__*/function (_Component) {
|
|
|
57
58
|
(0, _inheritsLoose2["default"])(FormRender, _Component);
|
|
58
59
|
var _proto = FormRender.prototype;
|
|
59
60
|
_proto.render = function render() {
|
|
60
|
-
var _this = this
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
var _this$props = this.props,
|
|
62
|
+
layout = _this$props.layout,
|
|
63
|
+
form = _this$props.form,
|
|
64
|
+
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, _excluded2);
|
|
65
|
+
return /*#__PURE__*/React.createElement(_page.PageLayout, {
|
|
66
|
+
layout: layout
|
|
67
|
+
}, /*#__PURE__*/React.createElement(_page2.PageLoadSchema, {
|
|
68
|
+
pageId: form.id
|
|
63
69
|
}, function (schema) {
|
|
64
70
|
return /*#__PURE__*/React.createElement(_reactRender.ReactRender, (0, _extends2["default"])({
|
|
65
71
|
schema: schema,
|
|
66
72
|
components: window.__components
|
|
67
|
-
},
|
|
73
|
+
}, restProps));
|
|
68
74
|
}));
|
|
69
75
|
};
|
|
70
76
|
return FormRender;
|
|
@@ -5,9 +5,12 @@ exports.__esModule = true;
|
|
|
5
5
|
exports.PageLoadSchema = PageLoadSchema;
|
|
6
6
|
var _result = _interopRequireDefault(require("antd/lib/result"));
|
|
7
7
|
var _spin = _interopRequireDefault(require("antd/lib/spin"));
|
|
8
|
+
var _message2 = _interopRequireDefault(require("antd/lib/message"));
|
|
8
9
|
var _react = require("react");
|
|
9
10
|
var _api = require("../api");
|
|
10
11
|
function PageLoadSchema(props) {
|
|
12
|
+
var pageId = props.pageId,
|
|
13
|
+
children = props.children;
|
|
11
14
|
var _useState = (0, _react.useState)(true),
|
|
12
15
|
loading = _useState[0],
|
|
13
16
|
setLoading = _useState[1];
|
|
@@ -18,14 +21,18 @@ function PageLoadSchema(props) {
|
|
|
18
21
|
errorMsg = _useState3[0],
|
|
19
22
|
setErrorMsg = _useState3[1];
|
|
20
23
|
(0, _react.useEffect)(function () {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
if (pageId) {
|
|
25
|
+
(0, _api.getSchema)(pageId).then(function (res) {
|
|
26
|
+
if (res.success) {
|
|
27
|
+
setLoading(false);
|
|
28
|
+
setSchema(res.data);
|
|
29
|
+
} else {
|
|
30
|
+
setErrorMsg(res.message);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
} else {
|
|
34
|
+
_message2["default"].error("页面id不可为空!").then();
|
|
35
|
+
}
|
|
29
36
|
}, []);
|
|
30
37
|
if (loading) {
|
|
31
38
|
return /*#__PURE__*/React.createElement(_spin["default"], {
|
|
@@ -38,5 +45,5 @@ function PageLoadSchema(props) {
|
|
|
38
45
|
title: errorMsg
|
|
39
46
|
});
|
|
40
47
|
}
|
|
41
|
-
return
|
|
48
|
+
return children(schema);
|
|
42
49
|
}
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|