修改
This commit is contained in:
@@ -117,7 +117,6 @@ const addNewComponent = async (formEl: FormInstance | undefined) => {
|
|||||||
downloadByZip({
|
downloadByZip({
|
||||||
name: element.value.name
|
name: element.value.name
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
console.log('🚀 ~ addNewComponent ~ res:', res)
|
|
||||||
downloadBlobFile(res, element.value.name + '.zip')
|
downloadBlobFile(res, element.value.name + '.zip')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -145,6 +144,7 @@ function downloadBlobFile(blob: any, fileName: string) {
|
|||||||
window.URL.revokeObjectURL(url)
|
window.URL.revokeObjectURL(url)
|
||||||
// 6. 移除a标签,清理DOM
|
// 6. 移除a标签,清理DOM
|
||||||
document.body.removeChild(aLink)
|
document.body.removeChild(aLink)
|
||||||
|
ElMessage.success('下载成功')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -70,20 +70,24 @@ const extractTitleFromLineName = (lineName: string): string => {
|
|||||||
|
|
||||||
// 更新指定角落数据的函数
|
// 更新指定角落数据的函数
|
||||||
const updateCornerData = (cornerIndex: number, elementId: string, lineName: string) => {
|
const updateCornerData = (cornerIndex: number, elementId: string, lineName: string) => {
|
||||||
// 更新标题为传入的 lineName 的最后一部分
|
// closeCorner(corners.value[cornerIndex].elementId)
|
||||||
corners.value[cornerIndex].title = extractTitleFromLineName(lineName)
|
corners.value[cornerIndex].show = false
|
||||||
|
setTimeout(() => {
|
||||||
|
// 更新标题为传入的 lineName 的最后一部分
|
||||||
|
corners.value[cornerIndex].title = extractTitleFromLineName(lineName)
|
||||||
|
|
||||||
// 格式化数据(只保留稳态指标一项)
|
// 格式化数据(只保留稳态指标一项)
|
||||||
corners.value[cornerIndex].data = [
|
corners.value[cornerIndex].data = [
|
||||||
{
|
{
|
||||||
label: '稳态指标',
|
label: '稳态指标',
|
||||||
value: '正在加载...'
|
value: '正在加载...'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
// 记录该角落对应的元素ID
|
// 记录该角落对应的元素ID
|
||||||
corners.value[cornerIndex].elementId = elementId
|
corners.value[cornerIndex].elementId = elementId
|
||||||
corners.value[cornerIndex].show = true
|
corners.value[cornerIndex].show = true
|
||||||
|
}, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示下一个角落的函数
|
// 显示下一个角落的函数
|
||||||
|
|||||||
@@ -699,13 +699,15 @@ const setMqtt = async () => {
|
|||||||
// 设置消息接收回调
|
// 设置消息接收回调
|
||||||
mqttClient.value.onMessage((subscribe: string, message: any) => {
|
mqttClient.value.onMessage((subscribe: string, message: any) => {
|
||||||
const msg: any = uint8ArrayToObject(message)
|
const msg: any = uint8ArrayToObject(message)
|
||||||
console.log('🚀 ~ setMqtt ~ msg:', msg)
|
// console.log('🚀 ~ setMqtt ~ msg:', msg)
|
||||||
|
|
||||||
if (subscribe.split('/')[2] === 'rtData') {
|
if (subscribe.split('/')[2] === 'rtData') {
|
||||||
// 指标数据
|
// 指标数据
|
||||||
|
|
||||||
// await setImportJson(savedExportJson.value)
|
// await setImportJson(savedExportJson.value)
|
||||||
|
const list = [
|
||||||
|
...new Set(msg.filter((item: any) => item.devStatus === 1).map((item: any) => item.lineId))
|
||||||
|
]
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (done_json.value) {
|
if (done_json.value) {
|
||||||
done_json.value?.forEach(item => {
|
done_json.value?.forEach(item => {
|
||||||
@@ -718,6 +720,12 @@ const setMqtt = async () => {
|
|||||||
) //'B相负载电流-CP95:31'
|
) //'B相负载电流-CP95:31'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
list.forEach((listValue: any) => {
|
||||||
|
if (listValue == item.lineId && item.type == 'svg') {
|
||||||
|
item.props.fill.val = '#ff0000'
|
||||||
|
// item.common_animations.val = 'flash'
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, 500)
|
}, 500)
|
||||||
@@ -771,7 +779,7 @@ const singlePublish = async (id: string) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const publish = async (list: any) => {
|
const publish = async (list: any) => {
|
||||||
console.log('🚀 ~ publish ~ list:', JSON.parse(list.path).canvasCfg.lineList)
|
// console.log('🚀 ~ publish ~ list:', JSON.parse(list.path).canvasCfg.lineList)
|
||||||
if (mqttClient.value) {
|
if (mqttClient.value) {
|
||||||
// 发送消息
|
// 发送消息
|
||||||
await mqttClient.value.publish(
|
await mqttClient.value.publish(
|
||||||
|
|||||||
Reference in New Issue
Block a user