Browse Source

修改学生端显示

zhousheng 4 years ago
parent
commit
1277bb8398

+ 21 - 27
TEAMModelOS/ClientApp/src/components/learnactivity/ClassList.vue

@@ -10,9 +10,6 @@
             </div>
             <div class="class-info">
                 <div class="learn-progress-main" v-show="!showTest">
-                    <div  style="text-align:center;width:100%">
-                        <Loading :top="200" type="1" v-if="dataLoading"></Loading>
-                    </div>
                     <!--<p style="color:#EEEEEE;font-size:16px;margin-top:5px;">测验成绩分析</p>-->
                     <div class="class-filter dark-iview-select">
                         <span class="filter-label">测验年级:</span>
@@ -25,19 +22,28 @@
                         </Select>
                     </div>
                     <!--<div class="chart-show">
-        <div v-if="!testStatus" class="chart" style="margin:auto">
-            <Grade v-if="studentList.length !== 0" :studentData="studentList"></Grade>
-        </div>
-        <div v-if="testStatus" class="chart">
-            <Analyse></Analyse>
-        </div>
-    </div>
-    <p style="color:#EEEEEE;padding-left:15px;font-size:16px;margin-top:10%;margin-bottom:10px;">学生成绩数据</p>-->
+                        <div v-if="!testStatus" class="chart" style="margin:auto">
+                            <Grade v-if="studentList.length !== 0" :studentData="studentList"></Grade>
+                        </div>
+                        <div v-if="testStatus" class="chart">
+                            <Analyse></Analyse>
+                        </div>
+                    </div>
+                    <p style="color:#EEEEEE;padding-left:15px;font-size:16px;margin-top:10%;margin-bottom:10px;">学生成绩数据</p>-->
                     <div class="table-show dark-iview-table">
-                        <Table v-if="!dataLoading" border :columns="scoreLists" height="750" :data="studentScore">
+                        
+                        <Table  border :columns="scoreLists" :loading="dataLoading" height="750" :data="studentScore">
+                            <div class="show-loading" slot="loading">
+                                <Loading :top="-200" type="1"></Loading>
+                            </div>
                             <template slot-scope="{ row,index }" :slot="'que'+qIndex" v-for="(item,qIndex) in quLen">
-                                <div @click="getStuScore(row,qIndex)" :class="[studentScore[row._index].data[qIndex] == -1 ?'scoreShow':'scoreShows']">
-                                    <span>{{studentScore[row._index].data[qIndex] == -1 ? '-': studentScore[row._index].data[qIndex]}}</span>
+                                <div @click="getStuScore(row,qIndex)">
+                                    <Poptip trigger="hover" content="点击前往评分页面">
+                                        <Icon class="scoreShow" size="26" type="ios-create-outline" v-show="studentScore[row._index].data[qIndex] == -1" />
+                                    </Poptip>      
+                                    <Poptip trigger="hover" content="点击查看试题详情">
+                                        <span class="scoreShows" v-show="studentScore[row._index].data[qIndex] != -1">{{studentScore[row._index].data[qIndex]}}</span>
+                                    </Poptip>
                                 </div>
                             </template>
                             <template slot-scope="{ row,index }" slot="total">
@@ -105,7 +111,7 @@ import { data } from 'autoprefixer'
                         slot: 'total',
                         align: 'center',
                         fixed: 'right',
-                        minWidth:100
+                        width:100
                     }
                 ],
                 scoreLists: [],
