diff --git a/src/views/basic/collectPoint/timerSetting.vue b/src/views/basic/collectPoint/timerSetting.vue
index 70565049..73466a21 100644
--- a/src/views/basic/collectPoint/timerSetting.vue
+++ b/src/views/basic/collectPoint/timerSetting.vue
@@ -186,6 +186,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 高拍仪扫码设置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -204,8 +277,6 @@
>
-
-
@@ -298,11 +369,14 @@ export default {
lastCodeSplit: true,
isScanCodeCheck: true,
getSplitConfirm: false,
- scanMaxCount:null,
+ FixedCount:null,
pdaMaxCount: null,
ipcMaxCount: null,
+ AutoDecode:1,
+ OutputMode:1
},
systemParam: null,
+ socket:null,
}
},
@@ -319,6 +393,8 @@ export default {
getSet().then((response) => {
if (response.code == 20000) {
this.formData = response.data
+ // this.formData.AutoDecode = 1
+ // this.formData.OutputMode = 1
}
})
},
@@ -345,13 +421,73 @@ export default {
})
.catch(() => {
});
- }
+ if (this.socket && this.socket.readyState === WebSocket.OPEN){
+ if (!isBlank(this.formData.AutoDecode)){
+ var setStr = "AutoDecode=" + this.formData.AutoDecode
+ this.sendData(setStr)
+ }
+ if (!isBlank(this.formData.FixedCount)){
+ var setStr = "FixedCount=" + this.formData.FixedCount
+ this.sendData(setStr)
+ }
+
+ }
+ },
+ // 连接 WebSocket
+ connectWebSocket() {
+ // WebSocket 服务器地址
+
+ // 创建 WebSocket 连接
+ this.socket = new WebSocket('ws://127.0.0.1:9988')
+
+ // 监听连接成功事件
+ this.socket.onopen = () => {
+ console.log("WebSocket connected!");
+ };
+
+ // 监听接收消息事件
+ this.socket.onmessage = (event) => {
+ this.receivedMessage = event.data; // 更新接收到的消息
+ console.log("Received message:", event.data);
+ };
+
+ // 监听错误事件
+ this.socket.onerror = (error) => {
+ console.error("WebSocket error:", error);
+ };
+
+ // 监听连接关闭事件
+ this.socket.onclose = () => {
+ console.log("WebSocket connection closed.");
+ };
+ },
+ // 发送数据
+ sendData(data) {
+ if (this.socket && this.socket.readyState === WebSocket.OPEN) {
+ // const data = JSON.stringify({ action: "subscribe", channel: "updates" }); // 发送的参数
+
+ this.socket.send(data); // 发送数据
+ console.log("Data sent:", data);
+ } else {
+ console.error("WebSocket is not connected.");
+ }
+ },
+ },
+ mounted() {
+ // 在组件挂载时创建 WebSocket 连接
+ this.connectWebSocket();
},
created() {
this.selectSysParam()
+ },
+ beforeDestroy() {
+ // 组件销毁前关闭 WebSocket 连接
+ if (this.socket) {
+ this.socket.close();
+ console.log("WebSocket connection closed in beforeDestroy.");
+ }
}
-
}
diff --git a/src/views/collect/IoCreateOrder.vue b/src/views/collect/IoCreateOrder.vue
index 84a8d0af..95ce0742 100644
--- a/src/views/collect/IoCreateOrder.vue
+++ b/src/views/collect/IoCreateOrder.vue
@@ -19,7 +19,11 @@
-
+ 拍照解码
+
SCAN_TIMEOUT) {
// 处理上一次完整的扫码数据
@@ -2391,6 +2397,16 @@ export default {
},
handleCodeArray(codeArray) {
this.codeArray = codeArray;
+ },
+ paizhao(){
+ if (this.ws && this.ws.readyState === WebSocket.OPEN) {
+ // const data = JSON.stringify({ action: "subscribe", channel: "updates" }); // 发送的参数
+ var sendData = "ManualClick=1"
+ this.ws.send(sendData); // 发送数据
+ console.log("Data sent:", sendData);
+ } else {
+ console.error("WebSocket is not connected.");
+ }
}
},
filters: {},