mac地址,推送调整

This commit is contained in:
sjl
2025-10-20 09:42:01 +08:00
parent 448d450936
commit 177e50de75
3 changed files with 117 additions and 186 deletions

View File

@@ -309,6 +309,7 @@
</el-form-item>
<el-form-item
class="form-item"
label="装置mac地址:"
:rules="{ required: true, message: '请输入装置mac地址', trigger: 'blur' }"
@@ -694,7 +695,7 @@ interface DeviceInfo {
nodeId: string
cntractNo: string
sort: number
nodeProcess:number
nodeProcess:string
}
// 设备信息列表
const deviceInfoList = ref<DeviceInfo[]>([])
@@ -841,7 +842,6 @@ const handleDialogClose = () => {
countdown.value = 0
}
//台账推送
const onAdd = async () => {
resultDialogVisible.value = true
pushResult.value = null
@@ -859,25 +859,41 @@ const onAdd = async () => {
try {
// 调用推送日志接口
await pushLog()
const pushLogResponse = await pushLog()
// 等待30秒
await new Promise(resolve => setTimeout(resolve, 30000))
// 30秒后调用查询推送结果接口
const result = await queryPushResult()
// 处理返回的日志数据
const logs = Array.isArray(result.data) ? result.data : []
// 根据结果进行处理
pushResult.value = {
success: true,
message: '台账推送成功',
logs: logs.map((item: any) => ({
message: item.message || JSON.stringify(item)
}))
// 检查返回的data是否为"暂无需要推送的数据"
if (pushLogResponse.data != "成功") {
// 直接提示用户没有数据推送
pushResult.value = {
success: false,
message: '暂无需要推送的数据',
logs: [{
message: '暂无需要推送的数据'
}]
}
return;
}
// 如果data不是"暂无需要推送的数据",则继续执行
if (pushLogResponse.data === "成功") {
// 等待30秒
await new Promise(resolve => setTimeout(resolve, 30000))
// 30秒后调用查询推送结果接口
const result = await queryPushResult()
// 处理返回的日志数据
const logs = Array.isArray(result.data) ? result.data : []
// 根据结果进行处理
pushResult.value = {
success: true,
message: '台账推送成功',
logs: logs.map((item: any) => ({
message: item.message || JSON.stringify(item)
}))
}
}
} catch (error: any) {
pushResult.value = {
success: false,
@@ -1028,7 +1044,7 @@ const add = () => {
nodeId: '',
cntractNo: '',
sort: 0,
nodeProcess: 1,
nodeProcess: '自动分配',
})
busBarIndex.value = (deviceInfoList.value.length - 1).toString()
// 清理监测点数据
@@ -1381,7 +1397,7 @@ const next = async () => {
nodeId: '',
cntractNo: '',
sort: 0,
nodeProcess: 1,
nodeProcess: '自动分配',
})
busBarIndex.value = (deviceInfoList.value.length - 1).toString()
nextfalg.value = false
@@ -2080,7 +2096,7 @@ const handleBusBarTabsEdit = (targetName: any, action: any) => {
nodeId: '',
cntractNo: '',
sort: 0,
nodeProcess: 1,
nodeProcess: '自动分配',
})
busBarIndex.value = (deviceInfoList.value.length - 1).toString()
} else if (action === 'remove') {