@zhubangyun/lowcode-core 5.4.251 → 5.4.291
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.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.less +0 -0
- package/es/style.js +2 -1
- 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/index.d.ts +2 -0
- package/es/utils/page/index.js +62 -15
- package/es/utils/page/page-form.js +0 -1
- package/es/utils/page/page-load-schema.js +5 -7
- 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.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.less +0 -0
- package/lib/style.js +2 -1
- 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/index.d.ts +2 -0
- package/lib/utils/page/index.js +64 -15
- package/lib/utils/page/page-form.js +0 -1
- package/lib/utils/page/page-load-schema.js +5 -7
- 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.d.ts
CHANGED
package/es/index.js
CHANGED
package/es/index.less
ADDED
|
File without changes
|
package/es/style.js
CHANGED
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
|
};
|
package/es/utils/page/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { showForm } from "./page-form";
|
|
2
|
+
export declare function showLoading(): Promise<void>;
|
|
3
|
+
export declare function hideLoading(): Promise<void>;
|
|
2
4
|
export declare function openPage(url: string, target?: string): Promise<any>;
|
|
3
5
|
export declare function closePage(url: string, target?: string): Promise<void>;
|
package/es/utils/page/index.js
CHANGED
|
@@ -1,41 +1,88 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
export { showForm } from "./page-form";
|
|
4
|
+
export function showLoading() {
|
|
5
|
+
return _showLoading.apply(this, arguments);
|
|
6
|
+
}
|
|
7
|
+
function _showLoading() {
|
|
8
|
+
_showLoading = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
9
|
+
var loading, div;
|
|
10
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
11
|
+
while (1) switch (_context.prev = _context.next) {
|
|
12
|
+
case 0:
|
|
13
|
+
loading = document.getElementById("fullscreen-loading");
|
|
14
|
+
if (loading) {
|
|
15
|
+
loading.style.display = "flex";
|
|
16
|
+
} else {
|
|
17
|
+
div = document.createElement("div");
|
|
18
|
+
div.id = "fullscreen-loading";
|
|
19
|
+
div.innerHTML = "\n <div class=\"atom-spinner\">\n <div class=\"spinner-inner\">\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-circle\"></div>\n </div>\n </div>\n ";
|
|
20
|
+
document.body.appendChild(div);
|
|
21
|
+
}
|
|
22
|
+
case 2:
|
|
23
|
+
case "end":
|
|
24
|
+
return _context.stop();
|
|
25
|
+
}
|
|
26
|
+
}, _callee);
|
|
27
|
+
}));
|
|
28
|
+
return _showLoading.apply(this, arguments);
|
|
29
|
+
}
|
|
30
|
+
export function hideLoading() {
|
|
31
|
+
return _hideLoading.apply(this, arguments);
|
|
32
|
+
}
|
|
33
|
+
function _hideLoading() {
|
|
34
|
+
_hideLoading = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
35
|
+
var loading;
|
|
36
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
37
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
38
|
+
case 0:
|
|
39
|
+
loading = document.getElementById("fullscreen-loading");
|
|
40
|
+
if (loading) {
|
|
41
|
+
loading.style.display = "none";
|
|
42
|
+
}
|
|
43
|
+
case 2:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context2.stop();
|
|
46
|
+
}
|
|
47
|
+
}, _callee2);
|
|
48
|
+
}));
|
|
49
|
+
return _hideLoading.apply(this, arguments);
|
|
50
|
+
}
|
|
4
51
|
export function openPage(_x, _x2) {
|
|
5
52
|
return _openPage.apply(this, arguments);
|
|
6
53
|
}
|
|
7
54
|
function _openPage() {
|
|
8
|
-
_openPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
55
|
+
_openPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(url, target) {
|
|
9
56
|
var _window$parent;
|
|
10
57
|
var page, func;
|
|
11
|
-
return _regeneratorRuntime.wrap(function
|
|
12
|
-
while (1) switch (
|
|
58
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
59
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
13
60
|
case 0:
|
|
14
61
|
// @ts-ignore
|
|
15
62
|
func = (_window$parent = window.parent) === null || _window$parent === void 0 ? void 0 : _window$parent.openWorkPlatformTab;
|
|
16
63
|
if (!func) {
|
|
17
|
-
|
|
64
|
+
_context3.next = 7;
|
|
18
65
|
break;
|
|
19
66
|
}
|
|
20
|
-
|
|
67
|
+
_context3.next = 4;
|
|
21
68
|
return func({
|
|
22
69
|
value: target,
|
|
23
70
|
url: url
|
|
24
71
|
});
|
|
25
72
|
case 4:
|
|
26
|
-
page =
|
|
27
|
-
|
|
73
|
+
page = _context3.sent;
|
|
74
|
+
_context3.next = 8;
|
|
28
75
|
break;
|
|
29
76
|
case 7:
|
|
30
77
|
page = window.open(url, target);
|
|
31
78
|
case 8:
|
|
32
79
|
console.debug("openPage", page, target);
|
|
33
|
-
return
|
|
80
|
+
return _context3.abrupt("return", page);
|
|
34
81
|
case 10:
|
|
35
82
|
case "end":
|
|
36
|
-
return
|
|
83
|
+
return _context3.stop();
|
|
37
84
|
}
|
|
38
|
-
},
|
|
85
|
+
}, _callee3);
|
|
39
86
|
}));
|
|
40
87
|
return _openPage.apply(this, arguments);
|
|
41
88
|
}
|
|
@@ -43,11 +90,11 @@ export function closePage(_x3, _x4) {
|
|
|
43
90
|
return _closePage.apply(this, arguments);
|
|
44
91
|
}
|
|
45
92
|
function _closePage() {
|
|
46
|
-
_closePage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
93
|
+
_closePage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(url, target) {
|
|
47
94
|
var _window$parent2;
|
|
48
95
|
var func;
|
|
49
|
-
return _regeneratorRuntime.wrap(function
|
|
50
|
-
while (1) switch (
|
|
96
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
97
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
51
98
|
case 0:
|
|
52
99
|
// @ts-ignore
|
|
53
100
|
func = (_window$parent2 = window.parent) === null || _window$parent2 === void 0 ? void 0 : _window$parent2.closeWorkPlatformTab;
|
|
@@ -61,9 +108,9 @@ function _closePage() {
|
|
|
61
108
|
}
|
|
62
109
|
case 2:
|
|
63
110
|
case "end":
|
|
64
|
-
return
|
|
111
|
+
return _context4.stop();
|
|
65
112
|
}
|
|
66
|
-
},
|
|
113
|
+
}, _callee4);
|
|
67
114
|
}));
|
|
68
115
|
return _closePage.apply(this, arguments);
|
|
69
116
|
}
|
|
@@ -114,7 +114,6 @@ var FormRender = /*#__PURE__*/function (_Component) {
|
|
|
114
114
|
}, /*#__PURE__*/React.createElement(PageLoadSchema, {
|
|
115
115
|
pageId: form === null || form === void 0 ? void 0 : form.id
|
|
116
116
|
}, function (schema) {
|
|
117
|
-
console.log(window._components || window.components || window.__components);
|
|
118
117
|
return /*#__PURE__*/React.createElement(ReactRender, _extends({
|
|
119
118
|
schema: schema,
|
|
120
119
|
components: window._components || window.components || window.__components
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _Result from "antd/es/result";
|
|
2
|
-
import _Spin from "antd/es/spin";
|
|
3
2
|
import _message from "antd/es/message";
|
|
4
3
|
import { useEffect, useState } from "react";
|
|
5
4
|
import { getSchema } from "../api";
|
|
5
|
+
import { PageLading } from "../../components/page-lading";
|
|
6
6
|
export function PageLoadSchema(props) {
|
|
7
7
|
var pageId = props.pageId,
|
|
8
8
|
children = props.children;
|
|
@@ -33,14 +33,12 @@ export function PageLoadSchema(props) {
|
|
|
33
33
|
}
|
|
34
34
|
}, []);
|
|
35
35
|
if (loading) {
|
|
36
|
-
return /*#__PURE__*/React.createElement(
|
|
36
|
+
return /*#__PURE__*/React.createElement(PageLading, {
|
|
37
|
+
loading: true,
|
|
37
38
|
style: {
|
|
38
|
-
|
|
39
|
-
height: "100%"
|
|
39
|
+
background: "white"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
42
|
-
spinning: true
|
|
43
|
-
}));
|
|
41
|
+
});
|
|
44
42
|
}
|
|
45
43
|
if (!schema) {
|
|
46
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.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.apiRequest = exports.RestFormApi = exports.RestApi = exports.Layout = void 0;
|
|
6
|
+
require("./index.less");
|
|
6
7
|
var _utils = _interopRequireDefault(require("./utils"));
|
|
7
8
|
exports.utils = _utils["default"];
|
|
8
9
|
var _reactRender = require("./components/react-render");
|
package/lib/index.less
ADDED
|
File without changes
|
package/lib/style.js
CHANGED
|
@@ -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
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { showForm } from "./page-form";
|
|
2
|
+
export declare function showLoading(): Promise<void>;
|
|
3
|
+
export declare function hideLoading(): Promise<void>;
|
|
2
4
|
export declare function openPage(url: string, target?: string): Promise<any>;
|
|
3
5
|
export declare function closePage(url: string, target?: string): Promise<void>;
|
package/lib/utils/page/index.js
CHANGED
|
@@ -3,47 +3,96 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.closePage = closePage;
|
|
6
|
+
exports.hideLoading = hideLoading;
|
|
6
7
|
exports.openPage = openPage;
|
|
7
8
|
exports.showForm = void 0;
|
|
9
|
+
exports.showLoading = showLoading;
|
|
8
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
12
|
var _pageForm = require("./page-form");
|
|
11
13
|
exports.showForm = _pageForm.showForm;
|
|
14
|
+
function showLoading() {
|
|
15
|
+
return _showLoading.apply(this, arguments);
|
|
16
|
+
}
|
|
17
|
+
function _showLoading() {
|
|
18
|
+
_showLoading = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
19
|
+
var loading, div;
|
|
20
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
loading = document.getElementById("fullscreen-loading");
|
|
24
|
+
if (loading) {
|
|
25
|
+
loading.style.display = "flex";
|
|
26
|
+
} else {
|
|
27
|
+
div = document.createElement("div");
|
|
28
|
+
div.id = "fullscreen-loading";
|
|
29
|
+
div.innerHTML = "\n <div class=\"atom-spinner\">\n <div class=\"spinner-inner\">\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-circle\"></div>\n </div>\n </div>\n ";
|
|
30
|
+
document.body.appendChild(div);
|
|
31
|
+
}
|
|
32
|
+
case 2:
|
|
33
|
+
case "end":
|
|
34
|
+
return _context.stop();
|
|
35
|
+
}
|
|
36
|
+
}, _callee);
|
|
37
|
+
}));
|
|
38
|
+
return _showLoading.apply(this, arguments);
|
|
39
|
+
}
|
|
40
|
+
function hideLoading() {
|
|
41
|
+
return _hideLoading.apply(this, arguments);
|
|
42
|
+
}
|
|
43
|
+
function _hideLoading() {
|
|
44
|
+
_hideLoading = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
45
|
+
var loading;
|
|
46
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
47
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
48
|
+
case 0:
|
|
49
|
+
loading = document.getElementById("fullscreen-loading");
|
|
50
|
+
if (loading) {
|
|
51
|
+
loading.style.display = "none";
|
|
52
|
+
}
|
|
53
|
+
case 2:
|
|
54
|
+
case "end":
|
|
55
|
+
return _context2.stop();
|
|
56
|
+
}
|
|
57
|
+
}, _callee2);
|
|
58
|
+
}));
|
|
59
|
+
return _hideLoading.apply(this, arguments);
|
|
60
|
+
}
|
|
12
61
|
function openPage(_x, _x2) {
|
|
13
62
|
return _openPage.apply(this, arguments);
|
|
14
63
|
}
|
|
15
64
|
function _openPage() {
|
|
16
|
-
_openPage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
65
|
+
_openPage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(url, target) {
|
|
17
66
|
var _window$parent;
|
|
18
67
|
var page, func;
|
|
19
|
-
return _regenerator["default"].wrap(function
|
|
20
|
-
while (1) switch (
|
|
68
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
69
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
21
70
|
case 0:
|
|
22
71
|
// @ts-ignore
|
|
23
72
|
func = (_window$parent = window.parent) === null || _window$parent === void 0 ? void 0 : _window$parent.openWorkPlatformTab;
|
|
24
73
|
if (!func) {
|
|
25
|
-
|
|
74
|
+
_context3.next = 7;
|
|
26
75
|
break;
|
|
27
76
|
}
|
|
28
|
-
|
|
77
|
+
_context3.next = 4;
|
|
29
78
|
return func({
|
|
30
79
|
value: target,
|
|
31
80
|
url: url
|
|
32
81
|
});
|
|
33
82
|
case 4:
|
|
34
|
-
page =
|
|
35
|
-
|
|
83
|
+
page = _context3.sent;
|
|
84
|
+
_context3.next = 8;
|
|
36
85
|
break;
|
|
37
86
|
case 7:
|
|
38
87
|
page = window.open(url, target);
|
|
39
88
|
case 8:
|
|
40
89
|
console.debug("openPage", page, target);
|
|
41
|
-
return
|
|
90
|
+
return _context3.abrupt("return", page);
|
|
42
91
|
case 10:
|
|
43
92
|
case "end":
|
|
44
|
-
return
|
|
93
|
+
return _context3.stop();
|
|
45
94
|
}
|
|
46
|
-
},
|
|
95
|
+
}, _callee3);
|
|
47
96
|
}));
|
|
48
97
|
return _openPage.apply(this, arguments);
|
|
49
98
|
}
|
|
@@ -51,11 +100,11 @@ function closePage(_x3, _x4) {
|
|
|
51
100
|
return _closePage.apply(this, arguments);
|
|
52
101
|
}
|
|
53
102
|
function _closePage() {
|
|
54
|
-
_closePage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
103
|
+
_closePage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(url, target) {
|
|
55
104
|
var _window$parent2;
|
|
56
105
|
var func;
|
|
57
|
-
return _regenerator["default"].wrap(function
|
|
58
|
-
while (1) switch (
|
|
106
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
107
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
59
108
|
case 0:
|
|
60
109
|
// @ts-ignore
|
|
61
110
|
func = (_window$parent2 = window.parent) === null || _window$parent2 === void 0 ? void 0 : _window$parent2.closeWorkPlatformTab;
|
|
@@ -69,9 +118,9 @@ function _closePage() {
|
|
|
69
118
|
}
|
|
70
119
|
case 2:
|
|
71
120
|
case "end":
|
|
72
|
-
return
|
|
121
|
+
return _context4.stop();
|
|
73
122
|
}
|
|
74
|
-
},
|
|
123
|
+
}, _callee4);
|
|
75
124
|
}));
|
|
76
125
|
return _closePage.apply(this, arguments);
|
|
77
126
|
}
|
|
@@ -121,7 +121,6 @@ var FormRender = /*#__PURE__*/function (_Component) {
|
|
|
121
121
|
}, /*#__PURE__*/_react["default"].createElement(_pageLoadSchema.PageLoadSchema, {
|
|
122
122
|
pageId: form === null || form === void 0 ? void 0 : form.id
|
|
123
123
|
}, function (schema) {
|
|
124
|
-
console.log(window._components || window.components || window.__components);
|
|
125
124
|
return /*#__PURE__*/_react["default"].createElement(_reactRender.ReactRender, (0, _extends2["default"])({
|
|
126
125
|
schema: schema,
|
|
127
126
|
components: window._components || window.components || window.__components
|
|
@@ -4,10 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.PageLoadSchema = PageLoadSchema;
|
|
6
6
|
var _result = _interopRequireDefault(require("antd/lib/result"));
|
|
7
|
-
var _spin = _interopRequireDefault(require("antd/lib/spin"));
|
|
8
7
|
var _message2 = _interopRequireDefault(require("antd/lib/message"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _api = require("../api");
|
|
10
|
+
var _pageLading = require("../../components/page-lading");
|
|
11
11
|
function PageLoadSchema(props) {
|
|
12
12
|
var pageId = props.pageId,
|
|
13
13
|
children = props.children;
|
|
@@ -38,14 +38,12 @@ function PageLoadSchema(props) {
|
|
|
38
38
|
}
|
|
39
39
|
}, []);
|
|
40
40
|
if (loading) {
|
|
41
|
-
return /*#__PURE__*/React.createElement(
|
|
41
|
+
return /*#__PURE__*/React.createElement(_pageLading.PageLading, {
|
|
42
|
+
loading: true,
|
|
42
43
|
style: {
|
|
43
|
-
|
|
44
|
-
height: "100%"
|
|
44
|
+
background: "white"
|
|
45
45
|
}
|
|
46
|
-
}
|
|
47
|
-
spinning: true
|
|
48
|
-
}));
|
|
46
|
+
});
|
|
49
47
|
}
|
|
50
48
|
if (!schema) {
|
|
51
49
|
return /*#__PURE__*/React.createElement(_result["default"], {
|