Compare commits

...

15 Commits
master ... 2.0

Author SHA1 Message Date
LiuJiaNan f5753e779d 2.0.6 2026-06-24 14:33:32 +08:00
LiuJiaNan 8566185de1 feat(history): 支持自定义历史记录对象实现返回功能
- FormBuilder 组件新增 history 属性,允许注入自定义历史记录对象
- 优化 FormBuilder 的取消操作,优先调用 history.goBack 方法
- HeaderBack 组件修改返回点击事件,支持使用自定义 history 对象
- Page 组件返回按钮支持自定义历史记录回退行为
- README 更新,新增版本信息及 antd6 升级说明
2026-06-24 14:33:24 +08:00
LiuJiaNan 582bbc0470 2.0.5 2026-06-23 16:33:42 +08:00
LiuJiaNan 896b394752 fix(SelectTree): 允许 Gwj 组件的额外属性
- 在类型定义中添加索引签名支持任意属性
- 增强了 EnterpriseType 属性的灵活性
- 解决类型限制带来的扩展困难问题
2026-06-23 16:33:33 +08:00
LiuJiaNan 31571d1466 fix(components): 修正 Divider 组件弃用属性 2026-06-23 14:47:44 +08:00
LiuJiaNan 5e9764fdfb 2.0.4 2026-06-23 14:11:49 +08:00
LiuJiaNan b4adc46214 fix(forms): 修复 Select 组件 showSearch 属性传递和样式问题
- 将 FormItemsRenderer 中 Select 组件的 showSearch 属性改为对象格式以支持 optionFilterProp
- 修改 Basic Select 组件中 showSearch 属性为对象格式以支持 optionFilterProp
- 修复 FormItemsRenderer 中表单项容器样式,添加 minWidth 以避免布局问题
2026-06-23 14:06:40 +08:00
LiuJiaNan e9962bf995 2.0.3 2026-06-23 13:51:48 +08:00
LiuJiaNan 05621be758 feat(formBuilder): 支持动态 col 样式及标题,增强 FormList 行定制能力
- 新增 colStyle 属性,支持 Col 内联样式函数动态计算
- 新增 colTitle 属性,支持 Col 内部标题节点动态渲染
- 新增 rowStyle 属性,允许 FormList 每行样式动态定义
- 新增 rowTitle 属性,支持 FormList 每行标题动态渲染
2026-06-23 13:51:16 +08:00
LiuJiaNan 585b03329b refactor(types): 移除已弃用的 onGetNodePathsIsIncludeOneself 和 callback 参数
- 删除 Cascader、LeftTree、SelectTree 组件中已弃用的 onGetNodePathsIsIncludeOneself 类型定义
- 删除 useTable hook 中已弃用的 callback 类型定义
- 组件实现中移除对 onGetNodePathsIsIncludeOneself 参数的支持和警告提示
- 统一使用 getNodePathsIsIncludeOneself 参数代替已废弃参数
- 移除 useTable hook 中对 callback 参数的警告和调用,建议使用 onSuccess
2026-06-23 13:50:34 +08:00
LiuJiaNan c3268aff48 2.0.2 2026-06-22 11:32:20 +08:00
LiuJiaNan 8bbdff2506 fix(modal): 修复Modal组件maskClosable属性用法错误
- 将Modal组件中的maskClosable属性改为mask={{ closable: false }}
2026-06-22 11:32:13 +08:00
LiuJiaNan acc9a1106a 2.0.1 2026-06-22 10:49:30 +08:00
LiuJiaNan 1cc778a90a fix(form): 修复表单项隐藏逻辑错误 2026-06-22 10:49:23 +08:00
LiuJiaNan 390d8c7799 升级antd到6.0 2026-06-22 08:49:36 +08:00
24 changed files with 118 additions and 93 deletions

View File

@ -15,4 +15,8 @@ yarn add zy-react-library
### v1.1.2 (2025-12-25)
- 🎉 优化编译效果
- 🎉 优化编译效果
### v2.0.0 (2026-06-22)
- 🎉 升级到antd6

View File

