Merge pull request #10420 from dataease/pr@dev-v2@feat_rich-text-threshold

fix(仪表板、数据大屏): 富文本支持阈值设置 #9371 #9627
This commit is contained in:
王嘉豪 2024-06-20 18:06:07 +08:00 committed by GitHub
commit 567eda72fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -223,21 +223,15 @@ const assignment = content => {
on.forEach(itm => {
if (dataRowFiledName.value.includes(itm)) {
const ele = itm.slice(1, -1)
if (initReady.value) {
let value = dataRowNameSelect.value[ele] !== undefined ? dataRowNameSelect.value[ele] : null
if (value && thresholdStyleInfo && thresholdStyleInfo[ele]) {
const thresholdStyle = thresholdStyleInfo[ele]
let value =
dataRowNameSelect.value[ele] !== undefined ? dataRowNameSelect.value[ele] : null
if (value && thresholdStyle) {
value = `<span style="color:${thresholdStyle.color};background-color: ${thresholdStyle.backgroundColor}">${value}</span>`
}
value = `<span style="color:${thresholdStyle.color};background-color: ${thresholdStyle.backgroundColor}">${value}</span>`
}
if (initReady.value) {
content = content.replace(itm, !!value ? value : '[未获取字段值]')
} else {
content = content.replace(
itm,
dataRowNameSelect.value[ele] !== undefined
? dataRowNameSelect.value[ele]
: '[获取中...]'
)
content = content.replace(itm, !!value ? value : '[获取中...]')
}
}
})