From 1051ab47ac671486801296ccf0ad7c0ed527d7e6 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 22 四月 2025 15:23:19 +0800
Subject: [PATCH] gx优化播报延时
---
src/samples/node-api.ts | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/samples/node-api.ts b/src/samples/node-api.ts
index 4f129ca..df6d4d2 100644
--- a/src/samples/node-api.ts
+++ b/src/samples/node-api.ts
@@ -9,7 +9,7 @@
import os from 'os'
// import internetAvailable from "internet-available"
var internetAvailable = require("internet-available")
-import { ElMessage, ElMessageBox } from 'element-plus'
+import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
import { on } from 'events'
interface ResultInfo{
@@ -36,6 +36,7 @@
})
// 主进程获取配置项完成sockte注册和httpshu
ipcRenderer.on('getConfigData',(_event,...args)=>{
+ console.log('----------------')
console.log("config.json",...args)
if(args!==null){
if(args[0]===undefined){
@@ -44,13 +45,8 @@
else if(args.length>0&&args[0].clientCode.length>0){
console.log('配置文件读取')
clientCode=args[0].clientCode
- // 建立sockte 通讯
- deviceList=args[0].deviceList
// 存放conging到仓库
confingInfoStore().setconfingInfo(args[0])
- // connect()
- // creatorClient(args[0])
-
}
}
@@ -74,9 +70,19 @@
sockteStore().setnetLink(true)
}).catch(()=>{
sockteStore().setnetLink(false)
+ ElNotification({
+ title: 'Success',
+ message: '网络连接成功',
+ type: 'success',
+ })
console.log("网路链接失败")
+ ElNotification({
+ title: '异常',
+ message: '网络已断开,等待重连',
+ type: 'warning',
+ })
})
-},10000)
+},5000)
const writeResult=(res: ResultInfo)=>{
// console.log(`收到设备回传结果:类型=${res.deviceType},结果=${res.result}`)
ipcRenderer.invoke('logger', `收到设备回传结果:类型=${res.deviceType},结果=${res.result}`)
--
Gitblit v1.8.0