@@ -117,7 +123,6 @@ import { data } from 'autoprefixer'
         },
         methods: {
             getBack(data) {
-                console.log(data)
                 if (data == '1') {
                     this.initClassData()
                 }
@@ -127,14 +132,12 @@ import { data } from 'autoprefixer'
                 this.showTest = false
                 this.selectStudent = {}
                 if (data.id) {
-                    console.log('4121561561')
                     data.classId = this.chooseClass
                     data.className = this.getClassName(this.chooseClass)
                     data.queNo = index
                     this.showTest = true
                 }
                 this.selectStudent = { ...data }
-                console.log(this.selectStudent)
             },
             getClassName(data) {
                 if (this.classData.length) {
@@ -147,7 +150,6 @@ import { data } from 'autoprefixer'
             },
             //初始化获取班级数据
             getClassData(data) {
-                console.log('2')
                 this.classData.length = 0
                 if (data !== undefined) {
                     for (let item of this.classList) {
@@ -156,11 +158,9 @@ import { data } from 'autoprefixer'
                         }
                     }
                 }
-                console.log(this.classData)
             },
             //年级数据获取
             getPeriod(data) {
-                console.log('1')
                 this.chooseGrade = ''
                 if (data) {
                     this.chooseGrade = data
@@ -179,7 +179,6 @@ import { data } from 'autoprefixer'
                 }, 0)
             },
             getScores(data) {
-                console.log(data)
                 return data.id
             },
             //获取班级测评数据
@@ -266,13 +265,11 @@ import { data } from 'autoprefixer'
                     }
                     this.scoreLists.push(data)
                 }
