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/systemSetting/passwordOpenDoorSettingView.js |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 55 insertions(+), 1 deletions(-)

diff --git a/vf107/src/view/config/menu/systemSetting/passwordOpenDoorSettingView.js b/vf107/src/view/config/menu/systemSetting/passwordOpenDoorSettingView.js
index cc69a5c..8753787 100644
--- a/vf107/src/view/config/menu/systemSetting/passwordOpenDoorSettingView.js
+++ b/vf107/src/view/config/menu/systemSetting/passwordOpenDoorSettingView.js
@@ -5,6 +5,7 @@
 import i18n from "../../../i18n.js"
 import systemSettingView from '../systemSettingView.js'
 import screen from '../../../../screen.js'
+import api from '../../../../service/api.js'
 const passwordOpenDoorSettingView = {}
 passwordOpenDoorSettingView.init = function () {
     /**************************************************鍒涘缓灞忓箷*****************************************************/
@@ -17,6 +18,9 @@
 
         const configAll = screen.getConfig()
         passwordOpenDoorSettingView.info[0].switch.select(configAll['sys.pwd'] == 1)
+
+        // 鏌ヨ搴旀�ュ紑闂ㄥ瘑鐮�
+        passwordOpenDoorSettingView.getEmergencyPassword()
     })
 
     const titleBox = viewUtils.title(screenMain, systemSettingView.screenMain, 'passwordOpenDoorSettingViewTitle', 'systemSettingView.passwordOpenDoorSetting')
@@ -26,13 +30,17 @@
         {
             title: "systemSettingView.passwordOpenDoor",
             type: 'switch',
+        },
+        {
+            title: "systemSettingView.emergencyOpenDoorPassword",
+            type: 'password',
         }
     ]
 
     const passwordOpenDoorSettingBox = dxui.View.build('passwordOpenDoorSettingBox', screenMain)
     viewUtils._clearStyle(passwordOpenDoorSettingBox)
     passwordOpenDoorSettingBox.align(dxui.Utils.ALIGN.TOP_MID, 0, screen.screenSize.height * (140 / 1280))
-    passwordOpenDoorSettingBox.setSize(screen.screenSize.width * (600 / 600), screen.screenSize.height * (600 / 1280))
+    passwordOpenDoorSettingBox.setSize(screen.screenSize.width * (600 / 600), screen.screenSize.height * (700 / 1280))
     passwordOpenDoorSettingBox.bgOpa(0)
     passwordOpenDoorSettingBox.flexFlow(dxui.Utils.FLEX_FLOW.ROW_WRAP)
     passwordOpenDoorSettingBox.flexAlign(dxui.Utils.FLEX_ALIGN.CENTER, dxui.Utils.FLEX_ALIGN.START, dxui.Utils.FLEX_ALIGN.START)
@@ -69,6 +77,30 @@
                 __switch.bgColor(0x000000, NativeObject.APP.NativeComponents.NativeEnum.LV_PART_INDICATOR | NativeObject.APP.NativeComponents.NativeEnum.LV_STATE_CHECKED)
                 item.switch = __switch
                 break;
+            case 'password':
+                const pwdInput = viewUtils.input(itemBox, item.title + 'Input', 2, undefined, '璇疯緭鍏ュ簲鎬ュ紑闂ㄥ瘑鐮�')
+                pwdInput.align(dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
+                pwdInput.setSize(screen.screenSize.width * (300 / 600), screen.screenSize.height * (50 / 1280))
+                pwdInput.setPasswordMode(true)
+                item.input = pwdInput
+
+                const eyeFill = viewUtils.imageBtn(itemBox, item.title + 'eye_fill', '/app/code/resource/image/eye-fill.png')
+                eyeFill.alignTo(pwdInput, dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
+                eyeFill.on(dxui.Utils.EVENT.CLICK, () => {
+                    pwdInput.setPasswordMode(true)
+                    eyeFill.hide()
+                    eyeOff.show()
+                })
+                eyeFill.hide()
+
+                const eyeOff = viewUtils.imageBtn(itemBox, item.title + 'eye_off', '/app/code/resource/image/eye-off.png')
+                eyeOff.alignTo(pwdInput, dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
+                eyeOff.on(dxui.Utils.EVENT.CLICK, () => {
+                    pwdInput.setPasswordMode(false)
+                    eyeFill.show()
+                    eyeOff.hide()
+                })
+                break;
         }
     })
 
@@ -76,6 +108,16 @@
         const saveConfigData = {
             sys: {
                 pwd: passwordOpenDoorSettingView.info[0].switch.isSelect() ? 1 : 0,
+            }
+        }
+
+        // 淇濆瓨搴旀�ュ紑闂ㄥ瘑鐮�
+        const emergencyPwd = passwordOpenDoorSettingView.info[1].input.text()
+        if (emergencyPwd) {
+            const res = api.insertEmergencyPassword({ password: emergencyPwd, description: "璁惧绔缃�" })
+            if (res !== true) {
+                passwordOpenDoorSettingView.statusPanel.fail()
+                return
             }
         }
 
@@ -95,4 +137,16 @@
     passwordOpenDoorSettingView.statusPanel = viewUtils.statusPanel(screenMain, 'systemSettingView.success', 'systemSettingView.fail')
 }
 
+// 鏌ヨ搴旀�ュ紑闂ㄥ瘑鐮�
+passwordOpenDoorSettingView.getEmergencyPassword = function () {
+    try {
+        const password = api.getEmergencyPassword()
+        if (password && password.password) {
+            passwordOpenDoorSettingView.info[1].input.text(password.password)
+        }
+    } catch (error) {
+        console.error('鏌ヨ搴旀�ュ紑闂ㄥ瘑鐮佸け璐�:', error)
+    }
+}
+
 export default passwordOpenDoorSettingView

--
Gitblit v1.9.3