소스 검색

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

CrazyIter_Bin 1 년 전
부모
커밋
35bc6b6b54

+ 2 - 0
TEAMModelOS/ClientApp/src/api/index.js

@@ -44,6 +44,7 @@ import areaOverview from './areaOverview'
 import newCourse from './newCourse'
 import iot from './iot'
 import areaActivity from './areaActivity'
+import schoolDashborad from './schoolDashborad'
 export default {
     accessToken,
     learnActivity,
@@ -88,6 +89,7 @@ export default {
     newCourse,
     iot,
     areaActivity,
+    schoolDashborad,
     // 获取登录跳转链接
     getLoginLink: function (data) {
         return post('api/login/login', data)

+ 6 - 0
TEAMModelOS/ClientApp/src/api/schoolDashborad.js

@@ -0,0 +1,6 @@
+import { fetch, post } from '@/api/http'
+export default {
+    schoolData:function(data){
+        return post('/school/init/get-scstats',data)
+    }
+}

+ 2 - 2
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -751,7 +751,7 @@
 									permission: "dashboard-read",
 									menuName: "dashCenter",
 									child: [],
-									isShow: !this.isGlobalSite,
+									isShow: true,
 								},
 								// 学校管理
 								{
@@ -1261,7 +1261,7 @@
 									menuName: "ResearchMgt",
 									permission: "research-read|research-upd",
 									child: [],
-									isShow: this.edition !== "artTest" && this.IES5Menu && !this.isGlobalSite
+									isShow: this.edition !== "artTest" && this.IES5Menu && !this.isGlobalSite && this.isOpenLessonRecord
 								},
 								// 学情分析(国际站单独)
 								{

+ 2 - 2
TEAMModelOS/ClientApp/src/view/areaMgmt/AreaEcharts/gradePie.vue

@@ -87,7 +87,7 @@ class InitChart {
     ]
     var data = datas ? datas : defaults
     let datum = data.map((v) => v.value)
-    let color = ['#27D099', '#B458F5', '#FCD54B', '#5684F4', '#81ecec', '#ff7675']
+    let color = ['#27D099', '#B458F5', '#FCD54B', '#5684F4', '#81ecec', '#ff7675','#FFFB7D','#E0C3FC','#97D9E1','#85FFBD','#FBAB7E','#FF5ACD']
     // let data1 = data[0].value + data[1].value + data[2].value + data[3].value
     let baseData = []
     for (var i = 0; i < data.length; i++) {
@@ -96,7 +96,7 @@ class InitChart {
         name: data[i].name,
         itemStyle: {
           normal: {
-            borderWidth: 20,
+            borderWidth: 15,
             shadowBlur: 10,
             borderColor: color[i],
             borderRadius: 5,

+ 166 - 28
TEAMModelOS/ClientApp/src/view/dashboard/school/SchoolDashboard.vue

@@ -1,10 +1,12 @@
 <template>
     <div class="school-dash-container">
-        <div class="schoolanalysebox" >
+        <div class="schoolanalysebox">
+            <Loading v-if="detailsLoding"></Loading>
             <div class="school-analyse-header bgimg">
             <div class="school-analyse-headersbox">
                 <div class="school-analyse-headersbox-name">
-                <span>123456</span>
+                    <img :src="schoolDeatils.picture"/>
+                    <span>{{schoolDeatils.name}}</span>
                 </div>
                 <div class="school-analyse-headersbox-basics">
                 <div class="items-basics">
@@ -42,7 +44,7 @@
             </div>
             <div class="class-total">
                 <div class="class-box total-box total1" v-for="itemD in classroomsData.details" :key="itemD.id">
-                <div class="classbox-num total-num">{{itemD.value}}</div>
+                <div class="classbox-num total-num">{{itemD.value}} <span v-show="itemD.id ===1" class="hours">H</span></div>
                 <div class="classbox-title total-title">{{itemD.name}}</div>
                 </div>
             </div>
@@ -131,7 +133,8 @@ export default {
     data(){
         return{
             schoolDeatils:{
-                name:'123456'
+                name:'',
+                picture:'',
             },
             anSchool:{
                 teachNum: 0,
@@ -145,7 +148,7 @@ export default {
                 classed: [],
                 activitys: [],
                 interacts: [],
-                times: ['11','22'],
+                times: [],
             },
             classroomsData:{
                 attend: [
@@ -195,7 +198,7 @@ export default {
                         show: true,
                         type: 'shadow',
                         },
-                        data: ['1月','2月','3月','4月','5月',],
+                        data: [],
                     },
                     ],
                     yAxis: [
@@ -228,7 +231,7 @@ export default {
                             name: '课例',
                             type: 'bar',
                             barWidth: '20',
-                            data: [11,15,16,18,17],
+                            data: [],
                             itemStyle: {
                             //lenged文本
                             opacity: 1,
@@ -286,7 +289,7 @@ export default {
                         show: true,
                         type: 'shadow',
                         },
-                        data: ['1月','2月','3月','4月','5月',],
+                        data: [],
                     },
                     ],
                     yAxis: [
@@ -320,7 +323,7 @@ export default {
                         name: '活动',
                         type: 'bar',
                         barWidth: '20',
-                        data: [11,15,16,14,18],
+                        data: [],
                         itemStyle: {
                         //lenged文本
                         opacity: 1,
@@ -378,7 +381,7 @@ export default {
                         show: true,
                         type: 'shadow',
                         },
-                        data: ['1月','2月','3月','4月','5月',],
+                        data: [],
                     },
                     ],
                     yAxis: [
@@ -412,7 +415,7 @@ export default {
                         name: '互动',
                         type: 'bar',
                         barWidth: '20',
-                        data: [10,5,9,78,12],
+                        data: [],
                         itemStyle: {
                         //lenged文本
                         opacity: 1,
@@ -464,8 +467,7 @@ export default {
                     },
                     legend: {
                     show: true,
-                    // data: this.anSchool.times,
-                    data:['1月','2月','3月','4月','5月'],
+                    data:[],
                     textStyle: {
                         color: '#000',
                     },
@@ -474,7 +476,7 @@ export default {
                     },
                     xAxis: {
                     type: 'category',
-                    data:['1月','2月','3月','4月','5月'],
+                    data:[],
                     boundaryGap: false,
                     },
                     yAxis: {
@@ -560,10 +562,12 @@ export default {
                     {
                         name: '科目占比',
                         type: 'pie',
-                        radius: '80%',
+                        radius: ['35%', '75%'],
                         center: ['45%', '50%'],
                         itemStyle: {
-                        borderRadius: 2,
+                        borderRadius: 25,
+                        borderWidth:2,
+                        borderColor:'#fff',
                         },
                         label: {
                         normal: {
@@ -576,18 +580,7 @@ export default {
                     ],
                 },
             },
-            detailsGrade:[ {
-                value: 0,
-                name: '123',
-              },
-              {
-                value: 0,
-                name: '456',
-              },
-              {
-                value: 0,
-                name: '789',
-              },],
+            detailsGrade:[],
             detailsbasics:[
             {
                 id: 1,
@@ -650,11 +643,143 @@ export default {
                 todayNum: 0,
             },
             ],
+            detailsLoding:false,
         }
     },
+    created(){
+        this.init()
+    },
     methods:{
         detailsback(){
             this.$router.push('/dashCenter')
+        },
+        init(){
+            let schoolCode=localStorage.cur_schoolCode
+            let data={schoolId:schoolCode}
+            this.detailsLoding=true
+            this.$api.schoolDashborad.schoolData(data).then((res)=>{
+                console.log(res,'school Back')
+             if(res.state == 200){
+                let {lessonStats,scStats,school}=res
+                //基础信息
+                this.schoolDeatils.name=school.name
+                this.schoolDeatils.picture=school.picture
+                this.anSchool.teachNum=scStats.tch
+                this.anSchool.studentNum=scStats.stu
+                this.anSchool.classNum=scStats.room
+                this.anSchool.classInfoNum=lessonStats.resourcesCount
+                //header data
+                this.classroomsData.attend[0].value=lessonStats.cnt
+                this.classroomsData.attend[1].value=lessonStats.dayCnt
+                this.classroomsData.attend[2].value=lessonStats.weekCnt
+                this.classroomsData.attend[3].value=lessonStats.monthCnt
+                this.classroomsData.attend[4].value=0
+
+                this.classroomsData.details[0].value=lessonStats.duration === 0 ? 0 : Number((lessonStats.duration / 60).toFixed(2))
+                this.classroomsData.details[1].value=lessonStats.attendCount
+                this.classroomsData.details[2].value=lessonStats.clientInteractionCount
+                this.classroomsData.details[3].value=lessonStats.workCount
+                this.classroomsData.details[4].value=lessonStats.interactionCount
+
+                //Bar data
+                //课例
+                scStats.lessStats.year.forEach((item) => {
+                    this.anSchool.classed.push(item.cnt)
+                    this.anSchool.class += item.cnt
+                    //处理时间
+                    this.anSchool.times.push(item.id)
+                })
+                //活动
+                scStats.actStats.year.forEach((item) => {
+                    this.anSchool.activitys.push(item.cnt)
+                    this.anSchool.activity += item.cnt
+                })
+                //互动
+                scStats.lessStats.yearInters.forEach((item) => {
+                    this.anSchool.interacts.push(item.cnt)
+                    this.anSchool.interact += item.cnt
+                })
+                this.detailsEchart.bar1.timeline.data = this.anSchool.times
+                this.detailsEchart.bar1.xAxis[0].data = this.anSchool.times
+                this.detailsEchart.bar1.series[0].data = this.anSchool.classed
+
+                this.detailsEchart.bar2.timeline.data = this.anSchool.times
+                this.detailsEchart.bar2.xAxis[0].data = this.anSchool.times
+                this.detailsEchart.bar2.series[0].data = this.anSchool.activitys
+
+                this.detailsEchart.bar3.timeline.data = this.anSchool.times
+                this.detailsEchart.bar3.xAxis[0].data = this.anSchool.times
+                this.detailsEchart.bar3.series[0].data = this.anSchool.interacts
+
+                //center data
+                //课例
+                 this.detailsbasics[0].num=scStats.lessStats.all
+                 this.detailsbasics[0].todayNum =scStats.lessStats.day
+                 this.detailsbasics[0].subheadingNum =scStats.lessStats.lastDay === 0 && scStats.lessStats.day === 0 ? '0%' : scStats.lessStats.lastDay === 0 ? '100%' : ((scStats.lessStats.day - scStats.lessStats.lastDay) / scStats.lessStats.lastDay).toFixed(2) * 100 + '%'
+                 this.detailsbasics[0].subheadNum = this.anSchool.classed[this.anSchool.classed.length - 2] === 0 && this.anSchool.classed[this.anSchool.classed.length - 1] === 0 ? '0%' : this.anSchool.classed[this.anSchool.classed.length - 2] === 0 ? '100%' : ((this.anSchool.classed[this.anSchool.classed.length - 1] - this.anSchool.classed[this.anSchool.classed.length - 2]) / this.anSchool.classed[this.anSchool.classed.length - 2] * 100).toFixed(2) + '%'
+                //活动
+                this.detailsbasics[1].num = scStats.actStats.all
+                this.detailsbasics[1].todayNum = scStats.actStats.dayCnt
+                this.detailsbasics[1].subheadingNum = scStats.actStats.lastDay === 0 && scStats.actStats.dayCnt === 0 ? '0%' : scStats.actStats.lastDay === 0 ? '100%' : ((scStats.actStats.dayCnt - scStats.actStats.lastDay) / scStats.actStats.lastDay).toFixed(2) * 100 + '%'
+                this.detailsbasics[1].subheadNum = this.anSchool.activitys[this.anSchool.activitys.length - 2] === 0 && this.anSchool.activitys[this.anSchool.activitys.length - 1] === 0 ? '0%' : this.anSchool.activitys[this.anSchool.activitys.length - 2] === 0 ? '100%' : ((this.anSchool.activitys[this.anSchool.activitys.length - 1] - this.anSchool.activitys[this.anSchool.activitys.length - 2]) / this.anSchool.activitys[this.anSchool.activitys.length - 2] * 100).toFixed(2) + '%'
+                //互动
+                let alls = scStats.lessStats.yearInters.reduce(function (total, currentValue) { ; return Number(total) + Number(currentValue.cnt) }, 0)
+                this.detailsbasics[2].num = alls
+                this.detailsbasics[2].todayNum = scStats.lessStats.dayInter
+                this.detailsbasics[2].subheadingNum = scStats.lessStats.lastDayInter === 0 && scStats.lessStats.dayInter === 0 ? '0%' : scStats.lessStats.lastDayInter === 0 ? '100%' : ((scStats.lessStats.dayInter - scStats.lessStats.lastDayInter) / scStats.lessStats.lastDayInter).toFixed(2) * 100 + '%'
+                this.detailsbasics[2].subheadNum = this.anSchool.interacts[this.anSchool.interacts.length - 2] === 0 && this.anSchool.interacts[this.anSchool.interacts.length - 1] === 0 ? '0%' : this.anSchool.interacts[this.anSchool.interacts.length - 2] === 0 ? '100%' : ((this.anSchool.interacts[this.anSchool.interacts.length - 1] - this.anSchool.interacts[this.anSchool.interacts.length - 2]) / this.anSchool.interacts[this.anSchool.interacts.length - 2] * 100).toFixed(2) + '%'
+                //总数据
+                let nowYear = scStats.lessStats.all + scStats.actStats.all
+                let lastYear = scStats.lessStats.lastYear + scStats.actStats.lastYear
+                this.detailsbasics[3].subheadNum = nowYear === 0 && lastYear === 0 ? '0%' : lastYear === 0 ? '100%' : (((nowYear - lastYear) / lastYear) * 100).toFixed(2) + '%'
+                let classedDatas =  this.anSchool.classed; let activitysDatas =  this.anSchool.activitys; let interactDatas =  this.anSchool.interacts
+                let tataldata1 = classedDatas.map((index, item) => { return index + activitysDatas[item]; })
+                this.detailsEchart.line.legend.data=this.anSchool.times
+                this.detailsEchart.line.xAxis.data=this.anSchool.times
+                this.detailsEchart.line.series[0].data = tataldata1
+
+                //处理年纪占比
+                let Xdata = [];
+                if(lessonStats.gradeCnt.length >0){
+                    lessonStats.gradeCnt.forEach((item)=>{
+                        let nameNum = Number(item.name)
+                        let stuId = item.periodId
+                        let values = item.value
+                        for(let y in school.period){
+                            if(school.period[y].id === stuId){
+                                let names=school.period[y].grades[nameNum]
+                                Xdata.push({ name: names, value: values })
+                            }
+                        }
+                    })
+                this.detailsGrade = Xdata
+                }else{
+                    this.detailsGrade=[]
+                }
+                //处理科目占比
+                let subjectData = []
+                if(lessonStats.subCnt.length >0){
+                    lessonStats.subCnt.forEach((item)=>{
+                        let nameId = item.name
+                        let values = item.value
+                        for(let i in school.period){
+                            let phaseData = school.period[i].subjects
+                            for (let a in phaseData) {
+                                if (phaseData[a].id === nameId) {
+                                    subjectData.push({ name: phaseData[a].name, value: values })
+                                }
+                            }
+                        }
+                    })
+                    this.detailsEchart.subject.series[0].data = subjectData    
+                }else{
+                    this.detailsEchart.subject.series[0].data =[]    
+                }
+                this.detailsLoding=false
+            }
+            }).catch((error)=>{
+                this.$Message.error(error)
+            })
         }
     }
 }
@@ -706,6 +831,9 @@ export default {
   text-align: center;
   margin-bottom: 2px;
   margin-top: 2%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
 }
 .school-analyse-headersbox-basics {
   width: 100%;
@@ -889,6 +1017,16 @@ export default {
     color: #fff;
     margin-right:5px;
 }
+.hours{
+    font-size:20px;
+    color:#409EFF;
+    margin-left:2px;
+}
+.school-analyse-headersbox-name img{
+    width:55px;
+    height:55px;
+    margin-right:1%;
+}
 .purples {
   /* background: rgba(112, 103, 245, 0.3); */
   background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%);

+ 7 - 0
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue

@@ -558,6 +558,8 @@ export default {
      * @param item
      */
     handleToolEdit(arr, item, index) {
+      console.error(this.errorList)
+      console.error(item)
       this.currentExerciseIndex = this.exerciseList.indexOf(item) // 清单列表下的index
       this.curOrderIndex = index
       if (item.scope === 'school') {
@@ -788,6 +790,11 @@ export default {
         preOrderList.splice(this.curOrderIndex, 1, item)
         this.paper.item = preOrderList
       }
+      /* 如果编辑好的题目是之前错误的题目 则移除掉 */
+      let isErrorItemIndex = this.errorList.findIndex(i => i.id === item.id)
+      if(isErrorItemIndex > -1){
+        this.errorList.splice(isErrorItemIndex, 1)
+      }
     },
 
 

+ 0 - 2
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseJudge.vue

@@ -74,8 +74,6 @@
 		watch:{
 			editInfo:{
 				handler(n){
-					console.log('主观题富文本接收到的数据')
-					console.log(n)
 					if(n){
 						this.stemEditor.txt.html(this.editInfo.question)
 						this.stemContent = this.editInfo.question

+ 2 - 1
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue

@@ -297,11 +297,12 @@
 			this.$editorTools.initMyEditor(stemEditor,this)
 			stemEditor.create()
 			this.stemEditor = stemEditor
-			this.initEditors()
 
 			if (this.editInfo && this.isEdit) { 
 				console.log('进入多选题Mounted编辑')
 				this.doRender(this.editInfo)
+			}else{
+				this.initEditors()
 			}
 		},
 		computed: {

+ 2 - 1
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue

@@ -248,7 +248,6 @@
 
 			stemEditor.create()
 			this.stemEditor = stemEditor
-			this.initEditors();
 			
 			if (this.editInfo && this.isEdit) {
 				console.log('进入单选题Mounted编辑',this.editInfo)
@@ -263,6 +262,8 @@
 					this.initEditors()
 					this.stemEditor.txt.html(this.editSingleInfo.question)
 				})
+			}else{
+				this.initEditors();
 			}
 		},
 		watch: {