lsc 1 년 전
부모
커밋
618297381f

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.39e940c521bcba9085038748c20a50d8.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.b01159b52abeac4e6216.js></script><script type=text/javascript src=./static/js/app.0bf84702ff069aa7b96c.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.66446d3e686ba1ea44ab6ae51054d13d.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.b01159b52abeac4e6216.js></script><script type=text/javascript src=./static/js/app.495f5f20b1f2f0e429b3.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/css/app.66446d3e686ba1ea44ab6ae51054d13d.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/css/app.66446d3e686ba1ea44ab6ae51054d13d.css.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/js/app.495f5f20b1f2f0e429b3.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/js/app.495f5f20b1f2f0e429b3.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 165 - 0
src/components/pages/dataBoardNew/course/chartList/bar2.vue

@@ -0,0 +1,165 @@
+<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: {
+    workList: {
+      type: Array,
+    },
+  },
+  data() {
+    return {
+      chartObj: null,
+      ooption: {
+        xdata: [],
+        type: [],
+      },
+      option: {
+        title: {
+          text: "作业数量",
+          textStyle: {
+            fontSize: 12,
+          },
+          padding: [10, 0, 0, 10],
+        },
+        tooltip: {
+          trigger: "axis",
+          axisPointer: {
+            type: "shadow",
+          },
+        },
+        dataZoom: [
+          {
+            // start: 50,
+            type: "inside",
+            yAxisIndex: 0,
+          },
+          {
+            type: "slider",
+            yAxisIndex: 0,
+          },
+        ],
+        grid: {
+          top: "10%",
+          left: "5%",
+          right: "5%",
+          bottom: "5%",
+          containLabel: true,
+        },
+        xAxis: {
+          type: "value",
+          boundaryGap: [0, 0.01],
+        },
+        yAxis: {
+          type: "category",
+          // data: ["六年级", "五年级", "四年级", "三年级", "二年级", "一年级"],
+          data: [],
+        },
+        series: [
+          {
+            name: "作业数量(个)",
+            type: "bar",
+            // data: [60, 110, 25, 130, 65, 80],
+            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.yAxis.data = option.xdata;
+        this.option.series[0].data = option.type;
+        // 初始化雷达图
+        this.chartObj = chartObj;
+        this.chartObj.setOption(this.option);
+      });
+    },
+  },
+  watch: {
+    workList: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.ooption = {
+          xdata: [],
+          type: [],
+        };
+        let _array = newValue;
+        for (var i = 0; i < _array.length; i++) {
+          this.ooption.xdata.push(_array[i].name);
+          this.ooption.type.push(_array[i].time);
+        }
+
+        if (!this.chartObj) {
+          this.setChart(this.ooption);
+        } else {
+          this.option.yAxis.data = this.ooption.xdata;
+          this.option.series[0].data = this.ooption.type;
+          this.chartObj.setOption(this.option);
+        }
+        this.$forceUpdate();
+      },
+    },
+  },
+  mounted() {
+    this.ooption = {
+      xdata: [],
+      type: [],
+    };
+    let _array = this.workList;
+    for (var i = 0; i < _array.length; i++) {
+      this.ooption.xdata.push(_array[i].name);
+      this.ooption.type.push(_array[i].time);
+    }
+    this.setChart(this.ooption);
+    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>

+ 3 - 3
src/components/pages/dataBoardNew/course/chartList/courseNum.vue

@@ -78,7 +78,7 @@ export default {
                 if(optimizedEmployee > employee){
                   employeePercentage = ((optimizedEmployee - employee) / optimizedEmployee) * 100
                 }
-                if (this.series.name === '本课程总数') {
+                if (this.series.name === '本课程总数') {
                   return  employeePercentage.toFixed(1) + '%';
                 } else {
                   return '';
@@ -88,13 +88,13 @@ export default {
           }
         },
         series: [{
-          name: '上课程总数',
+          name: '上课程总数',
           color: 'rgba(165,170,217,1)',
           data: [],
           pointPadding: 0.3, // 通过 pointPadding 和 pointPlacement 控制柱子位置
           // pointPlacement: -0.2
         }, {
-          name: '本课程总数',
+          name: '本课程总数',
           color: 'rgba(126,86,134,.9)',
           data: [],
           pointPadding: 0.4,

+ 206 - 0
src/components/pages/dataBoardNew/course/chartList/toolUse2.vue

@@ -0,0 +1,206 @@
+<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: {
+    yearArray: {
+      type: Array,
+    },
+  },
+  data() {
+    return {
+      chartObj: null,
+      ooption: {
+        xdata: [],
+        sdata: [],
+      },
+      option: {
+        // title: {
+        //   text: '登录频次',
+        //   textStyle: {
+        //     fontSize: 12,
+        //   },
+        //   padding: [10, 0, 0, 10]
+        // },
+        tooltip: {
+          position: 'top'
+        },
+        grid: {
+          top: '50',
+          left: '5%',
+          right: '5%',
+          bottom: '5%',
+          containLabel: true
+        },
+        xAxis: {
+          type: 'category',
+          // data: [
+          //     '1月', '2月', '3月', '4月', '5月', '6月', '7月',
+          //     '8月', '9月', '10月', '11月', '12月'
+          // ],
+          data: [],
+          splitArea: {
+            show: true
+          },
+          axisLabel: {
+            formatter: function (value) {
+              console.log(value);
+              var ret = "";//拼接加\n返回的类目项  
+              var maxLength = 2;//每项显示文字个数  
+              var valLength = value.length;//X轴类目项的文字个数  
+              var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数  
+              if (rowN > 1)//如果类目项的文字大于5,  
+              {
+                for (var i = 0; i < rowN; i++) {
+                  var temp = "";//每次截取的字符串  
+                  var start = i * maxLength;//开始截取的位置  
+                  var end = start + maxLength;//结束截取的位置  
+                  //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧  
+                  temp = value.substring(start, end) + "\n";
+                  ret += temp; //凭借最终的字符串  
+                }
+                return ret;
+              }
+              else {
+                return value;
+              }
+            }
+          }
+        },
+        yAxis: {
+          type: 'category',
+          data: [
+            '星期天', '星期一', '星期二', '星期三',
+            '星期四', '星期五', '星期六',
+          ],
+          splitArea: {
+            show: true
+          },
+        },
+        visualMap: {
+          min: 0,
+          max: 10,
+          calculable: true,
+          orient: 'horizontal',
+          right: '10',
+          top: '0%'
+        },
+        series: [
+          {
+            name: '',
+            type: 'heatmap',
+            data: [],
+            label: {
+              show: true
+            },
+            emphasis: {
+              itemStyle: {
+                shadowBlur: 10,
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
+              }
+            }
+          }
+        ]
+      },
+    };
+  },
+  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.sdata;
+        this.option.visualMap.max = option.max ? option.max : 0;
+        // 初始化雷达图
+        this.chartObj = chartObj;
+        this.chartObj.setOption(this.option);
+      });
+    },
+    setJson(array) {
+      this.ooption = {
+        xdata: [],
+        sdata: [],
+        max: 0
+      }
+      let _array = array
+      let max = []
+      for (var i = 0; i < _array.length; i++) {
+        this.ooption.xdata.push(_array[i].Month + '月')
+        this.ooption.sdata.push([i, 0, _array[i].sun])
+        this.ooption.sdata.push([i, 1, _array[i].mon])
+        this.ooption.sdata.push([i, 2, _array[i].tue])
+        this.ooption.sdata.push([i, 3, _array[i].wed])
+        this.ooption.sdata.push([i, 4, _array[i].thur])
+        this.ooption.sdata.push([i, 5, _array[i].fri])
+        this.ooption.sdata.push([i, 6, _array[i].sat])
+        // let _data = [_array[i].Month-1,] //[月份,星期,值]
+        max.push(_array[i].sun)
+        max.push(_array[i].mon)
+        max.push(_array[i].tue)
+        max.push(_array[i].wed)
+        max.push(_array[i].thur)
+        max.push(_array[i].fri)
+        max.push(_array[i].sat)
+      }
+      this.ooption.max = max.sort(function (a, b) {
+        return b - a;
+      })[0];
+      if (!this.chartObj) {
+        this.setChart(this.ooption);
+      } else {
+        this.option.xAxis.data = this.ooption.xdata;
+        this.option.series[0].data = this.ooption.sdata;
+        this.option.visualMap.max = this.ooption.max ? this.ooption.max : 0;
+        this.chartObj.setOption(this.option);
+      }
+    }
+  },
+  watch: {
+    yearArray: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.setJson(newValue)
+        this.$forceUpdate();
+      },
+    },
+  },
+  mounted() {
+    this.setJson(this.yearArray)
+
+    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>

+ 176 - 39
src/components/pages/dataBoardNew/course/index.vue

@@ -18,7 +18,9 @@
             </div>
             <div class="info blueBG">
               <span>本月新增课程环比</span>
-              <span v-if="loginCountMonthArray.length">{{ (loginCountMonthArray[loginCountMonthArray.length - 1].course) > 0 ? (((loginCountMonthArray[loginCountMonthArray.length - 1].course) / allCourse) * 100).toFixed(0) + '%' : 0 }}</span>
+              <span v-if="loginCountMonthArray.length">{{ (loginCountMonthArray[loginCountMonthArray.length - 1].course) >
+                0 ? (((loginCountMonthArray[loginCountMonthArray.length - 1].course) / allCourse) * 100).toFixed(0) + '%'
+                : 0 }}</span>
               <!-- <span>{{ weekCount }}</span> -->
               <!-- <span v-if="loginCountMonthArray.length">{{
                 loginCountMonthArray[loginCountMonthArray.length - 1].course -
@@ -118,15 +120,26 @@
               }}</span>
             </div>
           </div>
-          <Bar style="height: calc(100% - 70px)" v-if="skType == 0" :workList="tedurArray"></Bar>
-          <ToolUse style="height: calc(100% - 70px)" v-if="skType == 1" :yearArray="courseWorksCountYearArray"></ToolUse>
-          <!-- <div class="otherCss">
+          <Bar style="height: calc(100% - 70px)" v-if="skType == 0 && !oType" :workList="tedurArray"></Bar>
+          <!-- <ToolUse2 style="height: calc(100% - 100px)" v-if="skType == 0 && oType" :yearArray="courseWorksCountYearArray"></ToolUse2> -->
+
+          <ToolUse style="height: calc(100% - 100px)" v-if="skType == 1 && !oType2"
+            :yearArray="courseWorksCountYearArray"></ToolUse>
+          <Bar2 style="height: calc(100% - 100px)" v-if="skType == 1 && oType2" :workList="tedurArray2"></Bar2>
+          <!-- <div class="otherCss" v-if="skType == 0">
             <div v-if="!oType">切换为柱状图</div>
             <div v-if="oType">切换为热力图</div>
             <div class="otherImg" @click="otherEchart">
               <img src="../../../../assets/icon/other.png" alt="" />
             </div>
           </div> -->
+          <div class="otherCss" v-if="skType == 1">
+            <div v-if="!oType2">切换为热力图</div>
+            <div v-if="oType2">切换为柱状图</div>
+            <div class="otherImg" @click="otherEchart2">
+              <img src="../../../../assets/icon/other.png" alt="" />
+            </div>
+          </div>
         </div>
       </div>
     </div>
@@ -161,10 +174,10 @@
                 <span>已提交作业</span>
                 <div>
                   <el-progress :width="80" type="circle" :percentage="allCourse
-                      ? parseInt(
-                        ((haveWorksCourse / allCourse) * 100).toFixed(0)
-                      )
-                      : 0
+                    ? parseInt(
+                      ((haveWorksCourse / allCourse) * 100).toFixed(0)
+                    )
+                    : 0
                     " :stroke-width="5" :format="format" color="#106BFF"></el-progress>
                 </div>
               </div>
@@ -172,8 +185,8 @@
                 <span>设置评价</span>
                 <div>
                   <el-progress :width="80" type="circle" :percentage="allCourse
-                      ? parseInt(((evaCount / allCourse) * 100).toFixed(0))
-                      : 0
+                    ? parseInt(((evaCount / allCourse) * 100).toFixed(0))
+                    : 0
                     " :stroke-width="5" :format="format" color="#106BFF"></el-progress>
                 </div>
               </div>
@@ -181,10 +194,10 @@
                 <span>已评价课程</span>
                 <div>
                   <el-progress :width="80" type="circle" :percentage="allCourse
-                      ? parseInt(
-                        ((evaWorksCount / allCourse) * 100).toFixed(0)
-                      )
-                      : 0
+                    ? parseInt(
+                      ((evaWorksCount / allCourse) * 100).toFixed(0)
+                    )
+                    : 0
                     " :stroke-width="5" :format="format" color="#106BFF"></el-progress>
                 </div>
               </div>
@@ -192,10 +205,10 @@
                 <span>教学评一体化</span>
                 <div>
                   <el-progress :width="80" type="circle" :percentage="allCourse
-                      ? parseInt(
-                        ((evaWorksCount / allCourse) * 100).toFixed(0)
-                      )
-                      : 0
+                    ? parseInt(
+                      ((evaWorksCount / allCourse) * 100).toFixed(0)
+                    )
+                    : 0
                     " :stroke-width="5" :format="format" color="#106BFF"></el-progress>
                 </div>
               </div>
@@ -296,12 +309,14 @@
 <script>
 import TeaFre from "./chartList/teaFre.vue";
 import ToolUse from "./chartList/toolUse.vue";
+import ToolUse2 from "./chartList/toolUse2.vue";
 import CateRank from "./chartList/cateRank.vue";
 import WorkNum from "./chartList/workNum.vue";
 import CourseTime from "./chartList/courseTime.vue";
 import CourseAna from "./chartList/courseAna.vue";
 import WorkTime from "./chartList/workTime.vue";
 import Bar from "./chartList/bar.vue";
+import Bar2 from "./chartList/bar2.vue";
 import CourseNum from "./chartList/courseNum.vue";
 import ToolChart from "./chartList/toolChart.vue";
 import Subjuect from "./chartList/subjuect.vue";
@@ -309,12 +324,14 @@ export default {
   components: {
     TeaFre,
     ToolUse,
+    ToolUse2,
     CateRank,
     WorkNum,
     CourseTime,
     CourseAna,
     WorkTime,
     Bar,
+    Bar2,
     CourseNum,
     ToolChart,
     Subjuect,
@@ -339,6 +356,7 @@ export default {
       courseType: 0,
       sType: 0,
       oType: false,
+      oType2: false,
       shType: true,
       xtType: false,
       allCourse: 0,
@@ -348,6 +366,7 @@ export default {
       lType1: "grade",
       allTimeList: [],
       tedurArray: [],
+      tedurArray2: [],
       classList: [],
       subjectList: [],
       themeList: [],
@@ -400,6 +419,9 @@ export default {
     otherEchart() {
       this.oType = !this.oType;
     },
+    otherEchart2() {
+      this.oType2 = !this.oType2;
+    },
     shEchart() {
       this.shType = !this.shType;
     },
@@ -409,6 +431,50 @@ export default {
     format(percentage) {
       return percentage + "%";
     },
+    getMonth() {
+      // 获取当前时间
+      var currentDate = new Date();
+
+      // 获取本月的年份和月份
+      var currentYear = currentDate.getFullYear();
+      var currentMonth = currentDate.getMonth() + 1; // 月份从0开始,需要加1
+
+      // 获取上个月的年份和月份
+      var lastMonthYear, lastMonth;
+      if (currentMonth === 1) {
+        lastMonthYear = currentYear - 1;
+        lastMonth = 12;
+      } else {
+        lastMonthYear = currentYear;
+        lastMonth = currentMonth - 1;
+      }
+      // 获取本月的第一天和最后一天的日期
+      var firstDayOfMonth = new Date(currentYear, currentMonth - 1, 1);
+      var lastDayOfMonth = new Date(currentYear, currentMonth, 0);
+
+      // 获取上个月的第一天和最后一天的日期
+      var firstDayOfLastMonth = new Date(lastMonthYear, lastMonth - 1, 1);
+      var lastDayOfLastMonth = new Date(lastMonthYear, lastMonth, 0);
+
+      // 构建本月日期的数组
+      var currentMonthDates = [];
+      for (var i = 1; i <= lastDayOfMonth.getDate(); i++) {
+        let a = new Date(currentYear, currentMonth - 1, i)
+        currentMonthDates.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+      }
+
+      // 构建上个月日期的数组
+      var lastMonthDates = [];
+      for (var j = firstDayOfLastMonth.getDate(); j <= lastDayOfLastMonth.getDate(); j++) {
+        let a = new Date(lastMonthYear, lastMonth - 1, j)
+        lastMonthDates.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+      }
+
+      return {
+        lastWeek: lastMonthDates,//上月
+        toWeek: currentMonthDates //本月
+      }
+    },
     typeChange1() {
       var a = [];
       if (this.lType == "all") {
@@ -469,6 +535,7 @@ export default {
         }
       }
       courseWorksCountYearArray = courseWorksCountYearArray.reverse();
+
       for (var i = 0; i < this.allCourseWorks.length; i++) {
         let _date = new Date(this.allCourseWorks[i].create_at);
         let _type = this.allCourseWorks[i].typeid;
@@ -533,7 +600,7 @@ export default {
             }
           }
         } else if (this.lType1 == "grade") {
-          if (this.gradeList.indexOf(this.allCourseWorks[i].typeid)) {
+          if (this.gradeList.indexOf(this.allCourseWorks[i].typeid) != -1) {
             if (this.allCourseWorks[i].id) {
               worksCount++;
             }
@@ -548,7 +615,7 @@ export default {
             }
           }
         } else if (this.lType1 == "subject") {
-          if (this.subjectList2.indexOf(this.allCourseWorks[i].typeid)) {
+          if (this.subjectList2.indexOf(this.allCourseWorks[i].typeid) != -1) {
             if (this.allCourseWorks[i].id) {
               worksCount++;
             }
@@ -563,7 +630,7 @@ export default {
             }
           }
         } else {
-          if (this.thList.indexOf(this.allCourseWorks[i].typeid)) {
+          if (this.thList.indexOf(this.allCourseWorks[i].typeid) != -1) {
             if (this.allCourseWorks[i].id) {
               worksCount++;
             }
@@ -579,6 +646,75 @@ export default {
           }
         }
       }
+
+
+
+      var courseJson = this.allCourseWorks
+      let _allTime = JSON.parse(JSON.stringify(this.allTimeList)).filter(el => {
+        el.time = 0
+        return el
+      })
+      let _grade = JSON.parse(JSON.stringify(this.classList)).filter(el => {
+        el.time = 0
+        return el
+      })
+      let _subject = JSON.parse(JSON.stringify(this.subjectList)).filter(el => {
+        el.time = 0
+        return el
+      })
+      let _themeList = JSON.parse(JSON.stringify(this.themeList)).filter(el => {
+        el.time = 0
+        return el
+      })
+
+      for (var i = 0; i < courseJson.length; i++) {
+        for (var j = 0; j < _allTime.length; j++) {
+          if (courseJson[i].typeid.indexOf(_allTime[j].id) != -1) {
+            if (_allTime[j].time) {
+              _allTime[j].time += 1;
+            } else {
+              _allTime[j].time = 1;
+            }
+          }
+        }
+        for (var j = 0; j < _grade.length; j++) {
+          if (courseJson[i].typeid.indexOf(_grade[j].id) != -1) {
+            if (_grade[j].time) {
+              _grade[j].time += 1;
+            } else {
+              _grade[j].time = 1;
+            }
+          }
+        }
+        for (var k = 0; k < _subject.length; k++) {
+          if (courseJson[i].typeid.indexOf(_subject[k].id) != -1) {
+            if (_subject[k].time ) {
+              _subject[k].time += 1;
+            } else {
+              _subject[k].time = 1;
+            }
+          }
+        }
+        for (var l = 0; l < _themeList.length; l++) {
+          if (courseJson[i].typeid.indexOf(_themeList[l].id) != -1) {
+            if (_themeList[l].time) {
+              _themeList[l].time += 1;
+            } else{
+              _themeList[l].time = 1;
+            }
+          }
+        }
+      }
+
+      if (this.lType1 == "all") {
+        this.tedurArray2 = _allTime;
+      } else if (this.lType1 == "grade") {
+        this.tedurArray2 = _grade;
+      } else if (this.lType1 == "subject") {
+        this.tedurArray2 = _subject;
+      } else {
+        this.tedurArray2 = _themeList;
+      }
       this.courseWorksCountYearArray = courseWorksCountYearArray;
       this.worksCount = worksCount;
       this.haveWorksCourse = haveWorksCourse.length;
@@ -715,7 +851,7 @@ export default {
               }
             }
           }
-          
+
           this.allTimeList = _allTime;
           this.classList = _grade;
           this.subjectList = _subject;
@@ -1099,27 +1235,29 @@ export default {
             lastWeek: [], //上周
             toWeek: [], //本周
           };
-          for (var i = 0; i < 14; i++) {
-            let time = JSON.parse(JSON.stringify(lastDayOfWeek));
-            let time2 = new Date(time);
-            var a = new Date(time2.setDate(time2.getDate() - i));
-            if (i > 6) {
-              weekArray.lastWeek.push(
-                a.getFullYear() + "-" + (a.getMonth() + 1) + "-" + a.getDate()
-              );
-            } else {
-              weekArray.toWeek.push(
-                a.getFullYear() + "-" + (a.getMonth() + 1) + "-" + a.getDate()
-              );
-            }
-          }
+          // for (var i = 0; i < 14; i++) {
+          //   let time = JSON.parse(JSON.stringify(lastDayOfWeek));
+          //   let time2 = new Date(time);
+          //   var a = new Date(time2.setDate(time2.getDate() - i));
+          //   if (i > 6) {
+          //     weekArray.lastWeek.push(
+          //       a.getFullYear() + "-" + (a.getMonth() + 1) + "-" + a.getDate()
+          //     );
+          //   } else {
+          //     weekArray.toWeek.push(
+          //       a.getFullYear() + "-" + (a.getMonth() + 1) + "-" + a.getDate()
+          //     );
+          //   }
+          // }
+          weekArray = this.getMonth()
+
           let weekCourse = [];
           let weekCourse2 = [];
           let lastWeekCouseCount = 0;
           let toWeekCouseCount = 0;
           for (var z = 0; z < _course.length; z++) {
             let _date = new Date(
-              weekArray.lastWeek[weekArray.lastWeek.length - 1]
+              weekArray.lastWeek[0]
             );
             if (
               new Date(_course[z].create_at) > _date &&
@@ -1495,5 +1633,4 @@ export default {
 .blueBG {
   background: rgb(243, 248, 253);
   border: 2px solid rgb(234, 246, 255);
-}
-</style>
+}</style>

+ 1 - 0
src/components/pages/dataBoardNew/index.vue

@@ -6,6 +6,7 @@
         <div v-if="type == 1">综合数据中心</div>
         <div v-if="type == 2">课程数据中心</div>
         <div v-if="type == 3">学生数据中心</div>
+        <div v-if="type == 5">项目数据中心</div>
         <div v-if="type == 4">教师数据中心</div>
       </div>
       <div class="db_check">

+ 3 - 3
src/components/pages/dataBoardNew/project/chartList/courseNum.vue

@@ -78,7 +78,7 @@ export default {
                 if(optimizedEmployee > employee){
                   employeePercentage = ((optimizedEmployee - employee) / optimizedEmployee) * 100
                 }
-                if (this.series.name === '本课程总数') {
+                if (this.series.name === '本课程总数') {
                   return  employeePercentage.toFixed(1) + '%';
                 } else {
                   return '';
@@ -88,13 +88,13 @@ export default {
           }
         },
         series: [{
-          name: '上课程总数',
+          name: '上课程总数',
           color: 'rgba(165,170,217,1)',
           data: [],
           pointPadding: 0.3, // 通过 pointPadding 和 pointPlacement 控制柱子位置
           // pointPlacement: -0.2
         }, {
-          name: '本课程总数',
+          name: '本课程总数',
           color: 'rgba(126,86,134,.9)',
           data: [],
           pointPadding: 0.4,

+ 56 - 12
src/components/pages/dataBoardNew/project/index.vue

@@ -353,6 +353,50 @@ export default {
     format(percentage) {
       return percentage + '%';
     },
+    getMonth() {
+      // 获取当前时间
+      var currentDate = new Date();
+
+      // 获取本月的年份和月份
+      var currentYear = currentDate.getFullYear();
+      var currentMonth = currentDate.getMonth() + 1; // 月份从0开始,需要加1
+
+      // 获取上个月的年份和月份
+      var lastMonthYear, lastMonth;
+      if (currentMonth === 1) {
+        lastMonthYear = currentYear - 1;
+        lastMonth = 12;
+      } else {
+        lastMonthYear = currentYear;
+        lastMonth = currentMonth - 1;
+      }
+      // 获取本月的第一天和最后一天的日期
+      var firstDayOfMonth = new Date(currentYear, currentMonth - 1, 1);
+      var lastDayOfMonth = new Date(currentYear, currentMonth, 0);
+
+      // 获取上个月的第一天和最后一天的日期
+      var firstDayOfLastMonth = new Date(lastMonthYear, lastMonth - 1, 1);
+      var lastDayOfLastMonth = new Date(lastMonthYear, lastMonth, 0);
+
+      // 构建本月日期的数组
+      var currentMonthDates = [];
+      for (var i = 1; i <= lastDayOfMonth.getDate(); i++) {
+        let a = new Date(currentYear, currentMonth - 1, i)
+        currentMonthDates.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+      }
+
+      // 构建上个月日期的数组
+      var lastMonthDates = [];
+      for (var j = firstDayOfLastMonth.getDate(); j <= lastDayOfLastMonth.getDate(); j++) {
+        let a = new Date(lastMonthYear, lastMonth - 1, j)
+        lastMonthDates.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+      }
+
+      return {
+        lastWeek: lastMonthDates,//上月
+        toWeek: currentMonthDates //本月
+      }
+    },
     getData() {
       this.isLoading = true;
       let params = [
@@ -487,17 +531,17 @@ export default {
             lastWeekCouseCount: 0,
             toWeekCouseCount: 0
           }]
-          for (var i = 0; i < 14; i++) {
-            let time = JSON.parse(JSON.stringify(lastDayOfWeek))
-            let time2 = new Date(time)
-            var a = new Date(time2.setDate(time2.getDate() - i));
-            if (i > 6) {
-              weekArray.lastWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
-            } else {
-              weekArray.toWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
-            }
-          }
-
+          // for (var i = 0; i < 14; i++) {
+          //   let time = JSON.parse(JSON.stringify(lastDayOfWeek))
+          //   let time2 = new Date(time)
+          //   var a = new Date(time2.setDate(time2.getDate() - i));
+          //   if (i > 6) {
+          //     weekArray.lastWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+          //   } else {
+          //     weekArray.toWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+          //   }
+          // }
+          weekArray = this.getMonth()
           var _tsArray = {
             tt: 0,
             ts: 0,
@@ -506,7 +550,7 @@ export default {
 
           for (var i = 0; i < _workCourse.length; i++) {
             if (!wList[_workCourse[i].courseId]) {
-              let _date = new Date(weekArray.lastWeek[weekArray.lastWeek.length - 1])
+              let _date = new Date(weekArray.lastWeek[0])
               if (new Date(_workCourse[i].create_at) > _date) {
                 var a = new Date(_workCourse[i].create_at)
                 var string = a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate()

+ 3 - 3
src/components/pages/dataBoardNew/school/courseNum/index.vue

@@ -78,7 +78,7 @@ export default {
                 if(optimizedEmployee > employee){
                   employeePercentage = ((optimizedEmployee - employee) / optimizedEmployee) * 100
                 }
-                if (this.series.name === '本课程总数') {
+                if (this.series.name === '本课程总数') {
                   return  employeePercentage.toFixed(1) + '%';
                 } else {
                   return '';
@@ -88,13 +88,13 @@ export default {
           }
         },
         series: [{
-          name: '上课程总数',
+          name: '上课程总数',
           color: 'rgba(165,170,217,1)',
           data: [],
           pointPadding: 0.3, // 通过 pointPadding 和 pointPlacement 控制柱子位置
           // pointPlacement: -0.2
         }, {
-          name: '本课程总数',
+          name: '本课程总数',
           color: 'rgba(126,86,134,.9)',
           data: [],
           pointPadding: 0.4,

+ 70 - 17
src/components/pages/dataBoardNew/school/index.vue

@@ -29,7 +29,9 @@
             </div>
             <div class="info blueBG">
               <span>月登录环比</span>
-              <span v-if="loginCountMonthArray.length">{{ (loginCountMonthArray[loginCountMonthArray.length - 1].user) > 0 ? (((loginCountMonthArray[loginCountMonthArray.length - 1].user) / allUser) * 100).toFixed(0) + '%' : 0 }}</span>
+              <span v-if="loginCountMonthArray.length">{{ (loginCountMonthArray[loginCountMonthArray.length - 1].user) > 0
+                ? (((loginCountMonthArray[loginCountMonthArray.length - 1].user) / allUser) * 100).toFixed(0) + '%' : 0
+              }}</span>
               <!-- <span v-if="loginCountMonthArray.length">{{ (loginCountMonthArray[loginCountMonthArray.length - 1].user -
                 loginCountMonthArray[loginCountMonthArray.length - 2].user) < 0 ? 0 :
                 (((loginCountMonthArray[loginCountMonthArray.length - 1].user -
@@ -84,11 +86,13 @@
         </div>
         <div class="dataBox" style="height: calc(100% - 135px);">
           <!-- 登录频次热力图 -->
-          <toolUser style="height: calc(100%)" v-if="skType == 1 && !oType1" :yearArray="loginCountYearArray"></toolUser> 
+          <toolUser style="height: calc(100%)" v-if="skType == 1 && !oType1" :yearArray="loginCountYearArray"></toolUser>
           <!-- 登录频次柱状图 -->
-          <toolUserBar style="height: calc(100%)" v-if="skType == 1 && oType1" :loginArray="[teacherLoginCount, studentLoginCount]"></toolUserBar>
+          <toolUserBar style="height: calc(100%)" v-if="skType == 1 && oType1"
+            :loginArray="[teacherLoginCount, studentLoginCount]"></toolUserBar>
           <!-- 在线时长柱状图 -->
-          <bar style="height: calc(100%)" v-if="skType == 0 && !oType" :loginArray="[teacherOnlineTime, studentOnlineTime]"></bar>
+          <!-- <bar style="height: calc(100%)" v-if="skType == 0 && !oType" :loginArray="[teacherOnlineTime, studentOnlineTime]"></bar> -->
+          <loginTime style="height: calc(100%)" v-if="skType == 0 && !oType" :yearArray="userOnlineTime"></loginTime>
           <!-- 在线时长热力图 -->
           <barToolUser style="height: calc(100%)" v-if="skType == 0 && oType" :yearArray="allTimeYearArray"></barToolUser>
           <div class="otherCss" v-if="skType == 0">
@@ -336,6 +340,7 @@ import courseNum from "./courseNum";
 import workNum from "./workNum";
 import barToolUser from "./barToolUser";
 import toolUserBar from "./toolUserBar";
+import loginTime from "./loginTime";
 
 
 
@@ -351,6 +356,7 @@ export default {
     workNum,
     barToolUser,
     toolUserBar,
+    loginTime
   },
   props: {
     oid: {
@@ -380,7 +386,7 @@ export default {
       loginCountMonthArray: [],
       countLogin: 0,
       loginCountYearArray: [],
-      userOnlineTime: [],
+      userOnlineTime: '',
       teacherOnlineTime: [],
       studentOnlineTime: [],
       courseArray: [],
@@ -433,6 +439,50 @@ export default {
     format(percentage) {
       return percentage + '%';
     },
+    getMonth() {
+      // 获取当前时间
+      var currentDate = new Date();
+
+      // 获取本月的年份和月份
+      var currentYear = currentDate.getFullYear();
+      var currentMonth = currentDate.getMonth() + 1; // 月份从0开始,需要加1
+
+      // 获取上个月的年份和月份
+      var lastMonthYear, lastMonth;
+      if (currentMonth === 1) {
+        lastMonthYear = currentYear - 1;
+        lastMonth = 12;
+      } else {
+        lastMonthYear = currentYear;
+        lastMonth = currentMonth - 1;
+      }
+      // 获取本月的第一天和最后一天的日期
+      var firstDayOfMonth = new Date(currentYear, currentMonth - 1, 1);
+      var lastDayOfMonth = new Date(currentYear, currentMonth, 0);
+
+      // 获取上个月的第一天和最后一天的日期
+      var firstDayOfLastMonth = new Date(lastMonthYear, lastMonth - 1, 1);
+      var lastDayOfLastMonth = new Date(lastMonthYear, lastMonth, 0);
+
+      // 构建本月日期的数组
+      var currentMonthDates = [];
+      for (var i = 1; i <= lastDayOfMonth.getDate(); i++) {
+        let a = new Date(currentYear, currentMonth - 1, i)
+        currentMonthDates.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+      }
+
+      // 构建上个月日期的数组
+      var lastMonthDates = [];
+      for (var j = firstDayOfLastMonth.getDate(); j <= lastDayOfLastMonth.getDate(); j++) {
+        let a = new Date(lastMonthYear, lastMonth - 1, j)
+        lastMonthDates.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+      }
+
+      return {
+        lastWeek: lastMonthDates,//上月
+        toWeek: currentMonthDates //本月
+      }
+    },
     getData() {
       this.isLoading = true;
       let params = [
@@ -717,22 +767,25 @@ export default {
             lastWeek: [],//上周
             toWeek: [] //本周
           }
-          for (var i = 0; i < 14; i++) {
-            let time = JSON.parse(JSON.stringify(lastDayOfWeek))
-            let time2 = new Date(time)
-            var a = new Date(time2.setDate(time2.getDate() - i));
-            if (i > 6) {
-              weekArray.lastWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
-            } else {
-              weekArray.toWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
-            }
-          }
+          // for (var i = 0; i < 14; i++) {
+          //   let time = JSON.parse(JSON.stringify(lastDayOfWeek))
+          //   let time2 = new Date(time)
+          //   var a = new Date(time2.setDate(time2.getDate() - i));
+          //   if (i > 6) {
+          //     weekArray.lastWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+          //   } else {
+          //     weekArray.toWeek.push(a.getFullYear() + '-' + (a.getMonth() + 1) + '-' + a.getDate());
+          //   }
+          // }
+
+          weekArray = this.getMonth()
           let weekCourse = [];
           let weekCourse2 = [];
           let lastWeekCouseCount = 0
           let toWeekCouseCount = 0
           for (var z = 0; z < _course.length; z++) {
-            let _date = new Date(weekArray.lastWeek[weekArray.lastWeek.length - 1])
+            let _date = new Date(weekArray.lastWeek[0])
+            console.log(_date);
             if (new Date(_course[z].create_at) > _date && _course[z].pid == '34628934-d02f-11ec-8c78-005056b86db5') {
               weekCourse.push(_course[z])
               var a = new Date(_course[z].create_at)
@@ -778,7 +831,7 @@ export default {
                 //     lastCourseidWeek.push(weekCourse[z].courseid)
                 //   }
                 // } 
-                
+
                 //   weekCourse2[i].toCourse++
                 //   if (toCourseidWeek.indexOf(weekCourse[z].courseid) === -1) {
                 //     toCourseidWeek.push(weekCourse[z].courseid)

+ 167 - 0
src/components/pages/dataBoardNew/school/loginTime/index.vue

@@ -0,0 +1,167 @@
+<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: {
+        yearArray: {
+            type: String,
+        },
+    },
+    data() {
+        return {
+            chartObj: null,
+            ooption: {
+                xdata: [],
+                sdata: [],
+            },
+            option: {
+                series: [
+                    {
+                        type: 'gauge',
+                        startAngle: 180,
+                        endAngle: 0,
+                        center: ['50%', '75%'],
+                        radius: '150%',
+                        min: 0,
+                        max: 4000,
+                        splitNumber: 8,
+                        axisLine: {
+                            lineStyle: {
+                                width: 10,
+                                color: [
+                                    [0.25, 'rgb(251, 223, 148)'],
+                                    [0.5, 'rgb(145, 208, 237)'],
+                                    [0.75, 'rgb(68, 96, 193)'],
+                                    [1, 'rgb(240, 141, 158)']
+                                ]
+                            }
+                        },
+                        pointer: {
+                            icon: 'path://M12.8,0.7l12,40.1H0.7L12.8,0.7z',
+                            length: '12%',
+                            width: 12,
+                            offsetCenter: [0, '-60%'],
+                            itemStyle: {
+                                color: 'auto'
+                            }
+                        },
+                        axisTick: {
+                            length: 6,
+                            lineStyle: {
+                                color: 'auto',
+                                width: 2
+                            }
+                        },
+                        splitLine: {
+                            length: 20,
+                            lineStyle: {
+                                color: 'auto',
+                                width: 5
+                            }
+                        },
+                        axisLabel: {
+                            show:false
+                        },
+                        title:{
+                            show:false
+                        },
+                        title: {
+                            offsetCenter: [0, '10%'],
+                            fontSize: 20
+                        },
+                        detail: {
+                            fontSize: 30,
+                            offsetCenter: [0, '-15%'],
+                            color: 'inherit'
+                        },
+                        data: [
+                            {
+                                value: 0,
+                                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.xAxis.data = option.xdata;
+                this.option.series[0].data[0].value = this.yearArray;
+                // this.option.visualMap.max = option.max ? option.max : 0;
+
+                // 初始化雷达图
+                this.chartObj = chartObj;
+                this.chartObj.setOption(this.option);
+            });
+        },
+    },
+    watch: {
+        yearArray: {
+            immediate: true,
+            deep: true,
+            handler(newValue, oldValue) {
+                this.ooption = {
+                    xdata: [],
+                    sdata: [],
+                    max: 0
+                }
+                let _array = newValue
+                if (!this.chartObj) {
+                    this.setChart(this.ooption);
+                } else {
+                    this.option.series[0].data[0].value = this.yearArray;
+                    // this.option.xAxis.data = this.ooption.xdata;
+                    // this.option.series[0].data[0] = this.ooption.sdata;
+                    // this.option.visualMap.max = this.ooption.max ? this.ooption.max : 0;
+                    this.chartObj.setOption(this.option);
+                }
+                this.$forceUpdate();
+            },
+        },
+    },
+    mounted() {
+        
+
+        this.setChart(this.ooption);
+        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>
+  

+ 1 - 1
src/components/pages/dataBoardNew/teacher/chartList/bar.vue

@@ -126,7 +126,7 @@ export default {
     let _array = this.workTime;
     for (var i = 0; i < _array.length; i++) {
       this.ooption.ydata.push(_array[i].name);
-          this.ooption.teacher.push(_array[i].text + "小时");
+          this.ooption.teacher.push(_array[i].text);
     }
     this.setChart(this.ooption);
     var _this = this;

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.