From 0e2e6448406f8dd55f8664b46e78ce89c30634a2 Mon Sep 17 00:00:00 2001 From: lijisanxiong <1518062161@qq.com> Date: Wed, 17 Sep 2025 21:01:58 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E7=9B=B4=E6=8E=A5=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E7=BB=84=E4=BB=B6=E5=90=8C=E6=AD=A5=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=86=85=E5=AF=B9=E5=9B=BE=E7=89=87=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E7=9A=84=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/common/rawitem/rawitem.tsx | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b3de491..3f08ca5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ### Changed - 更新数据多项选择视图,数据多项选择视图(左右关系)视图参数checkstrictly默认值为false +- 直接内容组件同步图标组件内对图片路径的判断逻辑 ## [0.7.41-alpha.26] - 2025-09-12 diff --git a/src/common/rawitem/rawitem.tsx b/src/common/rawitem/rawitem.tsx index 705adc13..51599f60 100644 --- a/src/common/rawitem/rawitem.tsx +++ b/src/common/rawitem/rawitem.tsx @@ -9,6 +9,7 @@ import { ITextItem, IUnkownItem, } from '@ibiz/model-core'; +import { isBase64, isBase64Image, isSvg } from '@ibiz-template/core'; import './rawitem.scss'; import { parseHtml } from '../../util'; @@ -64,6 +65,16 @@ export const IBizRawItem = defineComponent({ return reg.test(imgUrl); }; + // 判断传入是否为图标图片路径 + const isImagePath = (content: string) => { + return ( + isImg(content) || + isBase64Image(content) || + isBase64(content) || + isSvg(content) + ); + }; + // 判断传入是否为html字符 const isHtmlStr = (str: string) => { try { @@ -106,7 +117,7 @@ export const IBizRawItem = defineComponent({ // 图片类型 if (rawItemType.value === 'IMAGE') { if (props.content && typeof props.content === 'string') { - if (isImg(props.content)) { + if (isImagePath(props.content)) { rawItemContent.value = { imagePath: props.content }; } else { rawItemContent.value = { cssClass: props.content }; -- Gitee