zengyicheng 1 年之前
父節點
當前提交
66e6b4aa5b

文件差異過大導致無法顯示
+ 466 - 184
src/components/pages/dataBoardNew/student/index.vue


+ 145 - 303
src/components/pages/dataBoardNew/student/studentInfo/index.vue

@@ -1,317 +1,159 @@
 <template>
-    <div class="data_body">
-        <div style="width: 100%; height: 100%">
-            <div id="charts_canvas" class="echart" style="width: 100%; height: 100%; "></div>
-        </div>
+  <div class="data_body">
+    <div style="width: 100%; height: 100%">
+      <div
+        id="charts_canvas"
+        class="echart"
+        style="width: 100%; height: 100%"
+      ></div>
     </div>
+  </div>
 </template>
-  
+
 <script>
 export default {
-    props: {
-        courseArray: {
-            type: Array,
-        },
-    },
-    data() {
-        return {
-            chartObj: null,
-            ooption: {
-                hours: [],
-                days: [],
-                data: [],
-            },
-            option: {
-                tooltip: {
-                    position: 'top',
-                    formatter: function (params) {
-                        // console.log(params);
-                        return params.marker + params.name + ' ' + params.data[1];//params.seriesName + '<br>' + params.
-
-                    }
-                },
-                title: [],
-                singleAxis: [],
-                series: []
-            },
-        };
-    },
-    methods: {
-        // setChart(option) {
-        //     // 雷达图显示的标签
-        //     let newPromise = new Promise((resolve) => {
-        //         resolve();
-        //     });
-        //     //然后异步执行echarts的初始化函数
-        //     newPromise.then(() => {
-        //         const chartObj = this.$echarts.init(
-        //             //劳动课程
-        //             this.$el.querySelector("#charts_canvas")
-        //         );
-        //         const hours = option.hours
-        //         // [
-        //         //     // '语文', '数学', '英语', '科学', '体育', '音乐', '美术',
-        //         //     // '劳动', '其他',
-        //         // ];
-        //         // prettier-ignore
-        //         const days = option.days
-        //         // [
-        //         //     // '一年级', '二年级', '三年级', '四年级', '五年级', '六年级'
-        //         // ];
-        //         // prettier-ignore
-        //         const data = option.data
-        //         // [
-        //         //     // [0, 0, 2], [0, 1, 1], [0, 2, 3], [0, 3, 0], [0, 4, 5], [0, 5, 5], [0, 6, 7], [0, 7, 8], [0, 8, 1],
-        //         //     // [1, 0, 5], [1, 1, 1], [1, 2, 2], [1, 3, 0], [1, 4, 5], [1, 5, 7], [1, 6, 7], [1, 7, 8], [1, 8, 6],
-        //         //     // [2, 0, 5], [2, 1, 2], [2, 2, 0], [2, 3, 2], [2, 4, 1], [2, 5, 5], [2, 6, 4], [2, 7, 4], [2, 8, 1],
-        //         //     // [3, 0, 1], [3, 1, 1], [3, 2, 1], [3, 3, 0], [3, 4, 5], [3, 5, 2], [3, 6, 7], [3, 7, 8], [3, 8, 5],
-        //         //     // [4, 0, 5], [4, 1, 3], [4, 2, 0], [4, 3, 3], [4, 4, 4], [4, 5, 2], [4, 6, 3], [4, 7, 5], [4, 8, 1],
-        //         //     // [5, 0, 5], [5, 1, 1], [5, 2, 0], [5, 3, 0], [5, 4, 5], [5, 5, 5], [5, 6, 7], [5, 7, 8], [5, 8, 3],
-        //         // ];
-        //         const title = [];
-        //         const singleAxis = [];
-        //         const series = [];
-        //         days.forEach(function (day, idx) {
-        //             title.push({
-        //                 textBaseline: 'middle',
-        //                 top: ((idx + 0.5) * 90) / days.length + '%',
-        //                 text: day,
-        //                 textStyle: {
-        //                     fontSize: 12,
-        //                 },
-        //             });
-        //             singleAxis.push({
-        //                 left: 70,
-        //                 type: 'category',
-        //                 boundaryGap: false,
-        //                 data: hours,
-        //                 top: (idx * 90) / days.length + 5 + '%',
-        //                 height: 90 / days.length - 10 + '%'
-        //             });
-        //             series.push({
-        //                 singleAxisIndex: idx,
-        //                 coordinateSystem: 'singleAxis',
-        //                 type: 'scatter',
-        //                 data: [],
-        //                 symbolSize: function (dataItem) {
-        //                     return dataItem[1] * 3;
-        //                 }
-        //             });
-        //         });
-        //         data.forEach(function (dataItem) {
-        //             series[dataItem[0]].data.push([dataItem[1], dataItem[2]]);
-        //         });
-        //         chartObj.off('click')
-        //         let _this = this
-        //         chartObj.on('click', function (param) {  
-        //             //param参数包含的内容有: 
-        //             //param.name:X轴的值 
-        //             //param.data:Y轴的值 
-        //             //param.value:Y轴的值 
-        //             //param.type:点击事件均为click 
-        //             //param.seriesName:legend的名称 
-        //             //param.seriesIndex:系列序号(series中当前图形是第几个图形第几个) 
-        //             //param.dataIndex:数值序列(X轴上当前点是第几个点)
-        //             //alert(param.seriesName);  //legend的名称
-        //             console.log(param);  //X轴的值
-        //             _this.$emit('openCourse',param.componentIndex,param.data[0])
-        //         });
-
-        //         this.option.title = title
-        //         this.option.singleAxis = singleAxis
-        //         this.option.series = series
-        //         // 初始化雷达图
-        //         this.chartObj = chartObj;
-        //         this.chartObj.setOption(this.option);
-        //     });
-        // },
-        setChart(option) {
-            // 雷达图显示的标签
-            let newPromise = new Promise((resolve) => {
-                resolve();
-            });
-            //然后异步执行echarts的初始化函数
-            newPromise.then(() => {
-                const chartObj = this.$echarts.init(
-                    //劳动课程
-                    this.$el.querySelector("#charts_canvas")
-                );
-                const hours = 
-                [
-                    '1班', '2班', '3班', '4班', '5班', '6班'
-                ];
-                // prettier-ignore
-                const days = 
-                [
-                    '一年级', '二年级', '三年级', '四年级', '五年级', '六年级'
-                ];
-                // prettier-ignore
-                const data = 
-                [
-                    [0, 0, 34], [0, 1, 35], [0, 2, 40], [0, 3, 33], [0, 4, 35], [0, 5, 35], 
-                    [1, 0, 34], [1, 1, 30], [1, 2, 35], [1, 3, 41], [1, 4, 42], [1, 5, 37], 
-                    [2, 0, 45], [2, 1, 35], [2, 2, 44], [2, 3, 45], [2, 4, 41], [2, 5, 35], 
-                    [3, 0, 41], [3, 1, 44], [3, 2, 43], [3, 3, 39], [3, 4, 42], [3, 5, 42], 
-                    [4, 0, 34], [4, 1, 36], [4, 2, 40], [4, 3, 0], [4, 4, 0], [4, 5, 0], 
-                    [5, 0, 44], [5, 1, 44], [5, 2, 34], [5, 3, 0], [5, 4, 0], [5, 5, 0],
-                ];
-                const title = [];
-                const singleAxis = [];
-                const series = [];
-                days.forEach(function (day, idx) {
-                    title.push({
-                        textBaseline: 'middle',
-                        top: ((idx + 0.5) * 90) / days.length + '%',
-                        text: day,
-                        textStyle: {
-                            fontSize: 12,
-                        },
-                    });
-                    singleAxis.push({
-                        left: 70,
-                        type: 'category',
-                        boundaryGap: false,
-                        data: hours,
-                        top: (idx * 90) / days.length + 5 + '%',
-                        height: 90 / days.length - 10 + '%'
-                    });
-                    series.push({
-                        singleAxisIndex: idx,
-                        coordinateSystem: 'singleAxis',
-                        type: 'scatter',
-                        data: [],
-                        symbolSize: function (dataItem) {
-                            return dataItem[1];
-                        }
-                    });
-                });
-                data.forEach(function (dataItem) {
-                    series[dataItem[0]].data.push([dataItem[1], dataItem[2]]);
-                });
-                this.option.title = title
-                this.option.singleAxis = singleAxis
-                this.option.series = series
-                // 初始化雷达图
-                this.chartObj = chartObj;
-                this.chartObj.setOption(this.option);
-            });
-        },
-        setJson(array) {
-            this.setChart(this.ooption);
-            if (array != undefined && array.length > 0) {
-                this.ooption = {
-                    hours: [],
-                    days: [],
-                    data: [],
-                }
-                let _grade = []
-                let _subject = []
-                let data = []
+  props: {
+      EloginTimeArray: {
+          type: Array,
+      },
+  },
+  data() {
+      return {
+          chartObj: null,
+          ooption: {
+              xdata: [],
+              data: [],
+          },
+          option: {
+              // title: {
+              //     text: '在线时长',
+              //     textStyle: {
+              //         fontSize: 12,
+              //     },
+              //     padding: [5, 0, 0, 10]
+              // },
+              tooltip: {
+                  trigger: "axis",
+                  axisPointer: {
+                      type: "shadow",
+                  },
+              },
+              dataZoom: [
+                  {
+                      // start: 50,
+                      type: 'inside',
+                      xAxisIndex: 0
+                  },
+                  {
+                      type: 'slider',
+                      xAxisIndex: 0
+                  }
+              ],
+              grid: {
+                  top: '5%',
+                  left: '5%',
+                  right: '10%',
+                  bottom: '10%',
+                  containLabel: true
+              },
+              xAxis: {
+                  type: 'category',
+                  data: [],
+                  // data: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
+              },
 
-                array.forEach(function (item, idx) {
-                    _grade.push(item.name)
-                })
+              yAxis: {
+                  type: 'value',
 
-                array[0].subject.forEach(function (item, idx) {
-                    _subject.push(item.name)
-                })
-                array.forEach(function (item, idx) {
-                    item.subject.forEach(function (item2, idx2) {
-                        data.push([idx, idx2, item2.course])
-                    })
-                })
-                this.ooption.hours = _subject
-                this.ooption.days = _grade
-                this.ooption.data = data
-                if (!this.chartObj) {
-                    this.setChart(this.ooption);
-                } else {
-                    const hours = this.ooption.hours;
-                    // prettier-ignore
-                    const days = this.ooption.days;
-                    // prettier-ignore
-                    const data = this.ooption.data;
-                    const title = [];
-                    const singleAxis = [];
-                    const series = [];
-                    days.forEach(function (day, idx) {
-                        title.push({
-                            textBaseline: 'middle',
-                            top: ((idx + 0.5) * 90) / days.length + '%',
-                            text: day,
-                            textStyle: {
-                                fontSize: 12,
-                            },
-                        });
-                        singleAxis.push({
-                            left: 70,
-                            type: 'category',
-                            boundaryGap: false,
-                            data: hours,
-                            top: (idx * 90) / days.length + 5 + '%',
-                            height: 90 / days.length - 10 + '%'
-                        });
-                        series.push({
-                            singleAxisIndex: idx,
-                            coordinateSystem: 'singleAxis',
-                            type: 'scatter',
-                            data: [],
-                            symbolSize: function (dataItem) {
-                                return dataItem[1] * 3;
-                            }
-                        });
-                    });
-                    data.forEach(function (dataItem) {
-                        series[dataItem[0]].data.push([dataItem[1], dataItem[2]]);
-                    });
+              },
+              series: [
+                  {
+                      name: "在线时长(时)",
+                      type: 'bar',
+                      // data: [180, 50, 70, 90, 100, 130],
+                      data: [],
+                      itemStyle: {
+                          normal: {
+                              color: function (params) {
+                                  return "#106bff";
+                              },
+                          },
+                      },
+                  }
+              ]
+          },
+      };
+  },
+  methods: {
+      setChart(option) {
+          // 雷达图显示的标签
+          let newPromise = new Promise((resolve) => {
+              resolve();
+          });
+          //然后异步执行echarts的初始化函数
+          newPromise.then(() => {
+              const chartObj = this.$echarts.init(
+                  //劳动课程
+                  this.$el.querySelector("#charts_canvas")
+              );
+              this.option.xAxis.data = option.xdata;
+              this.option.series[0].data = option.data;
+              // 初始化雷达图
+              this.chartObj = chartObj;
+              this.chartObj.setOption(this.option);
+          });
+      },
+      setArray(Array) {
+          this.ooption = {
+              xdata: [],
+              data: [],
+          }
+          let _array = Array
+          for (var i = 0; i < _array.length; i++) {
+              this.ooption.xdata.push(_array[i].name)
+              this.ooption.data.push(_array[i].loginTime)
+          }
 
-                    this.option.title = title
-                    this.option.singleAxis = singleAxis
-                    this.option.series = series
-                    this.chartObj.setOption(this.option);
-                }
-            }
-        }
-    },
-    watch: {
-        courseArray: {
-            immediate: true,
-            deep: true,
-            handler(newValue, oldValue) {
-                // newValue = newValue.filter(item => {
-                //     return ['一年级','二年级','三年级','四年级','五年级','六年级','七年级'].indexOf(item.name) !== -1
-                // })
-                this.setJson(newValue)
-                this.$forceUpdate();
-            },
-        },
-    },
-    mounted() {
-        // this.courseArray = this.courseArray.filter(item => {
-        //     return ['一年级','二年级','三年级','四年级','五年级','六年级','七年级'].indexOf(item.name) !== -1
-        // })
-
-        this.setJson(this.courseArray)
-        var _this = this;
-        window.addEventListener("resize", () => {
-            if (_this.chartObj) {
-                _this.chartObj.resize();
-            }
-        });
-    },
+          if (!this.chartObj) {
+              this.setChart(this.ooption);
+          } else {
+              this.option.xAxis.data = this.ooption.xdata;
+              this.option.series[0].data = this.ooption.data;
+              this.chartObj.setOption(this.option);
+          }
+      }
+  },
+  watch: {
+      EloginTimeArray: {
+          immediate: true,
+          deep: true,
+          handler(newValue, oldValue) {
+              this.setArray(newValue)
+              this.$forceUpdate();
+          },
+      },
+  },
+  mounted() {
+      this.setArray(this.EloginTimeArray)
+      var _this = this;
+      window.addEventListener("resize", () => {
+          if (_this.chartObj) {
+              _this.chartObj.resize();
+          }
+      });
+  },
 };
 </script>
