Prechádzať zdrojové kódy

Merge branch 'dev' of https://gogs.k12100.net/liuquanxin/bigDataStudent into dev

吴朋磊 2 mesiacov pred
rodič
commit
aa0efa84b8

+ 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');

+ 55 - 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,8 +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>一、现状分析</p> -->
-                             {{ firstWeakSubject.textValue }}
+                            <template v-if="firstWeakSubject?.textValueWrap?.length">
+                                <p v-for="text in firstWeakSubject.textValueWrap">{{ text }}</p>
+                            </template>
+                            <template v-else>暂无</template>
                         </template>
                     </div>
                 </div>
@@ -53,8 +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>一、现状分析</p> -->
-                            {{ secondWeakSubject.textValue }}
+                            <template v-if="secondWeakSubject?.textValueWrap?.length">
+                                <p v-for="text in secondWeakSubject.textValueWrap">{{ text }}</p>
+                            </template>
+                            <template v-else>暂无</template>
                         </template>
                     </div>
                 </div>
@@ -65,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>
-                            {{ needTeacherValue }}
+                            <template v-if="needTeacherValueWrap?.length">
+                                <p v-for="text in needTeacherValueWrap">{{ text }}</p>
+                            </template>
+                            <template v-else>暂无</template>
                         </template>
                     </div>
                 </div>
@@ -95,14 +102,17 @@ export default {
             firstWeakSubject:{
                 subjectCode: 10,
                 subjectName: '',
-                textValue: ''
+                textValue: '',
+                textValueWrap: [],
             },//第一个薄弱学科
             secondWeakSubject:{
                 subjectCode: 10,
                 subjectName: '',
-                textValue: ''
+                textValue: '',
+                textValueWrap: []
             },//第二个薄弱学科
             needTeacherValue:'',//
+            needTeacherValueWrap:'',//
             isEdit:false,//是否可编辑
         }
     },
@@ -125,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 = [];
@@ -135,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{
@@ -148,28 +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 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: firstWeakSubject?.textValue || '暂无'
+                        textValue: firstTextValue,
+                        textValueWrap: firstTextValueWrap
                     };//第一个薄弱学科
                     this.secondWeakSubject = {
                         subjectCode: secondWeakSubject?.subjectCode || '',
                         subjectName: secondWeakSubject?.subjectName || '',
-                        textValue: secondWeakSubject?.textValue || '暂无'
+                        textValue: secondTextValue,
+                        textValueWrap: secondTextValueWrap
                     };//第二个薄弱学科
-                    this.needTeacherValue = needTeacherValue || '暂无';
+                    this.needTeacherValue = needTextValue;
+                    const needTeacherValueWrap = needTextValue.split(/\r?\n/).filter(item => item !== '');
+                    this.needTeacherValueWrap = needTeacherValueWrap;
                 } else {
                     this.subjects = [];//科目
                     this.subjectsCode = [];//科目code
@@ -183,14 +202,17 @@ export default {
                     this.firstWeakSubject = {
                         subjectCode: '',
                         subjectName: '',
-                        textValue: '暂无'
+                        textValue:'',
+                        textValueWrap: []
                     };//第一个薄弱学科
                     this.secondWeakSubject = {
                         subjectCode: '',
                         subjectName: '',
-                        textValue: '暂无'
+                        textValue:'',
+                        textValueWrap: []
                     };//第二个薄弱学科
-                    this.needTeacherValue = '暂无';
+                    this.needTeacherValue = '';
+                    this.needTeacherValueWrap = [''];
                 }
             })
         },
@@ -206,6 +228,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 +246,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);
                     }