@ccs-ui/rc-pro 2.3.1 → 2.3.3-beta-1
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/dialog/form.js +10 -8
- package/es/pro-table/table.d.ts +5 -2
- package/es/pro-table/table.js +1 -1
- package/es/pro-table/tree.d.ts +1 -1
- package/es/pro-table/tree.js +13 -1
- package/package.json +1 -1
package/es/dialog/form.js
CHANGED
|
@@ -24,8 +24,14 @@ var DialogForm = function DialogForm(_ref) {
|
|
|
24
24
|
var formRef = _ref.formRef,
|
|
25
25
|
children = _ref.children,
|
|
26
26
|
_ref$formProps = _ref.formProps,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
_ref$formProps$labelC = _ref$formProps.labelCol,
|
|
28
|
+
labelCol = _ref$formProps$labelC === void 0 ? {
|
|
29
|
+
span: 7
|
|
30
|
+
} : _ref$formProps$labelC,
|
|
31
|
+
_ref$formProps$wrappe = _ref$formProps.wrapperCol,
|
|
32
|
+
wrapperCol = _ref$formProps$wrappe === void 0 ? {
|
|
33
|
+
span: 16
|
|
34
|
+
} : _ref$formProps$wrappe,
|
|
29
35
|
restProps = _objectWithoutProperties(_ref$formProps, _excluded);
|
|
30
36
|
var _Form$useForm = Form.useForm(),
|
|
31
37
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
@@ -37,12 +43,8 @@ var DialogForm = function DialogForm(_ref) {
|
|
|
37
43
|
});
|
|
38
44
|
return /*#__PURE__*/_jsx(Form, _objectSpread(_objectSpread({
|
|
39
45
|
form: form,
|
|
40
|
-
labelCol: labelCol
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
wrapperCol: wrapperCol || {
|
|
44
|
-
span: 14
|
|
45
|
-
},
|
|
46
|
+
labelCol: labelCol,
|
|
47
|
+
wrapperCol: wrapperCol,
|
|
46
48
|
preserve: false
|
|
47
49
|
}, restProps), {}, {
|
|
48
50
|
children: children
|
package/es/pro-table/table.d.ts
CHANGED
|
@@ -38,7 +38,8 @@ export type CcsTableProps<T> = Omit<TableProps<T>, 'columns' | 'title'> & {
|
|
|
38
38
|
className?: string;
|
|
39
39
|
/** style */
|
|
40
40
|
style?: CSSProperties;
|
|
41
|
-
|
|
41
|
+
/** 隐藏操作工具栏:刷新,列设置,密度设置,全屏 */
|
|
42
|
+
hideOperation?: boolean;
|
|
42
43
|
/** 列配置 */
|
|
43
44
|
columns?: TableColumns<T>;
|
|
44
45
|
/** table title */
|
|
@@ -70,8 +71,10 @@ export type CcsProTableProps<RecordType> = Pick<PropsWithCss, 'className'> & Pro
|
|
|
70
71
|
root?: CSSProperties;
|
|
71
72
|
table?: CSSProperties;
|
|
72
73
|
};
|
|
73
|
-
/**
|
|
74
|
+
/** 异步树父级值字段 */
|
|
74
75
|
parentFieldName?: string;
|
|
76
|
+
/** 异步树叶子节点标识 */
|
|
77
|
+
leafNode?: boolean | ((record: RecordType) => boolean);
|
|
75
78
|
/** ref 回调方法 */
|
|
76
79
|
proRef?: CCS.TableInstanceRef<RecordType>;
|
|
77
80
|
/** 显示序号 */
|
package/es/pro-table/table.js
CHANGED
|
@@ -553,7 +553,7 @@ var InternalProTable = function InternalProTable(props) {
|
|
|
553
553
|
formInitValues: formInitValues,
|
|
554
554
|
formItemLabelWidth: props.formItemLabelWidth,
|
|
555
555
|
onSearch: _onSearch,
|
|
556
|
-
tableOperation: (table === null || table === void 0 ? void 0 : table.
|
|
556
|
+
tableOperation: (table === null || table === void 0 ? void 0 : table.hideOperation) !== true ? /*#__PURE__*/_jsx(TableOperation, {
|
|
557
557
|
onChangeRowSize: function onChangeRowSize(e) {
|
|
558
558
|
return setTableRowSize(e);
|
|
559
559
|
},
|
package/es/pro-table/tree.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type TreeInstance<T> = {
|
|
|
9
9
|
onRequestTree: (query: any, record: T | any) => void;
|
|
10
10
|
onExpandKeys: (ids: string[]) => void;
|
|
11
11
|
};
|
|
12
|
-
type TreeTableProps<T> = Pick<CcsProTableProps<T>, 'table' | 'onSearchBefore' | 'parentFieldName' | 'onSearchAfter'> & {
|
|
12
|
+
type TreeTableProps<T> = Pick<CcsProTableProps<T>, 'table' | 'onSearchBefore' | 'parentFieldName' | 'onSearchAfter' | 'leafNode'> & {
|
|
13
13
|
data: CCS.TableData<T>;
|
|
14
14
|
sticky: boolean | TableSticky;
|
|
15
15
|
tableRowSize: TableProps['size'];
|
package/es/pro-table/tree.js
CHANGED
|
@@ -29,6 +29,7 @@ var TableTree = function TableTree(props) {
|
|
|
29
29
|
sticky = props.sticky,
|
|
30
30
|
treeRef = props.treeRef,
|
|
31
31
|
tableRef = props.tableRef,
|
|
32
|
+
leafNode = props.leafNode,
|
|
32
33
|
tableRowSize = props.tableRowSize,
|
|
33
34
|
tableContentRef = props.tableContentRef,
|
|
34
35
|
parentFieldName = props.parentFieldName,
|
|
@@ -96,7 +97,18 @@ var TableTree = function TableTree(props) {
|
|
|
96
97
|
if (requestResult) {
|
|
97
98
|
// onSearchAfter 处理请求结果
|
|
98
99
|
newReqResult = onSearchAfter(requestResult); // 获取table数据
|
|
99
|
-
dataSource = getDataFromFields(newReqResult, fieldNames.dataSource);
|
|
100
|
+
dataSource = getDataFromFields(newReqResult, fieldNames.dataSource); // 判断非叶子节点,添加children
|
|
101
|
+
if (leafNode && dataSource && Array.isArray(dataSource)) {
|
|
102
|
+
dataSource.forEach(function (d) {
|
|
103
|
+
if (typeof leafNode === 'string' && !d[leafNode]) {
|
|
104
|
+
d.children = [];
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (typeof leafNode === 'function' && !leafNode(d)) {
|
|
108
|
+
d.children = [];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
100
112
|
if (record) {
|
|
101
113
|
// 异步树
|
|
102
114
|
record[childrenColumnName] = dataSource;
|