lsc 2 лет назад
Родитель
Сommit
dfd2029beb
2 измененных файлов с 199 добавлено и 43 удалено
  1. 197 41
      src/components/pages/components/studentData.vue
  2. 2 2
      src/components/pages/worksDetail.vue

+ 197 - 41
src/components/pages/components/studentData.vue

@@ -12,38 +12,38 @@
           <div class="sd_module_children">
             <span class="s">课堂活动</span>
             <span class="s2">
-              <span>{{10.7}}</span>次
+              <span>{{randomNum(1,20)}}</span>次
             </span>
             <span>已经击败99%学生</span>
           </div>
           <div class="sd_module_count">
             <span>挑战:</span>
-            <span>{{1}}</span>次
+            <span>{{randomNum(1,5)}}</span>次
           </div>
           <div class="sd_module_count">
             <span>选项挑战:</span>
-            <span>{{1}}</span>次
+            <span>{{randomNum(1,5)}}</span>次
           </div>
           <div class="sd_module_count">
             <span>分数挑战:</span>
-            <span>{{1}}</span>次
+            <span>{{randomNum(1,5)}}</span>次
           </div>
         </div>
         <div class="sd_module_content">
           <div class="sd_module_children">
             <span class="s">课堂生成</span>
             <span class="s2">
-              <span>{{6.9}}</span>次
+              <span>{{randomNum(1,10)}}</span>次
             </span>
             <span>已经击败99%学生</span>
           </div>
           <div class="sd_module_count">
             <span>作品上传:</span>
-            <span>{{4}}</span>张
+            <span>{{randomNum(1,20)}}</span>张
           </div>
           <div class="sd_module_count">
             <span>视频上传:</span>
-            <span>{{0}}</span>部
+            <span>{{randomNum(1,5)}}</span>部
           </div>
         </div>
 
@@ -51,22 +51,22 @@
           <div class="sd_module_children">
             <span class="s">自主活动</span>
             <span class="s2">
-              <span>{{9}}</span>分
-              <span>{{40}}</span>秒
+              <span>{{randomNum(1,15)}}</span>分
+              <span>{{randomNum(1,60)}}</span>秒
             </span>
             <span>已经击败99%学生</span>
           </div>
           <div class="sd_module_count">
             <span>计时:</span>
-            <span>{{0}}</span>分
+            <span>{{randomNum(1,5)}}</span>分
           </div>
           <div class="sd_module_count">
             <span>小组计分:</span>
-            <span>{{7}}</span>次
+            <span>{{randomNum(1,10)}}</span>次
           </div>
           <div class="sd_module_count">
             <span>个人计分:</span>
-            <span>{{3}}</span>次
+            <span>{{randomNum(1,10)}}</span>次
           </div>
         </div>
       </div>
@@ -81,12 +81,12 @@
     <div class="sd_class">
       <div class="sd_tTitle">个人能力</div>
       <div class="sd_person_button">
-        <span @click="type=1" :class="{'active':type == 1}">语文</span>
-        <span @click="type=2" :class="{'active':type == 2}">数学</span>
-        <span @click="type=3" :class="{'active':type == 3}">英语</span>
-        <span @click="type=4" :class="{'active':type == 4}">信息科技</span>
-        <span @click="type=5" :class="{'active':type == 5}">艺术</span>
-        <span @click="type=6" :class="{'active':type == 6}">跨学科素养</span>
+        <span @click="setType(1)" :class="{'active':type == 1}">语文</span>
+        <span @click="setType(2)" :class="{'active':type == 2}">数学</span>
+        <span @click="setType(3)" :class="{'active':type == 3}">英语</span>
+        <span @click="setType(4)" :class="{'active':type == 4}">信息科技</span>
+        <span @click="setType(5)" :class="{'active':type == 5}">艺术</span>
+        <span @click="setType(6)" :class="{'active':type == 6}">跨学科素养</span>
       </div>
       <div class="sd_person_data">
         <div