-  
+
 <style scoped>
 .data_body {
-    height: 100%;
-    position: relative;
-    border-radius: 5px;
-    margin: 0 auto;
-    box-sizing: border-box;
-    padding: 0;
-    width: 95%;
-    background: #fff;
+  height: 100%;
+  position: relative;
+  border-radius: 5px;
+  margin: 0 auto;
+  box-sizing: border-box;
+  padding: 0;
+  width: 95%;
+  background: #fff;
 }
 </style>
-  

+ 45 - 13
src/components/pages/dataBoardNew/student/studentInfo2/index.vue

@@ -1,17 +1,18 @@
 <template>
   <div class="data_body">
     <div style="width: 100%; height: 100%">
-      <div
-        id="charts_canvas"
-        class="echart"
-        style="width: 100%; height: 100%"
-      ></div>
+      <div id="charts_canvas" class="echart" style="width: 100%; height: 100%"></div>
     </div>
   </div>
 </template>
 
 <script>
 export default {
+  props: {
+    EloginTimeArray: {
+      type: Array,
+    },
+  },
   data() {
     return {
       chartObj: null,
@@ -22,6 +23,13 @@ export default {
         tooltip: {
           trigger: "item",
         },
+        grid: {
+          top: "5%",
+          left: "5%",
+          right: "5%",
+          bottom: "5%",
+          containLabel: true,
+        },
         series: [
           {
             type: "pie",
@@ -35,12 +43,12 @@ export default {
               },
             },
             data: [
-              { value: 100, name: "一年级" },
-              { value: 150, name: "二年级" },
-              { value: 223, name: "三年级" },
-              { value: 216, name: "四年级" },
-              { value: 130, name: "五年级" },
-              { value: 208, name: "六年级" },
+              // { value: 123, name: "一年级" },
+              // { value: 200, name: "二年级" },
+              // { value: 250, name: "三年级" },
+              // { value: 450, name: "四年级" },
+              // { value: 300, name: "五年级" },
+              // { value: 100, name: "六年级" },
             ],
           },
         ],
@@ -48,7 +56,7 @@ export default {
     };
   },
   methods: {
-    setChart() {
+    setChart(option) {
       // 雷达图显示的标签
       let newPromise = new Promise((resolve) => {
         resolve();
@@ -59,16 +67,40 @@ export default {
           //劳动课程
           this.$el.querySelector("#charts_canvas")
         );
+        this.option.series[0].data = this.ooption.data.filter(item => item.value !== 0);
         // 初始化雷达图
         this.chartObj = chartObj;
         this.chartObj.setOption(this.option);
       });
     },
+    setArray(array) {
+      this.ooption = {
+        data: [],
+      };
+      for (var i = 0; i < array.length; i++) {
+        this.ooption.data.push({ value: array[i].loginTime, name: array[i].name });
+      }
+      if (!this.chartObj) {
+        this.setChart(this.ooption);
+      } else {
+        this.option.series[0].data = this.ooption.data;
+        this.chartObj.setOption(this.option);
+      }
+      this.$forceUpdate();
+    },
   },
   watch: {
+    EloginTimeArray: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.setArray(newValue);
+        this.$forceUpdate();
+      },
+    },
   },
   mounted() {
-    this.setChart();
+    this.setArray(this.EloginTimeArray);
     var _this = this;
     window.addEventListener("resize", () => {
       if (_this.chartObj) {

+ 159 - 0
src/components/pages/dataBoardNew/student/studentInfo3/index.vue

@@ -0,0 +1,159 @@
+<template>
+  <div class="data_body">
+    <div style="width: 100%; height: 100%">
+      <div
+        id="charts_canvas"
+        class="echart"
+        style="width: 100%; height: 100%"
+      ></div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+      EworksNumArray: {
+          type: Array,
+      },
+  },
+  data() {
+      return {
+          chartObj: null,
+          ooption: {
+              xdata: [],
+              data: [],
+          },
+          option: {
+              // title: {
+              //     text: '在线时长',
+              //     textStyle: {
+              //         fontSize: 12,
+              //     },
+              //     padding: [5, 0, 0, 10]
+              // },
+              tooltip: {
+                  trigger: "axis",
+                  axisPointer: {
+                      type: "shadow",
+                  },
+              },
+              dataZoom: [
+                  {
+                      // start: 50,
+                      type: 'inside',
+                      xAxisIndex: 0
+                  },
+                  {
+                      type: 'slider',
+                      xAxisIndex: 0
+                  }
+              ],
+              grid: {
+                  top: '5%',
+                  left: '5%',
+                  right: '10%',
+                  bottom: '10%',
+                  containLabel: true
+              },
+              xAxis: {
+                  type: 'category',
+                  data: [],
+                  // data: ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级']
+              },
+
+              yAxis: {
+                  type: 'value',
+
+              },
+              series: [
+                  {
+                      name: "作业数量",
+                      type: 'bar',
+                      // data: [180, 50, 70, 90, 100, 130],
+                      data: [],
+                      itemStyle: {
+                          normal: {
+                              color: function (params) {
+                                  return "#106bff";
+                              },
+                          },
+                      },
+                  }
+              ]
+          },
+      };
+  },
+  methods: {
+      setChart(option) {
+          // 雷达图显示的标签
+          let newPromise = new Promise((resolve) => {
+              resolve();
+          });
+          //然后异步执行echarts的初始化函数
+          newPromise.then(() => {
+              const chartObj = this.$echarts.init(
+                  //劳动课程
+                  this.$el.querySelector("#charts_canvas")
+              );
+              this.option.xAxis.data = option.xdata;
+              this.option.series[0].data = option.data;
+              // 初始化雷达图
+              this.chartObj = chartObj;
+              this.chartObj.setOption(this.option);
+          });
+      },
+      setArray(Array) {
+          this.ooption = {
+              xdata: [],
+              data: [],
+          }
+          let _array = Array
+          for (var i = 0; i < _array.length; i++) {
+              this.ooption.xdata.push(_array[i].name)
+              this.ooption.data.push(_array[i].works)
+          }
+
+          if (!this.chartObj) {
+              this.setChart(this.ooption);
+          } else {
+              this.option.xAxis.data = this.ooption.xdata;
+              this.option.series[0].data = this.ooption.data;
+              this.chartObj.setOption(this.option);
+          }
+      }
+  },
+  watch: {
+      EworksNumArray: {
+          immediate: true,
+          deep: true,
+          handler(newValue, oldValue) {
+              this.setArray(newValue)
+              this.$forceUpdate();
+          },
+      },
+  },
+  mounted() {
+      this.setArray(this.EworksNumArray)
+      var _this = this;
+      window.addEventListener("resize", () => {
+          if (_this.chartObj) {
+              _this.chartObj.resize();
+          }
+      });
+  },
+};
+</script>
+
+<style scoped>
+.data_body {
+  height: 100%;
+  position: relative;
+  border-radius: 5px;
+  margin: 0 auto;
+  box-sizing: border-box;
+  padding: 0;
+  width: 95%;
+  background: #fff;
+}
+</style>

+ 127 - 0
src/components/pages/dataBoardNew/student/studentInfo4/index.vue

@@ -0,0 +1,127 @@
+<template>
+  <div class="data_body">
+    <div style="width: 100%; height: 100%">
+      <div id="charts_canvas" class="echart" style="width: 100%; height: 100%"></div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    EworksNumArray: {
+      type: Array,
+    },
+  },
+  data() {
+    return {
+      chartObj: null,
+      ooption: {
+        data: [],
+      },
+      option: {
+        tooltip: {
+          trigger: "item",
+        },
+        grid: {
+          top: "5%",
+          left: "5%",
+          right: "5%",
+          bottom: "5%",
+          containLabel: true,
+        },
+        series: [
+          {
+            type: "pie",
+            radius: '50%',
+            avoidLabelOverlap: true,
+            emphasis: {
+              label: {
+                show: true,
+                fontSize: 16,
+                fontWeight: "bold",
+              },
+            },
+            data: [
+              // { value: 123, name: "一年级" },
+              // { value: 200, name: "二年级" },
+              // { value: 250, name: "三年级" },
+              // { value: 450, name: "四年级" },
+              // { value: 300, name: "五年级" },
+              // { value: 100, name: "六年级" },
+            ],
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    setChart(option) {
+      // 雷达图显示的标签
+      let newPromise = new Promise((resolve) => {
+        resolve();
+      });
+      //然后异步执行echarts的初始化函数
+      newPromise.then(() => {
+        const chartObj = this.$echarts.init(
+          //劳动课程
+          this.$el.querySelector("#charts_canvas")
+        );
+        this.option.series[0].data = this.ooption.data.filter(item => item.value !== 0);
+        // 初始化雷达图
+        this.chartObj = chartObj;
+        this.chartObj.setOption(this.option);
+      });
+    },
+    setArray(array) {
+      this.ooption = {
+        data: [],
+      };
+      for (var i = 0; i < array.length; i++) {
+        this.ooption.data.push({ value: array[i].works, name: array[i].name });
+      }
+      if (!this.chartObj) {
+        this.setChart(this.ooption);
+      } else {
+        this.option.series[0].data = this.ooption.data;
+        this.chartObj.setOption(this.option);
+      }
+      this.$forceUpdate();
+    },
+  },
+  watch: {
+    EworksNumArray: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.setArray(newValue);
+        this.$forceUpdate();
+      },
+    },
+  },
+  mounted() {
+    this.setArray(this.EworksNumArray);
+    var _this = this;
+    window.addEventListener("resize", () => {
+      if (_this.chartObj) {
+        _this.chartObj.resize();
+      }
+    });
+  },
+};
+</script>
+
+<style scoped>
+.data_body {
+  height: 100%;
+  /* display: flex; */
+  position: relative;
+  border-radius: 5px;
+  /* border: 1px solid #eee; */
+  margin: 0 auto;
+  box-sizing: border-box;
+  padding: 0;
+  width: 95%;
+  background: #fff;
+}
+</style>

+ 29 - 15
src/components/pages/dataBoardNew/teacher/index.vue

@@ -203,7 +203,10 @@
           <div class="allBox">
             <div class="allBox_left">
               <TeaAct v-if="bType == 0" :pusaDep="pusaDep"></TeaAct>
-              <TeaActSecond v-if="bType == 1" :pusaDep="pusaDep1"></TeaActSecond>
+              <TeaActSecond
+                v-if="bType == 1"
+                :pusaDep="pusaDep1"
+              ></TeaActSecond>
             </div>
             <div class="allBox_right" v-if="bType == 0">
               <div class="depth">
@@ -385,7 +388,8 @@
                       lightJson1.gProjectTeachers
                         ? parseInt(
                             (
-                              (lightJson1.gProjectTeachers / lightJson1.teachers) *
+                              (lightJson1.gProjectTeachers /
+                                lightJson1.teachers) *
                               100
                             ).toFixed(0)
                           )
@@ -702,24 +706,34 @@ export default {
           this.teacherNumCountMonthArray = teacherNumCountMonthArray;
           this.teacherLoginCountMonthArray = teacherLoginCountMonthArray;
 
+          let _classList = res.data[24]; //查询学校教研室
           let _workTime = res.data[6]; //查询教研室在线时长
           var mergedArray = [];
-          _workTime.forEach((obj) => {
-            var foundItem = mergedArray.find((item) => item.name === obj.name);
-            if (foundItem) {
-              foundItem.text = String(
-                Number(foundItem.text) + Number(obj.text)
-              );
-            } else {
-              mergedArray.push({ name: obj.name, text: obj.text });
+
+          for (var i = 0; i < _classList.length; i++) {
+            mergedArray.push({
+              id: _classList[i].id,
+              name: _classList[i].name,
+              text: 0,
+            });
+            for (let j = 0; j < _workTime.length; j++) {
+              const _user = _workTime[j];
+              if (_classList[i].id == _user.cclassid) {
+                mergedArray[i].text += Number(_user.text);
+              }
             }
-          });
-          mergedArray.forEach((obj) => {
-            obj.text = (Number(obj.text) / 3600).toFixed(2); // 秒转小时,并保留两位小数
-          });
+            mergedArray[i].text = (mergedArray[i].text / 60 / 60).toFixed(2); //换算成小时
+          }
           this.workTime = mergedArray;
 
-          this.allTime = parseInt(res.data[7][0].time) / 60 / 60;
+          var _allTime = 0;
+
+          for(var i = 0;i<mergedArray.length;i++){
+            _allTime +=  Number(mergedArray[i].text);
+          }
+
+          // this.allTime = parseInt(res.data[7][0].time) / 60 / 60;
+          this.allTime = _allTime;
 
           let allLoginCount = res.data[8]; //一年的登录频次
           let loginCountYearArray = [];

部分文件因文件數量過多而無法顯示