diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
index 2724613e11..80d96654d3 100644
--- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
+++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
@@ -372,34 +372,38 @@ const jumpTargetAdaptor = () => {
}
const assignment = content => {
- const on = content.match(/\[(.+?)\]/g)
- if (on) {
- const thresholdStyleInfo = conditionAdaptor(state.viewDataInfo)
- on.forEach(itm => {
- if (dataRowFiledName.value.includes(itm)) {
- const ele = itm.slice(1, -1)
- let value = dataRowNameSelect.value[ele] !== undefined ? dataRowNameSelect.value[ele] : null
- let targetValue = !!value ? value : state.emptyValue
- if (thresholdStyleInfo && thresholdStyleInfo[ele]) {
- const thresholdStyle = thresholdStyleInfo[ele]
- targetValue = `${targetValue}`
+ if (content) {
+ const on = content?.match(/\[(.+?)\]/g)
+ if (on) {
+ const thresholdStyleInfo = conditionAdaptor(state.viewDataInfo)
+ on.forEach(itm => {
+ if (dataRowFiledName.value.includes(itm)) {
+ const ele = itm.slice(1, -1)
+ let value =
+ dataRowNameSelect.value[ele] !== undefined ? dataRowNameSelect.value[ele] : null
+ let targetValue = !!value ? value : state.emptyValue
+ if (thresholdStyleInfo && thresholdStyleInfo[ele]) {
+ const thresholdStyle = thresholdStyleInfo[ele]
+ targetValue = `${targetValue}`
+ }
+ if (initReady.value) {
+ content = content.replace(itm, targetValue)
+ } else {
+ content = content.replace(itm, !!value ? targetValue : '[获取中...]')
+ }
}
- if (initReady.value) {
- content = content.replace(itm, targetValue)
- } else {
- content = content.replace(itm, !!value ? targetValue : '[获取中...]')
- }
- }
- })
+ })
+ }
+ content = content.replace('class="base-selected"', '')
+ //De 本地跳转失效问题
+ content = content.replace(/href="#\//g, 'href="/#/')
+ content = content.replace(/href=\\"#\//g, 'href=\\"/#/')
+ content = content.replace(/href=\\"#\//g, 'href=\\"/#/')
+ resetSelect()
+ initFontFamily(content)
+ jumpTargetAdaptor()
}
- content = content.replace('class="base-selected"', '')
- //De 本地跳转失效问题
- content = content.replace(/href="#\//g, 'href="/#/')
- content = content.replace(/href=\\"#\//g, 'href=\\"/#/')
- content = content.replace(/href=\\"#\//g, 'href=\\"/#/')
- resetSelect()
- initFontFamily(content)
- jumpTargetAdaptor()
+
return content
}
const initFontFamily = htmlText => {
diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts
index fba260aea4..155503036d 100644
--- a/core/core-frontend/src/utils/canvasUtils.ts
+++ b/core/core-frontend/src/utils/canvasUtils.ts
@@ -622,7 +622,7 @@ export function setIdValueTrans(from, to, content, colList) {
pre[next[from]] = next[to]
return pre
}, {})
- const on = content.match(/\[(.+?)\]/g)
+ const on = content?.match(/\[(.+?)\]/g)
if (on) {
on.forEach(itm => {
const ele = itm.slice(1, -1)