From 4679837dd12007338f8fb9f7608bec70d367c92a Mon Sep 17 00:00:00 2001 From: fzh <1399952343@qq.com> Date: Fri, 8 Sep 2023 19:52:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=B1=9E=E6=80=A7=E9=A1=B9=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E7=BC=96=E8=BE=91=E5=99=A8=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ .../ibiz-markdown-editor/ibiz-markdown-editor.scss | 7 ++++++- src/editor/raw/ibiz-raw/ibiz-raw.tsx | 13 ++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88eb4c52a..24a869f38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ - 支持表格支持列拖动 - 支持数据选择下拉编辑器右侧图标 - 支持编辑视图&操作视图 预制行为load +- 支持布局面板属性项直接内容编辑器配置编辑器参数 + +### Fixed + +- 修复布局面板属性项直接内容编辑器中参数是JSON字符串时,无法转换handlebars模板。 ### Changed diff --git a/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss b/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss index 0ccc124c3..83b92e5c8 100644 --- a/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss +++ b/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss @@ -2,7 +2,12 @@ .cherry{ min-height: 600px; } - + @include when(disabled){ + .cherry{ + min-height: auto; + } + } + .cherry-preview--full { border-left: none; } diff --git a/src/editor/raw/ibiz-raw/ibiz-raw.tsx b/src/editor/raw/ibiz-raw/ibiz-raw.tsx index 5f2719387..2710bfa44 100644 --- a/src/editor/raw/ibiz-raw/ibiz-raw.tsx +++ b/src/editor/raw/ibiz-raw/ibiz-raw.tsx @@ -26,6 +26,9 @@ export const IBizRaw = defineComponent({ if (editorModel.contentType) { type = editorModel.contentType; } + if (editorModel.editorParams?.contenttype) { + type = editorModel.editorParams?.contenttype; + } if (editorModel.editorParams?.template) { template = editorModel.editorParams.template.replaceAll('//n', '\n'); } @@ -45,9 +48,17 @@ export const IBizRaw = defineComponent({ content.value = newVal; } if (template && newVal) { + let obj = null; + if (typeof newVal === 'string') { + try { + obj = JSON.parse(newVal); + } catch (error) { + ibiz.log.error('JSON字符串转换错误'); + } + } content.value = await ibiz.util.hbs.render( template, - newVal as IData, + (obj || newVal) as IData, ); } } -- Gitee