From e491cdb48129752324c4e3764f99bd9203c56dec Mon Sep 17 00:00:00 2001
From: lgq <1015864684@qq.com>
Date: 星期二, 31 三月 2026 09:48:44 +0800
Subject: [PATCH] 1.新增VF205门禁机代码
---
vf205_access/src/view/config/menu/systemSetting/passwordManagementView.js | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 115 insertions(+), 0 deletions(-)
diff --git a/vf205_access/src/view/config/menu/systemSetting/passwordManagementView.js b/vf205_access/src/view/config/menu/systemSetting/passwordManagementView.js
new file mode 100644
index 0000000..1e289ab
--- /dev/null
+++ b/vf205_access/src/view/config/menu/systemSetting/passwordManagementView.js
@@ -0,0 +1,115 @@
+
+import dxui from '../../../../../dxmodules/dxUi.js'
+import std from '../../../../../dxmodules/dxStd.js'
+import viewUtils from "../../../viewUtils.js"
+import topView from "../../../topView.js"
+import systemSettingView from '../systemSettingView.js'
+import i18n from "../../../i18n.js"
+import screen from '../../../../screen.js'
+const passwordManagementView = {}
+passwordManagementView.init = function () {
+ /**************************************************鍒涘缓灞忓箷*****************************************************/
+ const screenMain = dxui.View.build('passwordManagementView', dxui.Utils.LAYER.MAIN)
+ passwordManagementView.screenMain = screenMain
+ screenMain.scroll(false)
+ screenMain.bgColor(0xffffff)
+ screenMain.on(dxui.Utils.ENUM.LV_EVENT_SCREEN_LOADED, () => {
+ topView.changeTheme(true)
+ })
+
+ const titleBox = viewUtils.title(screenMain, systemSettingView.screenMain, 'passwordManagementViewTitle', 'systemSettingView.passwordManagement')
+ titleBox.align(dxui.Utils.ALIGN.TOP_MID, 0, 70)
+
+ passwordManagementView.info = [
+ {
+ title: "systemSettingView.inputOriginalPassword",
+ type: 'input',
+ },
+ {
+ title: "systemSettingView.inputNewPassword",
+ type: 'input',
+ },
+ {
+ title: "systemSettingView.inputRepeatNewPassword",
+ type: 'input',
+ }
+ ]
+
+ const passwordManagementBox = dxui.View.build('passwordManagementBox', screenMain)
+ viewUtils._clearStyle(passwordManagementBox)
+ passwordManagementBox.align(dxui.Utils.ALIGN.TOP_MID, 0, 140)
+ passwordManagementBox.setSize(screen.screenSize.width, 300)
+ passwordManagementBox.bgOpa(0)
+ passwordManagementBox.flexFlow(dxui.Utils.FLEX_FLOW.ROW_WRAP)
+ passwordManagementBox.flexAlign(dxui.Utils.FLEX_ALIGN.CENTER, dxui.Utils.FLEX_ALIGN.START, dxui.Utils.FLEX_ALIGN.START)
+ passwordManagementBox.obj.lvObjSetStylePadGap(0, dxui.Utils.ENUM._LV_STYLE_STATE_CMP_SAME)
+ passwordManagementBox.borderWidth(1)
+ passwordManagementBox.setBorderColor(0xDEDEDE)
+ passwordManagementBox.obj.setStyleBorderSide(dxui.Utils.ENUM.LV_BORDER_SIDE_TOP, 0)
+
+ passwordManagementView.info.forEach(item => {
+ const itemBox = dxui.View.build(item.title, passwordManagementBox)
+ viewUtils._clearStyle(itemBox)
+ itemBox.setSize(760, 76)
+ itemBox.borderWidth(1)
+ itemBox.setBorderColor(0xDEDEDE)
+ itemBox.obj.setStyleBorderSide(dxui.Utils.ENUM.LV_BORDER_SIDE_BOTTOM, 0)
+
+ const itemLabel = dxui.Label.build(item.title + 'Label', itemBox)
+ itemLabel.dataI18n = item.title
+ itemLabel.align(dxui.Utils.ALIGN.LEFT_MID, 0, 0)
+ itemLabel.textFont(viewUtils.font(26))
+ itemLabel.width(300)
+ itemLabel.longMode(dxui.Utils.LABEL_LONG_MODE.SCROLL_CIRCULAR)
+
+ if (item.unit) {
+ const unitLabel = dxui.Label.build(item.title + 'UnitLabel', itemBox)
+ unitLabel.text(item.unit)
+ unitLabel.align(dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
+ unitLabel.textFont(viewUtils.font(26))
+ }
+
+ switch (item.type) {
+ case 'input':
+ const input = viewUtils.input(itemBox, item.title + 'input', undefined, undefined, undefined)
+ input.align(dxui.Utils.ALIGN.RIGHT_MID, 0, 0)
+ input.setSize(280, 55)
+ item.input = input
+ break;
+ }
+ })
+
+
+ const saveBtn = viewUtils.bottomBtn(screenMain, screenMain.id + 'saveBtn', 'systemSettingView.save', () => {
+ const configAll = screen.getConfig()
+ if (configAll['base.password'] != passwordManagementView.info[0].input.text()) {
+ passwordManagementView.statusPanel.fail()
+ return
+ }
+
+ if (passwordManagementView.info[1].input.text() != passwordManagementView.info[2].input.text()) {
+ passwordManagementView.statusPanel.fail()
+ return
+ }
+
+ const saveConfigData = {
+ base: {
+ password: passwordManagementView.info[2].input.text(),
+ }
+ }
+ const res = screen.saveConfig(saveConfigData)
+ if (res === true) {
+ passwordManagementView.statusPanel.success()
+ std.setTimeout(() => {
+ // 鎴愬姛杩斿洖涓婁竴灞傜晫闈�
+ dxui.loadMain(systemSettingView.screenMain)
+ }, 500)
+ } else {
+ passwordManagementView.statusPanel.fail()
+ }
+ })
+ saveBtn.align(dxui.Utils.ALIGN.BOTTOM_MID, 0, -83)
+ passwordManagementView.statusPanel = viewUtils.statusPanel(screenMain, 'systemSettingView.success', 'systemSettingView.fail')
+}
+
+export default passwordManagementView
--
Gitblit v1.9.3