@zhubangyun/lowcode-core 5.4.21 → 5.4.101
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 +0 -1
- package/es/index.js +0 -1
- package/es/style.js +4 -4
- package/es/utils/api/RestApi.d.ts +1 -1
- package/es/utils/api/RestApi.js +86 -60
- package/es/utils/{common → api}/UserInfo.d.ts +1 -1
- package/es/utils/api/UserInfo.js +39 -0
- package/es/utils/api/index.d.ts +4 -3
- package/es/utils/api/index.js +25 -12
- package/es/utils/cache/index.d.ts +12 -4
- package/es/utils/cache/index.js +21 -15
- package/es/utils/cache/schema.d.ts +29 -0
- package/es/utils/cache/schema.js +42 -0
- package/es/utils/common/SingletonInstanceMap.d.ts +3 -3
- package/es/utils/common/SingletonInstanceMap.js +4 -4
- package/es/utils/designer/assets/assets.data.base.js +1 -1
- package/es/utils/form/form.api.d.ts +4 -9
- package/es/utils/form/form.api.js +14 -135
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +2 -0
- package/es/utils/page/index.d.ts +1 -0
- package/es/utils/page/index.js +1 -0
- package/es/utils/page/page.form.d.ts +14 -0
- package/es/utils/page/page.form.js +66 -0
- package/es/utils/page/page.layout.d.ts +15 -0
- package/es/utils/page/page.layout.js +56 -0
- package/es/utils/page/page.load-schema.d.ts +4 -0
- package/es/utils/page/page.load-schema.js +37 -0
- package/es/utils/page/page.render.d.ts +2 -0
- package/es/utils/page/page.render.js +6 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/style.js +4 -4
- package/lib/utils/api/RestApi.d.ts +1 -1
- package/lib/utils/api/RestApi.js +86 -60
- package/lib/utils/{common → api}/UserInfo.d.ts +1 -1
- package/lib/utils/{common → api}/UserInfo.js +22 -2
- package/lib/utils/api/index.d.ts +4 -3
- package/lib/utils/api/index.js +28 -13
- package/lib/utils/cache/index.d.ts +12 -4
- package/lib/utils/cache/index.js +21 -15
- package/lib/utils/cache/schema.d.ts +29 -0
- package/lib/utils/cache/schema.js +47 -0
- package/lib/utils/common/SingletonInstanceMap.d.ts +3 -3
- package/lib/utils/common/SingletonInstanceMap.js +4 -4
- package/lib/utils/designer/assets/assets.data.base.js +1 -1
- package/lib/utils/form/form.api.d.ts +4 -9
- package/lib/utils/form/form.api.js +14 -135
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/page/index.d.ts +1 -0
- package/lib/utils/page/index.js +6 -0
- package/lib/utils/page/page.form.d.ts +14 -0
- package/lib/utils/page/page.form.js +71 -0
- package/lib/utils/page/page.layout.d.ts +15 -0
- package/lib/utils/page/page.layout.js +63 -0
- package/lib/utils/page/page.load-schema.d.ts +4 -0
- package/lib/utils/page/page.load-schema.js +42 -0
- package/lib/utils/page/page.render.d.ts +2 -0
- package/lib/utils/page/page.render.js +10 -0
- package/package.json +1 -1
- package/es/components/schema-render/components/assets.d.ts +0 -32
- package/es/components/schema-render/components/assets.js +0 -53
- package/es/components/schema-render/components/demo-schema.d.ts +0 -85
- package/es/components/schema-render/components/demo-schema.js +0 -107
- package/es/components/schema-render/components/schema-render-base.d.ts +0 -43
- package/es/components/schema-render/components/schema-render-base.js +0 -142
- package/es/components/schema-render/components/schema-render-layout.d.ts +0 -6
- package/es/components/schema-render/components/schema-render-layout.js +0 -46
- package/es/components/schema-render/index.d.ts +0 -31
- package/es/components/schema-render/index.js +0 -46
- package/es/utils/common/SubFormInstance.d.ts +0 -26
- package/es/utils/common/SubFormInstance.js +0 -100
- package/es/utils/common/UserInfo.js +0 -19
- package/es/utils/form/form.process.js +0 -0
- package/lib/components/schema-render/components/assets.d.ts +0 -32
- package/lib/components/schema-render/components/assets.js +0 -57
- package/lib/components/schema-render/components/demo-schema.d.ts +0 -85
- package/lib/components/schema-render/components/demo-schema.js +0 -111
- package/lib/components/schema-render/components/schema-render-base.d.ts +0 -43
- package/lib/components/schema-render/components/schema-render-base.js +0 -149
- package/lib/components/schema-render/components/schema-render-layout.d.ts +0 -6
- package/lib/components/schema-render/components/schema-render-layout.js +0 -51
- package/lib/components/schema-render/index.d.ts +0 -31
- package/lib/components/schema-render/index.js +0 -53
- package/lib/utils/common/SubFormInstance.d.ts +0 -26
- package/lib/utils/common/SubFormInstance.js +0 -105
- package/lib/utils/form/form.process.js +0 -1
- /package/es/utils/{form/form.handler.js → page/page.utils.js} +0 -0
- /package/lib/utils/{form/form.handler.js → page/page.utils.js} +0 -0
|
@@ -9,14 +9,16 @@ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inh
|
|
|
9
9
|
var _RestApi2 = require("../api/RestApi");
|
|
10
10
|
var _api = require("../api");
|
|
11
11
|
var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
12
|
-
function RestFormApi(formId, mock) {
|
|
12
|
+
function RestFormApi(formId, fieldId, mock) {
|
|
13
13
|
var _this;
|
|
14
14
|
_this = _RestApi.call(this, "forms", {}) || this;
|
|
15
15
|
_this.formId = void 0;
|
|
16
|
+
_this.fieldId = void 0;
|
|
16
17
|
_this.mock = void 0;
|
|
17
18
|
_this.initialized = false;
|
|
18
19
|
_this.schema = void 0;
|
|
19
20
|
_this.formId = formId;
|
|
21
|
+
_this.fieldId = formId;
|
|
20
22
|
_this.mock = !!mock;
|
|
21
23
|
return _this;
|
|
22
24
|
}
|
|
@@ -64,151 +66,28 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
64
66
|
}
|
|
65
67
|
return initialize;
|
|
66
68
|
}();
|
|
67
|
-
_proto.
|
|
68
|
-
var
|
|
69
|
+
_proto.handleRequestConfig = /*#__PURE__*/function () {
|
|
70
|
+
var _handleRequestConfig = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(config) {
|
|
69
71
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
70
72
|
while (1) switch (_context2.prev = _context2.next) {
|
|
71
73
|
case 0:
|
|
72
|
-
|
|
73
|
-
params = {};
|
|
74
|
-
}
|
|
75
|
-
if (page === void 0) {
|
|
76
|
-
page = 1;
|
|
77
|
-
}
|
|
78
|
-
if (pageSize === void 0) {
|
|
79
|
-
pageSize = 20;
|
|
80
|
-
}
|
|
81
|
-
_context2.next = 5;
|
|
74
|
+
_context2.next = 2;
|
|
82
75
|
return this.initialize();
|
|
83
|
-
case
|
|
84
|
-
|
|
76
|
+
case 2:
|
|
77
|
+
config.params = config.params || {};
|
|
78
|
+
config.params.formId = this.formId;
|
|
79
|
+
config.params.fieldId = this.fieldId;
|
|
80
|
+
config.params.mock = this.mock;
|
|
85
81
|
case 6:
|
|
86
82
|
case "end":
|
|
87
83
|
return _context2.stop();
|
|
88
84
|
}
|
|
89
85
|
}, _callee2, this);
|
|
90
86
|
}));
|
|
91
|
-
function
|
|
92
|
-
return
|
|
93
|
-
}
|
|
94
|
-
return search;
|
|
95
|
-
}();
|
|
96
|
-
_proto.getById = /*#__PURE__*/function () {
|
|
97
|
-
var _getById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id, options) {
|
|
98
|
-
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
99
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
100
|
-
case 0:
|
|
101
|
-
_context3.next = 2;
|
|
102
|
-
return this.initialize();
|
|
103
|
-
case 2:
|
|
104
|
-
return _context3.abrupt("return", _RestApi.prototype.getById.call(this, id, options));
|
|
105
|
-
case 3:
|
|
106
|
-
case "end":
|
|
107
|
-
return _context3.stop();
|
|
108
|
-
}
|
|
109
|
-
}, _callee3, this);
|
|
110
|
-
}));
|
|
111
|
-
function getById(_x4, _x5) {
|
|
112
|
-
return _getById.apply(this, arguments);
|
|
113
|
-
}
|
|
114
|
-
return getById;
|
|
115
|
-
}();
|
|
116
|
-
_proto.save = /*#__PURE__*/function () {
|
|
117
|
-
var _save = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(data, options) {
|
|
118
|
-
var config;
|
|
119
|
-
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
120
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
121
|
-
case 0:
|
|
122
|
-
_context4.next = 2;
|
|
123
|
-
return this.initialize();
|
|
124
|
-
case 2:
|
|
125
|
-
config = {};
|
|
126
|
-
this.handleRequestConfig(config);
|
|
127
|
-
return _context4.abrupt("return", _RestApi.prototype.save.call(this, data, options));
|
|
128
|
-
case 5:
|
|
129
|
-
case "end":
|
|
130
|
-
return _context4.stop();
|
|
131
|
-
}
|
|
132
|
-
}, _callee4, this);
|
|
133
|
-
}));
|
|
134
|
-
function save(_x6, _x7) {
|
|
135
|
-
return _save.apply(this, arguments);
|
|
136
|
-
}
|
|
137
|
-
return save;
|
|
138
|
-
}();
|
|
139
|
-
_proto.create = /*#__PURE__*/function () {
|
|
140
|
-
var _create = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(data, options) {
|
|
141
|
-
var config;
|
|
142
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
143
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
144
|
-
case 0:
|
|
145
|
-
_context5.next = 2;
|
|
146
|
-
return this.initialize();
|
|
147
|
-
case 2:
|
|
148
|
-
config = {};
|
|
149
|
-
this.handleRequestConfig(config);
|
|
150
|
-
return _context5.abrupt("return", _RestApi.prototype.create.call(this, data, options));
|
|
151
|
-
case 5:
|
|
152
|
-
case "end":
|
|
153
|
-
return _context5.stop();
|
|
154
|
-
}
|
|
155
|
-
}, _callee5, this);
|
|
156
|
-
}));
|
|
157
|
-
function create(_x8, _x9) {
|
|
158
|
-
return _create.apply(this, arguments);
|
|
159
|
-
}
|
|
160
|
-
return create;
|
|
161
|
-
}();
|
|
162
|
-
_proto.update = /*#__PURE__*/function () {
|
|
163
|
-
var _update = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id, data, options) {
|
|
164
|
-
var config;
|
|
165
|
-
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
166
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
167
|
-
case 0:
|
|
168
|
-
_context6.next = 2;
|
|
169
|
-
return this.initialize();
|
|
170
|
-
case 2:
|
|
171
|
-
config = {};
|
|
172
|
-
this.handleRequestConfig(config);
|
|
173
|
-
return _context6.abrupt("return", _RestApi.prototype.update.call(this, id, data, options));
|
|
174
|
-
case 5:
|
|
175
|
-
case "end":
|
|
176
|
-
return _context6.stop();
|
|
177
|
-
}
|
|
178
|
-
}, _callee6, this);
|
|
179
|
-
}));
|
|
180
|
-
function update(_x10, _x11, _x12) {
|
|
181
|
-
return _update.apply(this, arguments);
|
|
182
|
-
}
|
|
183
|
-
return update;
|
|
184
|
-
}();
|
|
185
|
-
_proto.deleteById = /*#__PURE__*/function () {
|
|
186
|
-
var _deleteById = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id, options) {
|
|
187
|
-
var config;
|
|
188
|
-
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
189
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
190
|
-
case 0:
|
|
191
|
-
_context7.next = 2;
|
|
192
|
-
return this.initialize();
|
|
193
|
-
case 2:
|
|
194
|
-
config = {};
|
|
195
|
-
this.handleRequestConfig(config);
|
|
196
|
-
return _context7.abrupt("return", _RestApi.prototype.deleteById.call(this, id, options));
|
|
197
|
-
case 5:
|
|
198
|
-
case "end":
|
|
199
|
-
return _context7.stop();
|
|
200
|
-
}
|
|
201
|
-
}, _callee7, this);
|
|
202
|
-
}));
|
|
203
|
-
function deleteById(_x13, _x14) {
|
|
204
|
-
return _deleteById.apply(this, arguments);
|
|
87
|
+
function handleRequestConfig(_x) {
|
|
88
|
+
return _handleRequestConfig.apply(this, arguments);
|
|
205
89
|
}
|
|
206
|
-
return
|
|
90
|
+
return handleRequestConfig;
|
|
207
91
|
}();
|
|
208
|
-
_proto.handleRequestConfig = function handleRequestConfig(config) {
|
|
209
|
-
config.params = config.params || {};
|
|
210
|
-
config.params.formId = this.formId;
|
|
211
|
-
config.params.mock = this.mock;
|
|
212
|
-
};
|
|
213
92
|
return RestFormApi;
|
|
214
93
|
}(_RestApi2.RestApi);
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import * as cache from "./cache";
|
|
|
2
2
|
import * as common from "./common";
|
|
3
3
|
import * as api from "./api";
|
|
4
4
|
import * as designer from "./designer";
|
|
5
|
+
import * as page from "./page";
|
|
5
6
|
declare const _default: {
|
|
6
7
|
api: typeof api;
|
|
7
8
|
cache: typeof cache;
|
|
9
|
+
page: typeof page;
|
|
8
10
|
designer: typeof designer;
|
|
9
11
|
common: typeof common;
|
|
10
12
|
};
|
package/lib/utils/index.js
CHANGED
|
@@ -6,11 +6,13 @@ var cache = _interopRequireWildcard(require("./cache"));
|
|
|
6
6
|
var common = _interopRequireWildcard(require("./common"));
|
|
7
7
|
var api = _interopRequireWildcard(require("./api"));
|
|
8
8
|
var designer = _interopRequireWildcard(require("./designer"));
|
|
9
|
+
var page = _interopRequireWildcard(require("./page"));
|
|
9
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
11
12
|
var _default = exports["default"] = {
|
|
12
13
|
api: api,
|
|
13
14
|
cache: cache,
|
|
15
|
+
page: page,
|
|
14
16
|
designer: designer,
|
|
15
17
|
common: common
|
|
16
18
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { showForm } from "./page.form";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PageLayout } from "./page.layout";
|
|
2
|
+
interface ShowFormOptions {
|
|
3
|
+
container?: HTMLDivElement;
|
|
4
|
+
layout?: PageLayout;
|
|
5
|
+
form: {
|
|
6
|
+
id: string;
|
|
7
|
+
fieldId?: string;
|
|
8
|
+
};
|
|
9
|
+
mode?: "add" | "edit" | "copy" | "detail";
|
|
10
|
+
dataId?: string;
|
|
11
|
+
onClose?: (data: any) => void | Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare function showForm(options: ShowFormOptions): void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.showForm = showForm;
|
|
6
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
var _page = require("./page.layout");
|
|
12
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
|
+
var _react = require("react");
|
|
14
|
+
var _page2 = require("./page.load-schema");
|
|
15
|
+
var _reactRender = require("../../components/react-render");
|
|
16
|
+
var _excluded = ["container", "onClose"];
|
|
17
|
+
function showForm(options) {
|
|
18
|
+
var container = options.container,
|
|
19
|
+
onClose = options.onClose,
|
|
20
|
+
restProps = (0, _objectWithoutPropertiesLoose2["default"])(options, _excluded);
|
|
21
|
+
//容器不存在需要手动取消挂载
|
|
22
|
+
var unmount = !container;
|
|
23
|
+
if (!container) {
|
|
24
|
+
container = document.createElement("div");
|
|
25
|
+
document.body.append(container);
|
|
26
|
+
}
|
|
27
|
+
_reactDom["default"].render( /*#__PURE__*/React.createElement(FormRender, (0, _extends2["default"])({}, restProps, {
|
|
28
|
+
onClose: ( /*#__PURE__*/function () {
|
|
29
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
|
30
|
+
var _container;
|
|
31
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
if (unmount) {
|
|
35
|
+
//取消挂载
|
|
36
|
+
_reactDom["default"].unmountComponentAtNode(container);
|
|
37
|
+
//移除
|
|
38
|
+
(_container = container) === null || _container === void 0 ? void 0 : _container.remove();
|
|
39
|
+
}
|
|
40
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(data);
|
|
41
|
+
case 2:
|
|
42
|
+
case "end":
|
|
43
|
+
return _context.stop();
|
|
44
|
+
}
|
|
45
|
+
}, _callee);
|
|
46
|
+
}));
|
|
47
|
+
return function (_x) {
|
|
48
|
+
return _ref.apply(this, arguments);
|
|
49
|
+
};
|
|
50
|
+
}())
|
|
51
|
+
})), container);
|
|
52
|
+
}
|
|
53
|
+
var FormRender = /*#__PURE__*/function (_Component) {
|
|
54
|
+
function FormRender() {
|
|
55
|
+
return _Component.apply(this, arguments) || this;
|
|
56
|
+
}
|
|
57
|
+
(0, _inheritsLoose2["default"])(FormRender, _Component);
|
|
58
|
+
var _proto = FormRender.prototype;
|
|
59
|
+
_proto.render = function render() {
|
|
60
|
+
var _this = this;
|
|
61
|
+
return /*#__PURE__*/React.createElement(_page.PageLayout, null, /*#__PURE__*/React.createElement(_page2.PageLoadSchema, {
|
|
62
|
+
pageId: this.props.form.id
|
|
63
|
+
}, function (schema) {
|
|
64
|
+
return /*#__PURE__*/React.createElement(_reactRender.ReactRender, (0, _extends2["default"])({
|
|
65
|
+
schema: schema,
|
|
66
|
+
components: window.__components
|
|
67
|
+
}, _this.props));
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
70
|
+
return FormRender;
|
|
71
|
+
}(_react.Component);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component } from "react";
|
|
2
|
+
export declare type PageLayoutType = "page" | "modal" | "drawer";
|
|
3
|
+
interface PageLayoutProps {
|
|
4
|
+
layout?: PageLayoutType;
|
|
5
|
+
children: any;
|
|
6
|
+
}
|
|
7
|
+
interface PageLayoutState {
|
|
8
|
+
open: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class PageLayout extends Component<PageLayoutProps, PageLayoutState> {
|
|
11
|
+
state: PageLayoutState;
|
|
12
|
+
close: () => void;
|
|
13
|
+
render(): any;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.PageLayout = void 0;
|
|
6
|
+
var _drawer = _interopRequireDefault(require("antd/lib/drawer"));
|
|
7
|
+
var _modal = _interopRequireDefault(require("antd/lib/modal"));
|
|
8
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
12
|
+
var PageLayout = exports.PageLayout = /*#__PURE__*/function (_Component) {
|
|
13
|
+
function PageLayout() {
|
|
14
|
+
var _this;
|
|
15
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16
|
+
args[_key] = arguments[_key];
|
|
17
|
+
}
|
|
18
|
+
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
19
|
+
_this.state = {
|
|
20
|
+
open: true
|
|
21
|
+
};
|
|
22
|
+
_this.close = function () {
|
|
23
|
+
_this.setState({
|
|
24
|
+
open: false
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
(0, _inheritsLoose2["default"])(PageLayout, _Component);
|
|
30
|
+
var _proto = PageLayout.prototype;
|
|
31
|
+
_proto.render = function render() {
|
|
32
|
+
var _this$props = this.props,
|
|
33
|
+
layout = _this$props.layout,
|
|
34
|
+
children = _this$props.children;
|
|
35
|
+
var state = this.state;
|
|
36
|
+
var restProps = {
|
|
37
|
+
open: state.open,
|
|
38
|
+
footer: false,
|
|
39
|
+
closable: false,
|
|
40
|
+
styles: {
|
|
41
|
+
header: {
|
|
42
|
+
display: "none"
|
|
43
|
+
},
|
|
44
|
+
body: {
|
|
45
|
+
padding: 0
|
|
46
|
+
},
|
|
47
|
+
content: {
|
|
48
|
+
padding: 0
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
onClose: this.close,
|
|
52
|
+
keyboard: false,
|
|
53
|
+
maskClosable: false
|
|
54
|
+
};
|
|
55
|
+
if (layout == "modal") {
|
|
56
|
+
return /*#__PURE__*/_react["default"].createElement(_modal["default"], restProps, children);
|
|
57
|
+
} else if (layout == "drawer") {
|
|
58
|
+
return /*#__PURE__*/_react["default"].createElement(_drawer["default"], restProps, children);
|
|
59
|
+
}
|
|
60
|
+
return children;
|
|
61
|
+
};
|
|
62
|
+
return PageLayout;
|
|
63
|
+
}(_react.Component);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.PageLoadSchema = PageLoadSchema;
|
|
6
|
+
var _result = _interopRequireDefault(require("antd/lib/result"));
|
|
7
|
+
var _spin = _interopRequireDefault(require("antd/lib/spin"));
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _api = require("../api");
|
|
10
|
+
function PageLoadSchema(props) {
|
|
11
|
+
var _useState = (0, _react.useState)(true),
|
|
12
|
+
loading = _useState[0],
|
|
13
|
+
setLoading = _useState[1];
|
|
14
|
+
var _useState2 = (0, _react.useState)(),
|
|
15
|
+
schema = _useState2[0],
|
|
16
|
+
setSchema = _useState2[1];
|
|
17
|
+
var _useState3 = (0, _react.useState)(),
|
|
18
|
+
errorMsg = _useState3[0],
|
|
19
|
+
setErrorMsg = _useState3[1];
|
|
20
|
+
(0, _react.useEffect)(function () {
|
|
21
|
+
(0, _api.getSchema)(props.pageId).then(function (res) {
|
|
22
|
+
if (res.success) {
|
|
23
|
+
setLoading(false);
|
|
24
|
+
setSchema(res.data);
|
|
25
|
+
} else {
|
|
26
|
+
setErrorMsg(res.message);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}, []);
|
|
30
|
+
if (loading) {
|
|
31
|
+
return /*#__PURE__*/React.createElement(_spin["default"], {
|
|
32
|
+
spinning: true
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (!schema) {
|
|
36
|
+
return /*#__PURE__*/React.createElement(_result["default"], {
|
|
37
|
+
status: 500,
|
|
38
|
+
title: errorMsg
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return props.children(schema);
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
packages: ({
|
|
3
|
-
package: string;
|
|
4
|
-
version: string;
|
|
5
|
-
library: string;
|
|
6
|
-
urls: string[];
|
|
7
|
-
title?: undefined;
|
|
8
|
-
description?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
title: string;
|
|
11
|
-
package: string;
|
|
12
|
-
version: string;
|
|
13
|
-
description: string;
|
|
14
|
-
urls: string[];
|
|
15
|
-
library: string;
|
|
16
|
-
})[];
|
|
17
|
-
components: {
|
|
18
|
-
exportName: string;
|
|
19
|
-
npm: {
|
|
20
|
-
package: string;
|
|
21
|
-
version: string;
|
|
22
|
-
};
|
|
23
|
-
url: string;
|
|
24
|
-
}[];
|
|
25
|
-
sort: {
|
|
26
|
-
groupList: string[];
|
|
27
|
-
categoryList: string[];
|
|
28
|
-
};
|
|
29
|
-
groupList: string[];
|
|
30
|
-
ignoreComponents: {};
|
|
31
|
-
};
|
|
32
|
-
export default _default;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
"packages": [{
|
|
3
|
-
"package": "root-material",
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"library": "RootMaterial",
|
|
6
|
-
"urls": ["https://cdn.zhiyunhe.com/plugin/lowcode/materials/root/view.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/root/view.css"]
|
|
7
|
-
}, {
|
|
8
|
-
"package": "antd-material",
|
|
9
|
-
"version": "0.1.0",
|
|
10
|
-
"library": "AntdMaterial",
|
|
11
|
-
"urls": ["https://cdn.zhiyunhe.com/plugin/dayjs/dayjs.min.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd/view.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd/view.css"]
|
|
12
|
-
}, {
|
|
13
|
-
"title": "fusion组件库",
|
|
14
|
-
"package": "@alifd/next",
|
|
15
|
-
"version": "1.26.4",
|
|
16
|
-
"description": "不可删除否则会出问题",
|
|
17
|
-
"urls": ["https://g.alicdn.com/code/lib/alifd__next/1.26.4/next-with-locales.min.js"],
|
|
18
|
-
"library": "Next"
|
|
19
|
-
}, {
|
|
20
|
-
"package": "chart-material",
|
|
21
|
-
"version": "0.1.0",
|
|
22
|
-
"library": "ChartMaterial",
|
|
23
|
-
"urls": ["https://cdn.zhiyunhe.com/plugin/antv/g2/5.1.19/g2.min.js", "https://cdn.zhiyunhe.com/plugin/datav/1.2.5/datav.min.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/chart/view.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/chart/view.css"]
|
|
24
|
-
}],
|
|
25
|
-
"components": [{
|
|
26
|
-
"exportName": "RootMaterialMeta",
|
|
27
|
-
"npm": {
|
|
28
|
-
"package": "root-material",
|
|
29
|
-
"version": "1.0.0"
|
|
30
|
-
},
|
|
31
|
-
"url": "https://cdn.zhiyunhe.com/plugin/lowcode/materials/root/meta.js"
|
|
32
|
-
}, {
|
|
33
|
-
"exportName": "AntdMaterialMeta",
|
|
34
|
-
"npm": {
|
|
35
|
-
"package": "antd-material",
|
|
36
|
-
"version": "1.0.0"
|
|
37
|
-
},
|
|
38
|
-
"url": "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd/meta.js"
|
|
39
|
-
}, {
|
|
40
|
-
"exportName": "ChartMaterialMeta",
|
|
41
|
-
"npm": {
|
|
42
|
-
"package": "chart-material",
|
|
43
|
-
"version": "1.0.0"
|
|
44
|
-
},
|
|
45
|
-
"url": "https://cdn.zhiyunhe.com/plugin/lowcode/materials/chart/meta.js"
|
|
46
|
-
}],
|
|
47
|
-
"sort": {
|
|
48
|
-
"groupList": ["", "默认分组", "原子组件", "精选组件", "图表组件"],
|
|
49
|
-
"categoryList": ["布局", "通用", "导航", "数据录入", "数据展示", "反馈", "大屏组件", "图表", "基础元素", "表格类", "表单详情类", "帮助类", "对话框类", "业务类", "引导", "信息输入", "信息展示", "信息反馈", "布局容器类"]
|
|
50
|
-
},
|
|
51
|
-
"groupList": ["默认分组", "原子组件", "精选组件", "图表组件"],
|
|
52
|
-
"ignoreComponents": {}
|
|
53
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
componentName: string;
|
|
3
|
-
props: {
|
|
4
|
-
ref: string;
|
|
5
|
-
style: {
|
|
6
|
-
height: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
dataSource: {
|
|
10
|
-
list: any[];
|
|
11
|
-
};
|
|
12
|
-
css: string;
|
|
13
|
-
hidden: boolean;
|
|
14
|
-
title: string;
|
|
15
|
-
isLocked: boolean;
|
|
16
|
-
condition: boolean;
|
|
17
|
-
conditionGroup: string;
|
|
18
|
-
state: {
|
|
19
|
-
isShowDialog: {
|
|
20
|
-
type: string;
|
|
21
|
-
value: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
methods: {
|
|
25
|
-
openDialog: {
|
|
26
|
-
type: string;
|
|
27
|
-
value: string;
|
|
28
|
-
source: string;
|
|
29
|
-
};
|
|
30
|
-
closeDialog: {
|
|
31
|
-
type: string;
|
|
32
|
-
value: string;
|
|
33
|
-
source: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
lifeCycles: {
|
|
37
|
-
componentDidMount: {
|
|
38
|
-
type: string;
|
|
39
|
-
value: string;
|
|
40
|
-
source: string;
|
|
41
|
-
};
|
|
42
|
-
componentWillUnmount: {
|
|
43
|
-
type: string;
|
|
44
|
-
value: string;
|
|
45
|
-
source: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
children: {
|
|
49
|
-
componentName: string;
|
|
50
|
-
props: {};
|
|
51
|
-
hidden: boolean;
|
|
52
|
-
title: string;
|
|
53
|
-
isLocked: boolean;
|
|
54
|
-
condition: boolean;
|
|
55
|
-
conditionGroup: string;
|
|
56
|
-
children: ({
|
|
57
|
-
componentName: string;
|
|
58
|
-
props: {};
|
|
59
|
-
hidden: boolean;
|
|
60
|
-
title: string;
|
|
61
|
-
isLocked: boolean;
|
|
62
|
-
condition: boolean;
|
|
63
|
-
conditionGroup: string;
|
|
64
|
-
children?: undefined;
|
|
65
|
-
} | {
|
|
66
|
-
componentName: string;
|
|
67
|
-
props: {};
|
|
68
|
-
hidden: boolean;
|
|
69
|
-
title: string;
|
|
70
|
-
isLocked: boolean;
|
|
71
|
-
condition: boolean;
|
|
72
|
-
conditionGroup: string;
|
|
73
|
-
children: {
|
|
74
|
-
componentName: string;
|
|
75
|
-
props: {};
|
|
76
|
-
hidden: boolean;
|
|
77
|
-
title: string;
|
|
78
|
-
isLocked: boolean;
|
|
79
|
-
condition: boolean;
|
|
80
|
-
conditionGroup: string;
|
|
81
|
-
}[];
|
|
82
|
-
})[];
|
|
83
|
-
}[];
|
|
84
|
-
};
|
|
85
|
-
export default _default;
|