From d39c649ffba8fc8c5c3bf2dd7b46d525c6cba5c6 Mon Sep 17 00:00:00 2001 From: LuckyFBB <976060700@qq.com> Date: Mon, 29 Sep 2025 14:39:51 +0800 Subject: [PATCH] fix(filterrules): use cloneDeep replace clone fix #604 --- src/filterRules/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/filterRules/index.tsx b/src/filterRules/index.tsx index 327500b12..12f25def7 100644 --- a/src/filterRules/index.tsx +++ b/src/filterRules/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { message } from 'antd'; import { InternalNamePath } from 'antd/lib/form/interface'; -import { clone } from 'lodash-es'; +import { cloneDeep } from 'lodash-es'; import shortId from 'shortid'; import useLocale from '../locale/useLocale'; @@ -89,7 +89,7 @@ const FilterRules = (props: IProps) => { }; const handleAddCondition = (keyObj: { key: string; isOut?: boolean }) => { - const cloneData = clone(value); + const cloneData = cloneDeep(value); const appendNode = findRelationNode(cloneData as IFilterValue, keyObj.key, keyObj.isOut); addCondition(appendNode, keyObj, initValues as T); onChange?.(cloneData); @@ -150,7 +150,7 @@ const FilterRules = (props: IProps) => { }; const handleDeleteCondition = (key: string) => { - const cloneData = clone(value); + const cloneData = cloneDeep(value); const deleteNode = findRelationNode(cloneData as IFilterValue, key, false); if (notEmpty.data && !deleteNode?.children) return message.info(notEmpty.message); if (!notEmpty.data && !deleteNode?.children) { @@ -192,7 +192,7 @@ const FilterRules = (props: IProps) => { // 更改条件节点的条件 const handleChangeCondition = (key: string, type: ROW_PERMISSION_RELATION) => { - const cloneData = clone(value); + const cloneData = cloneDeep(value); const changeNode = findRelationNode( cloneData as IFilterValue, key, @@ -207,7 +207,7 @@ const FilterRules = (props: IProps) => { // 改变节点的的数据 const handleChangeRowValues = (key: string, values: T) => { - const cloneData = clone(value); + const cloneData = cloneDeep(value); const changeNode = findRelationNode( cloneData as IFilterValue, key,