@zhubangyun/lowcode-core 5.5.82 → 5.5.83
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/load-materials/index.js +2 -7
- package/es/components/react-render/index.js +3 -3
- package/es/utils/cache/schema.d.ts +2 -28
- package/es/utils/cache/schema.js +69 -51
- package/es/utils/page/index.js +6 -2
- package/es/utils/page/page-load-schema.js +1 -4
- package/lib/components/load-materials/index.js +2 -7
- package/lib/components/react-render/index.js +3 -3
- package/lib/utils/cache/schema.d.ts +2 -28
- package/lib/utils/cache/schema.js +70 -52
- package/lib/utils/page/index.js +6 -2
- package/lib/utils/page/page-load-schema.js +1 -4
- package/package.json +1 -1
|
@@ -3,7 +3,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
import React, { useEffect, useState } from "react";
|
|
4
4
|
import { PageLoading } from "../page-loading";
|
|
5
5
|
import { loadPlugins } from "../../utils/common";
|
|
6
|
-
var __hasLoading = false;
|
|
7
6
|
export function LoadMaterials(props) {
|
|
8
7
|
var _useState = useState(false),
|
|
9
8
|
init = _useState[0],
|
|
@@ -21,10 +20,9 @@ export function LoadMaterials(props) {
|
|
|
21
20
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22
21
|
while (1) switch (_context.prev = _context.next) {
|
|
23
22
|
case 0:
|
|
24
|
-
|
|
25
|
-
_context.next = 3;
|
|
23
|
+
_context.next = 2;
|
|
26
24
|
return loadMaterials();
|
|
27
|
-
case
|
|
25
|
+
case 2:
|
|
28
26
|
case "end":
|
|
29
27
|
return _context.stop();
|
|
30
28
|
}
|
|
@@ -32,9 +30,6 @@ export function LoadMaterials(props) {
|
|
|
32
30
|
}));
|
|
33
31
|
return _initialize.apply(this, arguments);
|
|
34
32
|
}
|
|
35
|
-
if (__hasLoading) {
|
|
36
|
-
return props.children;
|
|
37
|
-
}
|
|
38
33
|
if (init) {
|
|
39
34
|
return props.children;
|
|
40
35
|
} else {
|
|
@@ -13,7 +13,7 @@ export var ReactRender = /*#__PURE__*/function (_PureComponent) {
|
|
|
13
13
|
args[_key] = arguments[_key];
|
|
14
14
|
}
|
|
15
15
|
_this = _PureComponent.call.apply(_PureComponent, [this].concat(args)) || this;
|
|
16
|
-
_this.key = Date.now().toString(36);
|
|
16
|
+
_this.key = Date.now().toString(36) + Math.random().toString(36);
|
|
17
17
|
_this.node = void 0;
|
|
18
18
|
return _this;
|
|
19
19
|
}
|
|
@@ -21,7 +21,7 @@ export var ReactRender = /*#__PURE__*/function (_PureComponent) {
|
|
|
21
21
|
var _proto = ReactRender.prototype;
|
|
22
22
|
_proto.render = function render() {
|
|
23
23
|
var _this2 = this;
|
|
24
|
-
var components = this.props.components;
|
|
24
|
+
var components = this.props.components || window._components;
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
27
27
|
locale: zhCN
|
|
@@ -32,7 +32,7 @@ export var ReactRender = /*#__PURE__*/function (_PureComponent) {
|
|
|
32
32
|
_this2.node = node === null || node === void 0 ? void 0 : node.__ref;
|
|
33
33
|
},
|
|
34
34
|
thisRequiredInJSE: true,
|
|
35
|
-
components: components
|
|
35
|
+
components: components,
|
|
36
36
|
appHelper: {
|
|
37
37
|
utils: utils,
|
|
38
38
|
requestHandlersMap: {
|
|
@@ -1,33 +1,7 @@
|
|
|
1
|
-
export declare function handleFormSchema(schema: any): void
|
|
1
|
+
export declare function handleFormSchema(schema: any): Promise<void>;
|
|
2
2
|
/**
|
|
3
3
|
* 遍历schema
|
|
4
4
|
* @param schema
|
|
5
5
|
* @param callback 返回true 继续往下遍历
|
|
6
6
|
*/
|
|
7
|
-
export declare function forEachFormSchema(schema:
|
|
8
|
-
export interface FormSchema {
|
|
9
|
-
id?: string;
|
|
10
|
-
state: any;
|
|
11
|
-
methods: any;
|
|
12
|
-
componentName: string;
|
|
13
|
-
formId?: string;
|
|
14
|
-
tableName?: string;
|
|
15
|
-
schemaName?: string;
|
|
16
|
-
columnName?: string;
|
|
17
|
-
fdmSchema?: any;
|
|
18
|
-
props: FormSchemaProps;
|
|
19
|
-
children?: FormSchema[];
|
|
20
|
-
}
|
|
21
|
-
export interface FormSchemaProps {
|
|
22
|
-
fieldId: string;
|
|
23
|
-
label: string;
|
|
24
|
-
fieldSchema?: any;
|
|
25
|
-
columnName: string;
|
|
26
|
-
array: boolean;
|
|
27
|
-
layout?: "inline";
|
|
28
|
-
fdmSchema?: any;
|
|
29
|
-
associationForm: {
|
|
30
|
-
id: string;
|
|
31
|
-
fieldId: string;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
7
|
+
export declare function forEachFormSchema(schema: any, callback: (child: any, index: number, children: any[]) => boolean): void;
|
package/es/utils/cache/schema.js
CHANGED
|
@@ -1,54 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
schema.methods = schema.methods || {};
|
|
6
|
-
forEachFormSchema(schema, function (field) {
|
|
7
|
-
if (field.fdmSchema) {
|
|
8
|
-
var _field$fdmSchema, _field$fdmSchema2;
|
|
9
|
-
fdmItems.push(field);
|
|
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%";
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
field.fdmSchema.props.noContainer = true;
|
|
15
|
-
}
|
|
16
|
-
if (field.props.fieldId) {
|
|
17
|
-
//删除children防止循环
|
|
18
|
-
var copyField = JSON.parse(JSON.stringify(field));
|
|
19
|
-
delete copyField.children;
|
|
20
|
-
fieldIdMap.set(field.props.fieldId, copyField);
|
|
21
|
-
}
|
|
22
|
-
return true;
|
|
23
|
-
});
|
|
24
|
-
//处理查询列
|
|
25
|
-
fdmItems.forEach(function (fdmField) {
|
|
26
|
-
forEachFormSchema(fdmField.fdmSchema, function (field) {
|
|
27
|
-
var _field$props;
|
|
28
|
-
var findSchema = fieldIdMap.get((_field$props = field.props) === null || _field$props === void 0 ? void 0 : _field$props.fieldId);
|
|
29
|
-
if (findSchema) {
|
|
30
|
-
field.componentName = findSchema.componentName;
|
|
31
|
-
field.props = Object.assign({}, JSON.parse(JSON.stringify(findSchema.props)), field.props);
|
|
32
|
-
//处理子表查询
|
|
33
|
-
if (findSchema.componentName == "SubFormField") {
|
|
34
|
-
if (findSchema.fdmSchema) {
|
|
35
|
-
var subFormFdmSchema = JSON.parse(JSON.stringify(findSchema.fdmSchema));
|
|
36
|
-
forEachFormSchema(subFormFdmSchema, function (field) {
|
|
37
|
-
if (field.componentName === "PageFdm") {
|
|
38
|
-
field.props.layout = "inline";
|
|
39
|
-
}
|
|
40
|
-
return true;
|
|
41
|
-
});
|
|
42
|
-
// @ts-ignore
|
|
43
|
-
field.props.fdmSchema = subFormFdmSchema;
|
|
44
|
-
field.children = subFormFdmSchema.children[0].children;
|
|
45
|
-
console.log(subFormFdmSchema);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
});
|
|
51
|
-
});
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
export function handleFormSchema(_x) {
|
|
4
|
+
return _handleFormSchema.apply(this, arguments);
|
|
52
5
|
}
|
|
53
6
|
|
|
54
7
|
/**
|
|
@@ -56,6 +9,71 @@ export function handleFormSchema(schema) {
|
|
|
56
9
|
* @param schema
|
|
57
10
|
* @param callback 返回true 继续往下遍历
|
|
58
11
|
*/
|
|
12
|
+
function _handleFormSchema() {
|
|
13
|
+
_handleFormSchema = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(schema) {
|
|
14
|
+
var fdmItems, associationFields, fieldIdMap;
|
|
15
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
|
+
while (1) switch (_context.prev = _context.next) {
|
|
17
|
+
case 0:
|
|
18
|
+
fdmItems = [];
|
|
19
|
+
associationFields = [];
|
|
20
|
+
fieldIdMap = new Map();
|
|
21
|
+
schema.state = schema.state || {};
|
|
22
|
+
schema.methods = schema.methods || {};
|
|
23
|
+
forEachFormSchema(schema, function (field) {
|
|
24
|
+
if (field.fdmSchema) {
|
|
25
|
+
var _field$fdmSchema, _field$fdmSchema2;
|
|
26
|
+
fdmItems.push(field);
|
|
27
|
+
field.fdmSchema.props = ((_field$fdmSchema = field.fdmSchema) === null || _field$fdmSchema === void 0 ? void 0 : _field$fdmSchema.props) || {};
|
|
28
|
+
field.fdmSchema.props.style = ((_field$fdmSchema2 = field.fdmSchema) === null || _field$fdmSchema2 === void 0 ? void 0 : _field$fdmSchema2.props.style) || {};
|
|
29
|
+
field.fdmSchema.props.style.height = "100%";
|
|
30
|
+
}
|
|
31
|
+
if (field.props.fieldId) {
|
|
32
|
+
//删除children防止循环
|
|
33
|
+
var copyField = JSON.parse(JSON.stringify(field));
|
|
34
|
+
delete copyField.children;
|
|
35
|
+
fieldIdMap.set(field.props.fieldId, copyField);
|
|
36
|
+
}
|
|
37
|
+
if (field.componentName == "AssociationField") {
|
|
38
|
+
associationFields.push(field);
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
});
|
|
42
|
+
//处理查询列
|
|
43
|
+
fdmItems.forEach(function (fdmField) {
|
|
44
|
+
forEachFormSchema(fdmField.fdmSchema, function (field) {
|
|
45
|
+
var _field$props;
|
|
46
|
+
var findSchema = fieldIdMap.get((_field$props = field.props) === null || _field$props === void 0 ? void 0 : _field$props.fieldId);
|
|
47
|
+
if (findSchema) {
|
|
48
|
+
field.componentName = findSchema.componentName;
|
|
49
|
+
field.props = Object.assign({}, JSON.parse(JSON.stringify(findSchema.props)), field.props);
|
|
50
|
+
//处理子表查询
|
|
51
|
+
if (findSchema.componentName == "SubFormField") {
|
|
52
|
+
if (findSchema.fdmSchema) {
|
|
53
|
+
var subFormFdmSchema = JSON.parse(JSON.stringify(findSchema.fdmSchema));
|
|
54
|
+
forEachFormSchema(subFormFdmSchema, function (field) {
|
|
55
|
+
if (field.componentName === "PageFdm") {
|
|
56
|
+
field.props.layout = "inline";
|
|
57
|
+
}
|
|
58
|
+
return true;
|
|
59
|
+
});
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
field.props.fdmSchema = subFormFdmSchema;
|
|
62
|
+
field.children = subFormFdmSchema.children[0].children;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
case 7:
|
|
70
|
+
case "end":
|
|
71
|
+
return _context.stop();
|
|
72
|
+
}
|
|
73
|
+
}, _callee);
|
|
74
|
+
}));
|
|
75
|
+
return _handleFormSchema.apply(this, arguments);
|
|
76
|
+
}
|
|
59
77
|
export function forEachFormSchema(schema, callback) {
|
|
60
78
|
var _schema$children;
|
|
61
79
|
schema === null || schema === void 0 ? void 0 : (_schema$children = schema.children) === null || _schema$children === void 0 ? void 0 : _schema$children.forEach(function (child, index, children) {
|
package/es/utils/page/index.js
CHANGED
|
@@ -44,11 +44,15 @@ export function hideLoading() {
|
|
|
44
44
|
}
|
|
45
45
|
function _hideLoading() {
|
|
46
46
|
_hideLoading = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
47
|
+
var loading;
|
|
47
48
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
48
49
|
while (1) switch (_context2.prev = _context2.next) {
|
|
49
50
|
case 0:
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
loading = document.getElementById("fullscreen-loading");
|
|
52
|
+
if (loading) {
|
|
53
|
+
loading.style.display = "none";
|
|
54
|
+
}
|
|
55
|
+
case 2:
|
|
52
56
|
case "end":
|
|
53
57
|
return _context2.stop();
|
|
54
58
|
}
|
|
@@ -10,7 +10,6 @@ var _pageLoading = require("../page-loading");
|
|
|
10
10
|
var _common = require("../../utils/common");
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
|
-
var __hasLoading = false;
|
|
14
13
|
function LoadMaterials(props) {
|
|
15
14
|
var _useState = (0, _react.useState)(false),
|
|
16
15
|
init = _useState[0],
|
|
@@ -28,10 +27,9 @@ function LoadMaterials(props) {
|
|
|
28
27
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
29
28
|
while (1) switch (_context.prev = _context.next) {
|
|
30
29
|
case 0:
|
|
31
|
-
|
|
32
|
-
_context.next = 3;
|
|
30
|
+
_context.next = 2;
|
|
33
31
|
return loadMaterials();
|
|
34
|
-
case
|
|
32
|
+
case 2:
|
|
35
33
|
case "end":
|
|
36
34
|
return _context.stop();
|
|
37
35
|
}
|
|
@@ -39,9 +37,6 @@ function LoadMaterials(props) {
|
|
|
39
37
|
}));
|
|
40
38
|
return _initialize.apply(this, arguments);
|
|
41
39
|
}
|
|
42
|
-
if (__hasLoading) {
|
|
43
|
-
return props.children;
|
|
44
|
-
}
|
|
45
40
|
if (init) {
|
|
46
41
|
return props.children;
|
|
47
42
|
} else {
|
|
@@ -18,7 +18,7 @@ var ReactRender = exports.ReactRender = /*#__PURE__*/function (_PureComponent) {
|
|
|
18
18
|
args[_key] = arguments[_key];
|
|
19
19
|
}
|
|
20
20
|
_this = _PureComponent.call.apply(_PureComponent, [this].concat(args)) || this;
|
|
21
|
-
_this.key = Date.now().toString(36);
|
|
21
|
+
_this.key = Date.now().toString(36) + Math.random().toString(36);
|
|
22
22
|
_this.node = void 0;
|
|
23
23
|
return _this;
|
|
24
24
|
}
|
|
@@ -26,7 +26,7 @@ var ReactRender = exports.ReactRender = /*#__PURE__*/function (_PureComponent) {
|
|
|
26
26
|
var _proto = ReactRender.prototype;
|
|
27
27
|
_proto.render = function render() {
|
|
28
28
|
var _this2 = this;
|
|
29
|
-
var components = this.props.components;
|
|
29
|
+
var components = this.props.components || window._components;
|
|
30
30
|
// @ts-ignore
|
|
31
31
|
return /*#__PURE__*/React.createElement(_configProvider["default"], {
|
|
32
32
|
locale: _zh_CN["default"]
|
|
@@ -37,7 +37,7 @@ var ReactRender = exports.ReactRender = /*#__PURE__*/function (_PureComponent) {
|
|
|
37
37
|
_this2.node = node === null || node === void 0 ? void 0 : node.__ref;
|
|
38
38
|
},
|
|
39
39
|
thisRequiredInJSE: true,
|
|
40
|
-
components: components
|
|
40
|
+
components: components,
|
|
41
41
|
appHelper: {
|
|
42
42
|
utils: _utils["default"],
|
|
43
43
|
requestHandlersMap: {
|
|
@@ -1,33 +1,7 @@
|
|
|
1
|
-
export declare function handleFormSchema(schema: any): void
|
|
1
|
+
export declare function handleFormSchema(schema: any): Promise<void>;
|
|
2
2
|
/**
|
|
3
3
|
* 遍历schema
|
|
4
4
|
* @param schema
|
|
5
5
|
* @param callback 返回true 继续往下遍历
|
|
6
6
|
*/
|
|
7
|
-
export declare function forEachFormSchema(schema:
|
|
8
|
-
export interface FormSchema {
|
|
9
|
-
id?: string;
|
|
10
|
-
state: any;
|
|
11
|
-
methods: any;
|
|
12
|
-
componentName: string;
|
|
13
|
-
formId?: string;
|
|
14
|
-
tableName?: string;
|
|
15
|
-
schemaName?: string;
|
|
16
|
-
columnName?: string;
|
|
17
|
-
fdmSchema?: any;
|
|
18
|
-
props: FormSchemaProps;
|
|
19
|
-
children?: FormSchema[];
|
|
20
|
-
}
|
|
21
|
-
export interface FormSchemaProps {
|
|
22
|
-
fieldId: string;
|
|
23
|
-
label: string;
|
|
24
|
-
fieldSchema?: any;
|
|
25
|
-
columnName: string;
|
|
26
|
-
array: boolean;
|
|
27
|
-
layout?: "inline";
|
|
28
|
-
fdmSchema?: any;
|
|
29
|
-
associationForm: {
|
|
30
|
-
id: string;
|
|
31
|
-
fieldId: string;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
7
|
+
export declare function forEachFormSchema(schema: any, callback: (child: any, index: number, children: any[]) => boolean): void;
|
|
@@ -1,66 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
exports.__esModule = true;
|
|
4
5
|
exports.forEachFormSchema = forEachFormSchema;
|
|
5
6
|
exports.handleFormSchema = handleFormSchema;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
schema.methods = schema.methods || {};
|
|
11
|
-
forEachFormSchema(schema, function (field) {
|
|
12
|
-
if (field.fdmSchema) {
|
|
13
|
-
var _field$fdmSchema, _field$fdmSchema2;
|
|
14
|
-
fdmItems.push(field);
|
|
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%";
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
field.fdmSchema.props.noContainer = true;
|
|
20
|
-
}
|
|
21
|
-
if (field.props.fieldId) {
|
|
22
|
-
//删除children防止循环
|
|
23
|
-
var copyField = JSON.parse(JSON.stringify(field));
|
|
24
|
-
delete copyField.children;
|
|
25
|
-
fieldIdMap.set(field.props.fieldId, copyField);
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
});
|
|
29
|
-
//处理查询列
|
|
30
|
-
fdmItems.forEach(function (fdmField) {
|
|
31
|
-
forEachFormSchema(fdmField.fdmSchema, function (field) {
|
|
32
|
-
var _field$props;
|
|
33
|
-
var findSchema = fieldIdMap.get((_field$props = field.props) === null || _field$props === void 0 ? void 0 : _field$props.fieldId);
|
|
34
|
-
if (findSchema) {
|
|
35
|
-
field.componentName = findSchema.componentName;
|
|
36
|
-
field.props = Object.assign({}, JSON.parse(JSON.stringify(findSchema.props)), field.props);
|
|
37
|
-
//处理子表查询
|
|
38
|
-
if (findSchema.componentName == "SubFormField") {
|
|
39
|
-
if (findSchema.fdmSchema) {
|
|
40
|
-
var subFormFdmSchema = JSON.parse(JSON.stringify(findSchema.fdmSchema));
|
|
41
|
-
forEachFormSchema(subFormFdmSchema, function (field) {
|
|
42
|
-
if (field.componentName === "PageFdm") {
|
|
43
|
-
field.props.layout = "inline";
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
});
|
|
47
|
-
// @ts-ignore
|
|
48
|
-
field.props.fdmSchema = subFormFdmSchema;
|
|
49
|
-
field.children = subFormFdmSchema.children[0].children;
|
|
50
|
-
console.log(subFormFdmSchema);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return true;
|
|
55
|
-
});
|
|
56
|
-
});
|
|
7
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
function handleFormSchema(_x) {
|
|
10
|
+
return _handleFormSchema.apply(this, arguments);
|
|
57
11
|
}
|
|
58
|
-
|
|
59
12
|
/**
|
|
60
13
|
* 遍历schema
|
|
61
14
|
* @param schema
|
|
62
15
|
* @param callback 返回true 继续往下遍历
|
|
63
16
|
*/
|
|
17
|
+
function _handleFormSchema() {
|
|
18
|
+
_handleFormSchema = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(schema) {
|
|
19
|
+
var fdmItems, associationFields, fieldIdMap;
|
|
20
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
fdmItems = [];
|
|
24
|
+
associationFields = [];
|
|
25
|
+
fieldIdMap = new Map();
|
|
26
|
+
schema.state = schema.state || {};
|
|
27
|
+
schema.methods = schema.methods || {};
|
|
28
|
+
forEachFormSchema(schema, function (field) {
|
|
29
|
+
if (field.fdmSchema) {
|
|
30
|
+
var _field$fdmSchema, _field$fdmSchema2;
|
|
31
|
+
fdmItems.push(field);
|
|
32
|
+
field.fdmSchema.props = ((_field$fdmSchema = field.fdmSchema) === null || _field$fdmSchema === void 0 ? void 0 : _field$fdmSchema.props) || {};
|
|
33
|
+
field.fdmSchema.props.style = ((_field$fdmSchema2 = field.fdmSchema) === null || _field$fdmSchema2 === void 0 ? void 0 : _field$fdmSchema2.props.style) || {};
|
|
34
|
+
field.fdmSchema.props.style.height = "100%";
|
|
35
|
+
}
|
|
36
|
+
if (field.props.fieldId) {
|
|
37
|
+
//删除children防止循环
|
|
38
|
+
var copyField = JSON.parse(JSON.stringify(field));
|
|
39
|
+
delete copyField.children;
|
|
40
|
+
fieldIdMap.set(field.props.fieldId, copyField);
|
|
41
|
+
}
|
|
42
|
+
if (field.componentName == "AssociationField") {
|
|
43
|
+
associationFields.push(field);
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
});
|
|
47
|
+
//处理查询列
|
|
48
|
+
fdmItems.forEach(function (fdmField) {
|
|
49
|
+
forEachFormSchema(fdmField.fdmSchema, function (field) {
|
|
50
|
+
var _field$props;
|
|
51
|
+
var findSchema = fieldIdMap.get((_field$props = field.props) === null || _field$props === void 0 ? void 0 : _field$props.fieldId);
|
|
52
|
+
if (findSchema) {
|
|
53
|
+
field.componentName = findSchema.componentName;
|
|
54
|
+
field.props = Object.assign({}, JSON.parse(JSON.stringify(findSchema.props)), field.props);
|
|
55
|
+
//处理子表查询
|
|
56
|
+
if (findSchema.componentName == "SubFormField") {
|
|
57
|
+
if (findSchema.fdmSchema) {
|
|
58
|
+
var subFormFdmSchema = JSON.parse(JSON.stringify(findSchema.fdmSchema));
|
|
59
|
+
forEachFormSchema(subFormFdmSchema, function (field) {
|
|
60
|
+
if (field.componentName === "PageFdm") {
|
|
61
|
+
field.props.layout = "inline";
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
});
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
field.props.fdmSchema = subFormFdmSchema;
|
|
67
|
+
field.children = subFormFdmSchema.children[0].children;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
case 7:
|
|
75
|
+
case "end":
|
|
76
|
+
return _context.stop();
|
|
77
|
+
}
|
|
78
|
+
}, _callee);
|
|
79
|
+
}));
|
|
80
|
+
return _handleFormSchema.apply(this, arguments);
|
|
81
|
+
}
|
|
64
82
|
function forEachFormSchema(schema, callback) {
|
|
65
83
|
var _schema$children;
|
|
66
84
|
schema === null || schema === void 0 ? void 0 : (_schema$children = schema.children) === null || _schema$children === void 0 ? void 0 : _schema$children.forEach(function (child, index, children) {
|
package/lib/utils/page/index.js
CHANGED
|
@@ -54,11 +54,15 @@ function hideLoading() {
|
|
|
54
54
|
}
|
|
55
55
|
function _hideLoading() {
|
|
56
56
|
_hideLoading = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
57
|
+
var loading;
|
|
57
58
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
58
59
|
while (1) switch (_context2.prev = _context2.next) {
|
|
59
60
|
case 0:
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
loading = document.getElementById("fullscreen-loading");
|
|
62
|
+
if (loading) {
|
|
63
|
+
loading.style.display = "none";
|
|
64
|
+
}
|
|
65
|
+
case 2:
|
|
62
66
|
case "end":
|
|
63
67
|
return _context2.stop();
|
|
64
68
|
}
|