@zhubangyun/lowcode-core 5.5.85 → 5.6.211
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-loading/index.js +2 -1
- package/es/index.less +3 -0
- package/es/utils/api/form-api.d.ts +6 -1
- package/es/utils/api/form-api.js +153 -1
- package/es/utils/api/rest-api.d.ts +10 -0
- package/es/utils/cache/index.js +7 -3
- package/es/utils/cache/schema.js +232 -12
- package/es/utils/page/index.d.ts +1 -0
- package/es/utils/page/index.js +1 -0
- package/es/utils/page/page-form-data-manager.d.ts +15 -0
- package/es/utils/page/page-form-data-manager.js +132 -0
- package/lib/components/page-loading/index.js +2 -1
- package/lib/index.less +3 -0
- package/lib/utils/api/form-api.d.ts +6 -1
- package/lib/utils/api/form-api.js +153 -1
- package/lib/utils/api/rest-api.d.ts +10 -0
- package/lib/utils/cache/index.js +7 -3
- package/lib/utils/cache/schema.js +232 -13
- package/lib/utils/page/index.d.ts +1 -0
- package/lib/utils/page/index.js +3 -1
- package/lib/utils/page/page-form-data-manager.d.ts +15 -0
- package/lib/utils/page/page-form-data-manager.js +139 -0
- package/package.json +1 -1
- package/es/utils/api/form-instance.d.ts +0 -26
- package/es/utils/api/form-instance.js +0 -100
- package/lib/utils/api/form-instance.d.ts +0 -26
- package/lib/utils/api/form-instance.js +0 -105
package/lib/utils/page/index.js
CHANGED
|
@@ -5,12 +5,14 @@ exports.__esModule = true;
|
|
|
5
5
|
exports.closePage = closePage;
|
|
6
6
|
exports.hideLoading = hideLoading;
|
|
7
7
|
exports.openPage = openPage;
|
|
8
|
-
exports.showForm = void 0;
|
|
8
|
+
exports.showFormDataManager = exports.showForm = void 0;
|
|
9
9
|
exports.showLoading = showLoading;
|
|
10
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
12
|
var _pageForm = require("./page-form");
|
|
13
13
|
exports.showForm = _pageForm.showForm;
|
|
14
|
+
var _pageFormDataManager = require("./page-form-data-manager");
|
|
15
|
+
exports.showFormDataManager = _pageFormDataManager.showFormDataManager;
|
|
14
16
|
var timerRef;
|
|
15
17
|
function debounceHide() {
|
|
16
18
|
if (timerRef) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PageLayoutType } from "./page-layout";
|
|
2
|
+
export declare type PageFormDataManagerModeType = "dataManager" | "selectOne" | "selectMore";
|
|
3
|
+
export interface ShowPageFormDataManagerProps {
|
|
4
|
+
container?: HTMLDivElement;
|
|
5
|
+
layout?: PageLayoutType;
|
|
6
|
+
form?: {
|
|
7
|
+
id: string;
|
|
8
|
+
fieldId?: string;
|
|
9
|
+
};
|
|
10
|
+
mode?: PageFormDataManagerModeType;
|
|
11
|
+
onSubmitOk?: () => void;
|
|
12
|
+
onRemoveOk?: () => void;
|
|
13
|
+
onClose?: () => void | Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare function showFormDataManager(options: ShowPageFormDataManagerProps): Promise<void>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.showFormDataManager = showFormDataManager;
|
|
6
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _pageLayout = require("./page-layout");
|
|
12
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _pageLoadSchema = require("./page-load-schema");
|
|
15
|
+
var _reactRender = require("../../components/react-render");
|
|
16
|
+
var _index = require("./index");
|
|
17
|
+
var _schema = require("../cache/schema");
|
|
18
|
+
var _excluded = ["layout", "form", "onClose"],
|
|
19
|
+
_excluded2 = ["container", "onClose"];
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
function showFormDataManager(_x) {
|
|
23
|
+
return _showFormDataManager.apply(this, arguments);
|
|
24
|
+
}
|
|
25
|
+
function _showFormDataManager() {
|
|
26
|
+
_showFormDataManager = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(options) {
|
|
27
|
+
var container, onClose, restProps, unmount, _options$form, paths, mode, params, url, page;
|
|
28
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
29
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
container = options.container, onClose = options.onClose, restProps = (0, _objectWithoutPropertiesLoose2["default"])(options, _excluded2); //容器不存在需要手动取消挂载
|
|
32
|
+
unmount = !container;
|
|
33
|
+
if (container) {
|
|
34
|
+
_context2.next = 15;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
if (!(options.layout == "page")) {
|
|
38
|
+
_context2.next = 13;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
paths = window.location.pathname.split("/");
|
|
42
|
+
mode = options.mode;
|
|
43
|
+
params = new URLSearchParams();
|
|
44
|
+
url = "/" + paths[1] + "/" + paths[2] + "/" + ((_options$form = options.form) === null || _options$form === void 0 ? void 0 : _options$form.id) + "/" + mode + "?" + params.toString();
|
|
45
|
+
_context2.next = 10;
|
|
46
|
+
return (0, _index.openPage)(url, url);
|
|
47
|
+
case 10:
|
|
48
|
+
page = _context2.sent;
|
|
49
|
+
console.debug("openPage", page);
|
|
50
|
+
return _context2.abrupt("return");
|
|
51
|
+
case 13:
|
|
52
|
+
container = document.createElement("div");
|
|
53
|
+
document.body.append(container);
|
|
54
|
+
case 15:
|
|
55
|
+
_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(FormRender, (0, _extends2["default"])({}, restProps, {
|
|
56
|
+
onClose: /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
57
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
58
|
+
while (1) switch (_context.prev = _context.next) {
|
|
59
|
+
case 0:
|
|
60
|
+
if (unmount) {
|
|
61
|
+
//等待动画结束
|
|
62
|
+
setTimeout(function () {
|
|
63
|
+
var _container;
|
|
64
|
+
//取消挂载
|
|
65
|
+
_reactDom["default"].unmountComponentAtNode(container);
|
|
66
|
+
//移除
|
|
67
|
+
(_container = container) === null || _container === void 0 ? void 0 : _container.remove();
|
|
68
|
+
}, 1000);
|
|
69
|
+
}
|
|
70
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
71
|
+
case 2:
|
|
72
|
+
case "end":
|
|
73
|
+
return _context.stop();
|
|
74
|
+
}
|
|
75
|
+
}, _callee);
|
|
76
|
+
}))
|
|
77
|
+
})), container);
|
|
78
|
+
case 16:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context2.stop();
|
|
81
|
+
}
|
|
82
|
+
}, _callee2);
|
|
83
|
+
}));
|
|
84
|
+
return _showFormDataManager.apply(this, arguments);
|
|
85
|
+
}
|
|
86
|
+
var FormRender = /*#__PURE__*/function (_Component) {
|
|
87
|
+
function FormRender() {
|
|
88
|
+
var _this;
|
|
89
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
90
|
+
args[_key] = arguments[_key];
|
|
91
|
+
}
|
|
92
|
+
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
93
|
+
_this.layoutRef = void 0;
|
|
94
|
+
return _this;
|
|
95
|
+
}
|
|
96
|
+
(0, _inheritsLoose2["default"])(FormRender, _Component);
|
|
97
|
+
var _proto = FormRender.prototype;
|
|
98
|
+
_proto.render = function render() {
|
|
99
|
+
var _this2 = this;
|
|
100
|
+
var self = this;
|
|
101
|
+
var _this$props = this.props,
|
|
102
|
+
layout = _this$props.layout,
|
|
103
|
+
form = _this$props.form,
|
|
104
|
+
onClose = _this$props.onClose,
|
|
105
|
+
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, _excluded);
|
|
106
|
+
// @ts-ignore
|
|
107
|
+
restProps.layout = layout || "drawer";
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
restProps.onClose = function () {
|
|
110
|
+
var _self$layoutRef;
|
|
111
|
+
(_self$layoutRef = self.layoutRef) === null || _self$layoutRef === void 0 ? void 0 : _self$layoutRef.close();
|
|
112
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
113
|
+
};
|
|
114
|
+
return /*#__PURE__*/_react["default"].createElement(_pageLayout.PageLayout, {
|
|
115
|
+
layout: layout,
|
|
116
|
+
ref: function ref(layout) {
|
|
117
|
+
return _this2.layoutRef = layout;
|
|
118
|
+
}
|
|
119
|
+
}, /*#__PURE__*/_react["default"].createElement(_pageLoadSchema.PageLoadSchema, {
|
|
120
|
+
pageId: form === null || form === void 0 ? void 0 : form.id
|
|
121
|
+
}, function (schema) {
|
|
122
|
+
var fdmSchema = schema.children[0].fdmSchema;
|
|
123
|
+
if (form !== null && form !== void 0 && form.fieldId) {
|
|
124
|
+
(0, _schema.forEachFormSchema)(schema, function (field) {
|
|
125
|
+
if (form.fieldId == field.props.fieldId) {
|
|
126
|
+
fdmSchema = field.fdmSchema;
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return /*#__PURE__*/_react["default"].createElement(_reactRender.ReactRender, (0, _extends2["default"])({
|
|
133
|
+
schema: schema,
|
|
134
|
+
components: window._components || window.components || window.__components
|
|
135
|
+
}, restProps));
|
|
136
|
+
}));
|
|
137
|
+
};
|
|
138
|
+
return FormRender;
|
|
139
|
+
}(_react.Component);
|
package/package.json
CHANGED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { FormInstance } from "antd/lib";
|
|
2
|
-
import { NamePath, StoreValue } from "antd/es/form/interface";
|
|
3
|
-
declare type NamePaths = (string | number)[];
|
|
4
|
-
export declare class SubFormInstance implements FormInstance {
|
|
5
|
-
parentForm: FormInstance;
|
|
6
|
-
namePath: NamePaths;
|
|
7
|
-
constructor(form: FormInstance, namePath: NamePaths);
|
|
8
|
-
overwritePathName(name: NamePath): any[];
|
|
9
|
-
overwriteFields(fields: any[]): any[];
|
|
10
|
-
getFieldError(name: NamePath): string[];
|
|
11
|
-
getFieldValue(name: NamePath): StoreValue;
|
|
12
|
-
getFieldWarning(name: NamePath): string[];
|
|
13
|
-
getFieldsError(nameList: NamePath[] | undefined): any[];
|
|
14
|
-
getFieldsValue(nameList?: NamePath[] | true, filterFunc?: (meta: any) => boolean): any;
|
|
15
|
-
isFieldTouched(name: NamePath): boolean;
|
|
16
|
-
isFieldValidating(name: NamePath): boolean;
|
|
17
|
-
isFieldsTouched(): boolean;
|
|
18
|
-
isFieldsValidating(nameList: NamePath[]): boolean;
|
|
19
|
-
resetFields(fields: NamePath[] | undefined): void;
|
|
20
|
-
setFieldValue(name: NamePath, value: any): void;
|
|
21
|
-
setFields(fields: any[]): void;
|
|
22
|
-
setFieldsValue(values: any): void;
|
|
23
|
-
submit(): void;
|
|
24
|
-
validateFields(nameList: NamePath[] | undefined): Promise<any>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
export var SubFormInstance = /*#__PURE__*/function () {
|
|
3
|
-
function SubFormInstance(form, namePath) {
|
|
4
|
-
this.parentForm = void 0;
|
|
5
|
-
this.namePath = void 0;
|
|
6
|
-
this.parentForm = form;
|
|
7
|
-
this.namePath = namePath;
|
|
8
|
-
}
|
|
9
|
-
var _proto = SubFormInstance.prototype;
|
|
10
|
-
_proto.overwritePathName = function overwritePathName(name) {
|
|
11
|
-
if (Array.isArray(name)) {
|
|
12
|
-
return [].concat(this.namePath, name);
|
|
13
|
-
} else {
|
|
14
|
-
return [].concat(this.namePath, [name]);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
_proto.overwriteFields = function overwriteFields(fields) {
|
|
18
|
-
var _this = this;
|
|
19
|
-
return fields === null || fields === void 0 ? void 0 : fields.map(function (field) {
|
|
20
|
-
return _extends({}, field, {
|
|
21
|
-
name: _this.overwritePathName(field.name)
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
_proto.getFieldError = function getFieldError(name) {
|
|
26
|
-
return this.parentForm.getFieldError(this.overwritePathName(name));
|
|
27
|
-
};
|
|
28
|
-
_proto.getFieldValue = function getFieldValue(name) {
|
|
29
|
-
return this.parentForm.getFieldValue(this.overwritePathName(name));
|
|
30
|
-
};
|
|
31
|
-
_proto.getFieldWarning = function getFieldWarning(name) {
|
|
32
|
-
return this.parentForm.getFieldWarning(this.overwritePathName(name));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
;
|
|
37
|
-
_proto.getFieldsError = function getFieldsError(nameList) {
|
|
38
|
-
var _this2 = this;
|
|
39
|
-
return this.parentForm.getFieldsError(nameList === null || nameList === void 0 ? void 0 : nameList.map(function (name) {
|
|
40
|
-
return _this2.overwritePathName(name);
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
;
|
|
46
|
-
_proto.getFieldsValue = function getFieldsValue(nameList, filterFunc) {
|
|
47
|
-
var values = _extends({}, this.parentForm.getFieldValue(this.namePath));
|
|
48
|
-
values.parent = this.parentForm.getFieldsValue(true);
|
|
49
|
-
return values;
|
|
50
|
-
};
|
|
51
|
-
_proto.isFieldTouched = function isFieldTouched(name) {
|
|
52
|
-
return this.parentForm.isFieldTouched(this.overwritePathName(name));
|
|
53
|
-
};
|
|
54
|
-
_proto.isFieldValidating = function isFieldValidating(name) {
|
|
55
|
-
return this.parentForm.isFieldValidating(this.overwritePathName(name));
|
|
56
|
-
};
|
|
57
|
-
_proto.isFieldsTouched = function isFieldsTouched() {
|
|
58
|
-
return this.parentForm.isFieldsTouched();
|
|
59
|
-
};
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
_proto.isFieldsValidating = function isFieldsValidating(nameList) {
|
|
62
|
-
var _this3 = this;
|
|
63
|
-
return this.parentForm.isFieldsValidating(nameList.map(function (name) {
|
|
64
|
-
return _this3.overwritePathName(name);
|
|
65
|
-
}));
|
|
66
|
-
};
|
|
67
|
-
_proto.resetFields = function resetFields(fields) {
|
|
68
|
-
if (Array.isArray(fields)) {
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
this.parentForm.resetFields(this.overwriteFields(fields));
|
|
71
|
-
} else {
|
|
72
|
-
this.parentForm.resetFields();
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
_proto.setFieldValue = function setFieldValue(name, value) {
|
|
76
|
-
return this.parentForm.setFieldValue(this.overwritePathName(name), value);
|
|
77
|
-
};
|
|
78
|
-
_proto.setFields = function setFields(fields) {
|
|
79
|
-
this.parentForm.setFields(this.overwriteFields(fields));
|
|
80
|
-
};
|
|
81
|
-
_proto.setFieldsValue = function setFieldsValue(values) {
|
|
82
|
-
var _this4 = this;
|
|
83
|
-
if (!values) return;
|
|
84
|
-
//删除父值
|
|
85
|
-
delete values.parent;
|
|
86
|
-
Object.keys(values).forEach(function (name) {
|
|
87
|
-
return _this4.parentForm.setFieldValue(_this4.overwritePathName(name), values[name]);
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
_proto.submit = function submit() {
|
|
91
|
-
this.parentForm.submit();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// @ts-ignore
|
|
95
|
-
;
|
|
96
|
-
_proto.validateFields = function validateFields(nameList) {
|
|
97
|
-
return this.parentForm.validateFields(nameList);
|
|
98
|
-
};
|
|
99
|
-
return SubFormInstance;
|
|
100
|
-
}();
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { FormInstance } from "antd/lib";
|
|
2
|
-
import { NamePath, StoreValue } from "antd/es/form/interface";
|
|
3
|
-
declare type NamePaths = (string | number)[];
|
|
4
|
-
export declare class SubFormInstance implements FormInstance {
|
|
5
|
-
parentForm: FormInstance;
|
|
6
|
-
namePath: NamePaths;
|
|
7
|
-
constructor(form: FormInstance, namePath: NamePaths);
|
|
8
|
-
overwritePathName(name: NamePath): any[];
|
|
9
|
-
overwriteFields(fields: any[]): any[];
|
|
10
|
-
getFieldError(name: NamePath): string[];
|
|
11
|
-
getFieldValue(name: NamePath): StoreValue;
|
|
12
|
-
getFieldWarning(name: NamePath): string[];
|
|
13
|
-
getFieldsError(nameList: NamePath[] | undefined): any[];
|
|
14
|
-
getFieldsValue(nameList?: NamePath[] | true, filterFunc?: (meta: any) => boolean): any;
|
|
15
|
-
isFieldTouched(name: NamePath): boolean;
|
|
16
|
-
isFieldValidating(name: NamePath): boolean;
|
|
17
|
-
isFieldsTouched(): boolean;
|
|
18
|
-
isFieldsValidating(nameList: NamePath[]): boolean;
|
|
19
|
-
resetFields(fields: NamePath[] | undefined): void;
|
|
20
|
-
setFieldValue(name: NamePath, value: any): void;
|
|
21
|
-
setFields(fields: any[]): void;
|
|
22
|
-
setFieldsValue(values: any): void;
|
|
23
|
-
submit(): void;
|
|
24
|
-
validateFields(nameList: NamePath[] | undefined): Promise<any>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.SubFormInstance = void 0;
|
|
6
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
|
-
var SubFormInstance = exports.SubFormInstance = /*#__PURE__*/function () {
|
|
8
|
-
function SubFormInstance(form, namePath) {
|
|
9
|
-
this.parentForm = void 0;
|
|
10
|
-
this.namePath = void 0;
|
|
11
|
-
this.parentForm = form;
|
|
12
|
-
this.namePath = namePath;
|
|
13
|
-
}
|
|
14
|
-
var _proto = SubFormInstance.prototype;
|
|
15
|
-
_proto.overwritePathName = function overwritePathName(name) {
|
|
16
|
-
if (Array.isArray(name)) {
|
|
17
|
-
return [].concat(this.namePath, name);
|
|
18
|
-
} else {
|
|
19
|
-
return [].concat(this.namePath, [name]);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
_proto.overwriteFields = function overwriteFields(fields) {
|
|
23
|
-
var _this = this;
|
|
24
|
-
return fields === null || fields === void 0 ? void 0 : fields.map(function (field) {
|
|
25
|
-
return (0, _extends2["default"])({}, field, {
|
|
26
|
-
name: _this.overwritePathName(field.name)
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
_proto.getFieldError = function getFieldError(name) {
|
|
31
|
-
return this.parentForm.getFieldError(this.overwritePathName(name));
|
|
32
|
-
};
|
|
33
|
-
_proto.getFieldValue = function getFieldValue(name) {
|
|
34
|
-
return this.parentForm.getFieldValue(this.overwritePathName(name));
|
|
35
|
-
};
|
|
36
|
-
_proto.getFieldWarning = function getFieldWarning(name) {
|
|
37
|
-
return this.parentForm.getFieldWarning(this.overwritePathName(name));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
;
|
|
42
|
-
_proto.getFieldsError = function getFieldsError(nameList) {
|
|
43
|
-
var _this2 = this;
|
|
44
|
-
return this.parentForm.getFieldsError(nameList === null || nameList === void 0 ? void 0 : nameList.map(function (name) {
|
|
45
|
-
return _this2.overwritePathName(name);
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
;
|
|
51
|
-
_proto.getFieldsValue = function getFieldsValue(nameList, filterFunc) {
|
|
52
|
-
var values = (0, _extends2["default"])({}, this.parentForm.getFieldValue(this.namePath));
|
|
53
|
-
values.parent = this.parentForm.getFieldsValue(true);
|
|
54
|
-
return values;
|
|
55
|
-
};
|
|
56
|
-
_proto.isFieldTouched = function isFieldTouched(name) {
|
|
57
|
-
return this.parentForm.isFieldTouched(this.overwritePathName(name));
|
|
58
|
-
};
|
|
59
|
-
_proto.isFieldValidating = function isFieldValidating(name) {
|
|
60
|
-
return this.parentForm.isFieldValidating(this.overwritePathName(name));
|
|
61
|
-
};
|
|
62
|
-
_proto.isFieldsTouched = function isFieldsTouched() {
|
|
63
|
-
return this.parentForm.isFieldsTouched();
|
|
64
|
-
};
|
|
65
|
-
// @ts-ignore
|
|
66
|
-
_proto.isFieldsValidating = function isFieldsValidating(nameList) {
|
|
67
|
-
var _this3 = this;
|
|
68
|
-
return this.parentForm.isFieldsValidating(nameList.map(function (name) {
|
|
69
|
-
return _this3.overwritePathName(name);
|
|
70
|
-
}));
|
|
71
|
-
};
|
|
72
|
-
_proto.resetFields = function resetFields(fields) {
|
|
73
|
-
if (Array.isArray(fields)) {
|
|
74
|
-
// @ts-ignore
|
|
75
|
-
this.parentForm.resetFields(this.overwriteFields(fields));
|
|
76
|
-
} else {
|
|
77
|
-
this.parentForm.resetFields();
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
_proto.setFieldValue = function setFieldValue(name, value) {
|
|
81
|
-
return this.parentForm.setFieldValue(this.overwritePathName(name), value);
|
|
82
|
-
};
|
|
83
|
-
_proto.setFields = function setFields(fields) {
|
|
84
|
-
this.parentForm.setFields(this.overwriteFields(fields));
|
|
85
|
-
};
|
|
86
|
-
_proto.setFieldsValue = function setFieldsValue(values) {
|
|
87
|
-
var _this4 = this;
|
|
88
|
-
if (!values) return;
|
|
89
|
-
//删除父值
|
|
90
|
-
delete values.parent;
|
|
91
|
-
Object.keys(values).forEach(function (name) {
|
|
92
|
-
return _this4.parentForm.setFieldValue(_this4.overwritePathName(name), values[name]);
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
_proto.submit = function submit() {
|
|
96
|
-
this.parentForm.submit();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// @ts-ignore
|
|
100
|
-
;
|
|
101
|
-
_proto.validateFields = function validateFields(nameList) {
|
|
102
|
-
return this.parentForm.validateFields(nameList);
|
|
103
|
-
};
|
|
104
|
-
return SubFormInstance;
|
|
105
|
-
}();
|