@ccs-ui/rc-pro 2.3.6-alpha-8 → 2.3.6-alpha-9
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/ccs.d.ts +10 -2
- package/es/group-form-item/index.d.ts +11 -0
- package/es/group-form-item/index.js +124 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/pro-table/form-item.d.ts +1 -1
- package/es/pro-table/form-item.js +27 -11
- package/es/pro-table/head.js +28 -22
- package/package.json +1 -1
package/es/ccs.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ButtonProps, PaginationProps } from 'antd';
|
|
2
2
|
import { Rule } from 'antd/es/form';
|
|
3
|
+
import { NamePath } from 'antd/es/form/interface';
|
|
3
4
|
import { CSSProperties, MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
4
5
|
import { TableColumn } from './pro-table/table';
|
|
5
6
|
type MenuType = {
|
|
@@ -93,11 +94,11 @@ type ShowDependType = {
|
|
|
93
94
|
name: string;
|
|
94
95
|
value: any;
|
|
95
96
|
};
|
|
96
|
-
|
|
97
|
+
type FormItemType = {
|
|
97
98
|
/** label 标题 */
|
|
98
99
|
label?: string;
|
|
99
100
|
/** form name */
|
|
100
|
-
name
|
|
101
|
+
name?: string;
|
|
101
102
|
/** form item element */
|
|
102
103
|
value: ReactElement;
|
|
103
104
|
/** 数据依赖、依赖项对应的name数组 */
|
|
@@ -108,7 +109,14 @@ export type TableFormItem = {
|
|
|
108
109
|
rules?: Rule[];
|
|
109
110
|
/** 在发起请求时调用方法,格式化值 */
|
|
110
111
|
onFormat?: (e: any) => any;
|
|
112
|
+
/** 组表单项名称 */
|
|
113
|
+
groupItemNames?: NamePath[];
|
|
111
114
|
};
|
|
115
|
+
export type TableFormItem = ({
|
|
116
|
+
name: string;
|
|
117
|
+
} & Partial<FormItemType>) | ({
|
|
118
|
+
groupItemNames: NamePath[];
|
|
119
|
+
} & Partial<FormItemType>);
|
|
112
120
|
type TableFormItems = TableFormItem[];
|
|
113
121
|
type TableInstanceRef<T = any> = MutableRefObject<TableInstance<T> | undefined> | React.RefObject<TableInstance<T>>;
|
|
114
122
|
type TableColumns<RecordType = any> = TableColumn<RecordType>[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FormItemProps } from 'antd';
|
|
2
|
+
import { NamePath } from 'antd/es/form/interface';
|
|
3
|
+
export type GroupFormItemProps = FormItemProps & {
|
|
4
|
+
/** 组表单项名称 */
|
|
5
|
+
groupItemNames: NamePath[];
|
|
6
|
+
};
|
|
7
|
+
declare function GroupFormItem({ groupItemNames, name, ...formItemProps }: GroupFormItemProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare namespace GroupFormItem {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
export default GroupFormItem;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["groupItemNames", "name"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
13
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
18
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
20
|
+
import { useUpdateEffect } from 'ahooks';
|
|
21
|
+
import { Form } from 'antd';
|
|
22
|
+
import { useEffect, useState } from 'react';
|
|
23
|
+
import { getDataFromFields } from "../select";
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
|
+
var FormUpdateItem = function FormUpdateItem(_ref) {
|
|
28
|
+
var name = _ref.name,
|
|
29
|
+
getFieldsValue = _ref.getFieldsValue,
|
|
30
|
+
setFieldValue = _ref.setFieldValue,
|
|
31
|
+
getFieldValue = _ref.getFieldValue,
|
|
32
|
+
groupItemNames = _ref.groupItemNames;
|
|
33
|
+
var nameValue = getFieldValue(name);
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
// 初始值
|
|
36
|
+
var initialValues = getFieldsValue(true);
|
|
37
|
+
var initNameValue = [];
|
|
38
|
+
|
|
39
|
+
// 根据子项初始值设置name的默认值
|
|
40
|
+
groupItemNames.forEach(function (item) {
|
|
41
|
+
initNameValue.push(getDataFromFields(initialValues, Array.isArray(item) ? item : [item]));
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// 如果子项有初始值,则设置name的默认值
|
|
45
|
+
if (initNameValue.filter(function (n) {
|
|
46
|
+
return n !== undefined;
|
|
47
|
+
}).length > 0) {
|
|
48
|
+
setFieldValue(name, initNameValue);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 如果子项没有初始值,主项有初始值
|
|
53
|
+
var groupNameValue = getDataFromFields(initialValues, Array.isArray(name) ? name : [name]);
|
|
54
|
+
if (Array.isArray(groupNameValue)) {
|
|
55
|
+
groupItemNames.forEach(function (item, index) {
|
|
56
|
+
setFieldValue(item, groupNameValue[index]);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}, []);
|
|
60
|
+
|
|
61
|
+
// 依赖主字段变更,更新子项属性值
|
|
62
|
+
useUpdateEffect(function () {
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
groupItemNames.forEach(function (item, index) {
|
|
65
|
+
setFieldValue(item, Array.isArray(nameValue) ? nameValue[index] : undefined);
|
|
66
|
+
});
|
|
67
|
+
}, 1);
|
|
68
|
+
}, [nameValue]);
|
|
69
|
+
return null;
|
|
70
|
+
};
|
|
71
|
+
function onGetNameValue() {
|
|
72
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
73
|
+
var name = arguments.length > 1 ? arguments[1] : undefined;
|
|
74
|
+
if (!obj) return undefined;
|
|
75
|
+
if (Array.isArray(name)) {
|
|
76
|
+
var names = _toConsumableArray(name);
|
|
77
|
+
var newName = names.shift();
|
|
78
|
+
if (names.length === 0) return obj[newName];
|
|
79
|
+
return onGetNameValue(obj[newName], names);
|
|
80
|
+
}
|
|
81
|
+
return obj[name];
|
|
82
|
+
}
|
|
83
|
+
function GroupFormItem(_ref2) {
|
|
84
|
+
var groupItemNames = _ref2.groupItemNames,
|
|
85
|
+
name = _ref2.name,
|
|
86
|
+
formItemProps = _objectWithoutProperties(_ref2, _excluded);
|
|
87
|
+
var _useState = useState(name || "_".concat(JSON.stringify(groupItemNames).replace(/[^a-zA-Z]/g, ''))),
|
|
88
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
89
|
+
itemName = _useState2[0];
|
|
90
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
91
|
+
children: [/*#__PURE__*/_jsx(Form.Item, _objectSpread({
|
|
92
|
+
name: itemName
|
|
93
|
+
}, formItemProps)), groupItemNames && groupItemNames.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
|
|
94
|
+
children: [/*#__PURE__*/_jsx(Form.Item, {
|
|
95
|
+
noStyle: true,
|
|
96
|
+
shouldUpdate: function shouldUpdate(l, r) {
|
|
97
|
+
return onGetNameValue(l, itemName) !== onGetNameValue(r, itemName);
|
|
98
|
+
},
|
|
99
|
+
children: function children(_ref3) {
|
|
100
|
+
var getFieldsValue = _ref3.getFieldsValue,
|
|
101
|
+
setFieldValue = _ref3.setFieldValue,
|
|
102
|
+
getFieldValue = _ref3.getFieldValue;
|
|
103
|
+
return /*#__PURE__*/_jsx(FormUpdateItem, {
|
|
104
|
+
getFieldsValue: getFieldsValue,
|
|
105
|
+
setFieldValue: setFieldValue,
|
|
106
|
+
getFieldValue: getFieldValue,
|
|
107
|
+
groupItemNames: groupItemNames,
|
|
108
|
+
name: itemName
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}), groupItemNames.map(function (item, index) {
|
|
112
|
+
return /*#__PURE__*/_jsx(Form.Item, {
|
|
113
|
+
noStyle: true,
|
|
114
|
+
name: item,
|
|
115
|
+
hidden: true
|
|
116
|
+
}, index);
|
|
117
|
+
})]
|
|
118
|
+
})]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
122
|
+
GroupFormItem.displayName = 'CcsGroupFormItem';
|
|
123
|
+
}
|
|
124
|
+
export default GroupFormItem;
|
package/es/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { default as CcsDialog } from './dialog';
|
|
|
9
9
|
export { default as CcsEditor } from './editor';
|
|
10
10
|
export { default as CcsEllipsis } from './ellipsis';
|
|
11
11
|
export { default as CcsFullScreenButton } from './full-screen';
|
|
12
|
+
export { default as CcsGroupFormItem } from './group-form-item';
|
|
12
13
|
export { default as useAppConfig } from './hooks/use-app';
|
|
13
14
|
export { default as useCcsOnceEvent } from './hooks/use-once-event';
|
|
14
15
|
export { default as useCcsPage } from './hooks/use-page';
|
package/es/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { default as CcsDialog } from "./dialog";
|
|
|
9
9
|
export { default as CcsEditor } from "./editor";
|
|
10
10
|
export { default as CcsEllipsis } from "./ellipsis";
|
|
11
11
|
export { default as CcsFullScreenButton } from "./full-screen";
|
|
12
|
+
export { default as CcsGroupFormItem } from "./group-form-item";
|
|
12
13
|
export { default as useAppConfig } from "./hooks/use-app";
|
|
13
14
|
export { default as useCcsOnceEvent } from "./hooks/use-once-event";
|
|
14
15
|
export { default as useCcsPage } from "./hooks/use-page";
|
|
@@ -3,5 +3,5 @@ import { CcsProTableProps } from './table';
|
|
|
3
3
|
type PropsType = TableFormItem & {
|
|
4
4
|
dependParam?: any;
|
|
5
5
|
} & Pick<CcsProTableProps<any>, 'formItemLabelWidth'>;
|
|
6
|
-
export default function HeadFormItem({ label, name, rules, value, dependParam, formItemLabelWidth, }: PropsType): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default function HeadFormItem({ label, name, rules, value, dependParam, groupItemNames, formItemLabelWidth, }: PropsType): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
7
|
import { Form } from 'antd';
|
|
2
8
|
import { cloneElement } from 'react';
|
|
9
|
+
import { CcsGroupFormItem } from '..';
|
|
3
10
|
import { classPrefix } from "./table";
|
|
4
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
12
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -9,19 +16,28 @@ export default function HeadFormItem(_ref) {
|
|
|
9
16
|
rules = _ref.rules,
|
|
10
17
|
value = _ref.value,
|
|
11
18
|
dependParam = _ref.dependParam,
|
|
19
|
+
groupItemNames = _ref.groupItemNames,
|
|
12
20
|
formItemLabelWidth = _ref.formItemLabelWidth;
|
|
21
|
+
var props = {
|
|
22
|
+
name: name,
|
|
23
|
+
rules: rules,
|
|
24
|
+
className: "".concat(classPrefix, "-form-label"),
|
|
25
|
+
label: formItemLabelWidth ? /*#__PURE__*/_jsx("div", {
|
|
26
|
+
style: {
|
|
27
|
+
width: formItemLabelWidth
|
|
28
|
+
},
|
|
29
|
+
children: label
|
|
30
|
+
}) : label
|
|
31
|
+
};
|
|
32
|
+
if (groupItemNames) {
|
|
33
|
+
return /*#__PURE__*/_jsx(CcsGroupFormItem, _objectSpread(_objectSpread({}, props), {}, {
|
|
34
|
+
groupItemNames: groupItemNames,
|
|
35
|
+
children: dependParam ? /*#__PURE__*/cloneElement(value, dependParam) : value
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
13
38
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
14
|
-
children: /*#__PURE__*/_jsx(Form.Item, {
|
|
15
|
-
name: name,
|
|
16
|
-
rules: rules,
|
|
17
|
-
className: "".concat(classPrefix, "-form-label"),
|
|
18
|
-
label: formItemLabelWidth ? /*#__PURE__*/_jsx("div", {
|
|
19
|
-
style: {
|
|
20
|
-
width: formItemLabelWidth
|
|
21
|
-
},
|
|
22
|
-
children: label
|
|
23
|
-
}) : label,
|
|
39
|
+
children: /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({}, props), {}, {
|
|
24
40
|
children: dependParam ? /*#__PURE__*/cloneElement(value, dependParam) : value
|
|
25
|
-
})
|
|
41
|
+
}))
|
|
26
42
|
});
|
|
27
43
|
}
|
package/es/pro-table/head.js
CHANGED
|
@@ -105,39 +105,44 @@ function HeadComponent(_ref) {
|
|
|
105
105
|
}), toolbar ? null : tableOperation]
|
|
106
106
|
});
|
|
107
107
|
var renderFormItems = function renderFormItems() {
|
|
108
|
-
return allFormItems.map(function (
|
|
109
|
-
|
|
108
|
+
return allFormItems.map(function (_ref2, index) {
|
|
109
|
+
var depends = _ref2.depends,
|
|
110
|
+
showDepends = _ref2.showDepends,
|
|
111
|
+
name = _ref2.name,
|
|
112
|
+
groupItemNames = _ref2.groupItemNames,
|
|
113
|
+
label = _ref2.label,
|
|
114
|
+
rules = _ref2.rules,
|
|
115
|
+
value = _ref2.value;
|
|
116
|
+
if (depends || showDepends) {
|
|
110
117
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
111
118
|
children: /*#__PURE__*/_jsx(Form.Item, {
|
|
112
119
|
noStyle: true,
|
|
113
120
|
shouldUpdate: function shouldUpdate(l, n) {
|
|
114
|
-
|
|
115
|
-
return ((_item$depends = item.depends) === null || _item$depends === void 0 ? void 0 : _item$depends.some(function (i) {
|
|
121
|
+
return (depends === null || depends === void 0 ? void 0 : depends.some(function (i) {
|
|
116
122
|
return l[i] !== n[i];
|
|
117
|
-
})) || (
|
|
123
|
+
})) || (showDepends === null || showDepends === void 0 ? void 0 : showDepends.some(function (i) {
|
|
118
124
|
return l[i.name] !== n[i.name];
|
|
119
125
|
})) || false;
|
|
120
126
|
},
|
|
121
|
-
children: function children(
|
|
122
|
-
var
|
|
123
|
-
var getFieldValue = _ref2.getFieldValue;
|
|
127
|
+
children: function children(_ref3) {
|
|
128
|
+
var getFieldValue = _ref3.getFieldValue;
|
|
124
129
|
var dependParam = {};
|
|
125
|
-
|
|
130
|
+
depends === null || depends === void 0 || depends.forEach(function (i) {
|
|
126
131
|
var value = getFieldValue(i);
|
|
127
132
|
dependParam[i] = value;
|
|
128
133
|
});
|
|
129
134
|
var isShow = true;
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
isShow = (_item$showDepends2 = item.showDepends) === null || _item$showDepends2 === void 0 ? void 0 : _item$showDepends2.every(function (i) {
|
|
135
|
+
if (showDepends && showDepends.length > 0) {
|
|
136
|
+
isShow = showDepends === null || showDepends === void 0 ? void 0 : showDepends.every(function (i) {
|
|
133
137
|
return getFieldValue(i.name) === i.value;
|
|
134
138
|
});
|
|
135
139
|
}
|
|
136
140
|
var itemContent = /*#__PURE__*/_jsx(HeadFormItem, {
|
|
137
|
-
name:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
name: name,
|
|
142
|
+
groupItemNames: groupItemNames,
|
|
143
|
+
label: label,
|
|
144
|
+
rules: rules,
|
|
145
|
+
value: value,
|
|
141
146
|
dependParam: dependParam,
|
|
142
147
|
formItemLabelWidth: formItemLabelWidth
|
|
143
148
|
});
|
|
@@ -145,18 +150,19 @@ function HeadComponent(_ref) {
|
|
|
145
150
|
return itemContent;
|
|
146
151
|
}
|
|
147
152
|
})
|
|
148
|
-
},
|
|
153
|
+
}, name);
|
|
149
154
|
}
|
|
150
155
|
var itemContent = /*#__PURE__*/_jsx(HeadFormItem, {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
156
|
+
groupItemNames: groupItemNames,
|
|
157
|
+
name: name,
|
|
158
|
+
value: value,
|
|
159
|
+
rules: rules,
|
|
160
|
+
label: label,
|
|
155
161
|
formItemLabelWidth: formItemLabelWidth
|
|
156
162
|
});
|
|
157
163
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
158
164
|
children: itemContent
|
|
159
|
-
},
|
|
165
|
+
}, index);
|
|
160
166
|
});
|
|
161
167
|
};
|
|
162
168
|
var formStyles = {
|