lsc 2 سال پیش
والد
کامیت
54be42e53d

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.559cf8a92c79780c8408e89335d0ac74.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.07d4f7f37346deafd24b.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.33f564a7527b2c5b2b008bcff132a2cf.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.5d0a2836b148a2e65bb9.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/css/app.33f564a7527b2c5b2b008bcff132a2cf.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/css/app.33f564a7527b2c5b2b008bcff132a2cf.css.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/app.07d4f7f37346deafd24b.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/app.5d0a2836b148a2e65bb9.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/app.5d0a2836b148a2e65bb9.js.map


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 7 - 5
src/components/pages/dataBoard/course/chartList/courseAna.vue

@@ -1,11 +1,7 @@
 <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>
@@ -65,6 +61,12 @@ export default {
           this.$el.querySelector("#charts_canvas")
         );
         this.option.series[0].data = this.ooption.data;
+        chartObj.off('click')
+        let _this = this
+        chartObj.on('click', function (param) {
+          console.log(param);  //X轴的值
+          _this.$emit('openCourse', param.dataIndex)
+        });
         // 初始化雷达图
         this.chartObj = chartObj;
         this.chartObj.setOption(this.option);

+ 8 - 1
src/components/pages/dataBoard/course/chartList/workNum.vue

@@ -59,7 +59,7 @@ export default {
         },
         series: [
           {
-            symbolSize: 15,
+            symbolSize: 8,
             data: [],
             type: "scatter",
           },
@@ -80,6 +80,13 @@ export default {
           this.$el.querySelector("#charts_canvas")
         );
         this.option.series[0].data = this.ooption.data;
+
+        chartObj.off('click')
+        let _this = this
+        chartObj.on('click', function (param) {
+          console.log(param);  //X轴的值
+          _this.$emit('openCourse', param.data[3])
+        });
         // 初始化雷达图
         this.chartObj = chartObj;
         this.chartObj.setOption(this.option);

+ 52 - 1
src/components/pages/dataBoard/course/index.vue

@@ -53,7 +53,7 @@
               </div>
               <div class="teaMiddle tSum">
                 <div>类别平均</div>
-                <div>{{ (typeCount / 3).toFixed(0) }}</div>
+                <div>{{ (cCount / typeCount).toFixed(0) }}</div>
               </div>
             </div>
             <CateRank
@@ -69,6 +69,7 @@
             <WorkNum
               style="height: calc(100% - 40px)"
               :workNumList="workNumList"
+              @openCourse="openCourse"
             ></WorkNum>
           </div>
         </div>
@@ -97,6 +98,7 @@
           <CourseAna
             style="height: calc(100% - 40px)"
             :courseNumberArray="courseNumberArray"
+            @openCourse="openCourse2"
           ></CourseAna>
         </div>
       </div>
@@ -183,6 +185,54 @@ export default {
     this.getData();
   },
   methods: {
+    openCourse(cid){
+      window.parent.postMessage({ cid: cid, screenType: "3" }, "*");
+    },
+    openCourse2(index){
+      console.log(index);
+      // console.log(this.courseNumberArray);
+      let id = this.courseNumberArray[index].typeid
+      let typea = ""
+      let typeb = ""
+      let typed = ""
+      // console.log(this.gradeArray);
+      // console.log(this.subjectArray);
+      // console.log(this.themeArray);
+      let key = 0
+      for (key in this.gradeArray) {
+        if (this.gradeArray.hasOwnProperty.call(this.gradeArray, key)) {
+          const element = this.gradeArray[key];
+          if(element.typeid == id){
+            typea = id
+          }
+        }
+      }
+      for (key in this.subjectArray) {
+        if (this.subjectArray.hasOwnProperty.call(this.subjectArray, key)) {
+          const element = this.subjectArray[key];
+          if(element.typeid == id){
+            typed = id
+          }
+        }
+      }
+      for (key in this.themeArray) {
+        if (this.themeArray.hasOwnProperty.call(this.themeArray, key)) {
+          const element = this.themeArray[key];
+          if(element.typeid == id){
+            typeb = id
+          }
+        }
+      }
+      window.parent.postMessage(
+        { 
+          tools: "openCourse",
+          typea: typea || "",
+          typeb: typeb || "",
+          typed: typed || "",
+        }, 
+        "*"
+      );
+    },
     typeChange() {
       if (this.cType === "") {
         this.courseNumberArray = this.allArray;
@@ -469,6 +519,7 @@ export default {
             item.task,
             item.work,
             item.title,
+            item.cid,
           ]);
           this.workNumList = workNumList;
         })

+ 15 - 0
src/components/pages/dataBoard/school/courseInfo/index.vue

@@ -62,6 +62,21 @@ export default {
                     this.$el.querySelector("#charts_canvas")
                 );
                 this.option.series[0].data = this.ooption.data;
+                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.dataIndex)
+                });
                 // 初始化雷达图
                 this.chartObj = chartObj;
                 this.chartObj.setOption(this.option);

