Bladeren bron

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

CrazyIter_Bin 1 jaar geleden
bovenliggende
commit
bf429a3766

+ 3 - 1
TEAMModelBI/ClientApp/src/view/product/index.vue

@@ -529,7 +529,7 @@ let productData = ref({
     // { name: '全部', value: 'sourceAll' },
     { name: '学校', value: 'school' },
     { name: '学区', value: 'area' },
-    { name: '城市', value: 'city' }
+    // { name: '城市', value: 'city' }
   ],
   districtName: '地区选择',
   district: [
@@ -880,6 +880,8 @@ function dataInit () {
       let resultColumns=columns.value.findIndex((item)=>{return  item.key==='schoolId'})
       resultColumns !==-1 ? columns.value.splice(1,1):''
       cellWidth.value=(100 / columns.value.length).toFixed(2)
+    }else{
+      filterdata.value=res.data
     }
   }).catch((err) => {
     ElMessage.error('API异常,数据获取失败')

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

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

+ 7 - 0
TEAMModelOS/ClientApp/src/api/iot.js

@@ -0,0 +1,7 @@
+import { fetch, post } from '@/api/http'
+export default {
+    //iot面板  学校
+    getSchooliot:function(data){
+        return post('/school/init/get-school-iot', data)
+    },
+}

+ 49 - 3
TEAMModelOS/ClientApp/src/assets/iconfont/demo_index.html

@@ -54,6 +54,18 @@
       <div class="content unicode" style="display: block;">
           <ul class="icon_lists dib-box">
           
+            <li class="dib">
+              <span class="icon iconfont">&#xe697;</span>
+                <div class="name">物联网</div>
+                <div class="code-name">&amp;#xe697;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe916;</span>
+                <div class="name">iot 物联网平台</div>
+                <div class="code-name">&amp;#xe916;</div>
+              </li>
+          
             <li class="dib">
               <span class="icon iconfont">&#xe696;</span>
                 <div class="name">星标题目</div>
@@ -1416,9 +1428,9 @@
 <pre><code class="language-css"
 >@font-face {
   font-family: 'iconfont';
-  src: url('iconfont.woff2?t=1687773648553') format('woff2'),
-       url('iconfont.woff?t=1687773648553') format('woff'),
-       url('iconfont.ttf?t=1687773648553') format('truetype');
+  src: url('iconfont.woff2?t=1689156682901') format('woff2'),
+       url('iconfont.woff?t=1689156682901') format('woff'),
+       url('iconfont.ttf?t=1689156682901') format('truetype');
 }
 </code></pre>
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -1444,6 +1456,24 @@
       <div class="content font-class">
         <ul class="icon_lists dib-box">
           
+          <li class="dib">
+            <span class="icon iconfont icon-wulianwang"></span>
+            <div class="name">
+              物联网
+            </div>
+            <div class="code-name">.icon-wulianwang
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont icon-iot"></span>
+            <div class="name">
+              iot 物联网平台
+            </div>
+            <div class="code-name">.icon-iot
+            </div>
+          </li>
+          
           <li class="dib">
             <span class="icon iconfont icon-xingbiaoti-"></span>
             <div class="name">
@@ -3487,6 +3517,22 @@
       <div class="content symbol">
           <ul class="icon_lists dib-box">
           
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-wulianwang"></use>
+                </svg>
+                <div class="name">物联网</div>
+                <div class="code-name">#icon-wulianwang</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-iot"></use>
+                </svg>
+                <div class="name">iot 物联网平台</div>
+                <div class="code-name">#icon-iot</div>
+            </li>
+          
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#icon-xingbiaoti-"></use>

+ 11 - 3
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 2000444 */
-  src: url('iconfont.woff2?t=1687773648553') format('woff2'),
-       url('iconfont.woff?t=1687773648553') format('woff'),
-       url('iconfont.ttf?t=1687773648553') format('truetype');
+  src: url('iconfont.woff2?t=1689156682901') format('woff2'),
+       url('iconfont.woff?t=1689156682901') format('woff'),
+       url('iconfont.ttf?t=1689156682901') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,14 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-wulianwang:before {
+  content: "\e697";
+}
+
+.icon-iot:before {
+  content: "\e916";
+}
+
 .icon-xingbiaoti-:before {
   content: "\e696";
 }

File diff suppressed because it is too large
+ 1 - 1
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.js


+ 14 - 0
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.json

@@ -5,6 +5,20 @@
   "css_prefix_text": "icon-",
   "description": "",
   "glyphs": [
+    {
+      "icon_id": "11761256",
+      "name": "物联网",
+      "font_class": "wulianwang",
+      "unicode": "e697",
+      "unicode_decimal": 59031
+    },
+    {
+      "icon_id": "9255041",
+      "name": "iot 物联网平台",
+      "font_class": "iot",
+      "unicode": "e916",
+      "unicode_decimal": 59670
+    },
     {
       "icon_id": "3727440",
       "name": "星标题目",

BIN
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.ttf


BIN
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff


BIN
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff2


+ 12 - 0
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -633,6 +633,18 @@ export default {
               child: [],
               isShow: this.isGlobalSite,
             },
+            //iot
+            {
+              icon: "iconfont icon-wulianwang",
+              name: 'iot数据看板',
+              router: "/schooliot",
+              tag: "",
+              role: "admin",
+              permission: "dashboard-read",
+              menuName: "TeacherDashboard",
+              child: [],
+              isShow: this.isGlobalSite,
+            },
             //学校管理
             {
               icon: "iconfont icon-school",

+ 9 - 0
TEAMModelOS/ClientApp/src/router/routes.js

@@ -1694,6 +1694,15 @@ export const routes = [{
                 activeName: 'areaIndex'
             }
         },
+        //学区iot数据看板
+        {
+            path: 'areaIot',
+            name: 'areaIot',
+            component: () => import('@/view/iot/areaiot.vue'),
+            meta: {
+                activeName: 'areaIot'
+            }
+        },
         //学校数据统计总览
         {
             path: 'areaSchool',

+ 12 - 0
TEAMModelOS/ClientApp/src/view/areaMgmt/AreaLayout.vue

@@ -269,6 +269,18 @@ export default {
           child: [],
           isShow: !this.$jsFn.checkJinNiu() && !this.$jsFn.checkTrain() && this.$store.state.config.srvAdrType != 'product'
         },
+        //学区iot
+        // {
+        //   icon: 'iconfont icon-iot',
+        //   name: '学区Iot看板',
+        //   router: '/area/areaiot',
+        //   tag: '',
+        //   role: '',
+        //   permission: '',
+        //   menuName: 'areaiot',
+        //   child: [],
+        //   isShow: !this.$jsFn.checkJinNiu() && !this.$jsFn.checkTrain() && this.$store.state.config.srvAdrType != 'product'
+        // },
         // 研修平台
         {
           icon: 'iconfont icon-basic-setting',

+ 668 - 0
TEAMModelOS/ClientApp/src/view/iot/areaiot.vue

@@ -0,0 +1,668 @@
+<template>
+<div class="schooliotbox">
+    <div class="containerbox">
+        <!--header-->
+            <!--title-->
+            <div class="container-title">
+                <dv-decoration-10 class="dv-dec-10" />
+                <div class="title-center">
+                    <dv-decoration-8 class="dv-dec-8" :color="['#568aea', '#000000']" />
+                    <div class="title-text">
+                        <span class="title-textbox">{{$t('schoolIot.title')}}</span>
+                        <dv-decoration-6 class="dv-dec-6" :reverse="true" :color="['#50e3c2', '#67a1e5']" />
+                    </div>
+                    <dv-decoration-8 class="dv-dec-8" :reverse="true" :color="['#568aea', '#000000']" />
+                </div>
+                <dv-decoration-10 class="dv-dec-10-s" />
+            </div>
+             <!--title end -->
+             <!--school name-->
+             <div class="school-name">
+                <!-- <img :src="schoolInfo.schoolLogo">
+                <span class="schoolbox-name">{{ schoolInfo.schoolName }}</span>
+                <span class="schoolbox-period">{{ schoolInfo.periodName }}</span>
+                <span class="schoolbox-semester">{{ schoolInfo.curSemester }}</span> -->
+                <span class="schoolbox-name">{{ schoolInfo.names }}</span>
+             </div>
+             <!--school name  end-->
+             <!--time-->
+             <div class="timebox">
+                <span class="timebox-text">{{ times.year }} <span style="display: inline-block; margin: 0 5px;color: #0fa2fe;">{{ times.day }}</span> </span>
+             </div>
+             <!--time end-->
+        <!--header end-->
+        <!--containerbody-->
+        <div class="containerbody">
+            <!--containerbody top-->
+            <div class="topbox">
+                <dv-border-box-12>
+                    <div class="topbox-item" v-for="(item,index) in basicaList" :key="index">
+                        <div class="item-title-images">
+                        <div :class="[item.key ==='participationnum' && locals==='en-us' ? 'common-title':'','item-title']">{{item.title}}</div>
+                        <div class="item-images">
+                            <!-- <svg class="analysisicon" aria-hidden="true">
+                            <use :xlink:href="item.icon"></use>
+                            </svg> -->
+                        </div>
+                    </div>
+                        <div :class="[item.key === 'classtime' || item.key === 'participationnum' ? 'item-nums-special':'item-nums']">
+                        <p v-if="item.key === 'classtime' || item.key === 'participationnum'">{{item.value}}<span class="timetag">Min</span><br /><span>{{Math.round(item.value/60)}}<span class="timetag">H</span></span></p>
+                        <p v-else>
+                            <countTo :startVal='0' :endVal='item.value' :duration='1500'  v-show="index !== 0"></countTo>
+                            <span v-show="index ===0">{{item.value}}</span>
+                        </p>
+                        </div>
+                        <div class="totalclass" v-show="item.key === 'roomnum' || item.key === 'teachnum' || item.key === 'studentnum'">
+                        <div v-if="item.key ==='roomnum'">
+                            <p class="totalclass-total">{{$t('schoolIot.basics.classTotals')}}</p>
+                            <p class="totalclass-num">70</p>
+                        </div>
+                        <div v-else-if="item.key ==='teachnum'">
+                            <p class="totalclass-total">{{$t('schoolIot.basics.teachTotals')}}</p>
+                            <p class="totalclass-num">70</p>
+                        </div>    
+                        <div v-else-if="item.key ==='studentnum'">
+                            <p class="totalclass-total">{{$t('schoolIot.basics.studentTotals')}}</p>
+                            <p class="totalclass-num">70</p>
+                        </div>    
+                    </div>
+                    </div>
+                </dv-border-box-12>
+            </div>
+             <!--containerbody top end-->
+             <!--containerbody rests-->
+             <div class="restsbox">
+                <div class="restsbox-left">
+                    <dv-border-box-11 :title="$t('schoolIot.classrooming.title')">
+                        <div class="left-item" v-for="(item,index) in inuseList" :key="index">
+                            <div class="item-img">
+                                <!-- <Icon :custom="item.icon" class="top-header-icon"/> -->
+                                <img :src="item.src"></img>
+                            </div>
+                            <div class="item-box">
+                                <p><countTo :startVal='0' :endVal='item.value' :duration='1500' class="itembox-value"></countTo></p>
+                                <span>{{item.title}}</span>
+                            </div>
+                        </div>
+                    </dv-border-box-11>
+                </div>
+                <div class="restsbox-right">
+                    <dv-border-box-11 :title="$t('schoolIot.device.title')">
+                        <div class="right-box">
+                            <!-- <dv-scroll-board :config="config" style="width:100%;height:100%" /> -->
+                            <div class="right-box-left">
+                                <BaseCircle  circleId="hiteach" chatName="HiTeach" :percent="45" subTitle="45" totalNum="158"></BaseCircle>
+                            </div>
+                            <div class="right-box-left">
+                                <BaseCircle  circleId="hita" chatName="HiTA" :percent="20" subTitle="15" totalNum="60"></BaseCircle>
+                            </div>
+                            <div class="right-box-left">
+                                <BaseCircle  circleId="hitachcc" chatName="HiTeach CC" :percent="10" subTitle="23" totalNum="0"></BaseCircle>
+                            </div>
+                        </div>
+                    </dv-border-box-11>    
+                </div>
+             </div>
+             <!--containerbody rests end-->
+             <!--bottom-->
+             <div class="bottombox">
+                <div class="bottombox-left">
+                    <dv-border-box-12>
+                        <div class="innerbox">
+                            <p class="boxtitles">
+                                <span>{{$t('schoolIot.lessons.title')}}</span>
+                                <dv-decoration-3 style="width:200px;height:20px;"/>
+                            </p>
+                            <div class="innerbox-inside">
+                                <!-- <div class="data-left">
+                                <BaseCircle  circleId="hiteach" chatName="HiTeach" :percent="45" subTitle="45" totalNum="158"></BaseCircle>
+                                </div>
+                                <div class="data-left">
+                                    <BaseCircle  circleId="hita" chatName="HiTA" :percent="20" subTitle="15" totalNum="60"></BaseCircle>
+                                </div>
+                                <div class="data-left">
+                                    <BaseCircle  circleId="hitachcc" chatName="HiTeach CC" :percent="10" subTitle="23" totalNum="80"></BaseCircle>
+                                </div>
+                                <div class="data-left">
+                                    <BaseCircle  circleId="webirs" chatName="WebIRS" :percent="40" subTitle="45" totalNum="77"></BaseCircle>
+                                </div> -->
+                                <barandLine ></barandLine>
+                            </div>
+                            <!-- <dv-decoration-2 :reverse="true" style="width:5px;height:95%;" :dur="5" /> -->
+                            <!-- <div class="data-right">
+                                <div class="data-right-top">
+                                    <YPie title="本月" :pieData="monthData"></YPie>
+                                </div>
+                                <div class="data-right-bottom">
+                                    <YPie title="学期" :pieData="semesterData"></YPie>
+                                </div>
+                            </div> -->
+                        </div>
+                    </dv-border-box-12>    
+                </div>
+                <div class="right-integration">
+                    <div class="bottombox-right">
+                        <dv-border-box-12>
+                            <div class="innerbox">
+                                <p class="boxtitles">
+                                    <span>课堂记录统计</span>
+                                    <dv-decoration-3 style="width:200px;height:20px;"/>
+                                </p>
+                                <div class="barbox">
+                                    <!-- <Bar title="学期" :pieData="bars"></Bar> -->
+                                      <dv-scroll-board :config="config" style="width:100%;height:100%" />
+                                </div>
+                            </div>
+                        </dv-border-box-12>    
+                    </div>
+                    <div class="bottombox-right">
+                        <dv-border-box-12>
+                            <div class="innerbox">
+                                <p class="boxtitles">
+                                    <span>{{$t('schoolIot.morphologyClass.title')}}</span>
+                                    <dv-decoration-3 style="width:200px;height:20px;"/>
+                                </p>
+                                <div class="barbox">
+                                    <Bar title="学期" :pieData="bars"></Bar>
+                                </div>
+                            </div>
+                        </dv-border-box-12>    
+                    </div>
+                </div>
+             </div>
+             <!--bottom end-->
+        </div>
+         <!--containerbodyend-->
+    </div>
+</div>
+</template>
+<script>
+import countTo from 'vue-count-to'
+import BasePie from '@/components/echart/pie/index'
+import YPie from './echarts/pie/index'
+import Bar from './echarts/bar/index'
+import BaseCircle from "./echarts/circle/index";
+import barandLine from './echarts/barandLine/barandLine'
+export default {
+   name:'areaiot',
+   components: {
+    countTo,
+    BasePie,
+    YPie,
+    Bar,
+    BaseCircle,
+    barandLine
+  },
+   data(){
+    return{
+        times:{
+            year:null,
+            month:null,
+            week:null,
+            day:null
+        },
+        weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
+        basicaList:[
+        // { title: '学校简码', icon: '#icon-xuanzexuexiao-01', value: 'hbcn', key: 'code' },
+        { title: this.$t('schoolIot.basics.classnums'), icon: '#icon-shouhuifangzi', value: 65, key: 'roomnum' },
+        { title: this.$t('schoolIot.basics.teachnums'), icon: '#icon-jiaoshijie', value: 158, key: 'teachnum' },
+        { title: this.$t('schoolIot.basics.studentnums'), icon: '#icon-zongrenshu', value: 7603, key: 'studentnum' },
+        { title: this.$t('schoolIot.basics.studentTime'), icon: '#icon-_shijian_xiaoshuai', value: 450, key: 'participationnum' },
+        { title: this.$t('schoolIot.basics.classroomTotal'), icon: '#icon-ketang', value: 45, key: 'classnum' },
+        { title: this.$t('schoolIot.basics.classroomTime'), icon: '#icon--shijian ', value: 648, key: 'classtime' },
+        ],
+        inuseList:[
+        { title: this.$t('schoolIot.classrooming.taskNums'), value: 15, icon: 'iconfont icon-renwu',src:require("@/assets/image/iot/task.png"),class: 'task', textClass: 'task-text' },
+        { title: this.$t('schoolIot.classrooming.productionNums'), value: 10, icon: 'iconfont icon-zuopinzhanshi',src:require("@/assets/image/iot/production.png"),class: 'accomplish', textClass: 'accomplish-text' },
+        { title: this.$t('schoolIot.classrooming.topicNums'), value: 22, icon: 'iconfont icon-xingbiaoti-',src:require("@/assets/image/iot/exam.png"),class: 'topic', textClass: 'topic-text' },
+        { title: this.$t('schoolIot.classrooming.interactionNums'), value: 58, icon: 'iconfont icon-hudongshequ',src:require("@/assets/image/iot/interact.png"),class: 'interaction', textClass: 'interaction-text' },
+        ],
+        config:{
+            header: ['教师','学校','时间','科目'],
+            data: [
+               ['王老师','东城一小','72Min','语文'],
+               ['李老师','锦江四小','32Min','数学'],
+               ['金老师','川师附小','48Min','英语'],
+               ['周老师','川师附小','54Min','数学'],
+               ['郭老师','川师附小','22Min','音乐'],
+               ['秦老师','锦江外国语小学','18Min','美术'],
+               ['晓老师','锦江四小','72Min','英语'],
+               ['车老师','锦江外国语小学','32Min','数学'],
+               ['王老师','锦江外国语小学','48Min','英语'],
+               ['李老师','锦江四小','54Min','语文'],
+            ],
+            index: true,
+            indexHeader:'排名',
+            // columnWidth: [200,200,200,200],
+            align: ['center'],
+            carousel: 'single',
+            headerBGC:'rgba(19, 25, 47, 0.6)',
+            oddRowBGC:'rgba(19, 25, 47, 0.6)',
+            evenRowBGC:'rgba(19, 25, 47, 0.6)',
+            waitTime:'4000'
+        },
+        todayData:[
+            {name:this.$t('schoolIot.device.deviceTotal'),value:58},
+            {name:this.$t('schoolIot.device.deviceOnline'),value:50},
+        ],
+        monthData:[
+            {name:'六年二班',value:120},
+            {name:'三年四班',value:98},
+            {name:'五年三班',value:88},
+            {name:'四年二班',value:75},
+            {name:'二年二班',value:65},
+            {name:'一年五班',value:40},
+        ],
+        semesterData:[
+            {name:'六年二班',value:220},
+            {name:'五年四班',value:150},
+            {name:'六年三班',value:144},
+            {name:'四年二班',value:139},
+            {name:'二年二班',value:98},
+            // {name:'四年五班',value:75},
+            // {name:'九年二班',value:98},
+            // {name:'八年五班',value:75},
+            // {name:'七年二班',value:98},
+            // {name:'十年五班',value:75},
+        ],
+        bars:{
+            xdata:[this.$t('schoolIot.morphologyClass.cooperation'), this.$t('schoolIot.morphologyClass.interaction'), this.$t('schoolIot.morphologyClass.task'), this.$t('schoolIot.morphologyClass.differentiation'),  this.$t('schoolIot.morphologyClass.examination')],
+            value:[254, 3254, 1654, 2454, 757,]
+        },
+        locals:'',
+    }
+   },
+   mounted(){
+    this.timeFn()
+   },
+   created(){
+     this.locals=localStorage.local
+     console.log(this.locals,'语言')
+   },
+   computed: {
+    schoolInfo() {
+    //   let store_user = this.$store.state.user
+    //   let semesterRange = this.$tools.getSemesterTimeRange()
+    //   console.log(store_user,semesterRange)
+    //   return {
+    //     schoolName: store_user.schoolProfile.school_base.name,
+    //     schoolLogo: store_user.schoolProfile.school_base.picture,
+    //     periodName: store_user.curPeriod.name,
+    //     curSemester: semesterRange.name_with_year
+    //   }
+       let areaName=sessionStorage.areaName
+    return{
+        names:areaName
+    }
+    }
+  },
+   methods:{
+    timeFn() {
+      this.timing = setInterval(() => {
+        this.times.day = this.$tools.formatTime(new Date(), 'hh:mm:ss')
+        this.times.year = this.$tools.formatTime(new Date(), 'yyyy-MM-dd')
+        this.times.week = this.weekday[new Date().getDay()]
+      }, 1000)
+    },
+   }
+}
+</script>
+<style scoped>
+.schooliotbox{
+    color: #d3d6dd;
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    position: relative;
+}
+.containerbox{
+    width:100%;
+    height:100%;
+    padding: 16px 16px 0 16px;
+    background-image:url('../../assets/image/pageBg.png');
+    background-size: cover;
+    background-position: center center;
+}
+.container-title,.title-center{
+    display: flex;
+    flex-wrap: nowrap;
+}
+.title-text{
+    position: relative;
+    width: 500px;
+    text-align: center;
+    background-size: cover;
+    background-repeat: no-repeat;
+}
+.title-textbox{
+    font-size: 28px;
+    font-weight: bold;
+    position: absolute;
+    letter-spacing: 3px;
+    display: inline-block;
+    background-image: linear-gradient(#00b5ef, #7393a6);
+    -webkit-background-clip: text;
+    background-clip: text;
+    font-family: auto;
+    color: transparent;
+    bottom: 15px;
+    left: 50%;
+    transform: translate(-50%);
+    width: 80%;
+}
+.schooliotbox .dv-dec-10{
+    width:33.3%;
+    height:5px;
+    display: flex;
+}
+.schooliotbox .dv-dec-10-s{
+    transform: rotateY(180deg);
+    width:33.3%;
+    height:5px;
+    display: flex;
+}
+.schooliotbox .dv-dec-8{
+    width: 200px;
+    height: 50px;
+    display: flex;
+}
+.schooliotbox .title-center .dv-dec-6{
+    position: absolute;
+    bottom:0;
+    left:50%;
+    width:250px;
+    height:8px;
+    transform: translate(-50%);
+}
+.school-name{
+    position: absolute;
+    left: 30px;
+    top: 40px;
+    font-size: 20px;
+    font-weight: bold;
+    cursor: pointer;
+    display: flex;
+    align-items: center;
+}
+.school-name img{
+    border-radius: 50%;
+    width: 25px;
+}
+.schoolbox-name{
+    margin: 0 10px;
+}
+.schoolbox-period,.schoolbox-semester{
+    font-size: 12px;
+    background-color: #2d2d2d;
+    display: inline-block;
+    padding: 2px 10px;
+    border-radius: 4px;
+    margin-right: 5px;
+}
+.timebox{
+    position: absolute;
+    right: 30px;
+    top: 30px;
+    font-size: 26px;
+    font-weight: bold;
+    cursor: pointer;
+}
+.timebox-text{
+    font-size: 30px;
+    margin-right: 20px;
+    font-weight: 200;
+    color: #9f9f9f;
+    font-family: 'staticFont';
+}
+.containerbody{
+    margin-top: 20px;
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
+}
+.topbox{
+    width:100%;
+    height:15vh;
+    display: flex;
+    flex-wrap: nowrap;
+    justify-content: space-between;
+}
+.topbox-item{
+    display: flex;
+    width: 15%;
+    padding: 8px;
+    flex-direction: column;
+    line-height: 60px;
+    border-radius: 5px;
+    /* box-shadow: 0 2px 5px #e9e9e9; */
+    margin: 0.8%;
+    background-color: rgba(19, 25, 47, 0.6);
+    position:relative;
+}
+.item-title-images {
+  width: 100%;
+  display: flex;
+  flex-wrap: nowrap;
+  justify-content: space-between;
+}
+.item-title-images {
+  width: 100%;
+  display: flex;
+  flex-wrap: nowrap;
+  justify-content: space-between;
+}
+.item-title {
+  font-size: 16px;
+  /* font-weight: bold; */
+  color: #05d5ff;
+}
+.analysisicon {
+  width: 2.3em;
+  height: 2.3em;
+  vertical-align: -0.5em;
+  fill: currentColor;
+  /* overflow: hidden;
+  margin-right: 25px;
+  margin-left: 0px; */
+}
+.item-nums {
+  width: 100%;
+  font-size: 22px;
+  font-weight: bold;
+  color: #d3d6dd;
+  position: relative;
+}
+.item-nums-special {
+  width: 100%;
+  font-size: 20px;
+  font-weight: bold;
+  color: #d3d6dd;
+  line-height: 20px;
+}
+.timetag {
+  font-size: 14px;
+  margin-left: 1%;
+  color: #7f8c8d;
+}
+.restsbox{
+    width:100%;
+    height:21vh;
+    display: flex;
+    flex-wrap: nowrap;
+    justify-content: space-between;
+}
+.restsbox-left,.restsbox-right{
+    width:50%;
+}
+.left-item{
+  width: 21%;
+  display: flex;
+  height: 110px;
+  justify-content: center;
+  align-items: center;
+  border-radius: 5px;
+  background-color: rgba(19, 25, 47, 0.6);
+  margin: 9% 2% 1% 2%;
+}
+.item-img {
+  width: 45%;
+  position:relative
+}
+.item-img img{
+    width:50%;
+    margin-left:15%;
+}
+.inuseicon {
+  width: 3em;
+  height: 3em;
+  vertical-align: -0.5em;
+  fill: currentColor;
+}
+.item-box {
+  padding: 5px 0px;
+}
+.item-img {
+  width: 45%;
+}
+.item-box {
+  width: 54%;
+}
+.item-box p,
+.inuse-total p {
+  font-size: 22px;
+  color: #d3d6dd;
+  font-weight: bold;
+  margin-bottom: 5px;
+}
+.itembox-value{
+  font-size: 22px !important;
+  color: #d3d6dd !important;
+  font-weight: bold;
+  margin-bottom: 5px;
+}
+.item-box span,
+.inuse-total span {
+  font-size: 14px;
+  color: #05d5ff;
+}
+.inuse-total {
+  position: absolute;
+  top: 5%;
+  left: 5%;
+  width: 30%;
+  line-height: 20px;
+  text-align: left;
+}
+.right-box{
+    width:100%;
+    /* padding: 6% 2% 2% 2%; */
+    display: flex;
+}
+.count-num{
+    display: inline-block;
+    margin-top: 5px;
+    font-size: 28px;
+    font-weight: bold;
+}
+.bottombox{
+    width:100%;
+    display: flex;
+    height:49vh;
+}
+.bottombox-left{
+    width:55%;
+    display: flex;
+}
+.innerbox{
+    width:100%;
+    height:100%;
+    padding: 20px 16px;
+    display: flex;
+    flex-wrap: wrap;
+   
+}
+.innerbox-inside{
+    width:100%;
+    height:98%;
+    background-color: rgba(19, 25, 47, 0.6);
+    /* display: flex;
+    flex-wrap: wrap; */
+}
+.bottombox-right{
+    width:100%;
+    height:50%;
+}
+.data-left,.data-right{
+    width:50%;
+    padding: 1%;
+    height:48%;
+}
+.separate-line{
+    width:2px;
+    height:95%;
+    background-color: #fff;
+}
+.boxtitles{
+    width:100%;
+    background-color: rgba(19, 25, 47, 0.6);
+    display: flex;
+    line-height: 20px;
+    padding-left: 1%;
+}
+.data-right{
+    display: flex;
+    flex-wrap: wrap;
+}
+.data-right-top,.data-right-bottom{
+    width:100%;
+    padding: 0%;
+    height:50%;
+}
+.barbox{
+    width:100%;
+    height:95%;
+    background-color: rgba(19, 25, 47, 0.6);
+}
+.top-header-icon {
+  fill: currentColor;
+  overflow: hidden;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  font-size: 38px;
+}
+.totalclass{
+    position:absolute;
+    right:3%;
+    bottom:2%;
+    line-height: 40px;
+    text-align: center;
+}
+.totalclass-total{
+    color: #05d5ff;
+    font-size:14px;
+}
+.totalclass-num{
+    font-size:20px;
+    color:#d3d6dd;
+}
+.right-box-left{
+    width:31%;
+    padding: 6% 1% 1% 1%;
+    height:100%;
+}
+.common-title{
+    line-height: 30px !important;
+}
+.right-integration{
+    width:45%;
+    display: flex;
+    flex-wrap: wrap;
+}
+</style>
+<style>
+.schooliotbox .topbox  .border-box-content,.schooliotbox .restsbox .border-box-content{
+    display: flex;
+}
+</style>

+ 1 - 1
TEAMModelOS/ClientApp/src/view/iot/echarts/bar/bar.vue

@@ -142,7 +142,7 @@
 							top:'7%',
 							left:'7%',
 							right:'3%',
-							bottom:'9%'
+							bottom:'15%'
 						},
 						toolbox: {
 							show: false

+ 54 - 24
TEAMModelOS/ClientApp/src/view/iot/echarts/barandLine/barandLine.vue

@@ -15,7 +15,8 @@
           line2: [],
           line3: [],
           line4: [],
-        }
+        },
+        transferJson:[]
       };
     },
     components: {
@@ -26,41 +27,63 @@
         type: Object,
         default: () => ({})
       },
+      baldata: {
+        type: Array,
+        default: () => ([])
+      },
     },
     created() {
       // 获取课例趋势图数据
     //   let trendJson = this.$store.state.dashboard.researchDashboard.trend
      let trendJson=[
-        {name:1,value:[43,5,3,7]},
-        {name:2,value:[15,0,2,5]},
-        {name:3,value:[77,15,30,48]},
-        {name:4,value:[62,15,21,45]},
-        {name:5,value:[33,11,13,27]},
-        {name:6,value:[105,35,43,87]},
-        {name:7,value:[80,30,33,57]},
-        {name:8,value:[70,25,23,62]},
-        {name:9,value:[23,5,13,27]},
-        {name:10,value:[66,18,23,47]},
-        {name:11,value:[55,15,13,37]},
+        // {name:1,value:[43,5,3,7]},
+        // {name:2,value:[15,0,2,5]},
+        // {name:3,value:[77,15,30,48]},
+        // {name:4,value:[62,15,21,45]},
+        // {name:5,value:[33,11,13,27]},
+        // {name:6,value:[105,35,43,87]},
+        // {name:7,value:[80,30,33,57]},
+        // {name:8,value:[70,25,23,62]},
+        // {name:9,value:[23,5,13,27]},
+        // {name:10,value:[66,18,23,47]},
+        // {name:11,value:[55,15,13,37]},
         // {name:12,value:[43,5,3,7]},
         // {name:13,value:[43,5,3,7]},
         // {name:14,value:[43,5,3,7]},
         // {name:15,value:[43,5,3,7]},
         // {name:16,value:[43,5,3,7]},
-     ]
-      if (trendJson) {
-        trendJson.forEach(i => {
-          this.trendData.xData.push(`${this.$t('lessonRecord.echarts.weekUtil')}${i.name}${this.$t('lessonRecord.echarts.week')}`)
-          this.trendData.line1.push(i.value[0])
-          this.trendData.line2.push(i.value[1])
-          this.trendData.line3.push(i.value[2])
-          this.trendData.line4.push(i.value[3])
-        })
+      ]
+      // trendJson=this.transferJson
+      // if (trendJson) {
+      //   trendJson.forEach(i => {
+      //     this.trendData.xData.push(`${this.$t('lessonRecord.echarts.weekUtil')}${i.name}${this.$t('lessonRecord.echarts.week')}`)
+      //     this.trendData.line1.push(i.value[0])
+      //     this.trendData.line2.push(i.value[1])
+      //     this.trendData.line3.push(i.value[2])
+      //     this.trendData.line4.push(i.value[3])
+      //   })
+      // }
+      
+    },
+    methods: {
+      init() {
+        let trendJson=[]
+        trendJson=this.transferJson
+        if (trendJson) {
+          trendJson.forEach(i => {
+            this.trendData.xData.push(`${this.$t('lessonRecord.echarts.weekUtil')}${i.name}${this.$t('lessonRecord.echarts.week')}`)
+            this.trendData.line1.push(i.value[0])
+            this.trendData.line2.push(i.value[1])
+            this.trendData.line3.push(i.value[2])
+            this.trendData.line4.push(i.value[3])
+          })
+        }
       }
     },
     watch: {
       cdata: {
         handler(newData) {
+          console.log(newData,'bal的数据s')
           this.options = {
             tooltip: {
               trigger: "axis",
@@ -258,7 +281,7 @@
             //     }, 
             //     ]
             // },
-            data: [13, 8, 45, 31, 19, 74, 27,30,10,15,13]
+            data:this.trendData.line2
             },
             {  //题目数量
             name: this.$t('schoolIot.lessons.topicNums'),
@@ -320,7 +343,7 @@
             //     }, 
             //     ]
             // },
-            data: [9, 5, 15, 21, 23, 34, 17,20,5,8,9]
+            data:this.trendData.line3
             },
             { //互动数量
             name: this.$t('schoolIot.lessons.interactionNums'),
@@ -382,7 +405,7 @@
             //     }, 
             //     ]
             // },
-            data: [88, 75, 65, 101, 73, 64, 47,40,35,28,19]
+            data: this.trendData.line4
             },
          ]
           }
@@ -390,6 +413,13 @@
         immediate: true,
         deep: true
       },
+      baldata: {
+          handler(newData) {
+            newData.length !==0 ? (this.transferJson=newData,this.init()):''
+          },
+          immediate: true,
+          deep: true
+      }
     },
   }
   </script>

+ 3 - 1
TEAMModelOS/ClientApp/src/view/iot/echarts/circle/index.vue

@@ -32,6 +32,7 @@
     },
     methods: {
       doRender() {
+        console.log('触发方法')
         if(!document.getElementById(this.circleId)) return
         let myChart = this.$echarts.init(document.getElementById(this.circleId))
         let option = {
@@ -123,7 +124,7 @@
         };
         myChart.clear()
         console.log(this.totalNum,'引用的值')
-        if(this.totalNum == 0){
+        if(this.totalNum == 0 && this.chatName ==='HiTeach CC'){
           option.title.splice(2,1)
           option.title[0].top='30%'
           // option.title[1].top='0%'
@@ -143,6 +144,7 @@
         deep: true,
         immediate: true,
         handler(n, o) {
+          console.log('触发time')
           this.doRender()
         }
       }

+ 118 - 17
TEAMModelOS/ClientApp/src/view/iot/schooliot.vue

@@ -54,15 +54,15 @@
                         <div class="totalclass" v-show="item.key === 'roomnum' || item.key === 'teachnum' || item.key === 'studentnum'">
                         <div v-if="item.key ==='roomnum'">
                             <p class="totalclass-total">{{$t('schoolIot.basics.classTotals')}}</p>
-                            <p class="totalclass-num">70</p>
+                            <p class="totalclass-num">{{item.total}}</p>
                         </div>
                         <div v-else-if="item.key ==='teachnum'">
                             <p class="totalclass-total">{{$t('schoolIot.basics.teachTotals')}}</p>
-                            <p class="totalclass-num">70</p>
+                            <p class="totalclass-num">{{item.total}}</p>
                         </div>    
                         <div v-else-if="item.key ==='studentnum'">
                             <p class="totalclass-total">{{$t('schoolIot.basics.studentTotals')}}</p>
-                            <p class="totalclass-num">70</p>
+                            <p class="totalclass-num">{{item.total}}</p>
                         </div>    
                     </div>
                     </div>
@@ -90,13 +90,13 @@
                         <div class="right-box">
                             <!-- <dv-scroll-board :config="config" style="width:100%;height:100%" /> -->
                             <div class="right-box-left">
-                                <BaseCircle  circleId="hiteach" chatName="HiTeach" :percent="45" subTitle="45" totalNum="158"></BaseCircle>
+                                <BaseCircle  circleId="hiteach" chatName="HiTeach" :percent="equipmentData.hiteachPercent" :subTitle="equipmentData.hiteachOnline" :totalNum="equipmentData.hiteachTotal"></BaseCircle>
                             </div>
                             <div class="right-box-left">
-                                <BaseCircle  circleId="hita" chatName="HiTA" :percent="20" subTitle="15" totalNum="60"></BaseCircle>
+                                <BaseCircle  circleId="hita" chatName="HiTA" :percent="equipmentData.hitaPercent" :subTitle="equipmentData.hitaOnline" :totalNum="equipmentData.hitaTotal"></BaseCircle>
                             </div>
                             <div class="right-box-left">
-                                <BaseCircle  circleId="hitachcc" chatName="HiTeach CC" :percent="10" subTitle="23" totalNum="0"></BaseCircle>
+                                <BaseCircle  circleId="hitachcc" chatName="HiTeach CC" :percent="equipmentData.ccPercent" :subTitle="equipmentData.ccOnline" totalNum="0"></BaseCircle>
                             </div>
                         </div>
                     </dv-border-box-11>    
@@ -125,7 +125,7 @@
                                 <div class="data-left">
                                     <BaseCircle  circleId="webirs" chatName="WebIRS" :percent="40" subTitle="45" totalNum="77"></BaseCircle>
                                 </div> -->
-                                <barandLine ></barandLine>
+                                <barandLine :baldata="baldatas"></barandLine>
                             </div>
                             <!-- <dv-decoration-2 :reverse="true" style="width:5px;height:95%;" :dur="5" /> -->
                             <!-- <div class="data-right">
@@ -160,12 +160,12 @@
 </div>
 </template>
 <script>
-import countTo from 'vue-count-to'
-import BasePie from '@/components/echart/pie/index'
-import YPie from './echarts/pie/index'
-import Bar from './echarts/bar/index'
+import BasePie from '@/components/echart/pie/index';
+import countTo from 'vue-count-to';
+import Bar from './echarts/bar/index';
+import barandLine from './echarts/barandLine/barandLine';
 import BaseCircle from "./echarts/circle/index";
-import barandLine from './echarts/barandLine/barandLine'
+import YPie from './echarts/pie/index';
 export default {
    name:'schooliot',
    components: {
@@ -184,11 +184,12 @@ export default {
             week:null,
             day:null
         },
+        weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
         basicaList:[
         // { title: '学校简码', icon: '#icon-xuanzexuexiao-01', value: 'hbcn', key: 'code' },
-        { title: this.$t('schoolIot.basics.classnums'), icon: '#icon-shouhuifangzi', value: 65, key: 'roomnum' },
-        { title: this.$t('schoolIot.basics.teachnums'), icon: '#icon-jiaoshijie', value: 158, key: 'teachnum' },
-        { title: this.$t('schoolIot.basics.studentnums'), icon: '#icon-zongrenshu', value: 7603, key: 'studentnum' },
+        { title: this.$t('schoolIot.basics.classnums'), icon: '#icon-shouhuifangzi', value: 65, key: 'roomnum',total:77, },
+        { title: this.$t('schoolIot.basics.teachnums'), icon: '#icon-jiaoshijie', value: 158, key: 'teachnum',total:77, },
+        { title: this.$t('schoolIot.basics.studentnums'), icon: '#icon-zongrenshu', value: 7603, key: 'studentnum',total:77,},
         { title: this.$t('schoolIot.basics.studentTime'), icon: '#icon-_shijian_xiaoshuai', value: 450, key: 'participationnum' },
         { title: this.$t('schoolIot.basics.classroomTotal'), icon: '#icon-ketang', value: 45, key: 'classnum' },
         { title: this.$t('schoolIot.basics.classroomTime'), icon: '#icon--shijian ', value: 648, key: 'classtime' },
@@ -199,6 +200,17 @@ export default {
         { title: this.$t('schoolIot.classrooming.topicNums'), value: 22, icon: 'iconfont icon-xingbiaoti-',src:require("@/assets/image/iot/exam.png"),class: 'topic', textClass: 'topic-text' },
         { title: this.$t('schoolIot.classrooming.interactionNums'), value: 58, icon: 'iconfont icon-hudongshequ',src:require("@/assets/image/iot/interact.png"),class: 'interaction', textClass: 'interaction-text' },
         ],
+        //设备统计
+        equipmentData: {
+          hiteachTotal: 0,
+          hiteachOnline: 0,
+          hiteachPercent:0,
+          hitaTotal: 0,
+          hitaOnline: 0,
+          hitaPercent:0,
+          ccOnline: 0,
+          ccPercent:0,
+        },
         config:{
             header: ['教室', '教师', '时间','科目'],
             data: [
@@ -248,9 +260,10 @@ export default {
         ],
         bars:{
             xdata:[this.$t('schoolIot.morphologyClass.cooperation'), this.$t('schoolIot.morphologyClass.interaction'), this.$t('schoolIot.morphologyClass.task'), this.$t('schoolIot.morphologyClass.differentiation'),  this.$t('schoolIot.morphologyClass.examination')],
-            value:[254, 3254, 1654, 2454, 757,]
+            value:[0, 0, 0, 0, 0,]
         },
-        locals:'',
+      locals: '',
+      baldatas:[],
     }
    },
    mounted(){
@@ -259,11 +272,13 @@ export default {
    created(){
      this.locals=localStorage.local
      console.log(this.locals,'语言')
+     this.init()
    },
    computed: {
     schoolInfo() {
       let store_user = this.$store.state.user
       let semesterRange = this.$tools.getSemesterTimeRange()
+      console.log(this.$store.state.user,'信息')
       return {
         schoolName: store_user.schoolProfile.school_base.name,
         schoolLogo: store_user.schoolProfile.school_base.picture,
@@ -280,6 +295,92 @@ export default {
         this.times.week = this.weekday[new Date().getDay()]
       }, 1000)
     },
+    init(){
+        let userdatas = this.$store.state.user
+        let data={schoolId:userdatas.schoolCode,periodId:userdatas.curPeriod.id}
+        this.$api.iot.getSchooliot(data).then((res)=>{
+          console.log(res, 'iot back')
+          //header基础数据
+          let { classCnt, deviceAuthCnt, teacherShow,teacherCnt, stuShow, studentCnt, stuLessonLengMin, lessonRecord, lessonLengMin } = res
+          this.basicaList[0].value = classCnt
+          this.basicaList[0].total = deviceAuthCnt
+          this.basicaList[1].value= teacherShow
+          this.basicaList[1].total = teacherCnt
+          this.basicaList[2].value = stuShow
+          this.basicaList[2].total = studentCnt
+          this.basicaList[3].value = stuLessonLengMin
+          this.basicaList[4].value = lessonRecord
+          this.basicaList[5].value = lessonLengMin
+          //课中统计 和 设备统计
+          let { mission, missionFin, item, interact, htcDevTotalCnt, htcDevCnt, htaDevTotalCnt, htaDevCnt, htccDevCnt } = res
+          this.inuseList[0].value = mission
+          this.inuseList[1].value = missionFin
+          this.inuseList[2].value = item
+          this.inuseList[3].value = interact
+
+          this.equipmentData.hiteachTotal = htcDevTotalCnt.toString()
+          this.equipmentData.hiteachOnline = htcDevCnt.toString()
+          this.equipmentData.hiteachPercent=Math.round((htcDevCnt/htcDevTotalCnt)*100)
+          this.equipmentData.hitaTotal = htaDevTotalCnt.toString()
+          this.equipmentData.hitaOnline = htaDevCnt.toString()
+          this.equipmentData.hitaPercent=Math.round((htaDevCnt/htaDevTotalCnt)*100)
+          this.equipmentData.ccOnline = htccDevCnt.toString()
+          this.equipmentData.ccPercent = 100
+
+          //多型态课堂
+          let {lTypeCoop,lTypeIact,lTypeMis,lTypeDif,lTypeTst }=res
+          this.bars.value = [lTypeCoop, lTypeIact, lTypeMis, lTypeDif, lTypeTst]
+          //处理课堂及历程统计
+          let time = new Date()
+          let nowTime = this.timeCycle(time.toLocaleString('en-US',{hour12: false}).split(" "))
+          console.log(nowTime, '时间')
+          let startime = new Date(res.sdate);let targettime=new Date(res.edate)
+          let weekNum = this.calculateWeekNumber(startime, targettime)
+          console.log(weekNum, '第几周')
+          let totalData = []
+          for (let i = 1; i <= weekNum; i++){
+            totalData.push({week:i,class:0,works:0,topic:0,interaction:0,})
+          }
+          //循环数据
+          res.iotData.forEach(item => {
+            let times = new Date(item.year + '-' + item.month + '-' + item.day)
+            let returnWeek = this.calculateWeekNumber(startime, times)
+            console.log(returnWeek,'数据属于第几周')
+            let reresultIndex = totalData.findIndex((item) => { return item.week === returnWeek })
+            console.log(reresultIndex,'下标位置')
+            totalData[reresultIndex].class += item.lessonRecord
+            totalData[reresultIndex].works += item.missionFin
+            totalData[reresultIndex].topic += item.item
+            totalData[reresultIndex].interaction += item.interact
+          });
+          console.log(totalData, '结果')
+          //处理成barandline需要的数据
+          let ultimatelyData = []
+          totalData.forEach((item) => { 
+            let valueData=[item.class,item.works,item.topic,item.interaction]
+            ultimatelyData.push({name:item.week,value:valueData})
+          })
+          console.log(ultimatelyData, '最终数据')
+          this.baldatas=ultimatelyData
+        })
+     },
+     //时间转换
+    timeCycle(times) {
+        let time = times[1]
+        let mdy = times[0]
+        mdy = mdy.split('/')
+        let month = parseInt(mdy[0]);
+        let day = parseInt(mdy[1]);
+        let year = parseInt(mdy[2])
+        return year + '-' + month + '-' + day
+    },
+      //处理时间问题
+     calculateWeekNumber(startDate, targetDate) {
+        const oneDay = 24 * 60 * 60 * 1000; // 一天的毫秒数
+        const daysPassed = Math.round((targetDate - startDate) / oneDay);
+        const weekNumber = Math.ceil((daysPassed + startDate.getDay() + 1) / 7);
+        return weekNumber;
+     },
    }
 }
 </script>

+ 24 - 13
TEAMModelOS/ClientApp/src/view/learnactivity/CreatePrivEva.vue

@@ -178,7 +178,8 @@ export default {
       mode: '',
       selectBefore: [],
       stuList: [],
-      showBack: false
+      showBack: false,
+      isComplete: false,
     }
   },
   methods: {
@@ -477,6 +478,7 @@ export default {
 
       this.$api.learnActivity.SaveExamInfo(requestData).then(
         res => {
+          this.isComplete = true
           if (res.error) {
             // this.$Message.error('API ERROR!')
             this.$Message.error(this.$t('learnActivity.mark.saveErr'))
@@ -735,19 +737,28 @@ export default {
     }
   },
   beforeRouteLeave(to, from, next) {
-    this.$Modal.confirm({
-      title: this.$t('evaluation.newExercise.modalTip'),
-      content: this.$t('learnActivity.createEv.unSaveTip'),
-      cancelText: this.$t('auth.cancel'),
-      onOk: () => {
-        if (to.name == 'answerSheet') {
-          from.meta.isKeep = true
-        } else {
-          from.meta.isKeep = false
-        }
-        next()
+    if(this.isComplete) {
+      if (to.name == 'answerSheet') {
+        from.meta.isKeep = true
+      } else {
+        from.meta.isKeep = false
       }
-    })
+      next()
+    } else {
+      this.$Modal.confirm({
+        title: this.$t('evaluation.newExercise.modalTip'),
+        content: this.$t('learnActivity.createEv.unSaveTip'),
+        cancelText: this.$t('auth.cancel'),
+        onOk: () => {
+          if (to.name == 'answerSheet') {
+            from.meta.isKeep = true
+          } else {
+            from.meta.isKeep = false
+          }
+          next()
+        }
+      })
+    }
   }
 }
 </script>

+ 24 - 13
TEAMModelOS/ClientApp/src/view/learnactivity/CreateSchoolEva.vue

@@ -248,7 +248,8 @@ export default {
             befPeriod: {
                 id: '',
                 name: ''
-            }
+            },
+            isComplete: false
         }
     },
     methods: {
@@ -682,6 +683,7 @@ export default {
             
             this.$api.learnActivity.SaveExamInfo(requestData).then(
                 res => {
+                    this.isComplete = true
                     if (res.error) {
                         // this.$Message.error('API ERROR!')
                         this.$Message.error(this.$t('learnActivity.mark.saveErr'))
@@ -968,19 +970,28 @@ export default {
         }
     },
     beforeRouteLeave(to, from, next) {
-        this.$Modal.confirm({
-            title: this.$t('evaluation.newExercise.modalTip'),
-            content: this.$t('learnActivity.createEv.unSaveTip'),
-            cancelText: this.$t('auth.cancel'),
-            onOk: () => {
-                if (to.name == 'answerSheet') {
-                    from.meta.isKeep = true
-                } else {
-                    from.meta.isKeep = false
-                }
-                next()
+        if(this.isComplete) {
+            if (to.name == 'answerSheet') {
+                from.meta.isKeep = true
+            } else {
+                from.meta.isKeep = false
             }
-        })
+            next()
+        } else {
+            this.$Modal.confirm({
+                title: this.$t('evaluation.newExercise.modalTip'),
+                content: this.$t('learnActivity.createEv.unSaveTip'),
+                cancelText: this.$t('auth.cancel'),
+                onOk: () => {
+                    if (to.name == 'answerSheet') {
+                        from.meta.isKeep = true
+                    } else {
+                        from.meta.isKeep = false
+                    }
+                    next()
+                }
+            })
+        }
     }
 }
 </script>

+ 5 - 2
TEAMModelOS/Controllers/School/SchoolController.cs

@@ -2109,7 +2109,7 @@ namespace TEAMModelOS.Controllers
                 {
                     classCnt = items;
                 }
-                //教師數
+                //教師數
                 int teacherCnt = 0;
                 sql = $"SELECT VALUE COUNT(c.id) FROM c";
                 await foreach (int items in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).GetItemQueryIterator<int>(queryText: sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Teacher-{_schoolId}") }))
@@ -2135,6 +2135,7 @@ namespace TEAMModelOS.Controllers
                 }
 
                 //取得產品分析資訊
+                List<string> tmidList = new List<string>(); ///TMID列表
                 int stuShow = 0; ///學生人次
                 long stuLessonLengMin = 0; ///學生參與總時間數(分)
                 int lessonRecord = 0; ///課堂數
@@ -2171,6 +2172,7 @@ namespace TEAMModelOS.Controllers
                         data.school.areaId = schAreaId;
                         data.school.type = schType;
                         iotData.Add(data);
+                        tmidList = tmidList.Union(data.tmidList).ToList();
                         stuShow += data.stuShow;
                         stuLessonLengMin += data.stuLessonLengMin;
                         lessonRecord += data.lessonRecord;
@@ -2189,6 +2191,7 @@ namespace TEAMModelOS.Controllers
                         lTypeDif += data.lTypeDif;
                     }
                 }
+                int teacherShow = tmidList.Count; ///老師使用人次
                 int htcDevCnt = htcDevList.Count; ///設備統計-HiTeach上線數
                 int htcDevTotalCnt = 0; ///設備統計-HiTeach總設備數
                 sql = $"SELECT VALUE COUNT(1) FROM (SELECT DISTINCT x FROM c JOIN x IN c.deviceList WHERE c.schoolId = '{_schoolId}' AND c.dateUnit = 'day' AND c.toolType = 'HiTeach')";
@@ -2205,7 +2208,7 @@ namespace TEAMModelOS.Controllers
                 }
                 int htccDevCnt = htccDevList.Count; ///設備統計-HiTeachCC上線數
 
-                return Ok(new { sdate=$"{dateFromYear}-{dateFromMonth}-{dateFromDay}", edate=$"{dateToYear}-{dateToMonth}-{dateToDay}", classCnt, teacherCnt, studentCnt, deviceAuthCnt, stuShow, stuLessonLengMin, lessonRecord, lessonLengMin, mission, missionFin, item, interact, htcDevCnt, htcDevTotalCnt, htaDevCnt, htaDevTotalCnt, htccDevCnt, lTypeCoop, lTypeIact, lTypeMis, lTypeTst, lTypeDif, iotData });
+                return Ok(new { sdate=$"{dateFromYear}-{dateFromMonth}-{dateFromDay}", edate=$"{dateToYear}-{dateToMonth}-{dateToDay}", classCnt, teacherCnt, teacherShow, studentCnt, deviceAuthCnt, stuShow, stuLessonLengMin, lessonRecord, lessonLengMin, mission, missionFin, item, interact, htcDevCnt, htcDevTotalCnt, htaDevCnt, htaDevTotalCnt, htccDevCnt, lTypeCoop, lTypeIact, lTypeMis, lTypeTst, lTypeDif, iotData });
             }
             catch (Exception ex)
             {