Эх сурвалжийг харах

一生一案接口参数及文案修改

liurongli 2 сар өмнө
parent
commit
927b60d3d2

+ 1 - 1
src/App.vue

@@ -18,7 +18,7 @@ export default {
     },
     methods: {
         SubmitLogin() {
-            const username = '376050cy_xiyanzuo_015';
+            const username = '76434917044491';
             const password = '123456';
             // const type = '1';
             const schoolType = sessionStorage.getItem('schoolType');

+ 34 - 22
src/views/analysisReport/studentPage/studentCase/mainPage.vue

@@ -13,7 +13,7 @@
                         <el-table-column align="center" v-for="subject in subjects" :key="subject" :label="subject">
                             <template slot-scope="scope">
                                 <template v-if="!isEdit">
-                                    {{ scope.row[subject] }}
+                                    {{ scope.row[subject] || '-' }}
                                 </template>
                                 <el-input v-else v-model="scope.row[subject]" style="width: 100%;" @input="ValidateNumber(scope.row,subject)" />
                             </template>
@@ -34,7 +34,10 @@
                     <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 v-for="text in firstWeakSubject.textValueWrap">{{ text }}</p>
+                            <template v-if="firstWeakSubject?.textValueWrap?.length">
+                                <p v-for="text in firstWeakSubject.textValueWrap">{{ text }}</p>
+                            </template>
+                            <template v-else>暂无</template>
                         </template>
                     </div>
                 </div>
@@ -52,7 +55,10 @@
                     <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 v-for="text in secondWeakSubject.textValueWrap">{{ text }}</p>
+                            <template v-if="secondWeakSubject?.textValueWrap?.length">
+                                <p v-for="text in secondWeakSubject.textValueWrap">{{ text }}</p>
+                            </template>
+                            <template v-else>暂无</template>
                         </template>
                     </div>
                 </div>
@@ -63,7 +69,10 @@
                     <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>
-                            <p v-for="text in needTeacherValueWrap">{{ text }}</p>
+                            <template v-if="needTeacherValueWrap?.length">
+                                <p v-for="text in needTeacherValueWrap">{{ text }}</p>
+                            </template>
+                            <template v-else>暂无</template>
                         </template>
                     </div>
                 </div>
@@ -126,7 +135,7 @@ export default {
         GetOneStudentOneCase() {
             this.$api.reportStudent.jointSchoolReport.getOneStudentOneCase(this.reportParam).then(res => {
                 if (res.code == 200 && res.data) {
-                    const {id,examId,schoolId,studentName,studentNo,studentCode,subjectVoList,studentGoalVoList,firstWeakSubject,secondWeakSubject,needTeacherValue} = res.data;
+                    const {id,schoolId,studentName,studentNo,studentCode,subjectVoList,studentGoalVoList,firstWeakSubject,secondWeakSubject,needTeacherValue} = res.data;
                     if(studentGoalVoList){
                         const studentGoalList = studentGoalVoList || [];
                         this.subjects = [];
@@ -136,8 +145,8 @@ export default {
                         studentGoalList.forEach(item => {
                             this.subjects.push(item.subjectName);
                             this.subjectsCode.push(item.subjectCode);
-                            obj1[item.subjectName] = item?.goalScore || '-';
-                            obj2[item.subjectName] = item?.goalRank || '-';
+                            obj1[item.subjectName] = item?.goalScore || '';
+                            obj2[item.subjectName] = item?.goalRank || '';
                         });
                         this.tableData.push(obj1,obj2)
                     }else{
@@ -149,34 +158,37 @@ export default {
                         subjectList.forEach(item => {
                             this.subjects.push(item.subjectName);
                             this.subjectsCode.push(item.subjectCode);
-                            obj1[item.subjectName] = '-';
-                            obj2[item.subjectName] = '-';
+                            obj1[item.subjectName] = '';
+                            obj2[item.subjectName] = '';
                         });
                         this.tableData.push(obj1,obj2)
                     }
                     this.id = id;
-                    this.examId = examId;
+                    this.examId = this.reportParam.examId;
                     this.schoolId = schoolId;
                     this.studentName = studentName;
                     this.studentNo = studentNo;
                     this.studentCode = studentCode;
-                    const firstTextValue = firstWeakSubject?.textValue || '暂无';
-                    const secondTextValue = secondWeakSubject?.textValue || '暂无';
-                    const needTextValue = needTeacherValue || '暂无';
+                    const firstTextValue = firstWeakSubject?.textValue || '';
+                    const secondTextValue = secondWeakSubject?.textValue || '';
+                    const needTextValue = needTeacherValue || '';
+                    const firstTextValueWrap = firstTextValue.split(/\r?\n/).filter(item => item !== '');
+                    const secondTextValueWrap = secondTextValue.split(/\r?\n/).filter(item => item !== '');
                     this.firstWeakSubject = {
                         subjectCode: firstWeakSubject?.subjectCode || '',
                         subjectName: firstWeakSubject?.subjectName || '',
                         textValue: firstTextValue,
-                        textValueWrap: firstTextValue.split(/\r?\n/)
+                        textValueWrap: firstTextValueWrap
                     };//第一个薄弱学科
                     this.secondWeakSubject = {
                         subjectCode: secondWeakSubject?.subjectCode || '',
                         subjectName: secondWeakSubject?.subjectName || '',
                         textValue: secondTextValue,
-                        textValueWrap: secondTextValue.split(/\r?\n/)
+                        textValueWrap: secondTextValueWrap
                     };//第二个薄弱学科
                     this.needTeacherValue = needTextValue;
-                    this.needTeacherValueWrap = needTextValue.split(/\r?\n/);
+                    const needTeacherValueWrap = needTextValue.split(/\r?\n/).filter(item => item !== '');
+                    this.needTeacherValueWrap = needTeacherValueWrap;
                 } else {
                     this.subjects = [];//科目
                     this.subjectsCode = [];//科目code
@@ -190,17 +202,17 @@ export default {
                     this.firstWeakSubject = {
                         subjectCode: '',
                         subjectName: '',
-                        textValue:'暂无',
-                        textValueWrap: ['暂无']
+                        textValue:'',
+                        textValueWrap: []
                     };//第一个薄弱学科
                     this.secondWeakSubject = {
                         subjectCode: '',
                         subjectName: '',
-                        textValue:'暂无',
-                        textValueWrap: ['暂无']
+                        textValue:'',
+                        textValueWrap: []
                     };//第二个薄弱学科
-                    this.needTeacherValue = '暂无';
-                    this.needTeacherValueWrap = ['暂无'];
+                    this.needTeacherValue = '';
+                    this.needTeacherValueWrap = [''];
                 }
             })
         },