lsc пре 1 година
родитељ
комит
5e74b840cd

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.8c3a313aa229a469ce4446478975198f.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.1b8e037bd3fbbd358d74.js></script><script type=text/javascript src=./static/js/app.81425b0278393d33bfcc.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.ecc833eeb360810551e27870dea4f5e2.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.b82466316e0966898ae1.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/css/app.8c3a313aa229a469ce4446478975198f.css.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/css/app.ecc833eeb360810551e27870dea4f5e2.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/css/app.ecc833eeb360810551e27870dea4f5e2.css.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/app.81425b0278393d33bfcc.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/app.b82466316e0966898ae1.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/app.b82466316e0966898ae1.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/vendor.b01159b52abeac4e6216.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
dist/static/js/vendor.b01159b52abeac4e6216.js.map


+ 28 - 0
package-lock.json

@@ -19,6 +19,7 @@
         "gantt-elastic": "^1.0.12",
         "gantt-elastic-header": "^0.1.11",
         "hevue-img-preview": "^5.0.3",
+        "highcharts-vue": "^1.4.3",
         "html-docx-js": "^0.3.1",
         "image-conversion": "^2.1.1",
         "jquery": "^3.6.0",
@@ -6464,6 +6465,21 @@
       "integrity": "sha1-TAb8y0YC/iYCs8k9+C1+fb8aio4=",
       "dev": true
     },
+    "node_modules/highcharts": {
+      "version": "11.1.0",
+      "resolved": "https://registry.npmmirror.com/highcharts/-/highcharts-11.1.0.tgz",
+      "integrity": "sha512-vhmqq6/frteWMx0GKYWwEFL25g4OYc7+m+9KQJb/notXbNtIb8KVy+ijOF7XAFqF165cq0pdLIePAmyFY5ph3g==",
+      "peer": true
+    },
+    "node_modules/highcharts-vue": {
+      "version": "1.4.3",
+      "resolved": "https://registry.npmmirror.com/highcharts-vue/-/highcharts-vue-1.4.3.tgz",
+      "integrity": "sha512-qIy9EFuLIgOw+reNkTvu0pvMBcSE0BAPtONAqZoEl0qaAIpGxiyXqhRNPDufWieSC0YlybpCznxE8EK19Kcg+A==",
+      "peerDependencies": {
+        "highcharts": ">=5.0.0",
+        "vue": ">=1.0.0"
+      }
+    },
     "node_modules/hmac-drbg": {
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/hmac-drbg/download/hmac-drbg-1.0.1.tgz",
@@ -23642,6 +23658,18 @@
       "integrity": "sha1-TAb8y0YC/iYCs8k9+C1+fb8aio4=",
       "dev": true
     },
