From 041c570c5c10bc828c4308270fd50980d7a20ecc Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Sun, 16 Apr 2023 23:26:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/utils/conditionUtil.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/conditionUtil.js b/frontend/src/utils/conditionUtil.js index 3b3e0f1240..f5d86e426e 100644 --- a/frontend/src/utils/conditionUtil.js +++ b/frontend/src/utils/conditionUtil.js @@ -16,8 +16,9 @@ export const isChange = (conditions1, conditions2) => { if (conditions1.length !== conditions2.length) return true let arr1 = JSON.parse(JSON.stringify(conditions1)) let arr2 = JSON.parse(JSON.stringify(conditions2)) - arr1 = arr1.sort((s1, s2) => s1.componentId > s2.componentId) - arr2 = arr2.sort((s1, s2) => s1.componentId > s2.componentId) + const strCodeAt = (str) => str[0].charCodeAt() + arr1 = arr1.sort((s1, s2) => strCodeAt(s1.componentId) - strCodeAt(s2.componentId)) + arr2 = arr2.sort((s1, s2) => strCodeAt(s1.componentId) - strCodeAt(s2.componentId)) return JSON.stringify(arr1) !== JSON.stringify(arr2) }