From e13013e40fc0b74460bf64e110cc92770d81e84d Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Wed, 16 Apr 2025 22:42:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=B4=A6=E5=8F=B7=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/system/Setting.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/pages/system/Setting.tsx b/src/pages/system/Setting.tsx index 611b09f..9d4e3d1 100644 --- a/src/pages/system/Setting.tsx +++ b/src/pages/system/Setting.tsx @@ -8,7 +8,7 @@ import { OrgItem } from '../../services/ktjTypes'; import {bleItem, child, GwdItem, orgCascaderType, systemItem} from './types'; import { sysSet } from '../../services/user/system'; import { useAppDispatch, useAppSelector } from "../../utils/hooks"; -import { updateSystemAccountState, updateSystemOrgState } from '../../store/system/systemSlice'; +import { updateSystemAccountState, updateSystemAllState, updateSystemOrgState } from '../../store/system/systemSlice'; import {createWebSocket, sharedWsUrl} from "../../services/socket"; import {start, stop, disconnect, connect} from "../../services/ble/ble"; @@ -65,6 +65,8 @@ export default function Setting(){ value: cloneOrgItem.value } setOrgInfo(orgItem) + let systemInfo = systemState.systemInfo + setSystemList(systemInfo) } }, [systemState.orgInfo]) @@ -255,8 +257,17 @@ export default function Setting(){ value } sysSet(params, "PUT").then(res=>{ + if(res.status === 0){ + const list:systemItem[] = JSON.parse(JSON.stringify(systemList)) + list.forEach(el => { + if(item.id === el.id){ + el.value = value + } + }) + dispatch(updateSystemAllState(list)) + message.success("修改成功") + } }) - } const form = () =>{