From cd40c6f6f3a6138cb70b2e2d017cc7f34a887ef8 Mon Sep 17 00:00:00 2001
From: lgq <1015864684@qq.com>
Date: 星期五, 17 四月 2026 13:59:49 +0800
Subject: [PATCH] 1.更新vf107代码,更新自动上报通行记录接口、人员查询接口、人员添加接口

---
 vf107/src/view/config/menu/networkSettingView.js |   41 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/vf107/src/view/config/menu/networkSettingView.js b/vf107/src/view/config/menu/networkSettingView.js
index 4b85f13..63b4d87 100644
--- a/vf107/src/view/config/menu/networkSettingView.js
+++ b/vf107/src/view/config/menu/networkSettingView.js
@@ -9,6 +9,9 @@
 const net_map = map.get("NET")
 const networkSettingView = {}
 
+networkSettingView.isEditing = false // 鏄惁姝e湪缂栬緫閰嶇疆鐨勬爣蹇椾綅
+networkSettingView.isVisible = false // 鏄惁鍦ㄧ綉缁滈厤缃〉闈㈢殑鏍囧織浣�
+
 networkSettingView.init = function () {
     /**************************************************鍒涘缓灞忓箷*****************************************************/
     const screenMain = dxui.View.build('networkSettingView', dxui.Utils.LAYER.MAIN)
@@ -20,6 +23,8 @@
     screenMain.bgColor(0xffffff)
     screenMain.on(dxui.Utils.ENUM.LV_EVENT_SCREEN_LOADED, () => {
         topView.changeTheme(true)
+        networkSettingView.isEditing = false // 灞忓箷鍔犺浇鏃堕噸缃紪杈戠姸鎬�
+        networkSettingView.isVisible = true // 灞忓箷鍔犺浇鏃惰缃负鍙
         const configAll = screen.getConfig()
 
         // Store initial state for comparison on save
@@ -38,6 +43,7 @@
         let netList = []
         switch (screen.dxDriver.DRIVER.MODEL) {
             case "vf105":
+            case "vf107":
                 netList = [i18n.t('networkSettingView.ethernet'), i18n.t('networkSettingView.wifi')]
                 break;
             case "vf114":
@@ -59,6 +65,8 @@
 
     screenMain.on(dxui.Utils.ENUM.LV_EVENT_SCREEN_UNLOADED, () => {
         wifiListBoxClose.send(dxui.Utils.EVENT.CLICK)
+        networkSettingView.isVisible = false // 灞忓箷鍗歌浇鏃惰缃负涓嶅彲瑙�
+        networkSettingView.isEditing = false // 灞忓箷鍗歌浇鏃堕噸缃紪杈戠姸鎬�
     })
 
     const titleBox = viewUtils.title(screenMain, configView.screenMain, 'networkSettingViewTitle', 'networkSettingView.title')
@@ -177,6 +185,21 @@
             input.setSize(screen.screenSize.width * (310 / 600), screen.screenSize.height * (45 / 1280))
             item.input = input
 
+            // 娣诲姞杈撳叆妗嗙劍鐐逛簨浠剁洃鍚拰鍊煎彉鍖栫洃鍚紝闃叉缂栬緫鏃堕厤缃閲嶇疆
+            input.on(dxui.Utils.EVENT.FOCUSED, () => {
+                networkSettingView.isEditing = true
+            })
+            input.on(dxui.Utils.EVENT.DEFOCUSED, () => {
+                // 鍙湁褰撻厤缃病鏈夊彉鍖栨椂鎵嶈缃甶sEditing涓篺alse
+                if (!networkSettingView._isConfigChanged()) {
+                    networkSettingView.isEditing = false
+                }
+            })
+            // 娣诲姞鍊煎彉鍖栫洃鍚紝褰撶敤鎴蜂慨鏀逛簡鍊兼椂璁剧疆isEditing涓簍rue
+            input.on(dxui.Utils.EVENT.VALUE_CHANGED, () => {
+                networkSettingView.isEditing = true
+            })
+
             if (item.title === 'networkSettingView.wifiName') {
                 input.setSize(screen.screenSize.width * (200 / 600), screen.screenSize.height * (45 / 1280))
                 input.align(dxui.Utils.ALIGN.RIGHT_MID, -screen.screenSize.width * (110 / 600), 0)
@@ -217,6 +240,11 @@
             __switch.setSize(screen.screenSize.width * (70 / 600), screen.screenSize.height * (35 / 1280))
             __switch.bgColor(0x000000, NativeObject.APP.NativeComponents.NativeEnum.LV_PART_INDICATOR | NativeObject.APP.NativeComponents.NativeEnum.LV_STATE_CHECKED)
             item.switch = __switch
+
+            // 娣诲姞寮�鍏充簨浠剁洃鍚紝闃叉鎿嶄綔鏃堕厤缃閲嶇疆
+            __switch.on(dxui.Utils.EVENT.VALUE_CHANGED, () => {
+                networkSettingView.isEditing = true
+            })
         }
 
         if (item.type === 'dropdown') {
@@ -233,6 +261,7 @@
 
             if (item.title === 'networkSettingView.type') {
                 dropdown.on(dxui.Utils.EVENT.VALUE_CHANGED, () => {
+                    networkSettingView.isEditing = true
                     switch (dropdown.getSelected()) {
                         case 0:
                             networkSettingView.changeNetType(1)
@@ -406,6 +435,7 @@
     const saveBtn = viewUtils.bottomBtn(screenMain, screenMain.id + 'saveBtn', 'networkSettingView.save', () => {
         if (!networkSettingView._isConfigChanged()) {
             // No changes, just go back
+            networkSettingView.isEditing = false
             dxui.loadMain(screenMain.backScreen)
             return
         }
@@ -527,6 +557,7 @@
             networkSettingView.statusPanel.success()
             std.setTimeout(() => {
                 // 鎴愬姛杩斿洖涓婁竴灞傜晫闈�
+                networkSettingView.isEditing = false
                 dxui.loadMain(screenMain.backScreen)
             }, 500)
             screen.updateNetStatus("disconnect")
@@ -546,10 +577,7 @@
 }
 
 networkSettingView._isConfigChanged = function () {
-    //濡傛灉鎵撳紑鐣岄潰鏃剁殑鏁版嵁鍜岀偣鍑讳繚瀛樻寜閽椂鐨勬暟鎹墠鍚庢病鏈夊彂鐢熷彉鍖栵紝灏变笉瑙﹀彂閲嶈繛鍜屾暟鎹繚瀛�
-    if (net_map.get("NET_STATUS") != "connected") {
-        return true //浣嗘槸鍋囧缃戠粶娌¤繛涓婏紝灏变竴瀹氳瑙﹀彂閲嶈繛鍜屾暟鎹繚瀛�
-    }
+    //妫�鏌ラ厤缃槸鍚︾湡鐨勫彂鐢熶簡鍙樺寲锛屾棤璁虹綉缁滅姸鎬佸浣�
     const selectedTypeIndex = networkSettingView.netInfo[0].dropdown.getSelected()
     let currentType
     switch (selectedTypeIndex) {
@@ -633,6 +661,11 @@
 }
 
 networkSettingView.refresh = function () {
+    // 濡傛灉鐢ㄦ埛姝e湪缂栬緫閰嶇疆锛屼笉鎵ц鑷姩鍒锋柊
+    if (networkSettingView.isEditing) {
+        return
+    }
+    
     const configAll = screen.getConfig()
 
     let selectNum = 0

--
Gitblit v1.9.3