@zhubangyun/lowcode-core 5.4.103 → 5.4.104
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/style.js
CHANGED
|
@@ -2,9 +2,9 @@ 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
|
-
import { PageLayout } from "./page.layout";
|
|
8
8
|
import ReactDOM from "react-dom";
|
|
9
9
|
import { Component } from "react";
|
|
10
10
|
import { PageLoadSchema } from "./page.load-schema";
|
|
@@ -52,15 +52,18 @@ var FormRender = /*#__PURE__*/function (_Component) {
|
|
|
52
52
|
_inheritsLoose(FormRender, _Component);
|
|
53
53
|
var _proto = FormRender.prototype;
|
|
54
54
|
_proto.render = function render() {
|
|
55
|
-
var _this = this
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
var _this$props = this.props,
|
|
56
|
+
layout = _this$props.layout,
|
|
57
|
+
form = _this$props.form,
|
|
58
|
+
restProps = _objectWithoutPropertiesLoose(_this$props, _excluded2);
|
|
59
|
+
return /*#__PURE__*/React.createElement(PageLoadSchema, {
|
|
60
|
+
pageId: form.id
|
|
58
61
|
}, function (schema) {
|
|
59
62
|
return /*#__PURE__*/React.createElement(ReactRender, _extends({
|
|
60
63
|
schema: schema,
|
|
61
64
|
components: window.__components
|
|
62
|
-
},
|
|
63
|
-
})
|
|
65
|
+
}, restProps));
|
|
66
|
+
});
|
|
64
67
|
};
|
|
65
68
|
return FormRender;
|
|
66
69
|
}(Component);
|
|
@@ -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/style.js
CHANGED
|
@@ -8,12 +8,12 @@ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inh
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
-
var _page = require("./page.layout");
|
|
12
11
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
12
|
var _react = require("react");
|
|
14
|
-
var
|
|
13
|
+
var _page = require("./page.load-schema");
|
|
15
14
|
var _reactRender = require("../../components/react-render");
|
|
16
|
-
var _excluded = ["container", "onClose"]
|
|
15
|
+
var _excluded = ["container", "onClose"],
|
|
16
|
+
_excluded2 = ["layout", "form"];
|
|
17
17
|
function showForm(options) {
|
|
18
18
|
var container = options.container,
|
|
19
19
|
onClose = options.onClose,
|
|
@@ -57,15 +57,18 @@ var FormRender = /*#__PURE__*/function (_Component) {
|
|
|
57
57
|
(0, _inheritsLoose2["default"])(FormRender, _Component);
|
|
58
58
|
var _proto = FormRender.prototype;
|
|
59
59
|
_proto.render = function render() {
|
|
60
|
-
var _this = this
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
var _this$props = this.props,
|
|
61
|
+
layout = _this$props.layout,
|
|
62
|
+
form = _this$props.form,
|
|
63
|
+
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, _excluded2);
|
|
64
|
+
return /*#__PURE__*/React.createElement(_page.PageLoadSchema, {
|
|
65
|
+
pageId: form.id
|
|
63
66
|
}, function (schema) {
|
|
64
67
|
return /*#__PURE__*/React.createElement(_reactRender.ReactRender, (0, _extends2["default"])({
|
|
65
68
|
schema: schema,
|
|
66
69
|
components: window.__components
|
|
67
|
-
},
|
|
68
|
-
})
|
|
70
|
+
}, restProps));
|
|
71
|
+
});
|
|
69
72
|
};
|
|
70
73
|
return FormRender;
|
|
71
74
|
}(_react.Component);
|
|
@@ -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
|
}
|