@ -1,7 +1,7 @@
{
"name": "zy-react-library",
"private": false,
"version": "1.3.19",
"version": "2.0.6",
"type": "module",
"description": "",
"author": "LiuJiaNan",
@ -30,13 +30,13 @@
},
"dependencies": {
"@ahooksjs/use-url-state": "^3.5.1",
"@ant-design/icons": "^5.6.1",
"@ant-design/pro-components": "^2.8.10",
"@ant-design/icons": "^6.2.5",
"@ant-design/pro-components": "^3.1.12-0",
"@cqsjjb/jjb-common-lib": "latest",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-react": "^1.0.6",
"ahooks": "^3.9.5",
"antd": "^5.27.6",
"antd": "^6.4.4",
"dayjs": "^1.11.18",
"lodash-es": "^4.17.21",
"react": "^18.3.1",

View File

@ -11,8 +11,6 @@ export interface BasicCascaderProps extends Omit<CascaderProps, "fieldNames"> {
idKey?: string;
/** 树形数据 children 字段,默认 children */
childrenKey?: string;
/** @deprecated 已弃用,请使用 getNodePathsIsIncludeOneself */
onGetNodePathsIsIncludeOneself?: boolean;
/** 决定 onGetNodePaths 是否包含自身节点,默认 true */
getNodePathsIsIncludeOneself?: boolean;
/** 获取父级节点 */

View File

@ -10,7 +10,6 @@ function BasicCascader(props) {
onGetData,
onChange,
onGetNodePaths,
onGetNodePathsIsIncludeOneself,
getNodePathsIsIncludeOneself = true,
placeholder = "",
data = [],
@ -21,14 +20,6 @@ function BasicCascader(props) {
...restProps
} = props;
// 如果使用了已弃用的参数给出警告
if (onGetNodePathsIsIncludeOneself !== undefined) {
console.warn("【BasicCascader】 onGetNodePathsIsIncludeOneself 参数已弃用,请使用 getNodePathsIsIncludeOneself 参数");
}
// 向后兼容,如果传入了旧参数,使用旧参数
const finalGetNodePathsIsIncludeOneself = onGetNodePathsIsIncludeOneself !== undefined ? onGetNodePathsIsIncludeOneself : getNodePathsIsIncludeOneself;
// 根据 level 处理树数据
const processedData = useMemo(() => {
return level
@ -43,7 +34,7 @@ function BasicCascader(props) {
const getNodePaths = (selectedOptions) => {
let nodePaths = selectedOptions;
if (!finalGetNodePathsIsIncludeOneself && selectedOptions) {
if (!getNodePathsIsIncludeOneself && selectedOptions) {
nodePaths = selectedOptions.slice(0, -1);
}
return nodePaths || [];

View File

@ -44,6 +44,11 @@ export interface FormBuilderProps<Values = any> extends Omit<FormProps, "form" |
form: FormInstance<Values>;
/** 表单提交时的回调函数 */
onFinish?: (values: Values) => void;
/** 历史记录对象,用于返回上一页,默认使用 window.history.back */
history?: {
goBack?: () => void;
[key: string]: any;
};
}
/**

View File

@ -21,6 +21,7 @@ const FormBuilder = (props) => {
showCancelButton = true,
customActionButtons,
extraActionButtons,
history,
loading = false,
...restProps
} = props;
@ -51,7 +52,7 @@ const FormBuilder = (props) => {
}, [showActionButtons]);
const handleCancel = () => {
window.history.back();
history?.goBack ? history.goBack() : window.history.back();
};
return (

View File

@ -1,9 +1,9 @@
import type { NamePath } from "@rc-component/form/lib/interface";
import type { ColProps } from "antd/es/col";
import type { FormItemProps, Rule } from "antd/es/form";
import type { FormListFieldData } from "antd/es/form/FormList";
import type { Gutter } from "antd/es/grid/row";
import type { NamePath } from "rc-field-form/lib/interface";
import type { ReactElement, ReactNode } from "react";
import type { CSSProperties, ReactElement, ReactNode } from "react";
import type { FORM_ITEM_RENDER_TYPE_MAP } from "../../enum/formItemRender";
import type { DeepPartial } from "./FormBuilder";
@ -131,6 +131,10 @@ export interface FormOptionBase<
dependencies?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, Dependencies[]>;
/** 是否仅用于保存标签,不渲染到页面上,只在表单中保存数据,默认 false */
onlyForLabel?: IsOnlyForLabel;
/** Col 的内联样式,会合并到 Col 的 style 上,支持函数动态计算 */
colStyle?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, CSSProperties | ((formValues: AllValues) => CSSProperties)>;
/** Col 内部、Form.Item 之前渲染的标题节点,支持函数动态计算 */
colTitle?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, ReactNode | ((formValues: AllValues) => ReactNode)>;
}
/**
@ -157,6 +161,10 @@ export type FormOptionByRender<
checkboxCol?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "checkbox" ? number : never>;
/** Form.List 独有的属性 */
formListUniqueProps?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "formList" ? FormListUniqueProps | ((formValues: AllValues) => FormListUniqueProps) : never>;
/** FormList 每行的内联样式,仅 render 为 formList 时可用,支持函数按行计算 */
rowStyle?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "formList" ? CSSProperties | ((field: FormListFieldData, fieldIndex: number) => CSSProperties) : never>;
/** FormList 每行起始位置渲染的标题节点,仅 render 为 formList 时可用,支持函数按行计算 */
rowTitle?: FormOptionProperty<IsOnlyForLabel, IsCustomizeRender, RenderType extends "formList" ? ReactNode | ((field: FormListFieldData, fieldIndex: number) => ReactNode) : never>;
};
/**

View File

@ -84,12 +84,8 @@ const FormItemsRenderer = ({
};
};
// 获取传给formItem的属性
const getFormItemProps = (option) => {
const formItemProps = typeof option.formItemProps === "function"
? option.formItemProps(getFormValues())
: (option.formItemProps || {});
// 设置日期组件的属性
const setDateComponentProps = (option, formItemProps) => {
// 为日期组件添加特殊处理
if ([
FORM_ITEM_RENDER_ENUM.DATE,
@ -117,6 +113,15 @@ const FormItemsRenderer = ({
formItemProps.getValueFromEvent = (_, dateString) => dateString;
formItemProps.getValueProps = value => ({ value: Array.isArray(value) ? value.map(v => v ? dayjs(v) : undefined) : undefined });
}
};
// 获取传给 formItem 的属性
const getFormItemProps = (option) => {
const formItemProps = typeof option.formItemProps === "function"
? option.formItemProps(getFormValues())
: (option.formItemProps || {});
setDateComponentProps(option, formItemProps);
return formItemProps;
};
@ -218,6 +223,39 @@ const FormItemsRenderer = ({
return { span: itemSpan, labelCol: itemLabelCol, wrapperCol: itemWrapperCol };
};
// 获取 col 样式
const getColStyle = (option) => {
return typeof option.colStyle === "function"
? option.colStyle(getFormValues())
: option.colStyle;
};
// 获取 col 标题Col 内部、Form.Item 之后)
const getColTitle = (option) => {
return typeof option.colTitle === "function"
? option.colTitle(getFormValues())
: option.colTitle;
};
// 获取 row 样式FormList 的每一行)
const getRowStyle = (option, field, fieldIndex) => {
return typeof option.rowStyle === "function"
? option.rowStyle(field, fieldIndex)
: option.rowStyle;
};
// 获取 row 标题FormList 每行末尾)
const getRowTitle = (option, field, fieldIndex) => {
return typeof option.rowTitle === "function"
? option.rowTitle(field, fieldIndex)
: option.rowTitle;
};
// 获取是否动态表单项
const getIsDynamicFormItem = (option, formItemProps) => {
return (option.shouldUpdate ?? option.dependencies) || (formItemProps.shouldUpdate ?? formItemProps.dependencies);
};
// 获取 hidden
const getHidden = (hidden) => {
// 支持动态计算 hidden
@ -264,7 +302,7 @@ const FormItemsRenderer = ({
case FORM_ITEM_RENDER_ENUM.SELECT:
return (
<Select placeholder={placeholder} showSearch allowClear optionFilterProp="children" {...componentProps}>
<Select placeholder={placeholder} showSearch={{ optionFilterProp: "children" }} allowClear {...componentProps}>
{(option.items || []).map((item) => {
const { value, label, disabled } = getSelectableItemAttributes(item, itemsFieldKey);
return (
@ -420,8 +458,12 @@ const FormItemsRenderer = ({
delete formItemProps.dependencies;
delete formItemProps.shouldUpdate;
if (getHidden(option.hidden))
return null;
return (
<Col key={getKey(option) || index} span={col.span} style={style}>
<Col key={getKey(option) || index} span={col.span} style={{ ...style, ...getColStyle(option) }}>
{getColTitle(option)}
<Form.Item
name={option.name}
label={renderLabel(option)}
@ -470,7 +512,7 @@ const FormItemsRenderer = ({
if (option.render === FORM_ITEM_RENDER_ENUM.DIVIDER) {
return (
<Col key={getKey(option) || index} span={col.span} style={style}>
<Divider orientation="left" {...componentProps}>{option.label}</Divider>
<Divider titlePlacement="start" {...componentProps}>{option.label}</Divider>
</Col>
);
}
@ -503,18 +545,19 @@ const FormItemsRenderer = ({
const componentProps = getComponentProps(option);
return (
<Col key={getKey(option) || index} span={col.span} style={style}>
<Col key={getKey(option) || index} span={col.span} style={{ ...style, ...getColStyle(option) }}>
{getColTitle(option)}
<Form.List name={option.name} {...componentProps}>
{(fields, { add, remove, move }) => (
<>
{fields.map((field, fieldIndex) => {
const listOptions = getListOptions(formListUniqueProps.options, field, fieldIndex, add, remove, move);
const rowStyle = getRowStyle(option, field, fieldIndex);
const rowTitle = getRowTitle(option, field, fieldIndex);
return (
<Row gutter={gutter} key={field.key}>
<Row gutter={gutter} key={field.key} style={rowStyle}>
{rowTitle}
{listOptions.map((listOption, listIndex) => {
if (getHidden(listOption.hidden))
return null;
const col = getCol(listOption);
const formItemProps = getFormItemProps(listOption);
@ -532,7 +575,7 @@ const FormItemsRenderer = ({
if (listOption.render === FORM_ITEM_RENDER_ENUM.FORM_LIST)
return renderFormList(params);
if ((listOption.shouldUpdate ?? listOption.dependencies) || (formItemProps.shouldUpdate ?? formItemProps.dependencies))
if (getIsDynamicFormItem(listOption, formItemProps))
return renderDynamicFormItem(params);
// 判断一个项是否需要显示按钮(不是 onlyForLabel 且不是隐藏的)
@ -562,8 +605,10 @@ const FormItemsRenderer = ({
if (listIndex === lastShowIndex || isNextNestedFormList || isNextNoShow) {
delete formItemProps.dependencies;
delete formItemProps.shouldUpdate;
return (
<Col key={getKey(listOption) || listIndex} span={col.span} style={style}>
<Col key={getKey(listOption) || listIndex} span={col.span} style={{ ...style, ...getColStyle(listOption) }}>
{getColTitle(listOption)}
<Form.Item
label={renderLabel(listOption)}
labelCol={col.labelCol}
@ -574,7 +619,7 @@ const FormItemsRenderer = ({
{...formItemProps}
>
<div style={{ display: "flex", gap: 10, alignItems: "center", justifyContent: "space-between" }}>
<div style={{ flex: 1 }}>
<div style={{ flex: 1, minWidth: 0 }}>
<Form.Item
noStyle
rules={getRules(listOption)}
@ -632,9 +677,6 @@ const FormItemsRenderer = ({
return (
<>
{options.map((option, index) => {
if (getHidden(option.hidden))
return null;
const col = getCol(option);
const style = getStyle(index);
const formItemProps = getFormItemProps(option);
@ -657,7 +699,7 @@ const FormItemsRenderer = ({
return renderFormList(params);
// 如果配置了 shouldUpdate 或 dependencies使用 Form.Item 的联动机制
if ((option.shouldUpdate ?? option.dependencies) || (formItemProps.shouldUpdate ?? formItemProps.dependencies))
if (getIsDynamicFormItem(option, formItemProps))
return renderDynamicFormItem(params);
// 普通表单项(静态配置)

View File

@ -17,12 +17,14 @@ function HeaderBack(props) {
<>
<div
className="back"
onClick={() => history?.goBack?.() || window.history.back()}
onClick={() => {
history?.goBack ? history.goBack() : window.history.back();
}}
>
<ArrowLeftOutlined style={{ fontSize: 14 }} />
<span>返回</span>
</div>
<Divider type="vertical" style={{ backgroundColor: "#dcdfe6", marginLeft: 15, marginRight: 15 }} />
<Divider orientation="vertical" style={{ backgroundColor: "#dcdfe6", marginLeft: 15, marginRight: 15 }} />
</>
)
}

View File

@ -131,7 +131,7 @@ function HiddenInfo(props) {
return (
<div>
<Spin spinning={loading || downloadFileLoading}>
<Divider orientation="left">隐患信息</Divider>
<Divider titlePlacement="start">隐患信息</Divider>
<Descriptions
bordered
column={1}
@ -193,7 +193,7 @@ function HiddenInfo(props) {
{
(info.hiddenUserPresetsCO && Object.keys(info.hiddenUserPresetsCO).length > 0) && (
<>
<Divider orientation="left">整改信息发现人预填</Divider>
<Divider titlePlacement="start">整改信息发现人预填</Divider>
<Descriptions
bordered
column={1}
@ -223,7 +223,7 @@ function HiddenInfo(props) {
{
(info.hiddenConfirmUserCO && info.hiddenConfirmUserCO.length > 0) && (
<>
<Divider orientation="left">隐患确认</Divider>
<Divider titlePlacement="start">隐患确认</Divider>
{
info.hiddenConfirmUserCO.map(item => (
<Descriptions
@ -256,7 +256,7 @@ function HiddenInfo(props) {
{
info.hiddenExtensionList && info.hiddenExtensionList.length > 0 && (
<>
<Divider orientation="left">延期信息</Divider>
<Divider titlePlacement="start">延期信息</Divider>
{
info.hiddenExtensionList.map(item => (
<Descriptions
@ -319,7 +319,7 @@ function HiddenInfo(props) {
{
info.hiddenSpecialList && info.hiddenSpecialList.length > 0 && (
<>
<Divider orientation="left">特殊处置审核信息</Divider>
<Divider titlePlacement="start">特殊处置审核信息</Divider>
{
info.hiddenSpecialList.map(item => (
<Descriptions
@ -405,7 +405,7 @@ function HiddenInfo(props) {
{
(info.hiddenRectifyUserCO && info.hiddenRectifyUserCO.length > 0) && (
<>
<Divider orientation="left">整改信息</Divider>
<Divider titlePlacement="start">整改信息</Divider>
{
info.hiddenRectifyUserCO.map((item, index) => (
<Descriptions
@ -454,7 +454,7 @@ function HiddenInfo(props) {
info.hiddenAcceptQualifiedUserCO.length > 0
? (
<>
<Divider orientation="left">验收信息</Divider>
<Divider titlePlacement="start">验收信息</Divider>
{
info.hiddenAcceptQualifiedUserCO.map((item, index) => (
<Descriptions
@ -482,7 +482,7 @@ function HiddenInfo(props) {
info.hiddenAcceptUnqualifiedUserCO.length > 0
? (
<>
<Divider orientation="left">验收打回信息</Divider>
<Divider titlePlacement="start">验收打回信息</Divider>
{
info.hiddenAcceptUnqualifiedUserCO.map(item => (
<Descriptions
@ -507,7 +507,7 @@ function HiddenInfo(props) {
(info.hiddenInspecCO && Object.keys(info.hiddenInspecCO).length > 0)
? (
<>
<Divider orientation="left">安全环保验收信息</Divider>
<Divider titlePlacement="start">安全环保验收信息</Divider>
<Descriptions
bordered
column={1}

View File

@ -53,7 +53,7 @@ const ImportFile = (props) => {
open={visible}
onCancel={handleClose}
width={600}
maskClosable={false}
mask={{ closable: false }}
footer={[
templateUrl && (
<Button key="export" onClick={handleExportTemplate}>

View File

@ -11,8 +11,6 @@ export interface BasicLeftTreeProps extends Omit<TreeProps, "fieldNames"> {
idKey?: string;
/** 树形数据 children 字段,默认 children */
childrenKey?: string;
/** @deprecated 已弃用,请使用 getNodePathsIsIncludeOneself */
onGetNodePathsIsIncludeOneself?: boolean;
/** 决定 onGetNodePaths 是否包含自身节点,默认 true */
getNodePathsIsIncludeOneself?: boolean;
/** 获取父级节点 */

View File

@ -12,7 +12,6 @@ const BasicLeftTree = (props) => {
onGetData,
onSelect,
onGetNodePaths,
onGetNodePathsIsIncludeOneself,
getNodePathsIsIncludeOneself = true,
expandedKeys: externalExpandedKeys,
treeData = [],
@ -22,14 +21,6 @@ const BasicLeftTree = (props) => {
...restProps
} = props;
// 如果使用了已弃用的参数给出警告
if (onGetNodePathsIsIncludeOneself !== undefined) {
console.warn("【BasicLeftTree】 onGetNodePathsIsIncludeOneself 参数已弃用,请使用 getNodePathsIsIncludeOneself 参数");
}
// 向后兼容,如果传入了旧参数,使用旧参数
const finalGetNodePathsIsIncludeOneself = onGetNodePathsIsIncludeOneself !== undefined ? onGetNodePathsIsIncludeOneself : getNodePathsIsIncludeOneself;
const [expandedKeys, setExpandedKeys] = useState([]);
const [searchValue, setSearchValue] = useState("");
const [autoExpandParent, setAutoExpandParent] = useState(true);
@ -90,7 +81,7 @@ const BasicLeftTree = (props) => {
targetId: selectedNodeId,
idKey,
childrenKey,
isIncludeOneself: finalGetNodePathsIsIncludeOneself,
isIncludeOneself: getNodePathsIsIncludeOneself,
});
onGetNodePaths?.(parentNodes);
}

View File

@ -267,7 +267,7 @@ const MapSelector = (props) => {
onCancel={handleClose}
width={1000}
destroyOnHidden={false}
maskClosable={false}
mask={{ closable: false }}
afterClose={handleAfterClose}
footer={[
<Button key="back" onClick={handleClose}>

View File

@ -61,7 +61,11 @@ function Page(props) {
{customActionButtons || (
<Space>
{extraActionButtons}
<Button onClick={() => history?.goBack?.() || window.history.back()}>
<Button
onClick={() => {
history?.goBack ? history.goBack() : window.history.back();
}}
>
{backButtonText}
</Button>
</Space>

View File

@ -90,7 +90,7 @@ function Pdf(props) {
<Modal
style={{ top: isFullscreen ? 0 : 100, maxWidth: isFullscreen ? "100vw" : "calc(100vw - 32px)", paddingBottom: isFullscreen ? 0 : 24 }}
open={visible}
maskClosable={false}
mask={{ closable: false }}
width={isFullscreen ? "100vw" : pdfWidth + 100}
title={title}
onCancel={() => {

View File

@ -59,7 +59,7 @@ function BasicSelect(props) {
}, [data]);
return (
<Select placeholder={`请选择${placeholder}`} showSearch allowClear optionFilterProp="children" onChange={handleChange} {...restProps}>
<Select placeholder={`请选择${placeholder}`} showSearch={{ optionFilterProp: "children" }} allowClear onChange={handleChange} {...restProps}>
{data.map((item) => {
const value = item[idKey];
const label = labelRender ? labelRender(item) : item[nameKey];

View File

@ -11,8 +11,6 @@ export interface BasicSelectTreeProps extends Omit<TreeSelectProps, "fieldNames"
idKey?: string;
/** 树形数据 children 字段,默认 children */
childrenKey?: string;
/** @deprecated 已弃用,请使用 getNodePathsIsIncludeOneself */
onGetNodePathsIsIncludeOneself?: boolean;
/** 决定 onGetNodePaths 是否包含自身节点,默认 true */
getNodePathsIsIncludeOneself?: boolean;
/** 获取父级节点 */

View File

@ -11,7 +11,6 @@ function BasicSelectTree(props) {
onChange,
onGetLabel,
onGetNodePaths,
onGetNodePathsIsIncludeOneself,
getNodePathsIsIncludeOneself = true,
placeholder = "",
treeData = [],
@ -23,14 +22,6 @@ function BasicSelectTree(props) {
...restProps
} = props;
// 如果使用了已弃用的参数给出警告
if (onGetNodePathsIsIncludeOneself !== undefined) {
console.warn("【BasicSelectTree】 onGetNodePathsIsIncludeOneself 参数已弃用,请使用 getNodePathsIsIncludeOneself 参数");
}
// 向后兼容,如果传入了旧参数,使用旧参数
const finalGetNodePathsIsIncludeOneself = onGetNodePathsIsIncludeOneself !== undefined ? onGetNodePathsIsIncludeOneself : getNodePathsIsIncludeOneself;
const processedTreeData = useMemo(() => {
// 根据 level 处理树数据
let result = level
@ -64,7 +55,7 @@ function BasicSelectTree(props) {
targetId,
idKey,
childrenKey,
isIncludeOneself: finalGetNodePathsIsIncludeOneself,
isIncludeOneself: getNodePathsIsIncludeOneself,
});
parentNodes.push(...currentParentNodes);
}
@ -81,7 +72,7 @@ function BasicSelectTree(props) {
targetId,
idKey,
childrenKey,
isIncludeOneself: finalGetNodePathsIsIncludeOneself,
isIncludeOneself: getNodePathsIsIncludeOneself,
});
onGetNodePaths?.(parentNodes);
onGetLabel?.(parentNodes[parentNodes.length - 1][nameKey]);

View File

@ -30,6 +30,7 @@ export interface Params {
inType?: InType[];
/** 企业类型 1-监管 2-企业 3-相关方 */
enterpriseType?: EnterpriseType | EnterpriseType[];
[key: string]: any;
}
/**

View File

@ -60,7 +60,7 @@ function Signature(props) {
title="签字"
width={800}
open={signatureModalOpen}
maskClosable={false}
mask={{ closable: false }}
onCancel={() => setSignatureModalOpen(false)}
footer={[
<Button key="clear" onClick={() => signatureCanvas.current.clear()}>重签</Button>,

View File

@ -92,7 +92,7 @@ const Video = forwardRef(({
关闭
</Button>,
]}
maskClosable={false}
mask={{ closable: false }}
onCancel={() => setVisible(false)}
>
{playerElement}

View File

@ -18,8 +18,6 @@ export interface UseTableOptions<TData extends Data, TParams extends Params> ext
params?: Record<string, any> | (() => Record<string, any>);
/** 表单数据转换函数,在每次请求之前调用,接收当前搜索的表单项,要求返回一个对象 */
transform?: (formData: FormValues) => FormValues;
/** @deprecated 已弃用,请使用 onSuccess */
callback?: (list: any[], data: any) => void;
/** 表单实例(通过 Form.useForm() 创建) */
form?: FormInstance;
}

View File

@ -96,13 +96,6 @@ function useTable(service, options) {
},
);
if (restOptions.callback !== undefined) {
console.warn("【useTable】 callback 参数已弃用,请使用 onSuccess 参数");
}
// 执行回调函数
restOptions.callback && restOptions.callback(res?.data?.list || [], res?.data || {});
// 返回结果
return {
...res,