From 2f519ead537a0b38019bbf64a6075cbb6e08f9b4 Mon Sep 17 00:00:00 2001 From: hyingbo <1363390067@qq.com> Date: 星期三, 09 七月 2025 13:53:01 +0800 Subject: [PATCH] 车间大屏看板设置设备默认图片 --- src/views/mdc/base/MdcWorkshopSignage.vue | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/src/views/mdc/base/MdcWorkshopSignage.vue b/src/views/mdc/base/MdcWorkshopSignage.vue index 6525c5b..21b8bc5 100644 --- a/src/views/mdc/base/MdcWorkshopSignage.vue +++ b/src/views/mdc/base/MdcWorkshopSignage.vue @@ -62,7 +62,7 @@ class="status-image" ></div> <div - :style="{ backgroundImage: `url(${getImgView(item.equipmentImage)})` }" + :style="{ backgroundImage: `url(${getImgEquipmentView(item.equipmentImage)})` }" class="device-image" ></div> </div> @@ -196,6 +196,20 @@ } return getFileAccessHttpUrl(text) }, + /** + * 璁惧鍥剧墖棰勮 + * @param text 鍥剧墖鍦板潃 + */ + getImgEquipmentView(text) { + if (text && text.indexOf(',') > 0) { + text = text.substring(0, text.indexOf(',')) + } + + if (text == null || text == '') { + return require('../../../assets/default.png') + } + return getFileAccessHttpUrl(text) + }, /** * 鐐瑰嚮淇濆瓨鎸夐挳璋冪敤鎺ュ彛淇濆瓨鎷栨嫿鍚庣殑浣嶇疆涓庤澶囧浘鏍囧昂瀵� -- Gitblit v1.9.3