@zhubangyun/lowcode-core 1.1.0
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/layout/index.d.ts +34 -0
- package/es/components/layout/index.js +63 -0
- package/es/components/layout/index.less +20 -0
- package/es/components/schema-render/components/assets.d.ts +32 -0
- package/es/components/schema-render/components/assets.js +53 -0
- package/es/components/schema-render/components/demo-schema.d.ts +85 -0
- package/es/components/schema-render/components/demo-schema.js +107 -0
- package/es/components/schema-render/components/schema-render-base.d.ts +43 -0
- package/es/components/schema-render/components/schema-render-base.js +142 -0
- package/es/components/schema-render/components/schema-render-layout.d.ts +6 -0
- package/es/components/schema-render/components/schema-render-layout.js +46 -0
- package/es/components/schema-render/index.d.ts +31 -0
- package/es/components/schema-render/index.js +46 -0
- package/es/components/typing.d.ts +3 -0
- package/es/components/typing.js +12 -0
- package/es/index.d.ts +7 -0
- package/es/index.js +7 -0
- package/es/pages/data/assets.d.ts +32 -0
- package/es/pages/data/assets.js +53 -0
- package/es/pages/data/schema.d.ts +50 -0
- package/es/pages/data/schema.js +49 -0
- package/es/pages/index.d.ts +1 -0
- package/es/pages/index.js +31 -0
- package/es/pages/index.less +0 -0
- package/es/style.js +6 -0
- package/es/utils/api/index.d.ts +1 -0
- package/es/utils/api/index.js +12 -0
- package/es/utils/common/ClientCache.d.ts +36 -0
- package/es/utils/common/ClientCache.js +120 -0
- package/es/utils/common/FormDataHandler.d.ts +45 -0
- package/es/utils/common/FormDataHandler.js +410 -0
- package/es/utils/common/LoadPlugins.d.ts +1 -0
- package/es/utils/common/LoadPlugins.js +158 -0
- package/es/utils/common/ProcessHandler.d.ts +30 -0
- package/es/utils/common/ProcessHandler.js +303 -0
- package/es/utils/common/Request.d.ts +2 -0
- package/es/utils/common/Request.js +20 -0
- package/es/utils/common/RestApi.d.ts +80 -0
- package/es/utils/common/RestApi.js +226 -0
- package/es/utils/common/RestFormApi.d.ts +12 -0
- package/es/utils/common/RestFormApi.js +158 -0
- package/es/utils/common/SubFormInstance.d.ts +26 -0
- package/es/utils/common/SubFormInstance.js +100 -0
- package/es/utils/common/UserInfo.d.ts +9 -0
- package/es/utils/common/UserInfo.js +19 -0
- package/es/utils/common/index.d.ts +7 -0
- package/es/utils/common/index.js +39 -0
- package/es/utils/index.d.ts +17 -0
- package/es/utils/index.js +11 -0
- package/es/utils/lowcode/index.d.ts +1 -0
- package/es/utils/lowcode/index.js +1 -0
- package/es/utils/lowcode/parseAssets.d.ts +3 -0
- package/es/utils/lowcode/parseAssets.js +185 -0
- package/lib/components/layout/index.d.ts +34 -0
- package/lib/components/layout/index.js +69 -0
- package/lib/components/layout/index.less +20 -0
- package/lib/components/schema-render/components/assets.d.ts +32 -0
- package/lib/components/schema-render/components/assets.js +57 -0
- package/lib/components/schema-render/components/demo-schema.d.ts +85 -0
- package/lib/components/schema-render/components/demo-schema.js +111 -0
- package/lib/components/schema-render/components/schema-render-base.d.ts +43 -0
- package/lib/components/schema-render/components/schema-render-base.js +149 -0
- package/lib/components/schema-render/components/schema-render-layout.d.ts +6 -0
- package/lib/components/schema-render/components/schema-render-layout.js +51 -0
- package/lib/components/schema-render/index.d.ts +31 -0
- package/lib/components/schema-render/index.js +53 -0
- package/lib/components/typing.d.ts +3 -0
- package/lib/components/typing.js +17 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +15 -0
- package/lib/pages/data/assets.d.ts +32 -0
- package/lib/pages/data/assets.js +57 -0
- package/lib/pages/data/schema.d.ts +50 -0
- package/lib/pages/data/schema.js +53 -0
- package/lib/pages/index.d.ts +1 -0
- package/lib/pages/index.js +34 -0
- package/lib/pages/index.less +0 -0
- package/lib/style.js +6 -0
- package/lib/utils/api/index.d.ts +1 -0
- package/lib/utils/api/index.js +17 -0
- package/lib/utils/common/ClientCache.d.ts +36 -0
- package/lib/utils/common/ClientCache.js +125 -0
- package/lib/utils/common/FormDataHandler.d.ts +45 -0
- package/lib/utils/common/FormDataHandler.js +416 -0
- package/lib/utils/common/LoadPlugins.d.ts +1 -0
- package/lib/utils/common/LoadPlugins.js +163 -0
- package/lib/utils/common/ProcessHandler.d.ts +30 -0
- package/lib/utils/common/ProcessHandler.js +308 -0
- package/lib/utils/common/Request.d.ts +2 -0
- package/lib/utils/common/Request.js +25 -0
- package/lib/utils/common/RestApi.d.ts +80 -0
- package/lib/utils/common/RestApi.js +230 -0
- package/lib/utils/common/RestFormApi.d.ts +12 -0
- package/lib/utils/common/RestFormApi.js +163 -0
- package/lib/utils/common/SubFormInstance.d.ts +26 -0
- package/lib/utils/common/SubFormInstance.js +105 -0
- package/lib/utils/common/UserInfo.d.ts +9 -0
- package/lib/utils/common/UserInfo.js +24 -0
- package/lib/utils/common/index.d.ts +7 -0
- package/lib/utils/common/index.js +48 -0
- package/lib/utils/index.d.ts +17 -0
- package/lib/utils/index.js +34 -0
- package/lib/utils/lowcode/index.d.ts +1 -0
- package/lib/utils/lowcode/index.js +6 -0
- package/lib/utils/lowcode/parseAssets.d.ts +3 -0
- package/lib/utils/lowcode/parseAssets.js +192 -0
- package/package.json +65 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.SchemaRender = void 0;
|
|
6
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
8
|
+
var _schemaRenderBase = require("./components/schema-render-base");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _schemaRenderLayout = require("./components/schema-render-layout");
|
|
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
|
+
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 SchemaRender = exports.SchemaRender = /*#__PURE__*/function (_Component) {
|
|
14
|
+
function SchemaRender(props) {
|
|
15
|
+
var _this;
|
|
16
|
+
_this = _Component.call(this, props) || this;
|
|
17
|
+
_this.state = {
|
|
18
|
+
show: true
|
|
19
|
+
};
|
|
20
|
+
_this.page = void 0;
|
|
21
|
+
/**
|
|
22
|
+
* 显示页面
|
|
23
|
+
*/
|
|
24
|
+
_this.showPage = function () {
|
|
25
|
+
_this.setState({
|
|
26
|
+
show: true
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 隐藏页面
|
|
31
|
+
*/
|
|
32
|
+
_this.hidePage = function () {
|
|
33
|
+
_this.setState({
|
|
34
|
+
show: false
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
_this.state.show = !!props.defaultShow;
|
|
38
|
+
return _this;
|
|
39
|
+
}
|
|
40
|
+
(0, _inheritsLoose2["default"])(SchemaRender, _Component);
|
|
41
|
+
var _proto = SchemaRender.prototype;
|
|
42
|
+
_proto.render = function render() {
|
|
43
|
+
var _this2 = this;
|
|
44
|
+
return /*#__PURE__*/_react["default"].createElement(_schemaRenderLayout.SchemaRenderLayout, {
|
|
45
|
+
root: this
|
|
46
|
+
}, /*#__PURE__*/_react["default"].createElement(_schemaRenderBase.SchemaRenderBase, (0, _extends2["default"])({}, this.props, {
|
|
47
|
+
ref: function ref(base) {
|
|
48
|
+
_this2.page = base === null || base === void 0 ? void 0 : base.page;
|
|
49
|
+
}
|
|
50
|
+
})));
|
|
51
|
+
};
|
|
52
|
+
return SchemaRender;
|
|
53
|
+
}(_react.Component);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.PageSizeEnum = void 0;
|
|
5
|
+
exports.getPageSize = getPageSize;
|
|
6
|
+
var PageSizeEnum = exports.PageSizeEnum = {
|
|
7
|
+
small: calWidth(1),
|
|
8
|
+
middle: calWidth(2),
|
|
9
|
+
larger: calWidth(4),
|
|
10
|
+
full: "100%"
|
|
11
|
+
};
|
|
12
|
+
function getPageSize(size) {
|
|
13
|
+
return (size ? PageSizeEnum[size] : PageSizeEnum.larger) || PageSizeEnum.larger;
|
|
14
|
+
}
|
|
15
|
+
function calWidth(i) {
|
|
16
|
+
return 300 * i + (i + 1) * 12;
|
|
17
|
+
}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as utils from "./utils";
|
|
2
|
+
export { RestApi } from "./utils";
|
|
3
|
+
export { RestFormApi } from "./utils";
|
|
4
|
+
export { ClientCache } from "./utils";
|
|
5
|
+
export { Layout } from "./components/layout";
|
|
6
|
+
export { SchemaRender } from "./components/schema-render";
|
|
7
|
+
export { utils };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.utils = exports.SchemaRender = exports.RestFormApi = exports.RestApi = exports.Layout = exports.ClientCache = void 0;
|
|
5
|
+
var utils = _interopRequireWildcard(require("./utils"));
|
|
6
|
+
exports.RestApi = utils.RestApi;
|
|
7
|
+
exports.RestFormApi = utils.RestFormApi;
|
|
8
|
+
exports.ClientCache = utils.ClientCache;
|
|
9
|
+
exports.utils = utils;
|
|
10
|
+
var _layout = require("./components/layout");
|
|
11
|
+
exports.Layout = _layout.Layout;
|
|
12
|
+
var _schemaRender = require("./components/schema-render");
|
|
13
|
+
exports.SchemaRender = _schemaRender.SchemaRender;
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
packages: ({
|
|
3
|
+
package: string;
|
|
4
|
+
version: string;
|
|
5
|
+
library: string;
|
|
6
|
+
urls: string[];
|
|
7
|
+
title?: undefined;
|
|
8
|
+
description?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
title: string;
|
|
11
|
+
package: string;
|
|
12
|
+
version: string;
|
|
13
|
+
description: string;
|
|
14
|
+
urls: string[];
|
|
15
|
+
library: string;
|
|
16
|
+
})[];
|
|
17
|
+
components: {
|
|
18
|
+
exportName: string;
|
|
19
|
+
npm: {
|
|
20
|
+
package: string;
|
|
21
|
+
version: string;
|
|
22
|
+
};
|
|
23
|
+
url: string;
|
|
24
|
+
}[];
|
|
25
|
+
sort: {
|
|
26
|
+
groupList: string[];
|
|
27
|
+
categoryList: string[];
|
|
28
|
+
};
|
|
29
|
+
groupList: string[];
|
|
30
|
+
ignoreComponents: {};
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
var _default = exports["default"] = {
|
|
6
|
+
"packages": [{
|
|
7
|
+
"package": "root-material",
|
|
8
|
+
"version": "0.1.0",
|
|
9
|
+
"library": "RootMaterial",
|
|
10
|
+
"urls": ["https://cdn.zhiyunhe.com/plugin/lowcode/materials/root/view.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/root/view.css"]
|
|
11
|
+
}, {
|
|
12
|
+
"package": "antd-material",
|
|
13
|
+
"version": "0.1.0",
|
|
14
|
+
"library": "AntdMaterial",
|
|
15
|
+
"urls": ["https://cdn.zhiyunhe.com/plugin/dayjs/dayjs.min.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd/view.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd/view.css"]
|
|
16
|
+
}, {
|
|
17
|
+
"title": "fusion组件库",
|
|
18
|
+
"package": "@alifd/next",
|
|
19
|
+
"version": "1.26.4",
|
|
20
|
+
"description": "不可删除否则会出问题",
|
|
21
|
+
"urls": ["https://g.alicdn.com/code/lib/alifd__next/1.26.4/next-with-locales.min.js"],
|
|
22
|
+
"library": "Next"
|
|
23
|
+
}, {
|
|
24
|
+
"package": "chart-material",
|
|
25
|
+
"version": "0.1.0",
|
|
26
|
+
"library": "ChartMaterial",
|
|
27
|
+
"urls": ["https://cdn.zhiyunhe.com/plugin/antv/g2/5.1.19/g2.min.js", "https://cdn.zhiyunhe.com/plugin/datav/1.2.5/datav.min.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/chart/view.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/chart/view.css"]
|
|
28
|
+
}],
|
|
29
|
+
"components": [{
|
|
30
|
+
"exportName": "RootMaterialMeta",
|
|
31
|
+
"npm": {
|
|
32
|
+
"package": "root-material",
|
|
33
|
+
"version": "1.0.0"
|
|
34
|
+
},
|
|
35
|
+
"url": "https://cdn.zhiyunhe.com/plugin/lowcode/materials/root/meta.js"
|
|
36
|
+
}, {
|
|
37
|
+
"exportName": "AntdMaterialMeta",
|
|
38
|
+
"npm": {
|
|
39
|
+
"package": "antd-material",
|
|
40
|
+
"version": "1.0.0"
|
|
41
|
+
},
|
|
42
|
+
"url": "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd/meta.js"
|
|
43
|
+
}, {
|
|
44
|
+
"exportName": "ChartMaterialMeta",
|
|
45
|
+
"npm": {
|
|
46
|
+
"package": "chart-material",
|
|
47
|
+
"version": "1.0.0"
|
|
48
|
+
},
|
|
49
|
+
"url": "https://cdn.zhiyunhe.com/plugin/lowcode/materials/chart/meta.js"
|
|
50
|
+
}],
|
|
51
|
+
"sort": {
|
|
52
|
+
"groupList": ["", "默认分组", "原子组件", "精选组件", "图表组件"],
|
|
53
|
+
"categoryList": ["布局", "通用", "导航", "数据录入", "数据展示", "反馈", "大屏组件", "图表", "基础元素", "表格类", "表单详情类", "帮助类", "对话框类", "业务类", "引导", "信息输入", "信息展示", "信息反馈", "布局容器类"]
|
|
54
|
+
},
|
|
55
|
+
"groupList": ["默认分组", "原子组件", "精选组件", "图表组件"],
|
|
56
|
+
"ignoreComponents": {}
|
|
57
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
componentName: string;
|
|
3
|
+
props: {
|
|
4
|
+
ref: string;
|
|
5
|
+
style: {
|
|
6
|
+
height: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
dataSource: {
|
|
10
|
+
list: any[];
|
|
11
|
+
};
|
|
12
|
+
css: string;
|
|
13
|
+
hidden: boolean;
|
|
14
|
+
title: string;
|
|
15
|
+
isLocked: boolean;
|
|
16
|
+
condition: boolean;
|
|
17
|
+
conditionGroup: string;
|
|
18
|
+
state: {
|
|
19
|
+
isShowDialog: {
|
|
20
|
+
type: string;
|
|
21
|
+
value: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
methods: {
|
|
25
|
+
openDialog: {
|
|
26
|
+
type: string;
|
|
27
|
+
value: string;
|
|
28
|
+
source: string;
|
|
29
|
+
};
|
|
30
|
+
closeDialog: {
|
|
31
|
+
type: string;
|
|
32
|
+
value: string;
|
|
33
|
+
source: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
lifeCycles: {
|
|
37
|
+
componentDidMount: {
|
|
38
|
+
type: string;
|
|
39
|
+
value: string;
|
|
40
|
+
source: string;
|
|
41
|
+
};
|
|
42
|
+
componentWillUnmount: {
|
|
43
|
+
type: string;
|
|
44
|
+
value: string;
|
|
45
|
+
source: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
children: any[];
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
var _default = exports["default"] = {
|
|
6
|
+
"componentName": "Page",
|
|
7
|
+
"props": {
|
|
8
|
+
"ref": "root",
|
|
9
|
+
"style": {
|
|
10
|
+
"height": "100%"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"dataSource": {
|
|
14
|
+
"list": []
|
|
15
|
+
},
|
|
16
|
+
"css": "",
|
|
17
|
+
"hidden": false,
|
|
18
|
+
"title": "",
|
|
19
|
+
"isLocked": false,
|
|
20
|
+
"condition": true,
|
|
21
|
+
"conditionGroup": "",
|
|
22
|
+
"state": {
|
|
23
|
+
"isShowDialog": {
|
|
24
|
+
"type": "JSExpression",
|
|
25
|
+
"value": "false"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"methods": {
|
|
29
|
+
"openDialog": {
|
|
30
|
+
"type": "JSFunction",
|
|
31
|
+
"value": "function openDialog() {\n this.setState({\n isShowDialog: true\n });\n}",
|
|
32
|
+
"source": "function openDialog() {\n this.setState({\n isShowDialog: true\n });\n}"
|
|
33
|
+
},
|
|
34
|
+
"closeDialog": {
|
|
35
|
+
"type": "JSFunction",
|
|
36
|
+
"value": "function closeDialog() {\n this.setState({\n isShowDialog: false\n });\n}",
|
|
37
|
+
"source": "function closeDialog() {\n this.setState({\n isShowDialog: false\n });\n}"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"lifeCycles": {
|
|
41
|
+
"componentDidMount": {
|
|
42
|
+
"type": "JSFunction",
|
|
43
|
+
"value": "function componentDidMount() {\n console.log('did mount');\n}",
|
|
44
|
+
"source": "function componentDidMount() {\n console.log('did mount');\n}"
|
|
45
|
+
},
|
|
46
|
+
"componentWillUnmount": {
|
|
47
|
+
"type": "JSFunction",
|
|
48
|
+
"value": "function componentWillUnmount() {\n console.log('will unmount');\n}",
|
|
49
|
+
"source": "function componentWillUnmount() {\n console.log('will unmount');\n}"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"children": []
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _react = _interopRequireDefault(require("react"));
|
|
5
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
6
|
+
var _schemaRender = require("../components/schema-render");
|
|
7
|
+
var _layout = require("../components/layout");
|
|
8
|
+
function App() {
|
|
9
|
+
return /*#__PURE__*/_react["default"].createElement(_layout.Layout, {
|
|
10
|
+
left: "left",
|
|
11
|
+
right: "right",
|
|
12
|
+
header: "header",
|
|
13
|
+
footer: "footer"
|
|
14
|
+
}, "123");
|
|
15
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
16
|
+
style: {
|
|
17
|
+
padding: 24,
|
|
18
|
+
height: "100%",
|
|
19
|
+
background: "#f1f1f1"
|
|
20
|
+
}
|
|
21
|
+
}, /*#__PURE__*/_react["default"].createElement(_schemaRender.SchemaRender, {
|
|
22
|
+
layout: "modal",
|
|
23
|
+
schemaId: "test",
|
|
24
|
+
defaultShow: true
|
|
25
|
+
}), /*#__PURE__*/_react["default"].createElement(_schemaRender.SchemaRender, {
|
|
26
|
+
layout: "drawer",
|
|
27
|
+
schemaId: "test",
|
|
28
|
+
defaultShow: true
|
|
29
|
+
}), /*#__PURE__*/_react["default"].createElement(_schemaRender.SchemaRender, {
|
|
30
|
+
schemaId: "test",
|
|
31
|
+
defaultShow: true
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(App, null), document.getElementById('root'));
|
|
File without changes
|
package/lib/style.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const request: import("axios").AxiosInstance;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.request = void 0;
|
|
6
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
7
|
+
var _Request = require("../common/Request");
|
|
8
|
+
var request = exports.request = _axios["default"].create({
|
|
9
|
+
baseURL: "/api",
|
|
10
|
+
// 基础URL
|
|
11
|
+
timeout: 10000,
|
|
12
|
+
// 请求超时时间(毫秒)
|
|
13
|
+
headers: {
|
|
14
|
+
'Content-Type': 'application/json;charset=UTF-8'
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
request.interceptors.response.use(_Request.onFulfilled, _Request.onRejected);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare type LoadData = (key: string) => Promise<any>;
|
|
2
|
+
export declare class ClientCache {
|
|
3
|
+
private cacheMap;
|
|
4
|
+
name: string;
|
|
5
|
+
loadData: LoadData;
|
|
6
|
+
constructor(options: {
|
|
7
|
+
name: string;
|
|
8
|
+
loadData: LoadData;
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* 获取值
|
|
12
|
+
* @param key
|
|
13
|
+
* @param cache 是否从缓存中获取
|
|
14
|
+
*/
|
|
15
|
+
get(key: string, cache?: boolean): Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* 重新加载
|
|
18
|
+
* @param key
|
|
19
|
+
*/
|
|
20
|
+
reload(key: string): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* 手动设置
|
|
23
|
+
* @param key
|
|
24
|
+
* @param value
|
|
25
|
+
*/
|
|
26
|
+
set(key: string, value: any): void;
|
|
27
|
+
/**
|
|
28
|
+
* 删除某个缓存
|
|
29
|
+
* @param key
|
|
30
|
+
*/
|
|
31
|
+
delete(key: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* 删除全部缓存
|
|
34
|
+
*/
|
|
35
|
+
clear(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.ClientCache = void 0;
|
|
6
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
+
var ClientCache = exports.ClientCache = /*#__PURE__*/function () {
|
|
9
|
+
function ClientCache(options) {
|
|
10
|
+
this.cacheMap = void 0;
|
|
11
|
+
this.name = void 0;
|
|
12
|
+
this.loadData = void 0;
|
|
13
|
+
this.cacheMap = new Map();
|
|
14
|
+
this.name = options.name;
|
|
15
|
+
if (typeof options.loadData == "function") {
|
|
16
|
+
this.loadData = options.loadData;
|
|
17
|
+
} else {
|
|
18
|
+
this.loadData = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
19
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
20
|
+
while (1) switch (_context.prev = _context.next) {
|
|
21
|
+
case 0:
|
|
22
|
+
return _context.abrupt("return", null);
|
|
23
|
+
case 1:
|
|
24
|
+
case "end":
|
|
25
|
+
return _context.stop();
|
|
26
|
+
}
|
|
27
|
+
}, _callee);
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 获取值
|
|
34
|
+
* @param key
|
|
35
|
+
* @param cache 是否从缓存中获取
|
|
36
|
+
*/
|
|
37
|
+
var _proto = ClientCache.prototype;
|
|
38
|
+
_proto.get =
|
|
39
|
+
/*#__PURE__*/
|
|
40
|
+
function () {
|
|
41
|
+
var _get = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(key, cache) {
|
|
42
|
+
var value;
|
|
43
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
44
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
45
|
+
case 0:
|
|
46
|
+
if (!(!cache && this.cacheMap.has(key))) {
|
|
47
|
+
_context2.next = 2;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
return _context2.abrupt("return", this.cacheMap.get(key));
|
|
51
|
+
case 2:
|
|
52
|
+
_context2.prev = 2;
|
|
53
|
+
_context2.next = 5;
|
|
54
|
+
return this.loadData(key);
|
|
55
|
+
case 5:
|
|
56
|
+
value = _context2.sent;
|
|
57
|
+
this.cacheMap.set(key, value);
|
|
58
|
+
return _context2.abrupt("return", value);
|
|
59
|
+
case 10:
|
|
60
|
+
_context2.prev = 10;
|
|
61
|
+
_context2.t0 = _context2["catch"](2);
|
|
62
|
+
console.log("\u7F13\u5B58 {" + this.name + "} \u83B7\u53D6\u503C\u5931\u8D25!\u5C06\u8FD4\u56DEnull", _context2.t0);
|
|
63
|
+
this.cacheMap.set(key, null);
|
|
64
|
+
return _context2.abrupt("return", null);
|
|
65
|
+
case 15:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context2.stop();
|
|
68
|
+
}
|
|
69
|
+
}, _callee2, this, [[2, 10]]);
|
|
70
|
+
}));
|
|
71
|
+
function get(_x, _x2) {
|
|
72
|
+
return _get.apply(this, arguments);
|
|
73
|
+
}
|
|
74
|
+
return get;
|
|
75
|
+
}()
|
|
76
|
+
/**
|
|
77
|
+
* 重新加载
|
|
78
|
+
* @param key
|
|
79
|
+
*/
|
|
80
|
+
;
|
|
81
|
+
_proto.reload =
|
|
82
|
+
/*#__PURE__*/
|
|
83
|
+
function () {
|
|
84
|
+
var _reload = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(key) {
|
|
85
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
86
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
87
|
+
case 0:
|
|
88
|
+
return _context3.abrupt("return", this.get(key, false));
|
|
89
|
+
case 1:
|
|
90
|
+
case "end":
|
|
91
|
+
return _context3.stop();
|
|
92
|
+
}
|
|
93
|
+
}, _callee3, this);
|
|
94
|
+
}));
|
|
95
|
+
function reload(_x3) {
|
|
96
|
+
return _reload.apply(this, arguments);
|
|
97
|
+
}
|
|
98
|
+
return reload;
|
|
99
|
+
}()
|
|
100
|
+
/**
|
|
101
|
+
* 手动设置
|
|
102
|
+
* @param key
|
|
103
|
+
* @param value
|
|
104
|
+
*/
|
|
105
|
+
;
|
|
106
|
+
_proto.set = function set(key, value) {
|
|
107
|
+
this.cacheMap.set(key, value);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 删除某个缓存
|
|
112
|
+
* @param key
|
|
113
|
+
*/;
|
|
114
|
+
_proto["delete"] = function _delete(key) {
|
|
115
|
+
this.cacheMap["delete"](key);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 删除全部缓存
|
|
120
|
+
*/;
|
|
121
|
+
_proto.clear = function clear() {
|
|
122
|
+
this.cacheMap.clear();
|
|
123
|
+
};
|
|
124
|
+
return ClientCache;
|
|
125
|
+
}();
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ProcessScriptOptions, ProcessScriptType } from "./ProcessHandler";
|
|
2
|
+
declare type Schema = {
|
|
3
|
+
componentName: string;
|
|
4
|
+
props: {
|
|
5
|
+
scripts: ProcessScriptType[];
|
|
6
|
+
format: string;
|
|
7
|
+
defaultValue: {
|
|
8
|
+
custom: any;
|
|
9
|
+
linkage: any;
|
|
10
|
+
shortcut: string;
|
|
11
|
+
formula: string;
|
|
12
|
+
type: "linkage" | "custom" | "formula" | "shortcut";
|
|
13
|
+
};
|
|
14
|
+
trim: boolean;
|
|
15
|
+
name: string;
|
|
16
|
+
label: string;
|
|
17
|
+
fillTableValues?: string[];
|
|
18
|
+
formula?: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default class FormDataHandler {
|
|
22
|
+
schema: Schema;
|
|
23
|
+
name: string;
|
|
24
|
+
fields: Schema[];
|
|
25
|
+
scripts: ProcessScriptType[];
|
|
26
|
+
subFormHandlers: FormDataHandler[];
|
|
27
|
+
constructor(schema: any);
|
|
28
|
+
onValuesChange(options: ProcessScriptOptions): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* 处理联动数据
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
private handleLinkage;
|
|
34
|
+
private handleFieldValue;
|
|
35
|
+
/**
|
|
36
|
+
* 处理填充子表
|
|
37
|
+
*/
|
|
38
|
+
private handleFillTableValues;
|
|
39
|
+
/***
|
|
40
|
+
* 创建初期值
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
createInitValues(): Promise<any>;
|
|
44
|
+
}
|
|
45
|
+
export {};
|