@@ -140,22 +140,22 @@ export default {
               },
             },
             data: [
-              { value: 1048, name: "学习时间" },
-              { value: 735, name: "自我介绍" },
-              { value: 580, name: "能力闯关" },
-              { value: 484, name: "提交探究表" },
-              { value: 300, name: "提交活动表" },
-              { value: 300, name: "讨论交流" },
-              { value: 300, name: "与大家分享你的“神兽”" },
-              { value: 300, name: "总结其它动物保护自己" },
-              { value: 300, name: "作业提交" },
-              { value: 300, name: "拓展思考,讨论交流" },
-              { value: 300, name: "提交倡议书" },
-              { value: 300, name: "提交学习手册" },
-              { value: 300, name: "能力测试" },
-              { value: 300, name: "自我评价调查问卷" },
-              { value: 300, name: "课程满意度调查问卷" },
-              { value: 300, name: "家长评价问卷调查" },
+              { value: 0, name: "学习时间" },
+              { value: 0, name: "自我介绍" },
+              { value: 0, name: "能力闯关" },
+              { value: 0, name: "提交探究表" },
+              { value: 0, name: "提交活动表" },
+              { value: 0, name: "讨论交流" },
+              { value: 0, name: "与大家分享你的“神兽”" },
+              { value: 0, name: "总结其它动物保护自己" },
+              { value: 0, name: "作业提交" },
+              { value: 0, name: "拓展思考,讨论交流" },
+              { value: 0, name: "提交倡议书" },
+              { value: 0, name: "提交学习手册" },
+              { value: 0, name: "能力测试" },
+              { value: 0, name: "自我评价调查问卷" },
+              { value: 0, name: "课程满意度调查问卷" },
+              { value: 0, name: "家长评价问卷调查" },
             ],
             emphasis: {
               itemStyle: {
@@ -315,21 +315,101 @@ export default {
           //劳动课程
           this.$el.querySelector("#charts_canvas")
         );
+        var optionB = [
+          { value: this.randomNum(0, 300), name: "学习时间" },
+          { value: this.randomNum(0, 300), name: "自我介绍" },
+          { value: this.randomNum(0, 300), name: "能力闯关" },
+          { value: this.randomNum(0, 300), name: "提交探究表" },
+          { value: this.randomNum(0, 300), name: "提交活动表" },
+          { value: this.randomNum(0, 300), name: "讨论交流" },
+          { value: this.randomNum(0, 300), name: "与大家分享你的“神兽”" },
+          { value: this.randomNum(0, 300), name: "总结其它动物保护自己" },
+          { value: this.randomNum(0, 300), name: "作业提交" },
+          { value: this.randomNum(0, 300), name: "拓展思考,讨论交流" },
+          { value: this.randomNum(0, 300), name: "提交倡议书" },
+          { value: this.randomNum(0, 300), name: "提交学习手册" },
+          { value: this.randomNum(0, 300), name: "能力测试" },
+          { value: this.randomNum(0, 300), name: "自我评价调查问卷" },
+          { value: this.randomNum(0, 300), name: "课程满意度调查问卷" },
+          { value: this.randomNum(0, 300), name: "家长评价问卷调查" },
+        ];
+        this.option.series[0].data = optionB;
         const chartObj2 = this.$echarts.init(
           //劳动课程
           this.$el.querySelector("#person_canvas1")
         );
-        this.option2.series.data = this.data;
+        this.option2.series.data = [
+          {
+            name: "信息意识",
+            value: 15,
+            children: [
+              {
+                name: "信息应用意识",
+                value: this.randomNum(1, 5),
+              },
+              {
+                name: "信息安全意识",
+                value: this.randomNum(1, 5),
+              },
+              {
+                name: "信息感知意识",
+                value: this.randomNum(1, 5),
+              },
+            ],
+          },
+          {
+            name: "信息社会责任",
+            value: 15,
+            children: [
+              {
+                name: "信息伦理道德",
+                value: this.randomNum(1, 5),
+              },
+              {
+                name: "信息法律法规",
+                value: this.randomNum(1, 10),
+              },
+            ],
+          },
+          {
+            name: "信息知识与技能",
+            value: 15,
+            children: [
+              {
+                name: "信息应用技能",
+                value: 5,
+              },
+              {
+                name: "信息科学知识",
+                value: 10,
+              },
+            ],
+          },
+          {
+            name: "信息思维与行为2",
+            value: 15,
+            children: [
+              {
+                name: "信息思维",
+                value: this.randomNum(1, 10),
+              },
+              {
+                name: "信息行为",
+                value: this.randomNum(1, 5),
+              },
+            ],
+          },
+        ];
         const chartObj3 = this.$echarts.init(
           //劳动课程
           this.$el.querySelector("#person_canvas2")
         );
-        let data = []
-        for(var i = 0;i<100;i++){
-            var x = this.randomNum(1,9)
-            var y = this.randomNum(0,8)
-            var z = this.randomNum(1,10)
-            data.push([x,y,z])
+        let data = [];
+        for (var i = 0; i < 100; i++) {
+          var x = this.randomNum(1, 9);
+          var y = this.randomNum(0, 8);
+          var z = this.randomNum(1, 10);
+          data.push([x, y, z]);
         }
         this.option3.series[0].data = data;
         // console.log(this.option.series[0].data);
@@ -355,6 +435,82 @@ export default {
           break;
       }
     },
+
+    setType(type) {
+      this.type = type;
+      this.option2.series.data = [
+        {
+          name: "信息意识",
+          value: 15,
+          children: [
+            {
+              name: "信息应用意识",
+              value: this.randomNum(1, 5),
+            },
+            {
+              name: "信息安全意识",
+              value: this.randomNum(1, 5),
+            },
+            {
+              name: "信息感知意识",
+              value: this.randomNum(1, 5),
+            },
+          ],
+        },
+        {
+          name: "信息社会责任",
+          value: 15,
+          children: [
+            {
+              name: "信息伦理道德",
+              value: this.randomNum(1, 5),
+            },
+            {
+              name: "信息法律法规",
+              value: this.randomNum(1, 10),
+            },
+          ],
+        },
+        {
+          name: "信息知识与技能",
+          value: 15,
+          children: [
+            {
+              name: "信息应用技能",
+              value: 5,
+            },
+            {
+              name: "信息科学知识",
+              value: 10,
+            },
+          ],
+        },
+        {
+          name: "信息思维与行为2",
+          value: 15,
+          children: [
+            {
+              name: "信息思维",
+              value: this.randomNum(1, 10),
+            },
+            {
+              name: "信息行为",
+              value: this.randomNum(1, 5),
+            },
+          ],
+        },
+      ];
+      this.chartObj2.setOption(this.option2);
+      let data = [];
+      for (var i = 0; i < 100; i++) {
+        var x = this.randomNum(1, 9);
+        var y = this.randomNum(0, 8);
+        var z = this.randomNum(1, 10);
+        data.push([x, y, z]);
+      }
+      this.option3.series[0].data = data;
+      this.chartObj3.setOption(this.option3);
+    },
   },
   mounted() {
     this.setChart();

+ 2 - 2
src/components/pages/worksDetail.vue

@@ -109,7 +109,7 @@
                 <div class="bigImg" v-else>
                   <img
                     :src="
-                    item.thumbnail.length > 0 ? item.thumbnail[1][0].url
+                    item.thumbnail.length > 0 && item.thumbnail[1].length ? item.thumbnail[1][0].url
                       : ''
                   "
                     alt
@@ -126,7 +126,7 @@
                   <div :class="item.tType == 1 ? 'isClick' : ''">
                     <img
                       :src="
-                    item.thumbnail.length > 0 ? item.thumbnail[1][0].url
+                    item.thumbnail.length > 0 && item.thumbnail[1].length ? item.thumbnail[1][0].url
                       : ''
                   "
                       alt