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/uiSwitch.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/vf205_access/dxmodules/uiSwitch.js b/vf205_access/dxmodules/uiSwitch.js
new file mode 100644
index 0000000..bfa4376
--- /dev/null
+++ b/vf205_access/dxmodules/uiSwitch.js
@@ -0,0 +1,49 @@
+//build锛�20240329
+//_switch鎺т欢
+import utils from "./uiUtils.js"
+import base from "./uiBase.js"
+let _switch = {}
+
+_switch.build = function (id, parent) {
+ let temp = utils.validateBuild(_switch.all, id, parent, '_switch')
+ let my = {type: 'switch'}
+ my.obj = new utils.GG.NativeSwitch({ 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 _switch;
\ No newline at end of file
--
Gitblit v1.9.3