修改预览展示

This commit is contained in:
guanj
2025-11-05 15:31:56 +08:00
parent a7a88e6706
commit 3d987b4761

View File

@@ -184,8 +184,6 @@ const canvasStyle = computed(() => ({
marginLeft: (document.documentElement.clientWidth - canvas_cfg.value.width * canvas_cfg.value.scale) / 2 + 'px' marginLeft: (document.documentElement.clientWidth - canvas_cfg.value.width * canvas_cfg.value.scale) / 2 + 'px'
})) }))
// 鼠标按下事件 - 开始拖拽 // 鼠标按下事件 - 开始拖拽
const onMouseDown = (e: MouseEvent) => { const onMouseDown = (e: MouseEvent) => {
if (mtPreviewProps.canDrag && e.button === 0) { if (mtPreviewProps.canDrag && e.button === 0) {
@@ -568,8 +566,8 @@ const setImportJson = (exportJson: IExportJson) => {
grid_cfg.value = gridCfg grid_cfg.value = gridCfg
done_json.value = importDoneJson done_json.value = importDoneJson
// 为图元添加点击事件 // // 为图元添加点击事件
addClickEventsToElements() // addClickEventsToElements()
// 首页初始化的时候 // 首页初始化的时候
nextTick(() => { nextTick(() => {
@@ -1028,7 +1026,10 @@ const setMqtt = async () => {
done_json.value.forEach(item => { done_json.value.forEach(item => {
msg.forEach((msgValue: any) => { msg.forEach((msgValue: any) => {
if (item.id == msgValue.id) { if (item.id == msgValue.id) {
item.props.text.val = item.props.text.val.replace(/#{3}/g, msgValue.value) //'B相负载电流-CP95:31' item.props.text.val = item.props.text.val.replace(
/#{3}/g,
msgValue.value == 3.1415926 ? '暂无数据' : msgValue.value
) //'B相负载电流-CP95:31'
} }
}) })
list.value.forEach((listValue: any) => { list.value.forEach((listValue: any) => {