Просмотр исходного кода

fix(health-plan): 重新制定时重置viewMode,修复页面空白问题

reCreate()遗漏viewMode=false重置,导致查看方案后点击重新制定时:
- step===1 && !viewMode → false(Step1不渲染)
- viewMode && planDetail → false(查看模式也不渲染)
- 页面空白

同时补充editing和sectionFeedback重置。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
liaoxg 2 месяцев назад
Родитель
Сommit
cd94a4a637
1 измененных файлов с 5 добавлено и 10 удалено
  1. 5 10
      cfc-frontend/pages/health/health-plan-summary.vue

+ 5 - 10
cfc-frontend/pages/health/health-plan-summary.vue

@@ -402,21 +402,13 @@ export default {
     buildPlanContent: function() {
       var sb = []
       if (this.planData.overview) {
-        sb.push('## 方案概述
-
-' + this.planData.overview + '
-
-')
+        sb.push('## 方案概述\n\n' + this.planData.overview + '\n\n')
       }
       var titles = { nutrition: '营养补充建议', diet: '饮食建议', exercise: '运动计划' }
       var self = this
       this.sectionKeys.forEach(function(key) {
         if (self.sections[key].content) {
-          sb.push('## ' + (titles[key] || key) + '
-
-' + self.sections[key].content + '
-
-')
+          sb.push('## ' + (titles[key] || key) + '\n\n' + self.sections[key].content + '\n\n')
         }
       })
       return sb.join('')
@@ -455,9 +447,12 @@ export default {
     },
     reCreate: function() {
       this.step = 1
+      this.viewMode = false
       this.planId = null
       this.planDetail = null
       this.taskSubmitted = false
+      this.editing = false
+      this.sectionFeedback = ''
       this.planData = {}
       this.sections = {
         nutrition: { content: '', confirmed: false },