|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex-col gap-16 wh-full"> |
|
|
|
<div class="flex-col gap-16 wh-full"> |
|
|
|
<el-button type="primary" @click="onBack" class="w-150px"> |
|
|
|
<el-button type="primary" @click="onBack" class="w-150px"> |
|
|
|
<i class="i-line-md:arrow-left"></i>返回站点数据 {{ isonLineTransfer }} |
|
|
|
<i class="i-line-md:arrow-left"></i>返回站点数据 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
<EdfsWrap title="设备列表" class="flex-1" useScrollBar> |
|
|
|
<EdfsWrap title="设备列表" class="flex-1" useScrollBar> |
|
|
|
<template #title-right> |
|
|
|
<template #title-right> |
|
|
@ -87,19 +87,13 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<div class="absolute l-0 t-0 w-full h-full z-10 bg-#FFF-90" |
|
|
|
<div class="absolute l-0 t-0 w-full h-full z-10 bg-#FFF-90" |
|
|
|
v-if="['updating', 'pending', 'rejected', 'timeout'].includes(item.upFirmware)"> |
|
|
|
v-if="['updating', 'pending', 'rejected', 'timeout'].includes(item.upFirmware)"> |
|
|
|
<div class="i-material-symbols-light:close absolute-rt text-base text-gray-950 cursor-pointer" v-if=" |
|
|
|
<div class="i-material-symbols-light:close absolute-rt text-base text-gray-950 cursor-pointer" |
|
|
|
['timeout', 'rejected', 'sc'].includes(item.upFirmware) || |
|
|
|
v-if="['timeout', 'rejected'].includes(item.upFirmware)" @click="upFirmwareSucceed(item.sn)"></div> |
|
|
|
(item.upFirmwareStatus?.step === 4 && item.upFirmwareStatus?.progress === 100)" |
|
|
|
|
|
|
|
@click="upFirmwareSucceed(item.sn)"> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<template v-if="item.upFirmware === 'updating'"> |
|
|
|
<template v-if="item.upFirmware === 'updating'"> |
|
|
|
<div class="device-item-body"> |
|
|
|
<div class="device-item-body"> |
|
|
|
<div class="info-item"> |
|
|
|
<div class="info-item"> |
|
|
|
<div>当前步骤:</div> |
|
|
|
<div>当前步骤:</div> |
|
|
|
<div>{{item.upFirmwareStatus?.step === 4 && item.upFirmwareStatus?.progress === 100 ? '安装完成' : |
|
|
|
<div>{{ item.upFirmwareStatus?.step ?? '--' }}</div> |
|
|
|
upgradeProgressStatusMap.find(r => r.status === item.upFirmwareStatus?.step)?.text ?? |
|
|
|
|
|
|
|
'--'}} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="info-item"> |
|
|
|
<div class="info-item"> |
|
|
|
<div>当前进度:</div> |
|
|
|
<div>当前进度:</div> |
|
|
@ -186,9 +180,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<div class="text-16px font-500"> {{ !!onOffDeviceTransferStatus ? onOffDeviceTransferStatus === |
|
|
|
<div class="text-16px font-500"> {{ !!onOffDeviceTransferStatus ? onOffDeviceTransferStatus === |
|
|
|
'progress' |
|
|
|
'progress' |
|
|
|
? '数据导入中' : `数据导入完成 (失败:${offLineTransferRes().error}个 超时:${offLineTransferRes().timeout}个) ` : |
|
|
|
? '数据导入中' : '数据导入完成' : '数据导入中' }}</div> |
|
|
|
'数据导入中' |
|
|
|
|
|
|
|
}}</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-progress> |
|
|
|
</el-progress> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -196,8 +188,8 @@ |
|
|
|
<div class="h-490 border-radius-8px bg-[#F9FAFB] p-10 flex-col"> |
|
|
|
<div class="h-490 border-radius-8px bg-[#F9FAFB] p-10 flex-col"> |
|
|
|
<div class="text-16px font-500">迁移日志</div> |
|
|
|
<div class="text-16px font-500">迁移日志</div> |
|
|
|
<el-scrollbar class="flex-1"> |
|
|
|
<el-scrollbar class="flex-1"> |
|
|
|
<div v-for="i in siteTransferLogList" |
|
|
|
<div v-for="i in siteTransferLogList" :class="i.status === 'error' ? 'text-red-500' : ''" |
|
|
|
:class="['error', 'timeout'].includes(i.status) ? 'text-red-500' : ''" class="text-gray-600"> |
|
|
|
class="text-gray-600"> |
|
|
|
【{{ i.device.sn }}】:{{ i.msg }} |
|
|
|
【{{ i.device.sn }}】:{{ i.msg }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-scrollbar> |
|
|
|
</el-scrollbar> |
|
|
@ -398,14 +390,13 @@ function zmqTimeoutCb(msg: TimeoutMsg) { |
|
|
|
message.error(`迁移超时,请重新稍后尝试`) |
|
|
|
message.error(`迁移超时,请重新稍后尝试`) |
|
|
|
exportPubDeviceMap.delete(msg.timeoutId) |
|
|
|
exportPubDeviceMap.delete(msg.timeoutId) |
|
|
|
closeTransferMask() |
|
|
|
closeTransferMask() |
|
|
|
transferStatus.value === 'failed' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const onlineDeviceMap: Record< |
|
|
|
const onlineDeviceMap: Record< |
|
|
|
keyof Omit< |
|
|
|
keyof Omit< |
|
|
|
IOnlineDevice, |
|
|
|
IOnlineDevice, |
|
|
|
'lastUpdated' | 'sn' | 'isChecked' | 'upFirmware' | 'upFirmwareStatus' | 'versions' |
|
|
|
'lastUpdated' | 'sn' | 'isChecked' | 'upFirmware' | 'upFirmwareStatus' |
|
|
|
>, |
|
|
|
>, |
|
|
|
string |
|
|
|
string |
|
|
|
> = { |
|
|
|
> = { |
|
|
@ -603,7 +594,7 @@ function firmwareUpTimeoutCb(msg: TimeoutMsg) { |
|
|
|
|
|
|
|
|
|
|
|
function zmqUpgradeCb(msg: PubMsgData) { |
|
|
|
function zmqUpgradeCb(msg: PubMsgData) { |
|
|
|
if (!isonLineTransfer.value) return |
|
|
|
if (!isonLineTransfer.value) return |
|
|
|
const status = msg.code |
|
|
|
const status = msg.result |
|
|
|
const deviceSn = msg.feedback[0] |
|
|
|
const deviceSn = msg.feedback[0] |
|
|
|
const progressStatus = msg.feedback[1] as number |
|
|
|
const progressStatus = msg.feedback[1] as number |
|
|
|
const progress = msg.feedback[2] || undefined |
|
|
|
const progress = msg.feedback[2] || undefined |
|
|
@ -611,16 +602,16 @@ function zmqUpgradeCb(msg: PubMsgData) { |
|
|
|
if (curentDevice && curentDevice.action === 'upgrade') { |
|
|
|
if (curentDevice && curentDevice.action === 'upgrade') { |
|
|
|
const { device } = curentDevice |
|
|
|
const { device } = curentDevice |
|
|
|
if (device) { |
|
|
|
if (device) { |
|
|
|
if (status === ZmqMsgResultType.PROGRESS) { |
|
|
|
if (status === 'progress') { |
|
|
|
upFirmwareStatus(deviceSn, msg.feedback) |
|
|
|
upFirmwareStatus(deviceSn, msg.feedback) |
|
|
|
if (progressStatus === 4 && progress === 100) { |
|
|
|
if (progressStatus === 4 && progress === 100) { |
|
|
|
upFirmwareSucceed(deviceSn) |
|
|
|
upFirmwareSucceed(deviceSn) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (status === ZmqMsgResultType.SUCCESS || status === ZmqMsgResultType.ERROR) { |
|
|
|
if (status === 'success' || status === 'error') { |
|
|
|
upFirmwareStatus(deviceSn, msg.feedback) |
|
|
|
upFirmwareStatus(deviceSn, msg.feedback) |
|
|
|
if (status === ZmqMsgResultType.ERROR) { |
|
|
|
if (status === 'error') { |
|
|
|
upFirmwareStatusReject(deviceSn, msg.feedback) |
|
|
|
upFirmwareStatusReject(deviceSn, msg.feedback) |
|
|
|
} |
|
|
|
} |
|
|
|
upgradeSnList.value = upgradeSnList.value.filter(item => item !== deviceSn) |
|
|
|
upgradeSnList.value = upgradeSnList.value.filter(item => item !== deviceSn) |
|
|
@ -667,23 +658,6 @@ const siteTransferLogList = ref<Array<{ |
|
|
|
status: 'success' | 'timeout' | 'error' |
|
|
|
status: 'success' | 'timeout' | 'error' |
|
|
|
}>>([]) |
|
|
|
}>>([]) |
|
|
|
|
|
|
|
|
|
|
|
const offLineTransferRes = () => { |
|
|
|
|
|
|
|
let timeoutNum = 0 |
|
|
|
|
|
|
|
let errorNum = 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const findTimeout = siteTransferLogList.value.filter(i => i.status === 'timeout') |
|
|
|
|
|
|
|
const uniqueTimeoutSn = new Set(findTimeout.map(i => i.device.sn)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timeoutNum = uniqueTimeoutSn.size |
|
|
|
|
|
|
|
const findError = siteTransferLogList.value.filter(i => i.status === 'error') |
|
|
|
|
|
|
|
errorNum = new Set(findError.map(i => i.device.sn)).size |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
timeout: timeoutNum, |
|
|
|
|
|
|
|
error: errorNum, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onOffDeviceTransferStatus = ref<'progress' | 'success' | undefined>() |
|
|
|
const onOffDeviceTransferStatus = ref<'progress' | 'success' | undefined>() |
|
|
|
function zmqImportCb(msg: PubMsgData) { |
|
|
|
function zmqImportCb(msg: PubMsgData) { |
|
|
|
const { id, feedback, result, code } = msg |
|
|
|
const { id, feedback, result, code } = msg |
|
|
@ -724,7 +698,7 @@ function zmqImportTimeoutCb(msg: TimeoutMsg) { |
|
|
|
siteTransferLogList.value.push({ |
|
|
|
siteTransferLogList.value.push({ |
|
|
|
msg: `数据导入超时,请稍后重试`, |
|
|
|
msg: `数据导入超时,请稍后重试`, |
|
|
|
device: offDevice, |
|
|
|
device: offDevice, |
|
|
|
status: 'timeout' |
|
|
|
status: 'error' |
|
|
|
}) |
|
|
|
}) |
|
|
|
importQueue.value.shift() |
|
|
|
importQueue.value.shift() |
|
|
|
isImporting.value = false |
|
|
|
isImporting.value = false |
|
|
|