@zhubangyun/lowcode-core 5.4.261 → 5.4.292
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/components/page-lading/index.d.ts +7 -0
- package/es/components/page-lading/index.js +25 -0
- package/es/components/page-lading/index.less +97 -0
- package/es/index.less +0 -97
- package/es/utils/api/form-api.js +22 -6
- package/es/utils/api/index.js +3 -1
- package/es/utils/api/rest-api.d.ts +14 -1
- package/es/utils/api/rest-api.js +14 -25
- package/es/utils/cache/schema.d.ts +2 -2
- package/es/utils/cache/schema.js +5 -1
- package/es/utils/designer/assets/assets.data.base.js +1 -1
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +2 -0
- package/es/utils/page/page-load-schema.js +7 -15
- package/lib/components/page-lading/index.d.ts +7 -0
- package/lib/components/page-lading/index.js +29 -0
- package/lib/components/page-lading/index.less +97 -0
- package/lib/index.less +0 -97
- package/lib/utils/api/form-api.js +22 -6
- package/lib/utils/api/index.js +3 -1
- package/lib/utils/api/rest-api.d.ts +14 -1
- package/lib/utils/api/rest-api.js +14 -25
- package/lib/utils/cache/schema.d.ts +2 -2
- package/lib/utils/cache/schema.js +5 -1
- package/lib/utils/designer/assets/assets.data.base.js +1 -1
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/page/page-load-schema.js +7 -15
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
export function PageLading(props) {
|
|
4
|
+
var style = props.style,
|
|
5
|
+
loading = props.loading;
|
|
6
|
+
if (!loading) {
|
|
7
|
+
return /*#__PURE__*/React.createElement(Fragment, null);
|
|
8
|
+
}
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: "page-loading",
|
|
11
|
+
style: style
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: "atom-spinner"
|
|
14
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: "spinner-inner"
|
|
16
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: "spinner-line"
|
|
18
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: "spinner-line"
|
|
20
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "spinner-line"
|
|
22
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: "spinner-circle"
|
|
24
|
+
}))));
|
|
25
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#fullscreen-loading {
|
|
2
|
+
position: fixed;
|
|
3
|
+
width: 100vw;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
top: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
z-index: 10;
|
|
8
|
+
background: white;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.page-loading {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
z-index: 10;
|
|
19
|
+
background: white;
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.atom-spinner, .atom-spinner * {
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.atom-spinner {
|
|
31
|
+
height: 60px;
|
|
32
|
+
width: 60px;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.atom-spinner .spinner-inner {
|
|
37
|
+
position: relative;
|
|
38
|
+
display: block;
|
|
39
|
+
height: 100%;
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.atom-spinner .spinner-circle {
|
|
44
|
+
display: block;
|
|
45
|
+
position: absolute;
|
|
46
|
+
color: #1677ff;
|
|
47
|
+
font-size: calc(60px * 0.24);
|
|
48
|
+
top: 50%;
|
|
49
|
+
left: 50%;
|
|
50
|
+
transform: translate(-50%, -50%);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.atom-spinner .spinner-line {
|
|
54
|
+
position: absolute;
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
border-left-width: calc(60px / 25);
|
|
59
|
+
border-top-width: calc(60px / 25);
|
|
60
|
+
border-left-color: #1677ff;
|
|
61
|
+
border-left-style: solid;
|
|
62
|
+
border-top-style: solid;
|
|
63
|
+
border-top-color: transparent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.atom-spinner .spinner-line:nth-child(1) {
|
|
67
|
+
animation: atom-spinner-animation-1 1s linear infinite;
|
|
68
|
+
transform: rotateZ(120deg) rotateX(66deg) rotateZ(0deg);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.atom-spinner .spinner-line:nth-child(2) {
|
|
72
|
+
animation: atom-spinner-animation-2 1s linear infinite;
|
|
73
|
+
transform: rotateZ(240deg) rotateX(66deg) rotateZ(0deg);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.atom-spinner .spinner-line:nth-child(3) {
|
|
77
|
+
animation: atom-spinner-animation-3 1s linear infinite;
|
|
78
|
+
transform: rotateZ(360deg) rotateX(66deg) rotateZ(0deg);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@keyframes atom-spinner-animation-1 {
|
|
82
|
+
100% {
|
|
83
|
+
transform: rotateZ(120deg) rotateX(66deg) rotateZ(360deg);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@keyframes atom-spinner-animation-2 {
|
|
88
|
+
100% {
|
|
89
|
+
transform: rotateZ(240deg) rotateX(66deg) rotateZ(360deg);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@keyframes atom-spinner-animation-3 {
|
|
94
|
+
100% {
|
|
95
|
+
transform: rotateZ(360deg) rotateX(66deg) rotateZ(360deg);
|
|
96
|
+
}
|
|
97
|
+
}
|
package/es/index.less
CHANGED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
#fullscreen-loading {
|
|
2
|
-
position: fixed;
|
|
3
|
-
width: 100vw;
|
|
4
|
-
height: 100vh;
|
|
5
|
-
top: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
z-index: 10;
|
|
8
|
-
background: white;
|
|
9
|
-
display: flex;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.page-loading {
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
z-index: 10;
|
|
19
|
-
background: white;
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.atom-spinner, .atom-spinner * {
|
|
27
|
-
box-sizing: border-box;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.atom-spinner {
|
|
31
|
-
height: 60px;
|
|
32
|
-
width: 60px;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.atom-spinner .spinner-inner {
|
|
37
|
-
position: relative;
|
|
38
|
-
display: block;
|
|
39
|
-
height: 100%;
|
|
40
|
-
width: 100%;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.atom-spinner .spinner-circle {
|
|
44
|
-
display: block;
|
|
45
|
-
position: absolute;
|
|
46
|
-
color: #1677ff;
|
|
47
|
-
font-size: calc(60px * 0.24);
|
|
48
|
-
top: 50%;
|
|
49
|
-
left: 50%;
|
|
50
|
-
transform: translate(-50%, -50%);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.atom-spinner .spinner-line {
|
|
54
|
-
position: absolute;
|
|
55
|
-
width: 100%;
|
|
56
|
-
height: 100%;
|
|
57
|
-
border-radius: 50%;
|
|
58
|
-
border-left-width: calc(60px / 25);
|
|
59
|
-
border-top-width: calc(60px / 25);
|
|
60
|
-
border-left-color: #1677ff;
|
|
61
|
-
border-left-style: solid;
|
|
62
|
-
border-top-style: solid;
|
|
63
|
-
border-top-color: transparent;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.atom-spinner .spinner-line:nth-child(1) {
|
|
67
|
-
animation: atom-spinner-animation-1 1s linear infinite;
|
|
68
|
-
transform: rotateZ(120deg) rotateX(66deg) rotateZ(0deg);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.atom-spinner .spinner-line:nth-child(2) {
|
|
72
|
-
animation: atom-spinner-animation-2 1s linear infinite;
|
|
73
|
-
transform: rotateZ(240deg) rotateX(66deg) rotateZ(0deg);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.atom-spinner .spinner-line:nth-child(3) {
|
|
77
|
-
animation: atom-spinner-animation-3 1s linear infinite;
|
|
78
|
-
transform: rotateZ(360deg) rotateX(66deg) rotateZ(0deg);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@keyframes atom-spinner-animation-1 {
|
|
82
|
-
100% {
|
|
83
|
-
transform: rotateZ(120deg) rotateX(66deg) rotateZ(360deg);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@keyframes atom-spinner-animation-2 {
|
|
88
|
-
100% {
|
|
89
|
-
transform: rotateZ(240deg) rotateX(66deg) rotateZ(360deg);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@keyframes atom-spinner-animation-3 {
|
|
94
|
-
100% {
|
|
95
|
-
transform: rotateZ(360deg) rotateX(66deg) rotateZ(360deg);
|
|
96
|
-
}
|
|
97
|
-
}
|
package/es/utils/api/form-api.js
CHANGED
|
@@ -21,6 +21,7 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
21
21
|
var _proto = RestFormApi.prototype;
|
|
22
22
|
_proto.initialize = /*#__PURE__*/function () {
|
|
23
23
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
24
|
+
var _this2 = this;
|
|
24
25
|
var res;
|
|
25
26
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
26
27
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -38,10 +39,25 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
38
39
|
res = _context.sent;
|
|
39
40
|
this.schema = res.data;
|
|
40
41
|
this.initialized = !!this.schema;
|
|
41
|
-
|
|
42
|
+
this.title = this.schema.label;
|
|
43
|
+
if (this.fieldId) {
|
|
44
|
+
JSON.stringify(this.schema, function (key, value) {
|
|
45
|
+
var _value$props;
|
|
46
|
+
if (key == "fdmSchema") {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
if ((value === null || value === void 0 ? void 0 : (_value$props = value.props) === null || _value$props === void 0 ? void 0 : _value$props.fieldId) === _this2.fieldId) {
|
|
50
|
+
if (value.props.label) {
|
|
51
|
+
_this2.title += "." + value.props.label;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return value;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
_context.next = 18;
|
|
42
58
|
break;
|
|
43
|
-
case
|
|
44
|
-
_context.prev =
|
|
59
|
+
case 14:
|
|
60
|
+
_context.prev = 14;
|
|
45
61
|
_context.t0 = _context["catch"](4);
|
|
46
62
|
console.log("获取schema失败!", {
|
|
47
63
|
formId: this.formId,
|
|
@@ -49,13 +65,13 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
49
65
|
mock: this.mock
|
|
50
66
|
}, _context.t0);
|
|
51
67
|
throw _context.t0;
|
|
52
|
-
case
|
|
68
|
+
case 18:
|
|
53
69
|
return _context.abrupt("return", this.initialized);
|
|
54
|
-
case
|
|
70
|
+
case 19:
|
|
55
71
|
case "end":
|
|
56
72
|
return _context.stop();
|
|
57
73
|
}
|
|
58
|
-
}, _callee, this, [[4,
|
|
74
|
+
}, _callee, this, [[4, 14]]);
|
|
59
75
|
}));
|
|
60
76
|
function initialize() {
|
|
61
77
|
return _initialize.apply(this, arguments);
|
package/es/utils/api/index.js
CHANGED
|
@@ -59,7 +59,9 @@ function _getFormApi() {
|
|
|
59
59
|
mock = window.__mock;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
key =
|
|
62
|
+
key = [formId, fieldId, mock ? "mock" : ""].filter(function (key) {
|
|
63
|
+
return !!key;
|
|
64
|
+
}).join("_");
|
|
63
65
|
_context2.next = 4;
|
|
64
66
|
return formApi.getInstance(key, {
|
|
65
67
|
mock: mock,
|
|
@@ -10,13 +10,26 @@ export interface RestApiOptions {
|
|
|
10
10
|
*/
|
|
11
11
|
title?: string;
|
|
12
12
|
}
|
|
13
|
+
export interface FilterRule {
|
|
14
|
+
connector?: "and" | "or";
|
|
15
|
+
key: string;
|
|
16
|
+
operator?: OperatorType;
|
|
17
|
+
value: any;
|
|
18
|
+
rules?: FilterRule[];
|
|
19
|
+
}
|
|
20
|
+
export declare type OperatorType = "eq" | "ne" | "gt" | "goe" | "lt" | "loe" | "like" | "notLike" | "in" | "notIn" | "isNull" | "isNotNull" | "between" | "notBetween";
|
|
21
|
+
export interface RestSearchParams {
|
|
22
|
+
page?: number;
|
|
23
|
+
pageSize?: number;
|
|
24
|
+
filterRules?: FilterRule[];
|
|
25
|
+
}
|
|
13
26
|
export declare abstract class BaseRestApi<DataType> {
|
|
14
27
|
uri: string;
|
|
15
28
|
title: string;
|
|
16
29
|
request: AxiosInstance;
|
|
17
30
|
protected constructor(uri: string, options?: RestApiOptions);
|
|
18
31
|
abstract handleRequestConfig(config: AxiosRequestConfig): void;
|
|
19
|
-
search(params?:
|
|
32
|
+
search(params?: RestSearchParams): Promise<ManyResult<DataType>>;
|
|
20
33
|
/**
|
|
21
34
|
* 通过id获取
|
|
22
35
|
* @param id
|
package/es/utils/api/rest-api.js
CHANGED
|
@@ -24,42 +24,31 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
24
24
|
}
|
|
25
25
|
var _proto = BaseRestApi.prototype;
|
|
26
26
|
_proto.search = /*#__PURE__*/function () {
|
|
27
|
-
var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params
|
|
27
|
+
var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
28
28
|
var _this$handleRequestCo;
|
|
29
29
|
var config;
|
|
30
30
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
31
31
|
while (1) switch (_context.prev = _context.next) {
|
|
32
32
|
case 0:
|
|
33
|
-
if (params === void 0) {
|
|
34
|
-
params = {};
|
|
35
|
-
}
|
|
36
|
-
if (page === void 0) {
|
|
37
|
-
page = 1;
|
|
38
|
-
}
|
|
39
|
-
if (pageSize === void 0) {
|
|
40
|
-
pageSize = 20;
|
|
41
|
-
}
|
|
42
|
-
params.page = page;
|
|
43
|
-
params.pageSize = pageSize;
|
|
44
33
|
config = {
|
|
45
34
|
params: params
|
|
46
35
|
};
|
|
47
|
-
_context.next =
|
|
36
|
+
_context.next = 3;
|
|
48
37
|
return (_this$handleRequestCo = this.handleRequestConfig) === null || _this$handleRequestCo === void 0 ? void 0 : _this$handleRequestCo.call(this, config);
|
|
49
|
-
case
|
|
50
|
-
_context.next =
|
|
38
|
+
case 3:
|
|
39
|
+
_context.next = 5;
|
|
51
40
|
return this.request.get("", {
|
|
52
41
|
params: params
|
|
53
42
|
});
|
|
54
|
-
case
|
|
43
|
+
case 5:
|
|
55
44
|
return _context.abrupt("return", _context.sent);
|
|
56
|
-
case
|
|
45
|
+
case 6:
|
|
57
46
|
case "end":
|
|
58
47
|
return _context.stop();
|
|
59
48
|
}
|
|
60
49
|
}, _callee, this);
|
|
61
50
|
}));
|
|
62
|
-
function search(_x
|
|
51
|
+
function search(_x) {
|
|
63
52
|
return _search.apply(this, arguments);
|
|
64
53
|
}
|
|
65
54
|
return search;
|
|
@@ -108,7 +97,7 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
108
97
|
}
|
|
109
98
|
}, _callee2, this);
|
|
110
99
|
}));
|
|
111
|
-
function getById(
|
|
100
|
+
function getById(_x2, _x3) {
|
|
112
101
|
return _getById.apply(this, arguments);
|
|
113
102
|
}
|
|
114
103
|
return getById;
|
|
@@ -149,7 +138,7 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
149
138
|
}
|
|
150
139
|
}, _callee3, this);
|
|
151
140
|
}));
|
|
152
|
-
function save(
|
|
141
|
+
function save(_x4, _x5) {
|
|
153
142
|
return _save.apply(this, arguments);
|
|
154
143
|
}
|
|
155
144
|
return save;
|
|
@@ -196,7 +185,7 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
196
185
|
}
|
|
197
186
|
}, _callee4, this);
|
|
198
187
|
}));
|
|
199
|
-
function create(
|
|
188
|
+
function create(_x6, _x7) {
|
|
200
189
|
return _create.apply(this, arguments);
|
|
201
190
|
}
|
|
202
191
|
return create;
|
|
@@ -243,7 +232,7 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
243
232
|
}
|
|
244
233
|
}, _callee5, this);
|
|
245
234
|
}));
|
|
246
|
-
function update(
|
|
235
|
+
function update(_x8, _x9, _x10) {
|
|
247
236
|
return _update.apply(this, arguments);
|
|
248
237
|
}
|
|
249
238
|
return update;
|
|
@@ -290,7 +279,7 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
290
279
|
}
|
|
291
280
|
}, _callee6, this);
|
|
292
281
|
}));
|
|
293
|
-
function deleteById(
|
|
282
|
+
function deleteById(_x11, _x12) {
|
|
294
283
|
return _deleteById.apply(this, arguments);
|
|
295
284
|
}
|
|
296
285
|
return deleteById;
|
|
@@ -308,7 +297,7 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
308
297
|
}
|
|
309
298
|
}, _callee7, this);
|
|
310
299
|
}));
|
|
311
|
-
function showError(
|
|
300
|
+
function showError(_x13, _x14) {
|
|
312
301
|
return _showError.apply(this, arguments);
|
|
313
302
|
}
|
|
314
303
|
return showError;
|
|
@@ -331,7 +320,7 @@ export var RestApi = /*#__PURE__*/function (_BaseRestApi2) {
|
|
|
331
320
|
}
|
|
332
321
|
}, _callee8);
|
|
333
322
|
}));
|
|
334
|
-
function handleRequestConfig(
|
|
323
|
+
function handleRequestConfig(_x15) {
|
|
335
324
|
return _handleRequestConfig.apply(this, arguments);
|
|
336
325
|
}
|
|
337
326
|
return handleRequestConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function handleFormSchema(schema:
|
|
1
|
+
export declare function handleFormSchema(schema: any): void;
|
|
2
2
|
/**
|
|
3
3
|
* 遍历schema
|
|
4
4
|
* @param schema
|
|
@@ -14,7 +14,7 @@ export interface FormSchema {
|
|
|
14
14
|
tableName?: string;
|
|
15
15
|
schemaName?: string;
|
|
16
16
|
columnName?: string;
|
|
17
|
-
fdmSchema?:
|
|
17
|
+
fdmSchema?: any;
|
|
18
18
|
props: FormSchemaProps;
|
|
19
19
|
children?: FormSchema[];
|
|
20
20
|
}
|
package/es/utils/cache/schema.js
CHANGED
|
@@ -5,9 +5,11 @@ export function handleFormSchema(schema) {
|
|
|
5
5
|
schema.methods = schema.methods || {};
|
|
6
6
|
forEachFormSchema(schema, function (field) {
|
|
7
7
|
if (field.fdmSchema) {
|
|
8
|
-
var _field$fdmSchema;
|
|
8
|
+
var _field$fdmSchema, _field$fdmSchema2;
|
|
9
9
|
fdmItems.push(field);
|
|
10
10
|
field.fdmSchema.props = ((_field$fdmSchema = field.fdmSchema) === null || _field$fdmSchema === void 0 ? void 0 : _field$fdmSchema.props) || {};
|
|
11
|
+
field.fdmSchema.props.style = ((_field$fdmSchema2 = field.fdmSchema) === null || _field$fdmSchema2 === void 0 ? void 0 : _field$fdmSchema2.props.style) || {};
|
|
12
|
+
field.fdmSchema.props.style.height = "100%";
|
|
11
13
|
// @ts-ignore
|
|
12
14
|
field.fdmSchema.props.noContainer = true;
|
|
13
15
|
}
|
|
@@ -27,6 +29,7 @@ export function handleFormSchema(schema) {
|
|
|
27
29
|
if (findSchema) {
|
|
28
30
|
field.componentName = findSchema.componentName;
|
|
29
31
|
field.props = Object.assign({}, JSON.parse(JSON.stringify(findSchema.props)), field.props);
|
|
32
|
+
//处理子表查询
|
|
30
33
|
if (findSchema.componentName == "SubFormField") {
|
|
31
34
|
if (findSchema.fdmSchema) {
|
|
32
35
|
var subFormFdmSchema = JSON.parse(JSON.stringify(findSchema.fdmSchema));
|
|
@@ -39,6 +42,7 @@ export function handleFormSchema(schema) {
|
|
|
39
42
|
// @ts-ignore
|
|
40
43
|
field.props.fdmSchema = subFormFdmSchema;
|
|
41
44
|
field.children = subFormFdmSchema.children[0].children;
|
|
45
|
+
console.log(subFormFdmSchema);
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
}
|
|
@@ -38,7 +38,7 @@ var BaseAssets = {
|
|
|
38
38
|
utils: [],
|
|
39
39
|
"components": [],
|
|
40
40
|
"sort": {
|
|
41
|
-
"categoryList": ["布局", "通用", "导航", "数据录入", "数据展示", "反馈", "大屏组件", "图表", "基础元素", "表格类", "表单详情类", "帮助类", "对话框类", "业务类", "引导", "信息输入", "信息展示", "信息反馈", "布局容器类", "增强组件", "工具组件"
|
|
41
|
+
"categoryList": ["普通", "范围", "高级", "布局", "通用", "导航", "数据录入", "数据展示", "反馈", "大屏组件", "图表", "基础元素", "表格类", "表单详情类", "帮助类", "对话框类", "业务类", "引导", "信息输入", "信息展示", "信息反馈", "布局容器类", "增强组件", "工具组件"],
|
|
42
42
|
"groupList": ["", "原子组件", "精选组件", "增强分组", "图表组件", "默认分组"]
|
|
43
43
|
}
|
|
44
44
|
};
|
package/es/utils/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import * as common from "./common";
|
|
|
2
2
|
import * as api from "./api";
|
|
3
3
|
import * as designer from "./designer";
|
|
4
4
|
import * as page from "./page";
|
|
5
|
+
import * as cache from "./cache";
|
|
5
6
|
declare const _default: {
|
|
6
7
|
api: typeof api;
|
|
7
8
|
page: typeof page;
|
|
9
|
+
cache: typeof cache;
|
|
8
10
|
designer: typeof designer;
|
|
9
11
|
common: typeof common;
|
|
10
12
|
};
|
package/es/utils/index.js
CHANGED
|
@@ -2,9 +2,11 @@ import * as common from "./common";
|
|
|
2
2
|
import * as api from "./api";
|
|
3
3
|
import * as designer from "./designer";
|
|
4
4
|
import * as page from "./page";
|
|
5
|
+
import * as cache from "./cache";
|
|
5
6
|
export default {
|
|
6
7
|
api: api,
|
|
7
8
|
page: page,
|
|
9
|
+
cache: cache,
|
|
8
10
|
designer: designer,
|
|
9
11
|
common: common
|
|
10
12
|
};
|
|
@@ -2,6 +2,7 @@ import _Result from "antd/es/result";
|
|
|
2
2
|
import _message from "antd/es/message";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { getSchema } from "../api";
|
|
5
|
+
import { PageLading } from "../../components/page-lading";
|
|
5
6
|
export function PageLoadSchema(props) {
|
|
6
7
|
var pageId = props.pageId,
|
|
7
8
|
children = props.children;
|
|
@@ -32,21 +33,12 @@ export function PageLoadSchema(props) {
|
|
|
32
33
|
}
|
|
33
34
|
}, []);
|
|
34
35
|
if (loading) {
|
|
35
|
-
return /*#__PURE__*/React.createElement(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: "spinner-line"
|
|
43
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className: "spinner-line"
|
|
45
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
46
|
-
className: "spinner-line"
|
|
47
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className: "spinner-circle"
|
|
49
|
-
}))));
|
|
36
|
+
return /*#__PURE__*/React.createElement(PageLading, {
|
|
37
|
+
loading: true,
|
|
38
|
+
style: {
|
|
39
|
+
background: "white"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
50
42
|
}
|
|
51
43
|
if (!schema) {
|
|
52
44
|
return /*#__PURE__*/React.createElement(_Result, {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.PageLading = PageLading;
|
|
5
|
+
require("./index.less");
|
|
6
|
+
var _react = require("react");
|
|
7
|
+
function PageLading(props) {
|
|
8
|
+
var style = props.style,
|
|
9
|
+
loading = props.loading;
|
|
10
|
+
if (!loading) {
|
|
11
|
+
return /*#__PURE__*/React.createElement(_react.Fragment, null);
|
|
12
|
+
}
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "page-loading",
|
|
15
|
+
style: style
|
|
16
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: "atom-spinner"
|
|
18
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: "spinner-inner"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "spinner-line"
|
|
22
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: "spinner-line"
|
|
24
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: "spinner-line"
|
|
26
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "spinner-circle"
|
|
28
|
+
}))));
|
|
29
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#fullscreen-loading {
|
|
2
|
+
position: fixed;
|
|
3
|
+
width: 100vw;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
top: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
z-index: 10;
|
|
8
|
+
background: white;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.page-loading {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
z-index: 10;
|
|
19
|
+
background: white;
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.atom-spinner, .atom-spinner * {
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.atom-spinner {
|
|
31
|
+
height: 60px;
|
|
32
|
+
width: 60px;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.atom-spinner .spinner-inner {
|
|
37
|
+
position: relative;
|
|
38
|
+
display: block;
|
|
39
|
+
height: 100%;
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.atom-spinner .spinner-circle {
|
|
44
|
+
display: block;
|
|
45
|
+
position: absolute;
|
|
46
|
+
color: #1677ff;
|
|
47
|
+
font-size: calc(60px * 0.24);
|
|
48
|
+
top: 50%;
|
|
49
|
+
left: 50%;
|
|
50
|
+
transform: translate(-50%, -50%);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.atom-spinner .spinner-line {
|
|
54
|
+
position: absolute;
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
border-left-width: calc(60px / 25);
|
|
59
|
+
border-top-width: calc(60px / 25);
|
|
60
|
+
border-left-color: #1677ff;
|
|
61
|
+
border-left-style: solid;
|
|
62
|
+
border-top-style: solid;
|
|
63
|
+
border-top-color: transparent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.atom-spinner .spinner-line:nth-child(1) {
|
|
67
|
+
animation: atom-spinner-animation-1 1s linear infinite;
|
|
68
|
+
transform: rotateZ(120deg) rotateX(66deg) rotateZ(0deg);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.atom-spinner .spinner-line:nth-child(2) {
|
|
72
|
+
animation: atom-spinner-animation-2 1s linear infinite;
|
|
73
|
+
transform: rotateZ(240deg) rotateX(66deg) rotateZ(0deg);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.atom-spinner .spinner-line:nth-child(3) {
|
|
77
|
+
animation: atom-spinner-animation-3 1s linear infinite;
|
|
78
|
+
transform: rotateZ(360deg) rotateX(66deg) rotateZ(0deg);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@keyframes atom-spinner-animation-1 {
|
|
82
|
+
100% {
|
|
83
|
+
transform: rotateZ(120deg) rotateX(66deg) rotateZ(360deg);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@keyframes atom-spinner-animation-2 {
|
|
88
|
+
100% {
|
|
89
|
+
transform: rotateZ(240deg) rotateX(66deg) rotateZ(360deg);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@keyframes atom-spinner-animation-3 {
|
|
94
|
+
100% {
|
|
95
|
+
transform: rotateZ(360deg) rotateX(66deg) rotateZ(360deg);
|
|
96
|
+
}
|
|
97
|
+
}
|
package/lib/index.less
CHANGED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
#fullscreen-loading {
|
|
2
|
-
position: fixed;
|
|
3
|
-
width: 100vw;
|
|
4
|
-
height: 100vh;
|
|
5
|
-
top: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
z-index: 10;
|
|
8
|
-
background: white;
|
|
9
|
-
display: flex;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.page-loading {
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
z-index: 10;
|
|
19
|
-
background: white;
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.atom-spinner, .atom-spinner * {
|
|
27
|
-
box-sizing: border-box;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.atom-spinner {
|
|
31
|
-
height: 60px;
|
|
32
|
-
width: 60px;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.atom-spinner .spinner-inner {
|
|
37
|
-
position: relative;
|
|
38
|
-
display: block;
|
|
39
|
-
height: 100%;
|
|
40
|
-
width: 100%;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.atom-spinner .spinner-circle {
|
|
44
|
-
display: block;
|
|
45
|
-
position: absolute;
|
|
46
|
-
color: #1677ff;
|
|
47
|
-
font-size: calc(60px * 0.24);
|
|
48
|
-
top: 50%;
|
|
49
|
-
left: 50%;
|
|
50
|
-
transform: translate(-50%, -50%);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.atom-spinner .spinner-line {
|
|
54
|
-
position: absolute;
|
|
55
|
-
width: 100%;
|
|
56
|
-
height: 100%;
|
|
57
|
-
border-radius: 50%;
|
|
58
|
-
border-left-width: calc(60px / 25);
|
|
59
|
-
border-top-width: calc(60px / 25);
|
|
60
|
-
border-left-color: #1677ff;
|
|
61
|
-
border-left-style: solid;
|
|
62
|
-
border-top-style: solid;
|
|
63
|
-
border-top-color: transparent;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.atom-spinner .spinner-line:nth-child(1) {
|
|
67
|
-
animation: atom-spinner-animation-1 1s linear infinite;
|
|
68
|
-
transform: rotateZ(120deg) rotateX(66deg) rotateZ(0deg);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.atom-spinner .spinner-line:nth-child(2) {
|
|
72
|
-
animation: atom-spinner-animation-2 1s linear infinite;
|
|
73
|
-
transform: rotateZ(240deg) rotateX(66deg) rotateZ(0deg);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.atom-spinner .spinner-line:nth-child(3) {
|
|
77
|
-
animation: atom-spinner-animation-3 1s linear infinite;
|
|
78
|
-
transform: rotateZ(360deg) rotateX(66deg) rotateZ(0deg);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@keyframes atom-spinner-animation-1 {
|
|
82
|
-
100% {
|
|
83
|
-
transform: rotateZ(120deg) rotateX(66deg) rotateZ(360deg);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@keyframes atom-spinner-animation-2 {
|
|
88
|
-
100% {
|
|
89
|
-
transform: rotateZ(240deg) rotateX(66deg) rotateZ(360deg);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@keyframes atom-spinner-animation-3 {
|
|
94
|
-
100% {
|
|
95
|
-
transform: rotateZ(360deg) rotateX(66deg) rotateZ(360deg);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
@@ -26,6 +26,7 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
26
26
|
var _proto = RestFormApi.prototype;
|
|
27
27
|
_proto.initialize = /*#__PURE__*/function () {
|
|
28
28
|
var _initialize = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
29
|
+
var _this2 = this;
|
|
29
30
|
var res;
|
|
30
31
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
31
32
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -43,10 +44,25 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
43
44
|
res = _context.sent;
|
|
44
45
|
this.schema = res.data;
|
|
45
46
|
this.initialized = !!this.schema;
|
|
46
|
-
|
|
47
|
+
this.title = this.schema.label;
|
|
48
|
+
if (this.fieldId) {
|
|
49
|
+
JSON.stringify(this.schema, function (key, value) {
|
|
50
|
+
var _value$props;
|
|
51
|
+
if (key == "fdmSchema") {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
if ((value === null || value === void 0 ? void 0 : (_value$props = value.props) === null || _value$props === void 0 ? void 0 : _value$props.fieldId) === _this2.fieldId) {
|
|
55
|
+
if (value.props.label) {
|
|
56
|
+
_this2.title += "." + value.props.label;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
_context.next = 18;
|
|
47
63
|
break;
|
|
48
|
-
case
|
|
49
|
-
_context.prev =
|
|
64
|
+
case 14:
|
|
65
|
+
_context.prev = 14;
|
|
50
66
|
_context.t0 = _context["catch"](4);
|
|
51
67
|
console.log("获取schema失败!", {
|
|
52
68
|
formId: this.formId,
|
|
@@ -54,13 +70,13 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
54
70
|
mock: this.mock
|
|
55
71
|
}, _context.t0);
|
|
56
72
|
throw _context.t0;
|
|
57
|
-
case
|
|
73
|
+
case 18:
|
|
58
74
|
return _context.abrupt("return", this.initialized);
|
|
59
|
-
case
|
|
75
|
+
case 19:
|
|
60
76
|
case "end":
|
|
61
77
|
return _context.stop();
|
|
62
78
|
}
|
|
63
|
-
}, _callee, this, [[4,
|
|
79
|
+
}, _callee, this, [[4, 14]]);
|
|
64
80
|
}));
|
|
65
81
|
function initialize() {
|
|
66
82
|
return _initialize.apply(this, arguments);
|
package/lib/utils/api/index.js
CHANGED
|
@@ -72,7 +72,9 @@ function _getFormApi() {
|
|
|
72
72
|
mock = window.__mock;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
key =
|
|
75
|
+
key = [formId, fieldId, mock ? "mock" : ""].filter(function (key) {
|
|
76
|
+
return !!key;
|
|
77
|
+
}).join("_");
|
|
76
78
|
_context2.next = 4;
|
|
77
79
|
return _cache.formApi.getInstance(key, {
|
|
78
80
|
mock: mock,
|
|
@@ -10,13 +10,26 @@ export interface RestApiOptions {
|
|
|
10
10
|
*/
|
|
11
11
|
title?: string;
|
|
12
12
|
}
|
|
13
|
+
export interface FilterRule {
|
|
14
|
+
connector?: "and" | "or";
|
|
15
|
+
key: string;
|
|
16
|
+
operator?: OperatorType;
|
|
17
|
+
value: any;
|
|
18
|
+
rules?: FilterRule[];
|
|
19
|
+
}
|
|
20
|
+
export declare type OperatorType = "eq" | "ne" | "gt" | "goe" | "lt" | "loe" | "like" | "notLike" | "in" | "notIn" | "isNull" | "isNotNull" | "between" | "notBetween";
|
|
21
|
+
export interface RestSearchParams {
|
|
22
|
+
page?: number;
|
|
23
|
+
pageSize?: number;
|
|
24
|
+
filterRules?: FilterRule[];
|
|
25
|
+
}
|
|
13
26
|
export declare abstract class BaseRestApi<DataType> {
|
|
14
27
|
uri: string;
|
|
15
28
|
title: string;
|
|
16
29
|
request: AxiosInstance;
|
|
17
30
|
protected constructor(uri: string, options?: RestApiOptions);
|
|
18
31
|
abstract handleRequestConfig(config: AxiosRequestConfig): void;
|
|
19
|
-
search(params?:
|
|
32
|
+
search(params?: RestSearchParams): Promise<ManyResult<DataType>>;
|
|
20
33
|
/**
|
|
21
34
|
* 通过id获取
|
|
22
35
|
* @param id
|
|
@@ -29,42 +29,31 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
29
29
|
}
|
|
30
30
|
var _proto = BaseRestApi.prototype;
|
|
31
31
|
_proto.search = /*#__PURE__*/function () {
|
|
32
|
-
var _search = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(params
|
|
32
|
+
var _search = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(params) {
|
|
33
33
|
var _this$handleRequestCo;
|
|
34
34
|
var config;
|
|
35
35
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
36
36
|
while (1) switch (_context.prev = _context.next) {
|
|
37
37
|
case 0:
|
|
38
|
-
if (params === void 0) {
|
|
39
|
-
params = {};
|
|
40
|
-
}
|
|
41
|
-
if (page === void 0) {
|
|
42
|
-
page = 1;
|
|
43
|
-
}
|
|
44
|
-
if (pageSize === void 0) {
|
|
45
|
-
pageSize = 20;
|
|
46
|
-
}
|
|
47
|
-
params.page = page;
|
|
48
|
-
params.pageSize = pageSize;
|
|
49
38
|
config = {
|
|
50
39
|
params: params
|
|
51
40
|
};
|
|
52
|
-
_context.next =
|
|
41
|
+
_context.next = 3;
|
|
53
42
|
return (_this$handleRequestCo = this.handleRequestConfig) === null || _this$handleRequestCo === void 0 ? void 0 : _this$handleRequestCo.call(this, config);
|
|
54
|
-
case
|
|
55
|
-
_context.next =
|
|
43
|
+
case 3:
|
|
44
|
+
_context.next = 5;
|
|
56
45
|
return this.request.get("", {
|
|
57
46
|
params: params
|
|
58
47
|
});
|
|
59
|
-
case
|
|
48
|
+
case 5:
|
|
60
49
|
return _context.abrupt("return", _context.sent);
|
|
61
|
-
case
|
|
50
|
+
case 6:
|
|
62
51
|
case "end":
|
|
63
52
|
return _context.stop();
|
|
64
53
|
}
|
|
65
54
|
}, _callee, this);
|
|
66
55
|
}));
|
|
67
|
-
function search(_x
|
|
56
|
+
function search(_x) {
|
|
68
57
|
return _search.apply(this, arguments);
|
|
69
58
|
}
|
|
70
59
|
return search;
|
|
@@ -113,7 +102,7 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
113
102
|
}
|
|
114
103
|
}, _callee2, this);
|
|
115
104
|
}));
|
|
116
|
-
function getById(
|
|
105
|
+
function getById(_x2, _x3) {
|
|
117
106
|
return _getById.apply(this, arguments);
|
|
118
107
|
}
|
|
119
108
|
return getById;
|
|
@@ -154,7 +143,7 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
154
143
|
}
|
|
155
144
|
}, _callee3, this);
|
|
156
145
|
}));
|
|
157
|
-
function save(
|
|
146
|
+
function save(_x4, _x5) {
|
|
158
147
|
return _save.apply(this, arguments);
|
|
159
148
|
}
|
|
160
149
|
return save;
|
|
@@ -201,7 +190,7 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
201
190
|
}
|
|
202
191
|
}, _callee4, this);
|
|
203
192
|
}));
|
|
204
|
-
function create(
|
|
193
|
+
function create(_x6, _x7) {
|
|
205
194
|
return _create.apply(this, arguments);
|
|
206
195
|
}
|
|
207
196
|
return create;
|
|
@@ -248,7 +237,7 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
248
237
|
}
|
|
249
238
|
}, _callee5, this);
|
|
250
239
|
}));
|
|
251
|
-
function update(
|
|
240
|
+
function update(_x8, _x9, _x10) {
|
|
252
241
|
return _update.apply(this, arguments);
|
|
253
242
|
}
|
|
254
243
|
return update;
|
|
@@ -295,7 +284,7 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
295
284
|
}
|
|
296
285
|
}, _callee6, this);
|
|
297
286
|
}));
|
|
298
|
-
function deleteById(
|
|
287
|
+
function deleteById(_x11, _x12) {
|
|
299
288
|
return _deleteById.apply(this, arguments);
|
|
300
289
|
}
|
|
301
290
|
return deleteById;
|
|
@@ -313,7 +302,7 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
313
302
|
}
|
|
314
303
|
}, _callee7, this);
|
|
315
304
|
}));
|
|
316
|
-
function showError(
|
|
305
|
+
function showError(_x13, _x14) {
|
|
317
306
|
return _showError.apply(this, arguments);
|
|
318
307
|
}
|
|
319
308
|
return showError;
|
|
@@ -336,7 +325,7 @@ var RestApi = exports.RestApi = /*#__PURE__*/function (_BaseRestApi2) {
|
|
|
336
325
|
}
|
|
337
326
|
}, _callee8);
|
|
338
327
|
}));
|
|
339
|
-
function handleRequestConfig(
|
|
328
|
+
function handleRequestConfig(_x15) {
|
|
340
329
|
return _handleRequestConfig.apply(this, arguments);
|
|
341
330
|
}
|
|
342
331
|
return handleRequestConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function handleFormSchema(schema:
|
|
1
|
+
export declare function handleFormSchema(schema: any): void;
|
|
2
2
|
/**
|
|
3
3
|
* 遍历schema
|
|
4
4
|
* @param schema
|
|
@@ -14,7 +14,7 @@ export interface FormSchema {
|
|
|
14
14
|
tableName?: string;
|
|
15
15
|
schemaName?: string;
|
|
16
16
|
columnName?: string;
|
|
17
|
-
fdmSchema?:
|
|
17
|
+
fdmSchema?: any;
|
|
18
18
|
props: FormSchemaProps;
|
|
19
19
|
children?: FormSchema[];
|
|
20
20
|
}
|
|
@@ -10,9 +10,11 @@ function handleFormSchema(schema) {
|
|
|
10
10
|
schema.methods = schema.methods || {};
|
|
11
11
|
forEachFormSchema(schema, function (field) {
|
|
12
12
|
if (field.fdmSchema) {
|
|
13
|
-
var _field$fdmSchema;
|
|
13
|
+
var _field$fdmSchema, _field$fdmSchema2;
|
|
14
14
|
fdmItems.push(field);
|
|
15
15
|
field.fdmSchema.props = ((_field$fdmSchema = field.fdmSchema) === null || _field$fdmSchema === void 0 ? void 0 : _field$fdmSchema.props) || {};
|
|
16
|
+
field.fdmSchema.props.style = ((_field$fdmSchema2 = field.fdmSchema) === null || _field$fdmSchema2 === void 0 ? void 0 : _field$fdmSchema2.props.style) || {};
|
|
17
|
+
field.fdmSchema.props.style.height = "100%";
|
|
16
18
|
// @ts-ignore
|
|
17
19
|
field.fdmSchema.props.noContainer = true;
|
|
18
20
|
}
|
|
@@ -32,6 +34,7 @@ function handleFormSchema(schema) {
|
|
|
32
34
|
if (findSchema) {
|
|
33
35
|
field.componentName = findSchema.componentName;
|
|
34
36
|
field.props = Object.assign({}, JSON.parse(JSON.stringify(findSchema.props)), field.props);
|
|
37
|
+
//处理子表查询
|
|
35
38
|
if (findSchema.componentName == "SubFormField") {
|
|
36
39
|
if (findSchema.fdmSchema) {
|
|
37
40
|
var subFormFdmSchema = JSON.parse(JSON.stringify(findSchema.fdmSchema));
|
|
@@ -44,6 +47,7 @@ function handleFormSchema(schema) {
|
|
|
44
47
|
// @ts-ignore
|
|
45
48
|
field.props.fdmSchema = subFormFdmSchema;
|
|
46
49
|
field.children = subFormFdmSchema.children[0].children;
|
|
50
|
+
console.log(subFormFdmSchema);
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
}
|
|
@@ -42,7 +42,7 @@ var BaseAssets = {
|
|
|
42
42
|
utils: [],
|
|
43
43
|
"components": [],
|
|
44
44
|
"sort": {
|
|
45
|
-
"categoryList": ["布局", "通用", "导航", "数据录入", "数据展示", "反馈", "大屏组件", "图表", "基础元素", "表格类", "表单详情类", "帮助类", "对话框类", "业务类", "引导", "信息输入", "信息展示", "信息反馈", "布局容器类", "增强组件", "工具组件"
|
|
45
|
+
"categoryList": ["普通", "范围", "高级", "布局", "通用", "导航", "数据录入", "数据展示", "反馈", "大屏组件", "图表", "基础元素", "表格类", "表单详情类", "帮助类", "对话框类", "业务类", "引导", "信息输入", "信息展示", "信息反馈", "布局容器类", "增强组件", "工具组件"],
|
|
46
46
|
"groupList": ["", "原子组件", "精选组件", "增强分组", "图表组件", "默认分组"]
|
|
47
47
|
}
|
|
48
48
|
};
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import * as common from "./common";
|
|
|
2
2
|
import * as api from "./api";
|
|
3
3
|
import * as designer from "./designer";
|
|
4
4
|
import * as page from "./page";
|
|
5
|
+
import * as cache from "./cache";
|
|
5
6
|
declare const _default: {
|
|
6
7
|
api: typeof api;
|
|
7
8
|
page: typeof page;
|
|
9
|
+
cache: typeof cache;
|
|
8
10
|
designer: typeof designer;
|
|
9
11
|
common: typeof common;
|
|
10
12
|
};
|
package/lib/utils/index.js
CHANGED
|
@@ -6,11 +6,13 @@ var common = _interopRequireWildcard(require("./common"));
|
|
|
6
6
|
var api = _interopRequireWildcard(require("./api"));
|
|
7
7
|
var designer = _interopRequireWildcard(require("./designer"));
|
|
8
8
|
var page = _interopRequireWildcard(require("./page"));
|
|
9
|
+
var cache = _interopRequireWildcard(require("./cache"));
|
|
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
|
page: page,
|
|
15
|
+
cache: cache,
|
|
14
16
|
designer: designer,
|
|
15
17
|
common: common
|
|
16
18
|
};
|
|
@@ -7,6 +7,7 @@ var _result = _interopRequireDefault(require("antd/lib/result"));
|
|
|
7
7
|
var _message2 = _interopRequireDefault(require("antd/lib/message"));
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _api = require("../api");
|
|
10
|
+
var _pageLading = require("../../components/page-lading");
|
|
10
11
|
function PageLoadSchema(props) {
|
|
11
12
|
var pageId = props.pageId,
|
|
12
13
|
children = props.children;
|
|
@@ -37,21 +38,12 @@ function PageLoadSchema(props) {
|
|
|
37
38
|
}
|
|
38
39
|
}, []);
|
|
39
40
|
if (loading) {
|
|
40
|
-
return /*#__PURE__*/React.createElement(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
47
|
-
className: "spinner-line"
|
|
48
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
className: "spinner-line"
|
|
50
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className: "spinner-line"
|
|
52
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
53
|
-
className: "spinner-circle"
|
|
54
|
-
}))));
|
|
41
|
+
return /*#__PURE__*/React.createElement(_pageLading.PageLading, {
|
|
42
|
+
loading: true,
|
|
43
|
+
style: {
|
|
44
|
+
background: "white"
|
|
45
|
+
}
|
|
46
|
+
});
|
|
55
47
|
}
|
|
56
48
|
if (!schema) {
|
|
57
49
|
return /*#__PURE__*/React.createElement(_result["default"], {
|