+ :style="`width: ${i.width}%; height: ${i.height}%;top: ${i.top}%;left: ${i.left}%;transform: rotate(${i.rotate}deg);
+ background: ${i.alpha};border-radius: ${i.radius}%; `">
{{ i.equipmentName }}
({
...item,
}))
+ const descList = receivedData.map(item =>
+ `${item.params?.equipmentName || '未知'} ${item.orderDesc || '无故障描述'} 维修人:${item.orderRepairmanName}`
+ );
+ this.scrollText = descList.join('★★★★★★★★'); // 用两个全角空格分隔
+
+ // 提取所有有效的设备名称
+ const activeEquipmentNames = new Set(
+ receivedData
+ .map(item => item.params?.equipmentName)
+ .filter(name => name)
+ );
+
+ // 更新infoData的高亮状态
+ this.infoData.forEach((item, index) => {
+ if (activeEquipmentNames.has(item.equipmentName)) {
+ // 响应式设置alpha
+ this.$set(this.infoData[index], 'alpha', '#CB4C4C80');
+ } else {
+ // 移除alpha属性
+ if (this.infoData[index].hasOwnProperty('alpha')) {
+ this.$delete(this.infoData[index], 'alpha');
+ }
+ }
+ });
+
} else {
console.warn('收到非数组格式数据:', receivedData)
}
@@ -519,7 +519,7 @@ export default {
console.error("JSON parsing failed:", error)
this.$notify.error({ title: '数据错误', message: '接收数据格式异常' })
}
- };
+ }.bind(this);;
this.ws.onclose = function (event) {
self.text_content = self.text_content + "已经关闭连接!" + "\n";
};