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/dxmodules/uiCheckbox.js |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/vf205_access/dxmodules/uiCheckbox.js b/vf205_access/dxmodules/uiCheckbox.js
new file mode 100644
index 0000000..f08dac2
--- /dev/null
+++ b/vf205_access/dxmodules/uiCheckbox.js
@@ -0,0 +1,48 @@
+//build锛�20240329
+//checkbox鎺т欢
+import utils from "./uiUtils.js"
+import base from "./uiBase.js"
+let checkbox = {}
+
+checkbox.build = function (id, parent) {
+    let temp = utils.validateBuild(checkbox.all, id, parent, 'checkbox')
+    let my = { type: 'checkbox' }
+    my.obj = new utils.GG.NativeCheckbox({ uid: id }, temp)
+    my.id = id
+    /**
+     * 鑾峰彇/璁剧疆鏂囧瓧
+     * @param {string} text 璁剧疆鏂囧瓧
+     * @returns 鑾峰彇鏂囧瓧
+     */
+    my.text = function (text) {
+        if (text == null || text == undefined) {
+            return this.obj.getText()
+        } else {
+            this.obj.setText(text)
+        }
+    }
+    /**
+     * 閫変腑鎴栦笉閫変腑
+     * @param {boolean} en true/false
+     */
+    my.select = function (en) {
+        if (en) {
+            if (!my.obj.hasState(utils.STATE.CHECKED)) {
+                my.obj.addState(utils.STATE.CHECKED)
+            }
+        } else {
+            my.obj.clearState(utils.STATE.CHECKED)
+        }
+    }
+    /**
+     * 鍒ゆ柇鏄惁閫変腑
+     * @returns 杩斿洖true/false
+     */
+    my.isSelect = function () {
+        return my.obj.hasState(utils.STATE.CHECKED)
+    }
+    let comp = Object.assign(my, base);
+    utils.setParent(this.all, comp, parent)
+    return comp;
+}
+export default checkbox;
\ No newline at end of file

--
Gitblit v1.9.3