Răsfoiți Sursa

一生一案修改接口对接

liurongli 2 luni în urmă
părinte
comite
e465616b19
1 a modificat fișierele cu 35 adăugiri și 14 ștergeri
  1. 35 14
      src/views/analysisReport/studentPage/studentCase/mainPage.vue

+ 35 - 14
src/views/analysisReport/studentPage/studentCase/mainPage.vue

@@ -34,8 +34,7 @@
                     <div class="common_content_text">
                         <el-input v-if="isEdit" type="textarea" placeholder="请输入你对该学科的计划和困惑。" v-model="firstWeakSubject.textValue" :rows="9" maxlength="1000" show-word-limit></el-input>
                         <template v-else>
-                            <!-- <p>一、现状分析</p> -->
-                             {{ firstWeakSubject.textValue }}
+                            <p v-for="text in firstWeakSubject.textValueWrap">{{ text }}</p>
                         </template>
                     </div>
                 </div>
@@ -53,8 +52,7 @@
                     <div class="common_content_text">
                         <el-input v-if="isEdit" type="textarea" placeholder="请输入你对该学科的计划和困惑。" v-model="secondWeakSubject.textValue" :rows="9" maxlength="1000" show-word-limit></el-input>
                         <template v-else>
-                            <!-- <p>一、现状分析</p> -->
-                            {{ secondWeakSubject.textValue }}
+                            <p v-for="text in secondWeakSubject.textValueWrap">{{ text }}</p>
                         </template>
                     </div>
                 </div>
@@ -65,7 +63,7 @@
                     <div class="common_content_text">
                         <el-input v-if="isEdit" type="textarea" placeholder="请输入你对该学科的计划和困惑。" v-model="needTeacherValue" :rows="9" maxlength="1000" show-word-limit></el-input>
                         <template v-else>
-                            {{ needTeacherValue }}
+                            <p v-for="text in needTeacherValueWrap">{{ text }}</p>
                         </template>
                     </div>
                 </div>
@@ -95,14 +93,17 @@ export default {
             firstWeakSubject:{
                 subjectCode: 10,
                 subjectName: '',
-                textValue: ''
+                textValue: '',
+                textValueWrap: [],
             },//第一个薄弱学科
             secondWeakSubject:{
                 subjectCode: 10,
                 subjectName: '',
-                textValue: ''
+                textValue: '',
+                textValueWrap: []
             },//第二个薄弱学科
             needTeacherValue:'',//
+            needTeacherValueWrap:'',//
             isEdit:false,//是否可编辑
         }
     },
@@ -159,17 +160,23 @@ export default {
                     this.studentName = studentName;
                     this.studentNo = studentNo;
                     this.studentCode = studentCode;
+                    const firstTextValue = firstWeakSubject?.textValue || '暂无';
+                    const secondTextValue = secondWeakSubject?.textValue || '暂无';
+                    const needTextValue = needTeacherValue || '暂无';
                     this.firstWeakSubject = {
                         subjectCode: firstWeakSubject?.subjectCode || '',
                         subjectName: firstWeakSubject?.subjectName || '',
-                        textValue: firstWeakSubject?.textValue || '暂无'
+                        textValue: firstTextValue,
+                        textValueWrap: firstTextValue.split(/\r?\n/)
                     };//第一个薄弱学科
                     this.secondWeakSubject = {
                         subjectCode: secondWeakSubject?.subjectCode || '',
                         subjectName: secondWeakSubject?.subjectName || '',
-                        textValue: secondWeakSubject?.textValue || '暂无'
+                        textValue: secondTextValue,
+                        textValueWrap: secondTextValue.split(/\r?\n/)
                     };//第二个薄弱学科
-                    this.needTeacherValue = needTeacherValue || '暂无';
+                    this.needTeacherValue = needTextValue;
+                    this.needTeacherValueWrap = needTextValue.split(/\r?\n/);
                 } else {
                     this.subjects = [];//科目
                     this.subjectsCode = [];//科目code
@@ -183,14 +190,17 @@ export default {
                     this.firstWeakSubject = {
                         subjectCode: '',
                         subjectName: '',
-                        textValue: '暂无'
+                        textValue:'暂无',
+                        textValueWrap: ['暂无']
                     };//第一个薄弱学科
                     this.secondWeakSubject = {
                         subjectCode: '',
                         subjectName: '',
-                        textValue: '暂无'
+                        textValue:'暂无',
+                        textValueWrap: ['暂无']
                     };//第二个薄弱学科
                     this.needTeacherValue = '暂无';
+                    this.needTeacherValueWrap = ['暂无'];
                 }
             })
         },
@@ -206,6 +216,16 @@ export default {
                         goalRank: this.tableData[1][item]
                     }
                 });
+                const firstWeakSubject = {
+                    subjectCode: this.firstWeakSubject.subjectCode,
+                    subjectName: this.firstWeakSubject.subjectName,
+                    textValue:this.firstWeakSubject.textValue
+                }
+                const secondWeakSubject = {
+                    subjectCode: this.secondWeakSubject.subjectCode,
+                    subjectName: this.secondWeakSubject.subjectName,
+                    textValue:this.secondWeakSubject.textValue
+                }
                 this.$api.reportStudent.jointSchoolReport.changeOneStudentOneCase({
                     id:this.id,
                     examId:this.examId,
@@ -214,12 +234,13 @@ export default {
                     studentNo:this.studentNo,
                     studentCode:this.studentCode,
                     studentGoalVoList:studentGoalVoList,
-                    firstWeakSubject:this.firstWeakSubject,
-                    secondWeakSubject:this.secondWeakSubject,
+                    firstWeakSubject:firstWeakSubject,
+                    secondWeakSubject:secondWeakSubject,
                     needTeacherValue:this.needTeacherValue
                 }).then(res => {
                     if(res.code == 200){
                         this.$message.success(res.msg);
+                        this.GetOneStudentOneCase();
                     }else{
                         this.$message.error(res.msg);
                     }