+ 61 - 3
src/components/pages/dataBoard/school/index.vue

@@ -71,7 +71,7 @@
               <span>{{ (courseCount / teacherCount).toFixed(0) }}</span>
             </div>
           </div>
-          <teacherInfo style="height: calc(100% - 70px)" :courseArray="courseArray"></teacherInfo>
+          <teacherInfo style="height: calc(100% - 70px)" :courseArray="courseArray" @openCourse="openCourse"></teacherInfo>
         </div>
       </div>
       <div class="bottom">
@@ -180,11 +180,11 @@
               </div>
               <div class="info3 blueBG">
                 <span>类别平均</span>
-                <span>{{ (typeCount / 3).toFixed(0) }}</span>
+                <span>{{ (courseCount / typeCount).toFixed(0) }}</span>
               </div>
             </div>
             <div class="course_box_p">
-              <courseInfo :courseNumberArray="courseNumberArray"></courseInfo>
+              <courseInfo :courseNumberArray="courseNumberArray" @openCourse="openCourse2"></courseInfo>
             </div>
           </div>
           <cateRank style="height: calc(100% - 50% - 10px); overflow: auto" :courseNumberArray="courseNumberArray">
@@ -277,6 +277,64 @@ export default {
     setMinWidth (val) {
       this.minWidth = val.srcElement.clientWidth
     },
+    openCourse(classIndex,subIndex){
+      // console.log(classIndex,subIndex);
+      // console.log(this.courseArray);
+      // console.log(this.courseArray[classIndex].id,this.courseArray[classIndex].subject[subIndex].id || '');
+      window.parent.postMessage(
+        { 
+          tools: "openCourse",
+          typea: this.courseArray[classIndex].id,
+          typed: this.courseArray[classIndex].subject[subIndex].id || '',
+        }, 
+        "*"
+      );
+    },
+    openCourse2(index){
+      console.log(index);
+      // console.log(this.courseNumberArray);
+      let id = this.courseNumberArray[index].typeid
+      let typea = ""
+      let typeb = ""
+      let typed = ""
+      // console.log(this.gradeArray);
+      // console.log(this.subjectArray);
+      // console.log(this.themeArray);
+      let key = 0
+      for (key in this.gradeArray) {
+        if (this.gradeArray.hasOwnProperty.call(this.gradeArray, key)) {
+          const element = this.gradeArray[key];
+          if(element.typeid == id){
+            typea = id
+          }
+        }
+      }
+      for (key in this.subjectArray) {
+        if (this.subjectArray.hasOwnProperty.call(this.subjectArray, key)) {
+          const element = this.subjectArray[key];
+          if(element.typeid == id){
+            typed = id
+          }
+        }
+      }
+      for (key in this.themeArray) {
+        if (this.themeArray.hasOwnProperty.call(this.themeArray, key)) {
+          const element = this.themeArray[key];
+          if(element.typeid == id){
+            typeb = id
+          }
+        }
+      }
+      window.parent.postMessage(
+        { 
+          tools: "openCourse",
+          typea: typea || "",
+          typeb: typeb || "",
+          typed: typed || "",
+        }, 
+        "*"
+      );
+    },
     getData() {
       this.isLoading = true;
       let params = [

+ 15 - 0
src/components/pages/dataBoard/school/teacherInfo/index.vue

@@ -101,6 +101,21 @@ export default {
                 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

+ 7 - 5
src/components/pages/dataBoard/teacher/chartList/teaData.vue

@@ -1,11 +1,7 @@
 <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>
@@ -105,6 +101,12 @@ export default {
         data.forEach(function (dataItem) {
           series[dataItem[0]].data.push([dataItem[1], dataItem[2]]);
         });
+        chartObj.off('click')
+        let _this = this
+        chartObj.on('click', function (param) {
+          console.log(param);  //X轴的值
+          _this.$emit('openCourse', param.componentIndex, param.data[0])
+        });
         this.option.title = title;
         this.option.singleAxis = singleAxis;
         this.option.series = series;

+ 55 - 54
src/components/pages/dataBoard/teacher/chartList/workNum.vue

@@ -1,29 +1,40 @@
 <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: {
+    workNumList: {
+      type: Array,
+    },
+  },
   data() {
     return {
       chartObj: null,
+      ooption: {
+        data: [],
+      },
       option: {
         xAxis: {
           name: "任务数量",
           nameTextStyle: {
             padding: [25, 0, 0, 0],
-            verticalAlign:'top'
+            verticalAlign: 'top'
           },
           nameGap: -45
         },
+        grid: {
+          top: "10%",
+          left: "5%",
+          right: "5%",
+          bottom: "8%",
+          containLabel: true,
+        },
         yAxis: {
           name: "作业提交数量",
         },
@@ -42,51 +53,10 @@ export default {
             );
           },
         },
-        grid: {
-           top: '30',
-           left: '5%',
-           right: '5%',
-           bottom: '6%',
-          containLabel: true
-        },
-        color: ["#3681FC"],
         series: [
           {
-            symbolSize: 15,
-            data: [
-              [10.0, 8.04],
-              [8.07, 6.95],
-              [13.1, 7],
-              [13.2, 8.48],
-              [13.3, 9.38],
-              [13.4, 6.28],
-              [9.05, 8],
-              [9.15, 8.71],
-              [9.25, 9],
-              [9.35, 7],
-              [9.45, 6],
-              [11.0, 8.33],
-              [14.0, 7.66],
-              [13.4, 6.81],
-              [10.0, 6.33],
-              [14.0, 8.96],
-              [12.5, 6.82],
-              [9.15, 7.2],
-              [11.5, 7.2],
-              [3.03, 4.23],
-              [12.2, 7.83],
-              [2.02, 4.47],
-              [1.05, 3.33],
-              [4.35, 4],
-              [4.25, 5.26],
-              [4.15, 6.36],
-              [4.5, 4.96],
-              [6.03, 7.24],
-              [12.0, 6.26],
-              [12.0, 8.84],
-              [7.08, 5.82],
-              [5.02, 5.68],
-            ],
+            symbolSize: 8,
+            data: [],
             type: "scatter",
           },
         ],
@@ -94,7 +64,7 @@ export default {
     };
   },
   methods: {
-    setChart() {
+    setChart(option) {
       // 雷达图显示的标签
       let newPromise = new Promise((resolve) => {
         resolve();
@@ -102,16 +72,50 @@ export default {
       //然后异步执行echarts的初始化函数
       newPromise.then(() => {
         const chartObj = this.$echarts.init(
+          //劳动课程
           this.$el.querySelector("#charts_canvas")
         );
+        this.option.series[0].data = this.ooption.data;
+
+        chartObj.off('click')
+        let _this = this
+        chartObj.on('click', function (param) {
+          console.log(param);  //X轴的值
+          _this.$emit('openCourse', param.data[3])
+        });
         // 初始化雷达图
         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(array[i]);
+      }
+      if (!this.chartObj) {
+        this.setChart(this.ooption);
+      } else {
+        this.option.series[0].data = this.ooption.data;
+        this.chartObj.setOption(this.option);
+      }
+      this.$forceUpdate();
+    },
+  },
+  watch: {
+    workNumList: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.setArray(newValue);
+        this.$forceUpdate();
+      },
+    },
   },
   mounted() {
-    this.setChart(this.option);
+    this.setArray(this.workNumList);
     var _this = this;
     window.addEventListener("resize", () => {
       if (_this.chartObj) {
@@ -119,9 +123,6 @@ export default {
       }
     });
   },
-  created() {
-    this.setChart();
-  },
 };
 </script>
 

+ 63 - 3
src/components/pages/dataBoard/teacher/index.vue

@@ -68,7 +68,7 @@
               <div>{{ subjectCourse.toFixed(0) }}</div>
             </div>
           </div>
-          <TeaData style="height: calc(100% - 62px)" :courseArray="courseArray"></TeaData>
+          <TeaData style="height: calc(100% - 62px)" :courseArray="courseArray" @openCourse="openCourse2"></TeaData>
         </div>
       </div>
       <div class="bottom">
@@ -194,7 +194,7 @@
           <div class="title">教学活动</div>
         </div>
         <div class="dataBox">
-          <WorkNum style="height: calc(100% - 40px)"></WorkNum>
+          <WorkNum :workNumList="workNumList" @openCourse="openCourse"></WorkNum>
         </div>
       </div>
       <div class="bottom">
@@ -254,13 +254,33 @@ export default {
       weekCount:0,
       gradeCourse: 0,
       subjectCourse: 0,
-      courseArray: []
+      courseArray: [],
+      workNumList: [],
+      grade:[],
+      subject:[],
+      theme:[],
     };
   },
   mounted() {
     this.getData();
   },
   methods: {
+    openCourse2(classIndex,subIndex){
+      console.log(classIndex,subIndex);
+      // console.log(this.courseArray);
+      // console.log(this.courseArray[classIndex].id,this.courseArray[classIndex].subject[subIndex].id || '');
+      window.parent.postMessage(
+        { 
+          tools: "openCourse",
+          typea: this.courseArray[classIndex].id,
+          typed: this.courseArray[classIndex].subject[subIndex].id || '',
+        }, 
+        "*"
+      );
+    },
+    openCourse(cid){
+      window.parent.postMessage({ cid: cid, screenType: "3" }, "*");
+    },
     getData() {
       this.isLoading = true;
       let params = [
@@ -371,6 +391,46 @@ export default {
           this.subjectCourse = _subjectCourse / _subject.length
           this.courseArray = _courseArray
 
+          this.grade = _grade;
+          this.subject = _subject;
+          this.theme = res.data[9];//主题
+          var _workCourse = res.data[10]; //带作业的课程
+          var wList = [];
+          for (var i = 0; i < _workCourse.length; i++) {
+            if (!wList[_workCourse[i].courseId]) {
+              wList[_workCourse[i].courseId] = {
+                cid: _workCourse[i].courseId,
+                title: _workCourse[i].title,
+                task: 0,
+                work: 0,
+              };
+              let chapters = JSON.parse(_workCourse[i].chapters);
+              for (var j = 0; j < chapters.length; j++) {
+                if (wList[_workCourse[i].courseId].task == 0) {
+                  wList[_workCourse[i].courseId].task =
+                    chapters[j].chapterInfo[0].taskJson.length;
+                } else {
+                  wList[_workCourse[i].courseId].task +=
+                    chapters[j].chapterInfo[0].taskJson.length;
+                }
+              }
+            }
+          }
+          for (var i = 0; i < _workCourse.length; i++) {
+            let a = Object.keys(wList);
+            for (var j = 0; j < Object.keys(wList).length; j++) {
+              if (_workCourse[i].courseId == wList[a[j]].cid) {
+                wList[a[j]].work++;
+              }
+            }
+          }
+          var workNumList = Object.values(wList).map((item) => [
+            item.task,
+            item.work,
+            item.title,
+            item.cid,
+          ]);
+          this.workNumList = workNumList;
           this.$forceUpdate();
         })
         .catch((err) => {

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است