ztxkui 4.2.23-321-beta → 4.2.23-322-beta
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.
|
@@ -198,7 +198,7 @@ var BasicTable = function (_a) {
|
|
|
198
198
|
React.createElement("br", null),
|
|
199
199
|
React.createElement("b", null, "\u5217\u4F38\u7F29\uFF1B"),
|
|
200
200
|
"isResizableColumn\u5C5E\u6027\u9ED8\u8BA4\u4E3Atrue\uFF0C\u5982\u679C\u4E0D\u9700\u8981\u5217\u4F38\u7F29\u53EF\u4EE5\u4F20\u5165false"),
|
|
201
|
-
React.createElement(Table, { dataSource: dataSource, columns: columns, rowKey: "id", showColumnDynamic: true, showColumnDynamicKey: dynamicKey || 'symbol-id-1', rowSelection: {
|
|
201
|
+
React.createElement(Table, { isContextMenu: true, dataSource: dataSource, columns: columns, rowKey: "id", showColumnDynamic: true, showColumnDynamicKey: dynamicKey || 'symbol-id-1', rowSelection: {
|
|
202
202
|
type: 'checkbox',
|
|
203
203
|
onChange: function (selectedRowKeys, selectedRows) {
|
|
204
204
|
console.log(selectedRowKeys, selectedRows);
|
|
@@ -4,7 +4,7 @@ export interface IProps extends Omit<FormProps, 'form'> {
|
|
|
4
4
|
form?: FormInstance;
|
|
5
5
|
}
|
|
6
6
|
interface FormInstance extends AntFormInstance {
|
|
7
|
-
setDynamicList
|
|
7
|
+
setDynamicList?: (list: any[]) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare const FormContext: React.Context<{
|
|
10
10
|
form?: FormInstance;
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import React, { createContext } from 'react';
|
|
23
|
+
import React, { createContext, useEffect, useRef } from 'react';
|
|
24
24
|
import { Form as AntForm } from 'antd';
|
|
25
25
|
import { FormProvider } from 'antd/lib/form/context';
|
|
26
26
|
import SearchContainer from '../business/SearchContainer/index';
|
|
@@ -67,18 +67,21 @@ function Form(props) {
|
|
|
67
67
|
function useForm(_form) {
|
|
68
68
|
var antForm = AntForm.useForm(_form)[0];
|
|
69
69
|
var dynamicList = React.useRef();
|
|
70
|
-
var form =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
var form = useRef(antForm);
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
form.current = __assign(__assign({}, antForm), { setDynamicList: setDynamicList, getFieldsValue: function (nameList, filterFunc) {
|
|
73
|
+
var values = __assign({}, antForm.getFieldsValue(nameList, filterFunc));
|
|
74
|
+
if (dynamicList.current) {
|
|
75
|
+
dynamicList.current.forEach(function (item) {
|
|
76
|
+
if (!item.show) {
|
|
77
|
+
values[item.name] = undefined;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return values;
|
|
82
|
+
} });
|
|
83
|
+
}, [antForm]);
|
|
84
|
+
return [form.current];
|
|
82
85
|
function setDynamicList(list) {
|
|
83
86
|
dynamicList.current = list;
|
|
84
87
|
}
|
|
@@ -45,7 +45,8 @@ var SearchLeft = function (_a) {
|
|
|
45
45
|
var form = useContext(FormContext).form;
|
|
46
46
|
// 绑定自定义配置类型
|
|
47
47
|
useEffect(function () {
|
|
48
|
-
|
|
48
|
+
var _a;
|
|
49
|
+
(_a = form === null || form === void 0 ? void 0 : form.setDynamicList) === null || _a === void 0 ? void 0 : _a.call(form, dynamicList);
|
|
49
50
|
}, [form, dynamicList]);
|
|
50
51
|
/** 表单容器Ref */
|
|
51
52
|
var containerRef = useRef(null);
|