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