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/timeSettingView.js | 124 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 124 insertions(+), 0 deletions(-)
diff --git a/vf205_access/src/view/config/menu/systemSetting/timeSettingView.js b/vf205_access/src/view/config/menu/systemSetting/timeSettingView.js
new file mode 100644
index 0000000..1012fc9
--- /dev/null
+++ b/vf205_access/src/view/config/menu/systemSetting/timeSettingView.js
@@ -0,0 +1,124 @@
+import dxui from '../../../../../dxmodules/dxUi.js'
+import std from '../../../../../dxmodules/dxStd.js'
+import dxMap from '../../../../../dxmodules/dxMap.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 timeSettingView = {}
+timeSettingView.init = function () {
+ /**************************************************鍒涘缓灞忓箷*****************************************************/
+ const screenMain = dxui.View.build('timeSettingView', dxui.Utils.LAYER.MAIN)
+ timeSettingView.screenMain = screenMain
+ screenMain.scroll(false)
+ screenMain.bgColor(0xffffff)
+ screenMain.on(dxui.Utils.ENUM.LV_EVENT_SCREEN_LOADED, () => {
+ topView.changeTheme(true)
+
+ const configAll = screen.getConfig()
+ timeSettingView.info[0].input.text(configAll['ntp.gmt'] + '')
+ timeSettingView.info[1].input.text(configAll['ntp.server'] + '')
+
+ const syncTime = dxMap.get("NTP_SYNC").get("syncTime")
+ if (syncTime) {
+ msgLabel.text(new Date(syncTime).toLocaleString())
+ }
+ })
+
+ const titleBox = viewUtils.title(screenMain, systemSettingView.screenMain, 'timeSettingViewTitle', 'systemSettingView.timeSetting')
+ titleBox.align(dxui.Utils.ALIGN.TOP_MID, 0, 70)
+
+ timeSettingView.info = [
+ {
+ title: "systemSettingView.syncMode",
+ type: 'input',
+ },
+ {
+ title: "systemSettingView.ntpAddress",
+ type: 'input',
+ }
+ ]
+
+ const timeSettingBox = dxui.View.build('timeSettingBox', screenMain)
+ viewUtils._clearStyle(timeSettingBox)
+ timeSettingBox.align(dxui.Utils.ALIGN.TOP_MID, 0, 140)
+ timeSettingBox.setSize(screen.screenSize.width, 300)
+ timeSettingBox.bgOpa(0)
+ timeSettingBox.flexFlow(dxui.Utils.FLEX_FLOW.ROW_WRAP)
+ timeSettingBox.flexAlign(dxui.Utils.FLEX_ALIGN.CENTER, dxui.Utils.FLEX_ALIGN.START, dxui.Utils.FLEX_ALIGN.START)
+ timeSettingBox.obj.lvObjSetStylePadGap(0, dxui.Utils.ENUM._LV_STYLE_STATE_CMP_SAME)
+ timeSettingBox.borderWidth(1)
+ timeSettingBox.setBorderColor(0xDEDEDE)
+ timeSettingBox.obj.setStyleBorderSide(dxui.Utils.ENUM.LV_BORDER_SIDE_TOP, 0)
+
+ timeSettingView.info.forEach(item => {
+ const itemBox = dxui.View.build(item.title, timeSettingBox)
+ 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))
+
+ 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)
+ if (item.title == "systemSettingView.ntpAddress") {
+ input.setSize(300, 55)
+ } else {
+ input.setSize(150, 55)
+ }
+ item.input = input
+ break;
+ }
+ })
+
+ const msgLabel = dxui.Label.build('msgLabel', screenMain)
+ msgLabel.align(dxui.Utils.ALIGN.TOP_MID, 0, 662)
+ msgLabel.textFont(viewUtils.font(22))
+ msgLabel.text('2024/02/12 19:07')
+ msgLabel.textColor(0x888888)
+
+ const msgLabel2 = dxui.Label.build('msgLabel2', screenMain)
+ msgLabel2.align(dxui.Utils.ALIGN.TOP_MID, 0, 690)
+ msgLabel2.textFont(viewUtils.font(22))
+ msgLabel2.textColor(0x888888)
+ msgLabel2.dataI18n = 'systemSettingView.timeSyncSuccess'
+
+
+ const saveBtn = viewUtils.bottomBtn(screenMain, screenMain.id + 'saveBtn', 'systemSettingView.save', () => {
+ const saveConfigData = {
+ ntp: {
+ gmt: parseInt(timeSettingView.info[0].input.text()),
+ server: timeSettingView.info[1].input.text(),
+ }
+ }
+ const res = screen.saveConfig(saveConfigData)
+ if (res === true) {
+ timeSettingView.statusPanel.success()
+ std.setTimeout(() => {
+ // 鎴愬姛杩斿洖涓婁竴灞傜晫闈�
+ dxui.loadMain(systemSettingView.screenMain)
+ }, 500)
+ } else {
+ timeSettingView.statusPanel.fail()
+ }
+ })
+ saveBtn.align(dxui.Utils.ALIGN.BOTTOM_MID, 0, -83)
+ timeSettingView.statusPanel = viewUtils.statusPanel(screenMain, 'systemSettingView.success', 'systemSettingView.fail')
+}
+
+export default timeSettingView
--
Gitblit v1.9.3