-                console.log('list', this.scoreLists)
                 let ans = []
                 for (let i = 0; i < this.studentAns.studentIds.length; i++) {
                     for (let k = 0; k < this.studentData.students.length; k++) {
                         let score = {}
                         if (this.studentAns.studentIds[i] == this.studentData.students[k].id) {
-                            console.log(i)
                             score.name = this.studentData.students[k].name
                             score.id = this.studentAns.studentIds[i]
                             score.data = this.studentAns.studentScores[i]
@@ -309,7 +306,6 @@ import { data } from 'autoprefixer'
             },
             getAllStudentData() {
                 this.dataLoading = true
-                console.log(this.paperData)
                 let requestData = {
                     id: this.paperData.id,
                     school: this.$store.state.user.schoolCode,
@@ -320,9 +316,7 @@ import { data } from 'autoprefixer'
                     this.$api.learnActivity.FindAllStudent(requestData).then(
                         res => {
                             this.studentAns = {}
-                            console.log(res)
                             if (res.examClassResults.length > 0) {
-                                console.log(res.examClassResults[0])
                                 this.studentAns = res.examClassResults[0]
                                 this.setTableData()
                                 setTimeout(() => {

+ 110 - 83
TEAMModelOS/ClientApp/src/components/learnactivity/GradeList.less

@@ -15,98 +15,125 @@
     border-right: 1px solid @borderColor;
 }
 
-.grade-box {
+.show-loading /deep/ .loading-container {
     width: 100%;
-    margin: 10px;
-    float: right;
-}
-
-.search-box {
-    height: 5%;
-    margin-top:5px;
-    /*margin-left:5px;*/
-    border-bottom: 1px solid @borderColor;
-}
-.student-box {
-    height:98%;
-    li :hover{
-        cursor:pointer;
+    height: 100%;
+    right: 0px;
+    top: 0;
+    left: 0;
+    display: flex;
+    /* flex-direction: row; */
+    text-align: center;
+    justify-content: center;
+    /* background: rgba(103, 103, 103, 0.27); */
+    z-index: 1000;
     }
-    .student-list{
-        height:96%;
+
+    .grade-box {
+        width: 100%;
+        margin: 10px;
+        float: right;
     }
-    .student-show {
-        width:95%;
-        height: 40px;
-        padding-top:10px;
+
+    .search-box {
+        height: 5%;
+        margin-top: 5px;
+        /*margin-left:5px;*/
         border-bottom: 1px solid @borderColor;
-        display: block;
-        span {
-            font-size: 15px;
-            color: @primary-textColor;
-            margin-left: 10px;
+    }
+
+    .student-box {
+        height: 98%;
+
+        li :hover {
+            cursor: pointer;
+        }
+
+        .student-list {
+            height: 96%;
+        }
+
+        .student-show {
+            width: 95%;
+            height: 40px;
+            padding-top: 10px;
+            border-bottom: 1px solid @borderColor;
+            display: block;
+
+            span {
+                font-size: 15px;
+                color: @primary-textColor;
+                margin-left: 10px;
+            }
         }
     }
-}
-.awnser-box {
-    margin-top: 10px;
-    width: 95%;
-    border: 1px solid @borderColor;
 
-    .question-box {
-        margin-top: 20px;
+    .awnser-box {
+        margin-top: 10px;
+        width: 95%;
+        border: 1px solid @borderColor;
+
+        .question-box {
+            margin-top: 20px;
+            display: flex;
+            width: 100%;
+            /* background-color: #fff; */
+            /*margin-bottom: 10px;*/
+            margin-left: 5px;
+        }
+    }
+
+    .content {
         display: flex;
         width: 100%;
-        /* background-color: #fff; */
-        /*margin-bottom: 10px;*/
+        margin: auto;
+        height: 730px;
+        border: 1px solid @borderColor;
+        position: relative;
+    }
+
+    .top-bar {
+        height: 40px;
+        border: 1px solid #424242;
+        display: inline-flex;
+        width: 100%;
+    }
+
+    .type-list {
+        width: 100%;
+        padding-top: 5px;
         margin-left: 5px;
     }
-}
-.content {
-    display: flex;
-    width: 100%;
-    margin: auto;
-    height:730px;
-    border: 1px solid @borderColor;
-    position:relative;
-}
 
-.top-bar {
-    height: 40px;
-    border: 1px solid #424242;
-    display: inline-flex;
-    width: 100%;
-}
-.type-list{
-    width:100%;
-    padding-top:5px;
-    margin-left:5px;
-}
-.button-list {
-    width: 50%;
-    padding-top: 3px;
-    text-align: right;
-}
-.base-info-btn{
-    margin-left:5px;
-    margin-right:10px;
-}
-.base-info-item {
-    font-size: 16px;
-    color: #a5a5a5;
-    margin-left:15px;
-}
-.analysis-info {
-    font-size: 16px;
-    color: #0f9272;
-}
-.activity-status {
-    font-size: 10px !important;
-    background: #19be6b;
-    float: right;
-    padding: 0 5px;
-    color: @primary-textColor;
-    display: inline-block;
-    margin-right: 10px;
-    border-radius: 5px;
-}
+    .button-list {
+        width: 50%;
+        padding-top: 3px;
+        text-align: right;
+    }
+
+    .base-info-btn {
+        margin-left: 5px;
+        margin-right: 10px;
+    }
+
+    .base-info-item {
+        font-size: 16px;
+        color: #a5a5a5;
+        margin-left: 15px;
+    }
+
+    .analysis-info {
+        font-size: 16px;
+        color: #0f9272;
+    }
+
+    .activity-status {
+        font-size: 10px !important;
+        background: #19be6b;
+        float: right;
+        padding: 0 5px;
+        color: @primary-textColor;
+        display: inline-block;
+        margin-right: 10px;
+        border-radius: 5px;
+    }

+ 10 - 1
TEAMModelOS/ClientApp/src/components/learnactivity/GradeList.vue

@@ -269,7 +269,16 @@
             },
         },
         mounted() {
-            this.getClassData(1)
+            this.$store.dispatch('user/getSchoolProfile').then(
+                (res) => {
+                    if (res) {
+                        this.getClassData(1)
+                    }
+                },
+                (err) => {
+                    this.$Message.error('API error!')
+                }
+            )
         },
         watch: {
             paperInfo: {

+ 4 - 3
TEAMModelOS/ClientApp/src/components/student-web/EventBasicInfo.vue

@@ -18,11 +18,11 @@
     <i-col :xs="24" :sm="24" :md="24" :lg="getCurrentLang()=='tw'?12:24" class="info-part">
       <ul class="base-info" :class="{'base-infoEn':getCurrentLang()=='en'}">
         <li
-          v-if="this.$store.getters.getItemTitle.eventType == 'exam' "
+          v-if="this.$store.getters.getItemTitle.eventType == 'exam' && paper.length !== 0 "
         >
           <svg-icon icon-class="subject" class="base-info-icon" />{{ $t('studentWeb.baseInfo.subject')}}
-          <span class="base-info-text">综合科目</span>
-           <span class="base-info-text" v-if="getCurrentLang()=='en'">{{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}</span>
+          <span class="base-info-text">{{paper.length > 1? '综合科目':paper[0].subject.name }}</span>
+          <span class="base-info-text" v-if="getCurrentLang()=='en'">{{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}</span>
         </li>
 
         <!--<li>
@@ -104,6 +104,7 @@ export default {
     },
         },
         mounted() {
+            console.log('54534135123123')
             console.log(this.paper)
         },
         methods: {

+ 1 - 1
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContent.vue

@@ -59,7 +59,7 @@ export default {
     }
   },
         mounted() {
-            console.log(this.$store.getters.getItemTitle.eventType)
+            //console.log(this.$store.getters.getItemTitle.eventType)
     //this.theFirstActiveEvent(); // <!-- 如果沒選的時候預設顯示列表第一個-->
   },
   data() {

+ 2 - 2
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTest.vue

@@ -118,12 +118,12 @@
             </div>-->
             <!----->
             <!--多學科試卷-->
-            <div v-if="paperData.length >1 ">
+            <div v-if="paperData.length > 0 ">
                 <ul v-for="(item, index) in paperData"
                     :key="index"
                     class="tasks"
                     @click="opentestWithSubject(item)">
-                    <li class="title" v-if="getCurrentLang() == 'tw'">
+                    <li class="title">
                         <span style="position: relative; top: 1px">
                             <svg-icon icon-class="test" class="title-icon" />
                         </span>

+ 1 - 0
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestPop.vue

@@ -462,6 +462,7 @@
             openWarmMessage: function (showMessageNum) {
                 this.WarmMessageisOpen = true;
                 if (showMessageNum == 1) {
+                    //if()
                     this.showMessageNum = showMessageNum;
                 } else if (showMessageNum == 2) {
                     for (var i = 0; i <= this.$store.getters.getPaperInfo.item.length; i++) {

+ 0 - 14
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventView.vue

@@ -51,22 +51,8 @@
             this.$emit("onNavName", this.MyName);
             this.$store.commit("ToggleSidebar", true);
             this.$store.commit("SaveNowPage", '活動');
-            //this.setPaperData()
         },
         methods: {
-
-
-            setPaperData() {
-                let data = {
-                    scope: "school",
-                    blob: "/paper/主观题测试"
-                }
-                let info = this.$evTools.getFullPaper(data)
-                console.log('学生端试卷信息')
-                console.log(info)
-            },
-
-
             scrollList() {
                 //當從通知操作進行捲動時,將篩選條件清空
                 this.selectedEventStatusNow = "所有活動狀態";

+ 8 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.vue

@@ -806,12 +806,18 @@
                     scope: this.mode,
                     createDate: Math.round(new Date())
                 }
+
                 this.$api.learnActivity.SaveExamInfo(data).then(
                     res => {
                         if (res.error == null) {
                             this.$Message.success('评测发布成功!')
-                            this.evaluationInfo.papers = res.exam
-                            this.isLoading = false
+                            setTimeout(() => {
+                                this.isLoading = false
+                                let datas = this.mode + 'Evaluation'
+                                this.$router.push({
+                                    name: datas
+                                })
+                                this.evaluationInfo.papers = res.exam},500)
                         } else {
                             this.$Message.error('API ERROR!')
                             this.isLoading = false