From e00e1fe781cd139273443fbe208446fcd02c2555 Mon Sep 17 00:00:00 2001 From: lijisanxiong <1518062161@qq.com> Date: Wed, 17 Sep 2025 14:50:33 +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 | 4 ++++ src/common/rawitem/rawitem.tsx | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a298589a..ce95f6749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ - 表单容器类(表单分组、表单分页、表单成员分页、表单关系界面分页),适配状态属性loading(是否显示loading状态) - 面板容器类(分页面板、面板容器(视图内容)、面板容器(视图头部)、分割容器),新增状态属性loading(是否显示loading状态),并新增控制器能力startLoading(开始加载中)和endLoading(结束加载中) +### Changed + +- 直接内容组件同步图标组件内对图片路径的判断逻辑 + ## [0.7.41-alpha.26] - 2025-09-12 ### Added diff --git a/src/common/rawitem/rawitem.tsx b/src/common/rawitem/rawitem.tsx index 705adc130..cdc989ede 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,18 @@ export const IBizRawItem = defineComponent({ return reg.test(imgUrl); }; + // 判断传入是否为图标图片路径 + const isImagePath = (content: string) => { + return ( + isImg(content) || + isBase64Image(content) || + isBase64(content) || + isSvg(content) || + content.endsWith?.('svg') || + content.startsWith?.('http') + ); + }; + // 判断传入是否为html字符 const isHtmlStr = (str: string) => { try { @@ -106,7 +119,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