diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b3de491c457301d689f54e05595978fc89e5b6f..3f08ca5c302e4d50bce130f4f8a062d6d6bbbbbe 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 705adc130fbc0d74da0c114eb0c9582efdab86dc..51599f60be539ac03b4d34ff6f29dfff4ebedbf7 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 };