+    "highcharts": {
+      "version": "11.1.0",
+      "resolved": "https://registry.npmmirror.com/highcharts/-/highcharts-11.1.0.tgz",
+      "integrity": "sha512-vhmqq6/frteWMx0GKYWwEFL25g4OYc7+m+9KQJb/notXbNtIb8KVy+ijOF7XAFqF165cq0pdLIePAmyFY5ph3g==",
+      "peer": true
+    },
+    "highcharts-vue": {
+      "version": "1.4.3",
+      "resolved": "https://registry.npmmirror.com/highcharts-vue/-/highcharts-vue-1.4.3.tgz",
+      "integrity": "sha512-qIy9EFuLIgOw+reNkTvu0pvMBcSE0BAPtONAqZoEl0qaAIpGxiyXqhRNPDufWieSC0YlybpCznxE8EK19Kcg+A==",
+      "requires": {}
+    },
     "hmac-drbg": {
       "version": "1.0.1",
       "resolved": "https://registry.npm.taobao.org/hmac-drbg/download/hmac-drbg-1.0.1.tgz",

+ 1 - 0
package.json

@@ -21,6 +21,7 @@
     "gantt-elastic": "^1.0.12",
     "gantt-elastic-header": "^0.1.11",
     "hevue-img-preview": "^5.0.3",
+    "highcharts-vue": "^1.4.3",
     "html-docx-js": "^0.3.1",
     "image-conversion": "^2.1.1",
     "jquery": "^3.6.0",

+ 47 - 13
src/components/pages/dataBoardNew/school/bar/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: {
+    loginArray: {
+      type: Array
+    },
+  },
   data() {
     return {
       chartObj: null,
@@ -22,18 +23,27 @@ export default {
       option: {
         tooltip: {
           trigger: "item",
+          formatter: "{b}   {c}(小时)",
+        },
+        grid: {
+          top: '5%',
+          left: '5%',
+          right: '5%',
+          bottom: '5%',
+          containLabel: true
         },
         xAxis: {
-          type: "value",
-          data: [0, 50, 100, 150, 200, 250],
+          type: "category",
+          data: ["老师", "学生"],
         },
         yAxis: {
-          type: "category",
-          data: ["五年级", "四年级", "三年级", "二年级", "一年级"],
+          type: "value",
+          data: [],
         },
         series: [
           {
-            data: [120, 200, 150, 80, 70, 110, 130],
+            data: [],
+            barWidth: 30,
             type: "bar",
           },
         ],
@@ -41,7 +51,7 @@ export default {
     };
   },
   methods: {
-    setChart() {
+    setChart(array) {
       // 雷达图显示的标签
       let newPromise = new Promise((resolve) => {
         resolve();
@@ -51,15 +61,39 @@ export default {
         const chartObj = this.$echarts.init(
           this.$el.querySelector("#charts_canvas")
         );
+        this.option.series[0].data = array;
         // 初始化雷达图
         this.chartObj = chartObj;
         this.chartObj.setOption(this.option);
       });
     },
+    setJson(array) {
+      this.ooption = {
+        xdata: [],
+        sdata: [],
+        max: 0
+      }
+
+      if (!this.chartObj) {
+        this.setChart(array);
+      } else {
+        this.option.series[0].data = array;
+        this.chartObj.setOption(this.option);
+      }
+    }
+  },
+  watch: {
+    loginArray: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.setJson(newValue)
+        this.$forceUpdate();
+      },
+    },
   },
-  watch: {},
   mounted() {
-    this.setChart();
+    this.setJson(this.loginArray)
     var _this = this;
     window.addEventListener("resize", () => {
       if (_this.chartObj) {

+ 86 - 40
src/components/pages/dataBoardNew/school/cateRank/index.vue

@@ -1,17 +1,25 @@
 <template>
   <div class="data_body">
-    <div style="width: 100%; height: 100%">
-      <div
-        id="charts_canvas"
-        class="echart"
-        style="width: 100%; height: 100%"
-      ></div>
+    <div style="width: 100%; height: 100%;align-items: center;justify-content: center;">
+      <!-- <div id="cateRank" class="echart" style="width: 100%; height: 100%"></div> -->
+      <highcharts :options="option" style="width: 100%; height: 95%;"></highcharts>
     </div>
   </div>
 </template>
 
 <script>
+import {Chart} from 'highcharts-vue'
+import HighCharts from 'highcharts'
+//和弦图的引入依赖
+import HC_sankey from 'highcharts/modules/sankey';
+import dependencywheel from 'highcharts/modules/dependency-wheel';
+HC_sankey(HighCharts);
+dependencywheel(HighCharts);
+
 export default {
+  components: {
+    highcharts: Chart,
+  },
   data() {
     return {
       chartObj: null,
@@ -19,30 +27,78 @@ export default {
         data: [],
       },
       option: {
-        tooltip: {
-          trigger: "item",
+        title: {
+          text: null,
+        },
+        credits: {
+            enabled: false//不显示LOGO
         },
-        series: [
-          {
-            type: "pie",
-            radius: '50%',
-            avoidLabelOverlap: true,
-            emphasis: {
-              label: {
-                show: true,
-                fontSize: 16,
-                fontWeight: "bold",
-              },
+        series: [{
+          keys: ['from', 'to', 'weight'],
+          data: [
+            ['Brazil', 'Portugal', 5],
+            ['Brazil', 'France', 1],
+            ['Brazil', 'Spain', 1],
+            ['Brazil', 'England', 1],
+            ['Canada', 'Portugal', 1],
+            ['Canada', 'France', 5],
+            ['Canada', 'England', 1],
+            ['Mexico', 'Portugal', 1],
+            ['Mexico', 'France', 1],
+            ['Mexico', 'Spain', 5],
+            ['Mexico', 'England', 1],
+            ['USA', 'Portugal', 1],
+            ['USA', 'France', 1],
+            ['USA', 'Spain', 1],
+            ['USA', 'England', 5],
+            ['Portugal', 'Angola', 2],
+            ['Portugal', 'Senegal', 1],
+            ['Portugal', 'Morocco', 1],
+            ['Portugal', 'South Africa', 3],
+            ['France', 'Angola', 1],
+            ['France', 'Senegal', 3],
+            ['France', 'Mali', 3],
+            ['France', 'Morocco', 3],
+            ['France', 'South Africa', 1],
+            ['Spain', 'Senegal', 1],
+            ['Spain', 'Morocco', 3],
+            ['Spain', 'South Africa', 1],
+            ['England', 'Angola', 1],
+            ['England', 'Senegal', 1],
+            ['England', 'Morocco', 2],
+            ['England', 'South Africa', 7],
+            ['South Africa', 'China', 5],
+            ['South Africa', 'India', 1],
+            ['South Africa', 'Japan', 3],
+            ['Angola', 'China', 5],
+            ['Angola', 'India', 1],
+            ['Angola', 'Japan', 3],
+            ['Senegal', 'China', 5],
+            ['Senegal', 'India', 1],
+            ['Senegal', 'Japan', 3],
+            ['Mali', 'China', 5],
+            ['Mali', 'India', 1],
+            ['Mali', 'Japan', 3],
+            ['Morocco', 'China', 5],
+            ['Morocco', 'India', 1],
+            ['Morocco', 'Japan', 3],
+            ['Japan', 'Brazil', 1]
+          ],
+          type: 'dependencywheel',
+          name: 'Dependency wheel series',
+          dataLabels: {
+            color: '#333',
+            textPath: {
+              enabled: true,
+              attributes: {
+                dy: 5
+              }
             },
-            data: [
-              { value: 100, name: "2人以下" },
-              { value: 150, name: "3-4人" },
-              { value: 223, name: "5-6人" },
-              { value: 216, name: "7人以上" }
-            ],
+            distance: 10
           },
-        ],
-      },
+          size: '95%'
+        }]
+      }
     };
   },
   methods: {
@@ -53,26 +109,16 @@ export default {
       });
       //然后异步执行echarts的初始化函数
       newPromise.then(() => {
-        const chartObj = this.$echarts.init(
-          //劳动课程
-          this.$el.querySelector("#charts_canvas")
-        );
+        const chartObj = Highcharts.chart('cateRank',this.option);
         // 初始化雷达图
-        this.chartObj = chartObj;
-        this.chartObj.setOption(this.option);
+        // this.chartObj = chartObj;
+        // this.chartObj.setOption(this.option);
       });
     },
   },
   watch: {
   },
   mounted() {
-    this.setChart();
-    var _this = this;
-    window.addEventListener("resize", () => {
-      if (_this.chartObj) {
-        _this.chartObj.resize();
-      }
-    });
   },
 };
 </script>

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

@@ -1,42 +1,98 @@
 <template>
   <div class="data_body">
-    <div style="width: 100%; height: 100%">
-      <div
-        id="charts_canvas"
-        class="echart"
-        style="width: 100%; height: 100%"
-      ></div>
+    <div style="width: 100%; height: 100%;display: flex;align-items: center;justify-content: center;">
+      <!-- <div id="cateRank" class="echart" style="width: 100%; height: 100%"></div> -->
+      <highcharts :options="option" style="width: 95%; height: 95%"></highcharts>
     </div>
   </div>
 </template>
 
 <script>
+import { Chart } from 'highcharts-vue'
+import HighCharts from 'highcharts'
+//和弦图的引入依赖
+// import column from 'highcharts/modules/column';
+// column(HighCharts);
+
 export default {
+  components: {
+    highcharts: Chart,
+  },
   data() {
     return {
       chartObj: null,
       ooption: {
-        xdata: [],
-        type: [],
+        data: [],
       },
       option: {
-        tooltip: {
-          trigger: "item",
+        chart: {
+          type: 'column'
         },
-        xAxis: {
-          type: "category",
-          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
+        title: {
+          text: null
         },
-        yAxis: {
-          type: "value",
+        credits: {
+            enabled: false//不显示LOGO
         },
-        series: [
-          {
-            data: [120, 200, 150, 80, 70, 110, 130],
-            type: "bar",
+        xAxis: {
+          categories: [
+            '一年级',
+            '二年级',
+            '三年级'
+          ]
+        },
+        yAxis: [{
+          min: 0,
+          title: {
+            text: '课程总数'
+          }
+        }, {
+          title: {
+            text: '项目总数'
           },
-        ],
-      },
+          opposite: true
+        }],
+        legend: {
+          shadow: false
+        },
+        tooltip: {
+          shared: true
+        },
+        plotOptions: {
+          column: {
+            grouping: false,
+            shadow: false,
+            borderWidth: 0
+          }
+        },
+        series: [{
+          name: '上周课程总数',
+          color: 'rgba(165,170,217,1)',
+          data: [150, 73, 20],
+          pointPadding: 0.3, // 通过 pointPadding 和 pointPlacement 控制柱子位置
+          pointPlacement: -0.2
+        }, {
+          name: '本周课程总数',
+          color: 'rgba(126,86,134,.9)',
+          data: [140, 90, 40],
+          pointPadding: 0.4,
+          pointPlacement: -0.2
+        }, {
+          name: '上周项目总数',
+          color: 'rgba(248,161,63,1)',
+          data: [153, 178, 195],
+          pointPadding: 0.3,
+          pointPlacement: 0.2,
+          yAxis: 1  // 指定数据列所在的 yAxis
+        }, {
+          name: '本周项目总数',
+          color: 'rgba(186,60,61,.9)',
+          data: [203, 198, 208],
+          pointPadding: 0.4,
+          pointPlacement: 0.2,
+          yAxis: 1
+        }]
+      }
     };
   },
   methods: {
@@ -47,24 +103,18 @@ export default {
       });
       //然后异步执行echarts的初始化函数
       newPromise.then(() => {
-        const chartObj = this.$echarts.init(
-          this.$el.querySelector("#charts_canvas")
-        );
+        const chartObj = Highcharts.chart('cateRank', this.option);
         // 初始化雷达图
-        this.chartObj = chartObj;
-        this.chartObj.setOption(this.option);
+        // this.chartObj = chartObj;
+        // this.chartObj.setOption(this.option);
       });
     },
   },
-  watch: {},
+  watch: {
+  },
   mounted() {
-    this.setChart();
-    var _this = this;
-    window.addEventListener("resize", () => {
-      if (_this.chartObj) {
-        _this.chartObj.resize();
-      }
-    });
+    // this.setChart();
+
   },
 };
 </script>

+ 87 - 23
src/components/pages/dataBoardNew/school/index.vue

@@ -5,9 +5,9 @@
       <div class="top">
         <div class="titleBox" style="justify-content: space-between">
           <div class="title">基础概况</div>
-          <el-select v-model="cType" class="selectBox" style="width: 110px">
+          <!-- <el-select v-model="cType" class="selectBox" style="width: 110px">
             <el-option label="全部" value="全部"></el-option>
-          </el-select>
+          </el-select> -->
         </div>
         <div class="dataBox">
           <div class="info_box">
@@ -17,19 +17,20 @@
             </div>
             <div class="info blueBG">
               <span>本月登录用户环比</span>
-              <span>{{ (loginCountMonthArray[loginCountMonthArray.length - 1].user -
+              <span v-if="loginCountMonthArray.length">{{ (loginCountMonthArray[loginCountMonthArray.length - 1].user -
                 loginCountMonthArray[loginCountMonthArray.length - 2].user) < 0 ? 0 :
                 ((loginCountMonthArray[loginCountMonthArray.length - 1].user -
                   loginCountMonthArray[loginCountMonthArray.length - 2].user) /
-                loginCountMonthArray[loginCountMonthArray.length - 2].user) * 100 + '%'  }}</span>
+                  loginCountMonthArray[loginCountMonthArray.length - 2].user) * 100 + '%' }}</span>
             </div>
             <div class="info blueBG">
               <span>本月登录用户总数</span>
-              <span>{{ loginCountMonthArray[loginCountMonthArray.length - 1].user }}</span>
+              <span v-if="loginCountMonthArray.length">{{ loginCountMonthArray[loginCountMonthArray.length - 1].user
+              }}</span>
             </div>
             <div class="info blueBG">
               <span>本月新增登录用户</span>
-              <span>{{ (loginCountMonthArray[loginCountMonthArray.length - 1].user -
+              <span v-if="loginCountMonthArray.length">{{ (loginCountMonthArray[loginCountMonthArray.length - 1].user -
                 loginCountMonthArray[loginCountMonthArray.length - 2].user) < 0 ? 0 :
                 loginCountMonthArray[loginCountMonthArray.length - 1].user -
                 loginCountMonthArray[loginCountMonthArray.length - 2].user }}</span>
@@ -48,45 +49,41 @@
             style="cursor: pointer; padding: 0 0 5px 0">
             登录频次
           </div>
-          <el-select v-model="cType1" class="selectBox" style="width: 110px;margin-left:auto;">
+          <!-- <el-select v-model="cType1" class="selectBox" style="width: 110px;margin-left:auto;">
             <el-option label="全部年级" value="全部年级"></el-option>
             <el-option label="一年级" value="一年级"></el-option>
             <el-option label="二年级" value="二年级"></el-option>
             <el-option label="三年级" value="三年级"></el-option>
-          </el-select>
+          </el-select> -->
           <!-- <div class="timeDiv">
             <div @click="tType = 0" :class="{ isClick: tType == 0 }">周</div>
             <div @click="tType = 1" :class="{ isClick: tType == 1 }">月</div>
             <div @click="tType = 2" :class="{ isClick: tType == 2 }">学期</div>
           </div> -->
         </div>
-        <div class="info_box" v-if="skType == 0">
+        <div class="info_box" v-if="skType == 1">
           <div class="info blueBG">
             <span>登录频次</span>
-            <!-- <span>{{ count }}</span> -->
-            <span>{{ 1513 }}</span>
+            <span>{{ countLogin }}</span>
           </div>
           <div class="info blueBG">
             <span>人均登录频次</span>
-            <!-- <span>{{ weekCount }}</span> -->
-            <span>{{ 4 }}</span>
+            <span>{{ countLogin > 0 ? (countLogin / allUser).toFixed(0) : 0 }}</span>
           </div>
         </div>
-        <div class="info_box" v-if="skType == 1">
+        <div class="info_box" v-if="skType == 0">
           <div class="info blueBG">
             <span>累计时长</span>
-            <!-- <span>{{ count }}</span> -->
-            <span>{{ 15310 }}</span>
+            <span>{{ userOnlineTime }}</span>
           </div>
           <div class="info blueBG">
             <span>人均使用时长</span>
-            <!-- <span>{{ weekCount }}</span> -->
-            <span>{{ 4 }}</span>
+            <span>{{ userOnlineTime > 0 ? (userOnlineTime / allUser).toFixed(0) : 0 }}</span>
           </div>
         </div>
         <div class="dataBox" style="height: calc(100% - 115px);">
-          <toolUser style="height: calc(100% - 10px)" v-if="skType == 0"></toolUser>
-          <bar style="height: calc(100% - 10px)" v-if="skType == 1"></bar>
+          <toolUser style="height: calc(100%)" v-if="skType == 1" :yearArray="loginCountYearArray"></toolUser>
+          <bar style="height: calc(100%)" v-if="skType == 0" :loginArray="[teacherOnlineTime,studentOnlineTime]"></bar>
           <!-- <div class="otherCss">
             <div v-if="!oType">切换为柱状图</div>
             <div v-if="oType">切换为热力图</div>
@@ -285,7 +282,7 @@
           </el-select>
         </div>
         <div class="dataBox">
-          <cateRank style="height: calc(100% - 72px)"></cateRank>
+          <cateRank style="height: calc(100%)"></cateRank>
         </div>
       </div>
     </div>
@@ -301,6 +298,9 @@ import toolUser from "./toolUser";
 import bar from "./bar";
 import courseNum from "./courseNum";
 import workNum from "./workNum";
+
+
+
 export default {
   components: {
     loginCount,
@@ -336,7 +336,12 @@ export default {
       oType: false,
       shType: false,
       allUser: 0,
-      loginCountMonthArray: []
+      loginCountMonthArray: [],
+      countLogin: 0,
+      loginCountYearArray: [],
+      userOnlineTime: [],
+      teacherOnlineTime: [],
+      studentOnlineTime: [],
     };
   },
   mounted() {
@@ -404,6 +409,64 @@ export default {
           }
           this.loginCountMonthArray = loginCountMonthArray
 
+          let countLogin = res.data[5][0].count; //总的登录频次
+          this.countLogin = countLogin
+
+          let loginCountYear = res.data[6];//一年的登录频次
+          let loginCountYearArray = []
+          for (var i = Month; i > Month - 12; i--) {
+            if (i <= 0) {
+              loginCountYearArray.push({
+                Year: Year - 1,
+                Month: 12 + i,
+                mon: 0,
+                tue: 0,
+                wed: 0,
+                thur: 0,
+                fri: 0,
+                sat: 0,
+                sun: 0,
+              })
+            } else {
+              loginCountYearArray.push({
+                Month: i,
+                Year: Year,
+                mon: 0,
+                tue: 0,
+                wed: 0,
+                thur: 0,
+                fri: 0,
+                sat: 0,
+                sun: 0,
+              })
+            }
+          }
+          loginCountYearArray = loginCountYearArray.reverse()
+          for (var i = 0; i < loginCountYear.length; i++) {
+            let _date = new Date(loginCountYear[i].create_at)
+            var _month = _date.getMonth() + 1
+            var _year = _date.getFullYear()
+            var _day = _date.getDay()
+            let dayArray = ['sun', 'mon', 'tue', 'wed', 'thur', 'fri', 'sat']
+            for (var j = 0; j < loginCountYearArray.length; j++) {
+              if (_month == loginCountYearArray[j].Month && _year == loginCountYearArray[j].Year) {
+                loginCountYearArray[j][dayArray[_day]]++
+                break;
+              }
+            }
+          }
+          console.log(loginCountYearArray);
+          this.loginCountYearArray = loginCountYearArray
+
+          let _userOnlineTime = res.data[7][0].time;//在线时长 所有用户
+          let _teacherOnlineTime = res.data[8][0].time;//在线时长 老师
+          let _studentOnlineTime = res.data[9][0].time;//在线时长 学生
+          _userOnlineTime = (_userOnlineTime / 60 / 60).toFixed(0)
+          _teacherOnlineTime = (_teacherOnlineTime / 60 / 60).toFixed(0)
+          _studentOnlineTime = (_studentOnlineTime / 60 / 60).toFixed(0)
+          this.userOnlineTime = _userOnlineTime
+          this.teacherOnlineTime = _teacherOnlineTime
+          this.studentOnlineTime = _studentOnlineTime
           this.$forceUpdate();
         })
         .catch((err) => {
@@ -683,4 +746,5 @@ export default {
 .blueBG {
   background: rgb(243, 248, 253);
   border: 2px solid rgb(234, 246, 255);
-}</style>
+}
+</style>

+ 127 - 235
src/components/pages/dataBoardNew/school/toolUser/index.vue

@@ -1,275 +1,117 @@
 <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: {
+    yearArray: {
+      type: Array,
+    },
+  },
   data() {
     return {
       chartObj: null,
+      ooption: {
+        xdata: [],
+        sdata: [],
+      },
       option: {
+        // title: {
+        //   text: '登录频次',
+        //   textStyle: {
+        //     fontSize: 12,
+        //   },
+        //   padding: [10, 0, 0, 10]
+        // },
         tooltip: {
-          position: "top",
+          position: 'top'
         },
         grid: {
-          height: "50%",
-          top: "10%",
+          top: '50',
+          left: '5%',
+          right: '5%',
+          bottom: '5%',
+          containLabel: true
         },
         xAxis: {
-          type: "category",
-          data: [
-            "12a",
-            "1a",
-            "2a",
-            "3a",
-            "4a",
-            "5a",
-            "6a",
-            "7a",
-            "8a",
-            "9a",
-            "10a",
-            "11a",
-            "12p",
-            "1p",
-            "2p",
-            "3p",
-            "4p",
-            "5p",
-            "6p",
-            "7p",
-            "8p",
-            "9p",
-            "10p",
-            "11p",
-          ],
+          type: 'category',
+          // data: [
+          //     '1月', '2月', '3月', '4月', '5月', '6月', '7月',
+          //     '8月', '9月', '10月', '11月', '12月'
+          // ],
+          data: [],
           splitArea: {
-            show: true,
+            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",
+          type: 'category',
           data: [
-            "星期一",
-            "星期二",
-            "星期三",
-            "星期四",
-            "星期五",
-            "星期六",
-            "星期日",
+            '星期天', '星期一', '星期二', '星期三',
+            '星期四', '星期五', '星期六',
           ],
           splitArea: {
-            show: true,
+            show: true
           },
         },
         visualMap: {
           min: 0,
           max: 10,
           calculable: true,
-          orient: "horizontal",
-          left: "center",
-          bottom: "15%",
+          orient: 'horizontal',
+          right: '10',
+          top: '0%'
         },
         series: [
           {
-            name: "Punch Card",
-            type: "heatmap",
-            data: [
-              [0, 0, 5],
-              [0, 1, 1],
-              [0, 2, 0],
-              [0, 3, 0],
-              [0, 4, 0],
-              [0, 5, 0],
-              [0, 6, 0],
-              [0, 7, 0],
-              [0, 8, 0],
-              [0, 9, 0],
-              [0, 10, 0],
-              [0, 11, 2],
-              [0, 12, 4],
-              [0, 13, 1],
-              [0, 14, 1],
-              [0, 15, 3],
-              [0, 16, 4],
-              [0, 17, 6],
-              [0, 18, 4],
-              [0, 19, 4],
-              [0, 20, 3],
-              [0, 21, 3],
-              [0, 22, 2],
-              [0, 23, 5],
-              [1, 0, 7],
-              [1, 1, 0],
-              [1, 2, 0],
-              [1, 3, 0],
-              [1, 4, 0],
-              [1, 5, 0],
-              [1, 6, 0],
-              [1, 7, 0],
-              [1, 8, 0],
-              [1, 9, 0],
-              [1, 10, 5],
-              [1, 11, 2],
-              [1, 12, 2],
-              [1, 13, 6],
-              [1, 14, 9],
-              [1, 15, 11],
-              [1, 16, 6],
-              [1, 17, 7],
-              [1, 18, 8],
-              [1, 19, 12],
-              [1, 20, 5],
-              [1, 21, 5],
-              [1, 22, 7],
-              [1, 23, 2],
-              [2, 0, 1],
-              [2, 1, 1],
-              [2, 2, 0],
-              [2, 3, 0],
-              [2, 4, 0],
-              [2, 5, 0],
-              [2, 6, 0],
-              [2, 7, 0],
-              [2, 8, 0],
-              [2, 9, 0],
-              [2, 10, 3],
-              [2, 11, 2],
-              [2, 12, 1],
-              [2, 13, 9],
-              [2, 14, 8],
-              [2, 15, 10],
-              [2, 16, 6],
-              [2, 17, 5],
-              [2, 18, 5],
-              [2, 19, 5],
-              [2, 20, 7],
-              [2, 21, 4],
-              [2, 22, 2],
-              [2, 23, 4],
-              [3, 0, 7],
-              [3, 1, 3],
-              [3, 2, 0],
-              [3, 3, 0],
-              [3, 4, 0],
-              [3, 5, 0],
-              [3, 6, 0],
-              [3, 7, 0],
-              [3, 8, 1],
-              [3, 9, 0],
-              [3, 10, 5],
-              [3, 11, 4],
-              [3, 12, 7],
-              [3, 13, 14],
-              [3, 14, 13],
-              [3, 15, 12],
-              [3, 16, 9],
-              [3, 17, 5],
-              [3, 18, 5],
-              [3, 19, 10],
-              [3, 20, 6],
-              [3, 21, 4],
-              [3, 22, 4],
-              [3, 23, 1],
-              [4, 0, 1],
-              [4, 1, 3],
-              [4, 2, 0],
-              [4, 3, 0],
-              [4, 4, 0],
-              [4, 5, 1],
-              [4, 6, 0],
-              [4, 7, 0],
-              [4, 8, 0],
-              [4, 9, 2],
-              [4, 10, 4],
-              [4, 11, 4],
-              [4, 12, 2],
-              [4, 13, 4],
-              [4, 14, 4],
-              [4, 15, 14],
-              [4, 16, 12],
-              [4, 17, 1],
-              [4, 18, 8],
-              [4, 19, 5],
-              [4, 20, 3],
-              [4, 21, 7],
-              [4, 22, 3],
-              [4, 23, 0],
-              [5, 0, 2],
-              [5, 1, 1],
-              [5, 2, 0],
-              [5, 3, 3],
-              [5, 4, 0],
-              [5, 5, 0],
-              [5, 6, 0],
-              [5, 7, 0],
-              [5, 8, 2],
-              [5, 9, 0],
-              [5, 10, 4],
-              [5, 11, 1],
-              [5, 12, 5],
-              [5, 13, 10],
-              [5, 14, 5],
-              [5, 15, 7],
-              [5, 16, 11],
-              [5, 17, 6],
-              [5, 18, 0],
-              [5, 19, 5],
-              [5, 20, 3],
-              [5, 21, 4],
-              [5, 22, 2],
-              [5, 23, 0],
-              [6, 0, 1],
-              [6, 1, 0],
-              [6, 2, 0],
-              [6, 3, 0],
-              [6, 4, 0],
-              [6, 5, 0],
-              [6, 6, 0],
-              [6, 7, 0],
-              [6, 8, 0],
-              [6, 9, 0],
-              [6, 10, 1],
-              [6, 11, 0],
-              [6, 12, 2],
-              [6, 13, 1],
-              [6, 14, 3],
-              [6, 15, 4],
-              [6, 16, 0],
-              [6, 17, 0],
-              [6, 18, 0],
-              [6, 19, 0],
-              [6, 20, 1],
-              [6, 21, 2],
-              [6, 22, 2],
-              [6, 23, 6],
-            ].map(function (item) {
-              return [item[1], item[0], item[2] || "-"];
-            }),
+            name: '',
+            type: 'heatmap',
+            data: [],
             label: {
-              show: true,
+              show: true
             },
             emphasis: {
               itemStyle: {
                 shadowBlur: 10,
-                shadowColor: "rgba(0, 0, 0, 0.5)",
-              },
-            },
-          },
-        ],
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
+              }
+            }
+          }
+        ]
       },
     };
   },
   methods: {
-    setChart() {
+    setChart(option) {
       // 雷达图显示的标签
       let newPromise = new Promise((resolve) => {
         resolve();
@@ -277,18 +119,70 @@ export default {
       //然后异步执行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();
+      },
+    },
   },
-  watch: {},
   mounted() {
-    this.setChart();
-    var _this = this;
+    this.setJson(this.yearArray)
+
     window.addEventListener("resize", () => {
       if (_this.chartObj) {
         _this.chartObj.resize();
@@ -301,14 +195,12 @@ export default {
 <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>
+</style>

+ 95 - 73
src/components/pages/synergyCourse/addCourse.vue

@@ -33,8 +33,8 @@
             }" v-if="cid && userid != courseUserid && role != '1'"></div> -->
             <div class="whiteBg" style="background:unset;padding: 0;position:relative;">
               <div class="updateMask" :style="{
-              height: '100%',
-            }" v-if="cid && userid != courseUserid && role != '1'"></div>
+                height: '100%',
+              }" v-if="cid && userid != courseUserid && role != '1'"></div>
               <div>
                 <div class="basic_box" style="padding: 0;">
                   <div class="big_box">
@@ -46,7 +46,8 @@
                           <div class="course_input_box">
                             <div class="bb_courseIcon"><img src="../../../assets/icon/new/course.png" /></div>
                             <input type="text" placeholder="请输入课程名称" class="binfo_input" v-model="courseName"
-                              style="border: 1.5px solid rgb(202, 209, 220);margin: 0px 10px 0px 0px;border-radius: 5px;font-weight: 600;padding: 12px 14px 12px 71px;" @change="changeName"/>
+                              style="border: 1.5px solid rgb(202, 209, 220);margin: 0px 10px 0px 0px;border-radius: 5px;font-weight: 600;padding: 12px 14px 12px 71px;"
+                              @change="changeName" />
                             <!-- background: #f6f6f6; -->
                             <!-- <el-switch v-model="isTeacherSee" active-text="是否公开此课程"
                               style="justify-content: center;width: 200px;"></el-switch> -->
@@ -116,16 +117,17 @@
             <div class="whiteBg" style="margin-top: 10px;">
               <div class="wb_j_box">
                 <div class="wb_j_box_content">
-                  <div class="wb_j_box_btn"  @click="openMember">
-                      <div class="wb_j_box_title">协同人员</div>
-                      <div class="wb_j_box_btn_c">
-                        <el-tooltip effect="dark" :content="getListMan2(checkboxList3)" placement="top" v-if="checkboxList3.length"  popper-class="text_tooltip2">
-                          <div class="wb_j_box_span">{{getListMan2(checkboxList3)}}</div>
-                        </el-tooltip>
-                        <div v-else class="wb_j_box_span">请选择协同人员</div>
-                        <div class="wb_j_box_arrow"></div>
-                      </div>
+                  <div class="wb_j_box_btn" @click="openMember">
+                    <div class="wb_j_box_title">协同人员</div>
+                    <div class="wb_j_box_btn_c">
+                      <el-tooltip effect="dark" :content="getListMan2(checkboxList3)" placement="top"
+                        v-if="checkboxList3.length" popper-class="text_tooltip2">
+                        <div class="wb_j_box_span">{{ getListMan2(checkboxList3) }}</div>
+                      </el-tooltip>
+                      <div v-else class="wb_j_box_span">请选择协同人员</div>
+                      <div class="wb_j_box_arrow"></div>
                     </div>
+                  </div>
                 </div>
                 <div style="margin-left: auto;">
                   <button class="c_pub_button_add pub_btn_paste_img" @click="pasteTask" v-if="isPasteTask">智能粘贴</button>
@@ -133,8 +135,8 @@
               </div>
             </div>
             <div class="whiteBg" style="margin-top: 10px">
-              <groupBox :cid="cid" :people="checkboxList3" :classList="classList" :courseDetail="courseDetail" :userid="userid" :type="1"
-                classId="" :oid="oid" v-if="cid"></groupBox>
+              <groupBox :cid="cid" :people="checkboxList3" :classList="classList" :courseDetail="courseDetail"
+                :userid="userid" :type="1" classId="" :oid="oid" v-if="cid"></groupBox>
               <div v-else class="tipsBox">请添加课程名称后才能设置分组</div>
             </div>
             <div class="whiteBg" style="border-radius: 0; background:#F0F2F5;" v-if="false">
@@ -1539,7 +1541,8 @@
               <button class="c_pub_button_return pub_btn_return_img" @click="lastSteps">
                 返回首页
               </button>
-              <button class="c_pub_button_confirm pub_btn_finish_img" @click="nextSteps">
+              <button class="c_pub_button_confirm pub_btn_finish_img" @click="nextSteps"
+                v-if="!(cid && userid != courseUserid && role != '1')">
                 确认上传
               </button>
             </div>
@@ -2935,9 +2938,9 @@ export default {
       imageList: [],
       heightPx: '100%',
       toolsData: toolsData,
-      pageSize:20,
-      total:0,
-      page:0,
+      pageSize: 20,
+      total: 0,
+      page: 0,
     };
   },
   directives: {
@@ -2988,7 +2991,7 @@ export default {
       return function (list) {
         let _people2 = [];
         if (this.ManAarray.length) {
-          for(var j = 0;j < list.length; j++){
+          for (var j = 0; j < list.length; j++) {
             let people = list[j];
             for (var i = 0; i < this.ManAarray.length; i++) {
               if (this.ManAarray[i].userid == people && people != this.courseUserid) {
@@ -3314,6 +3317,7 @@ export default {
         .$confirm("是否保存已编辑内容?", "提示", {
           confirmButtonText: "保存",
           cancelButtonText: "不保存",
+          distinguishCancelAndClose: true,
           type: "warning",
         })
         .then(() => {
@@ -3391,45 +3395,63 @@ export default {
       return _guid;
     },
     lastSteps() {
-      this
-        .$confirm("是否保存已编辑内容?", "提示", {
-          confirmButtonText: "保存",
-          cancelButtonText: "不保存",
-          type: "warning",
-        })
-        .then(() => {
-          if (this.cid == "" || this.cid == undefined) {
-            if (this.courseName == "") {
-              this.$message.error("请补充填写课程名称");
-              return;
+      if (this.cid && this.userid != this.courseUserid && this.role != '1') {
+        this.goTo(
+          "/synergyCourse?userid=" +
+          this.userid +
+          "&oid=" +
+          this.oid +
+          "&org=" +
+          this.org +
+          "&role=" +
+          this.role
+        );
+      } else {
+        this
+          .$confirm("是否保存已编辑内容?", "提示", {
+            confirmButtonText: "保存",
+            cancelButtonText: "不保存",
+            distinguishCancelAndClose: true,
+            type: "warning",
+          })
+          .then(() => {
+            if (this.cid == "" || this.cid == undefined) {
+              if (this.courseName == "") {
+                this.$message.error("请补充填写课程名称");
+                return;
+              } else {
+                this.addWork();
+              }
             } else {
-              this.addWork();
+              if (this.courseName == "") {
+                this.$message.error("请补充填写课程名称");
+                return;
+              } else {
+                // if (this.userid != this.courseUserid && this.role != "1") {
+                //   this.updateWork2();
+                // } else {
+                this.updateWork();
+                // }
+              }
             }
-          } else {
-            if (this.courseName == "") {
-              this.$message.error("请补充填写课程名称");
-              return;
-            } else {
-              // if (this.userid != this.courseUserid && this.role != "1") {
-              //   this.updateWork2();
-              // } else {
-              this.updateWork();
-              // }
+          })
+          .catch((v) => {
+            console.log(v)
+            if (v == "cancel") {
+              this.goTo(
+                "/synergyCourse?userid=" +
+                this.userid +
+                "&oid=" +
+                this.oid +
+                "&org=" +
+                this.org +
+                "&role=" +
+                this.role
+              );
             }
-          }
-        })
-        .catch(() => {
-          this.goTo(
-            "/synergyCourse?userid=" +
-            this.userid +
-            "&oid=" +
-            this.oid +
-            "&org=" +
-            this.org +
-            "&role=" +
-            this.role
-          );
-        });
+
+          });
+      }
     },
     nextSteps() {
       if (this.cid == "" || this.cid == undefined) {
@@ -3453,7 +3475,7 @@ export default {
       }
       this.$refs.stepBox.scrollTop = 0;
     },
-    changeName(){
+    changeName() {
       if (this.cid == "" || this.cid == undefined) {
         if (this.courseName == "") {
           this.$message.error("请补充填写课程名称");
@@ -4885,9 +4907,9 @@ export default {
           this.cid = res.data.courseId;
           this.courseUserid = this.userid;
           this.islogin = true;
-          if(type!=2){
+          if (type != 2) {
             this.steps = 4;
-          }else{
+          } else {
             this.selectCourseDetail222();
           }
         })
@@ -4897,14 +4919,14 @@ export default {
         });
     },
     selectCourseDetail222() {
-        let params = {
-          cid: this.cid,
-        };
-        this.ajax
-          .get(this.$store.state.api + "select_synergy", params)
-          .then((res) => {
-            this.courseDetail = res.data[0][0]
-          });
+      let params = {
+        cid: this.cid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "select_synergy", params)
+        .then((res) => {
+          this.courseDetail = res.data[0][0]
+        });
     },
     goCourse() {
       window.parent.postMessage({ cid: this.courseId, type: "1" }, "*");
@@ -5049,7 +5071,7 @@ export default {
           // }
           this.number = this.nbOrder;
           this.courseId = this.cid;
-          if(type != 2){
+          if (type != 2) {
             this.steps = 4;
           }
         })
@@ -7165,7 +7187,7 @@ export default {
       }, 0);
     },
     openMember() {
-      if(this.cid && this.userid != this.courseUserid && this.role != '1'){
+      if (this.cid && this.userid != this.courseUserid && this.role != '1') {
         this.$message.error('非管理员和创建者不可编辑')
         return;
       }
@@ -11469,9 +11491,9 @@ ol {
   display: flex;
   align-items: center;
 }
-.tipsBox{
+
+.tipsBox {
   text-align: center;
-    line-height: 200px;
-    font-size: 20px;
-}
-</style>
+  line-height: 200px;
+  font-size: 20px;
+}</style>

Неке датотеке нису приказане због велике количине промена