Commit 661c329d by 李伟康

fix(strategy): 修复策略详情描述文本显示问题

- 在StrategyDetail组件中,当description为空时显示默认值'-'
- 在StrategyList组件中,当description为空时显示默认值'-'
- 统一了空值处理逻辑,避免页面显示异常
- 保持了原有的HTML标签替换功能不变
1 parent e7a0135a
...@@ -274,7 +274,7 @@ export default { ...@@ -274,7 +274,7 @@ export default {
this.setData(data) this.setData(data)
}, },
setData (data) { setData (data) {
data.descriptionText = data.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') data.descriptionText = data.description ? data.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') : '-'
this.detailInfo = data this.detailInfo = data
this.loading = false this.loading = false
}, },
......
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
list.map(e => { list.map(e => {
e.showDel = dayjs().diff(dayjs(e.startDate), 's') < 0 e.showDel = dayjs().diff(dayjs(e.startDate), 's') < 0
e.createdDateText = dayjs(e.createdDate).format('YYYY-MM-DD') e.createdDateText = dayjs(e.createdDate).format('YYYY-MM-DD')
e.descriptionText = e.description ? e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') : '' e.descriptionText = e.description ? e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') : '-'
}) })
if (this.pageNum == 1) { if (this.pageNum == 1) {
this.list = list this.list = list
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!