forked from github/dataease
Merge pull request #10676 from dataease/pr@dev-v2@refactor_rich-text
refactor(图表): 优化富文本条件设置是否为空的显示判断
This commit is contained in:
commit
b8d22d107f
@ -227,14 +227,15 @@ const assignment = content => {
|
|||||||
if (dataRowFiledName.value.includes(itm)) {
|
if (dataRowFiledName.value.includes(itm)) {
|
||||||
const ele = itm.slice(1, -1)
|
const ele = itm.slice(1, -1)
|
||||||
let value = dataRowNameSelect.value[ele] !== undefined ? dataRowNameSelect.value[ele] : null
|
let value = dataRowNameSelect.value[ele] !== undefined ? dataRowNameSelect.value[ele] : null
|
||||||
if (value && thresholdStyleInfo && thresholdStyleInfo[ele]) {
|
let targetValue = !!value ? value : '-'
|
||||||
|
if (thresholdStyleInfo && thresholdStyleInfo[ele]) {
|
||||||
const thresholdStyle = thresholdStyleInfo[ele]
|
const thresholdStyle = thresholdStyleInfo[ele]
|
||||||
value = `<span style="color:${thresholdStyle.color};background-color: ${thresholdStyle.backgroundColor}">${value}</span>`
|
targetValue = `<span style="color:${thresholdStyle.color};background-color: ${thresholdStyle.backgroundColor}">${targetValue}</span>`
|
||||||
}
|
}
|
||||||
if (initReady.value) {
|
if (initReady.value) {
|
||||||
content = content.replace(itm, !!value ? value : '-')
|
content = content.replace(itm, targetValue)
|
||||||
} else {
|
} else {
|
||||||
content = content.replace(itm, !!value ? value : '[获取中...]')
|
content = content.replace(itm, !!value ? targetValue : '[获取中...]')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -366,6 +367,7 @@ const calcData = (view: Chart, callback) => {
|
|||||||
const curViewInfo = canvasViewInfo.value[element.value.id]
|
const curViewInfo = canvasViewInfo.value[element.value.id]
|
||||||
curViewInfo['curFields'] = res.data.fields
|
curViewInfo['curFields'] = res.data.fields
|
||||||
dvMainStore.setViewDataDetails(element.value.id, state.data)
|
dvMainStore.setViewDataDetails(element.value.id, state.data)
|
||||||
|
initReady.value = true
|
||||||
initCurFields(res)
|
initCurFields(res)
|
||||||
}
|
}
|
||||||
callback?.()
|
callback?.()
|
||||||
|
Loading…
Reference in New Issue
Block a user