Bläddra i källkod

Merge branch 'master' of gitee.com:sh_13808852820/program into master

智方网络_吖荣 4 år sedan
förälder
incheckning
ca260aa42c

+ 12 - 25
src/components/device/device.vue

@@ -23,10 +23,7 @@
         </div>
 
         <!-- 已链接 -->
-        <div
-          class="connected_box"
-          v-if="connect_show"
-        >
+        <div class="connected_box" v-if="connect_show">
           <device_connected
             @open_choose_toy="open_choose_toy"
             @change_brain_status="change_device_status"
@@ -73,10 +70,7 @@
       </div>
       <!-- 内容 -->
       <div class="padding toy_list">
-        <van-row
-          gutter="14"
-          class="toy_list_content"
-        >
+        <van-row gutter="14" class="toy_list_content">
           <van-col
             v-for="(toy, index) in toy_list"
             :key="index"
@@ -91,11 +85,7 @@
                   : 'toy_item_normal_bg'
               "
             >
-              <img
-                :src="toy.img"
-                alt=""
-                class="toy_img"
-              />
+              <img :src="toy.img" alt="" class="toy_img" />
               <text class="toy_text padding-top">{{ toy.name }}</text>
             </div>
           </van-col>
@@ -103,7 +93,8 @@
       </div>
       <!-- 结尾 -->
       <div class="toy_actions padding text-center">
-        <view class="text-gray toy_action_text padding">选择你最感兴趣的项目,点击“选好了”以后将会自动连接
+        <view class="text-gray toy_action_text padding"
+          >选择你最感兴趣的项目,点击“选好了”以后将会自动连接
         </view>
         <button
           class="cu-btn lg cu-btn-primary text-white text-center padding"
@@ -125,7 +116,6 @@
     <!--    >-->
     <!--      <gameIng v-if="game_status" @closePop="onStartGameShowClose"></gameIng>-->
     <!--    </van-popup>-->
-
   </div>
 </template>
 
@@ -327,16 +317,13 @@ export default {
       $this.choose_toy_window.show = true;
       let $serviceId = game_store.getters.getServiceId();
       let $charateristic = game_store.getters.getCharacterId();
-      
+
       bluetooth.shutdownSendControl(
-            $this._deviceId,
-            $serviceId,
-            $charateristic
-          );
-      bluetooth.sendEnd(
-            $this._deviceId,
-            $serviceId,
-            $charateristic);
+        $this._deviceId,
+        $serviceId,
+        $charateristic
+      );
+      bluetooth.sendEnd($this._deviceId, $serviceId, $charateristic);
     },
     // 选好玩具
     choose_ok() {
@@ -537,7 +524,7 @@ export default {
     let $game_status = game_store.getters.getGameStatus();
     // 游戏过程中关闭脑环状态
     let $game_close_status = game_store.getters.getGameCloseStatus();
-    // console.log("游戏中:" + $game_status);
+    console.log("返回时:" + $game_status, $game_close_status);
     if ($game_status == 3) {
       //不在游戏状态
       $this.connect_toy = 0;

+ 1 - 1
src/components/device/toy/connecting.vue

@@ -328,7 +328,7 @@ export default {
       $this.pay_type = $event;
       let $params = {
         type: $event,
-        device_id: $this.toy_id,
+        device_id: $this.toy_id, 
         access_token: wx.getStorageSync("token"),
       };
       gameStart($params).then(

+ 248 - 9
src/pages/report/index.vue

@@ -204,13 +204,13 @@
       </view>
     </view>
     <!-- 专注力变化看板 -->
-    <!-- <view class="absorbed_change">
+    <view class="absorbed_change">
       <view class="interfere_title_wrap">
         <view class="line"></view>
         <view class="title">专注力变化分析</view>
-      </view> -->
-    <!-- 看板一 干扰 -->
-    <!-- <view class="interfere_wrap">
+      </view>
+      <!-- 看板一 干扰 -->
+      <view class="interfere_wrap">
         <view class="interfere">
           <img
             src="http://img.shuimuai.com/program_interfere_log.png"
@@ -223,11 +223,86 @@
           </view>
         </view>
+        <!-- 表图 -->
+        <view class="interfere_echarts_wrap">
+          <view class="interfere_echarts">
+            <mpvue-echarts
+              :echarts="echarts"
+              :onInit="interfere_charts"
+              canvasId="demo-canvas-4"
+            />
+          </view>
+          <view class="interfere_echarts_bottom">
+            <text>0</text>
+            <text>2</text>
+            <text>4</text>
+            <text>6</text>
+            <text>8</text>
+            <text>10</text>
+            <text>12</text>
+            <text>14</text>
+            <text>16</text>
+            <text>18</text>
+            <text>20</text>
+          </view>
+        </view>
         <view class="interfere_footer">
           <title class="interfere_footer_logo"></title>专注力干扰
         </view>
       </view>
-    </view> -->
+
+      <!-- 调整能力分析 -->
+      <view class="adjustment_warp">
+        <view class="adjustment_title">
+          <img
+            src="http://img.shuimuai.com/program_rise_log.png"
+            alt=""
+            class="adjustment_title_logo"
+          >
+          <text>调整能力分析</text>
+        </view>
+        <!-- 表图 -->
+        <view class="adjustment_echarts_wrap">
+          <view class="adjustment_echarts">
+            <mpvue-echarts
+              :echarts="echarts"
+              :onInit="adjustment_charts"
+              canvasId="demo-canvas-5"
+            />
+          </view>
+          <view class="adjustment_echarts_bottom">
+            <text>0</text>
+            <text>2</text>
+            <text>4</text>
+            <text>6</text>
+            <text>8</text>
+            <text>10</text>
+            <text>12</text>
+            <text>14</text>
+            <text>16</text>
+            <text>18</text>
+            <text>20</text>
+          </view>
+        </view>
+        <view class="adjustment_footer">
+          <view class="adjustment_footer_logo"></view>专注力上升
+        </view>
+      </view>
+
+      <!-- 爆发值和调整时间 -->
+      <view class="absorbed_change_footer">
+        <view class="footer_text">
+          最大爆发值:
+          <text class="footer_text_W">{{ record.burst }}</text>
+        </view>
+        <view class="footer_text">
+          平均调整时间:
+          <text class="footer_text_W">{{ record.burstTime}}</text>
+          s
+        </view>
+      </view>
+
+    </view>
 
     <van-toast id="van-toast" />
 
@@ -244,12 +319,21 @@ import util, {
   getPieChartsOption,
   getRadarChartOption,
   timestampToTimeS,
+  getInterfereChartsOption,
+  interfereAction,
+  getAdjustmentChartsOption,
 } from "../../utils/index";
 import { gameDetail, gameLineChart } from "../../requests/game";
 import game_store from "../../store/game";
 import Toast from "../../../static/vant/toast/toast";
 
-var att_charts, hight_att_pie_charts, radar_charts, $pie_charts, $this;
+var att_charts,
+  hight_att_pie_charts,
+  radar_charts,
+  $pie_charts,
+  $interfere_echarts,
+  $adjustment_echarts,
+  $this;
 
 // 大脑图表初始化
 function initAttChart(canvas, width, height) {
@@ -310,6 +394,35 @@ function initPieChart(canvas, width, height) {
   return $pie_charts; // 返回 chart 后可以自动绑定触摸操作
 }
 
+// 干扰图表初始化 interfere_echarts
+function interfereChart(canvas, width, height) {
+  $interfere_echarts = echarts.init(canvas, null, {
+    width: width,
+    height: height,
+  });
+  canvas.setChart($interfere_echarts);
+
+  var option = getInterfereChartsOption(); // ECharts 配置项
+
+  $interfere_echarts.setOption(option);
+
+  return $interfere_echarts; // 返回 chart 后可以自动绑定触摸操作
+}
+// 调整能力表初始化 interfere_echarts
+function adjustmentCharts(canvas, width, height) {
+  $adjustment_echarts = echarts.init(canvas, null, {
+    width: width,
+    height: height,
+  });
+  canvas.setChart($adjustment_echarts);
+
+  var option = getAdjustmentChartsOption(); // ECharts 配置项
+
+  $adjustment_echarts.setOption(option);
+
+  return $adjustment_echarts; // 返回 chart 后可以自动绑定触摸操作
+}
+
 export default {
   name: "index_container",
   components: {
@@ -318,11 +431,13 @@ export default {
   data() {
     return {
       // 0:未选择 1:时间 2:次数
-      // 折线图
+      // 折线图 表格数据
       attCharts: initAttChart,
       hight_att_charts: initHightPieChart,
       radar_charts: initRadarChart,
       pie_charts: initPieChart,
+      interfere_charts: interfereChart,
+      adjustment_charts: adjustmentCharts,
 
       echarts,
       record: {},
@@ -335,6 +450,10 @@ export default {
       data_section: 0,
       //数据集合
       data_lines: [],
+      //  干扰值
+      interfereData: [],
+      // 调整能力值
+      adjustmentData: [],
     };
   },
   methods: {
@@ -352,10 +471,12 @@ export default {
             Toast.clear();
             let $res = res.data;
             $this.record = $res.data;
-            console.log("成绩记录参数", $this.record);
+
+            // console.log("成绩记录数据", $res.data.interfereArr);
+            // console.log("数据长度:", $res.data.line);
+
             $this.record.play_time = formatSeconds($this.record.play_time);
             $this.record.start_time = timestampToTimeS($this.record.start_time);
-            console.log("训练时间", $this.record.start_time);
             $this.record.height_absorbed = Math.ceil(
               $this.record.height / $this.record.total * 100
             );
@@ -389,6 +510,19 @@ export default {
                 $this.record.play_time / $five_min
               );
             }
+
+            // 干扰值数据传输
+            $this.interfereData = interfereAction($res.data.interfereArr);
+            let $interfere_option = getInterfereChartsOption(
+              $this.interfereData
+            );
+            $interfere_echarts.setOption($interfere_option);
+            // 调整能力数据传输
+            $this.adjustmentData = interfereAction($res.data.burstArr);
+            let $adjustment_option = getAdjustmentChartsOption(
+              $this.adjustmentData
+            );
+            $adjustment_echarts.setOption($adjustment_option);
           },
           (err) => {
             Toast.fail("错误代码:" + res.code + ",联系客服");
@@ -802,6 +936,31 @@ image.boy {
   font-weight: 900;
 }
 /* 干扰 echarts */
+.interfere_echarts_wrap {
+  width: 360px;
+  height: 193px;
+  background: #f3f3f3;
+  opacity: 0.6;
+  box-shadow: 0px 6px 11px #dadada;
+}
+.interfere_echarts {
+  /* margin: 0 auto; */
+  width: 100%;
+  height: 173px;
+  /* background: #f3f3f3;
+  opacity: 0.6;
+  box-shadow: 0px 6px 11px #dadada; */
+}
+.interfere_echarts_bottom {
+  margin: 0 auto;
+  width: 90%;
+  height: 20px;
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+  font-size: 15px;
+  color: #828282;
+}
 /* 干扰 bottom */
 .interfere_footer {
   width: 100%;
@@ -813,6 +972,7 @@ image.boy {
   display: flex;
   justify-content: center;
   align-items: center;
+  margin-top: 10px;
 }
 .interfere_footer .interfere_footer_logo {
   display: inline-block;
@@ -821,4 +981,83 @@ image.boy {
   background-color: #23cc92;
   margin-right: 5px;
 }
+/* 调整能力 */
+.adjustment_warp {
+  margin-top: 50px;
+}
+.adjustment_title {
+  display: flex;
+  color: #676767;
+  font-size: 15px;
+  padding-left: 8px;
+  box-sizing: border-box;
+  margin-bottom: 35px;
+}
+.adjustment_title .adjustment_title_logo {
+  display: inline-block;
+  width: 19px;
+  height: 19px;
+  margin-right: 7px;
+}
+/* 调整能力表图 */
+.adjustment_echarts_wrap {
+  margin: 0 auto;
+  width: 360px;
+  height: 193px;
+
+  background: #f3f3f3;
+  opacity: 0.6;
+  box-shadow: 0px 6px 11px #dadada;
+}
+.adjustment_echarts {
+  width: 100%;
+  height: 173px;
+}
+.adjustment_echarts_bottom {
+  margin: 0 auto;
+  width: 90%;
+  height: 20px;
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+  font-size: 15px;
+  color: #828282;
+}
+.adjustment_footer {
+  width: 100%;
+  height: 26px;
+  font-size: 13px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
+  color: #676767;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-top: 10px;
+}
+.adjustment_footer .adjustment_footer_logo {
+  display: inline-block;
+  width: 13px;
+  height: 13px;
+  background-color: #f3a100;
+  margin-right: 5px;
+}
+/* 爆发值和调整时间 */
+.absorbed_change_footer {
+  display: flex;
+  justify-content: space-around;
+  margin-top: 28px;
+}
+
+.absorbed_change_footer .footer_text {
+  font-size: 16px;
+  color: #676767;
+}
+.footer_text_W {
+  font-size: 21px;
+  font-weight: 600;
+}
+.test {
+  color: rgb(163, 7, 7);
+}
 </style>

+ 1 - 1
src/requests/game.js

@@ -21,7 +21,7 @@ export function gameEnd($params) {
 export function gameDetail($record_id) {
   let $params = {};
   $params["game_record_id"] = $record_id;
-    // $params["game_record_id"] = "5484";
+  // $params["game_record_id"] = "9389";
   $params["access_token"] = wx.getStorageSync("token");
   return fly.post("game/game-detail", $params);
 }

+ 9 - 7
src/utils/bluetooth.js

@@ -447,7 +447,9 @@ export default {
             duration: 0,
             message: '智脑环已断开连接,请重新扫码智脑环'
           });
-          game_store.setters.setGameStatus(0);
+          //   game_store.setters.setGameStatus(0);
+          game_store.setters.setGameCloseStatus(1);
+
 
 
         }
@@ -738,26 +740,26 @@ export default {
   },
 
   //根据错误代码返回字符串信息
-  GetopenBluetoothAdapterError(errCode){
+  GetopenBluetoothAdapterError(errCode) {
 
     let $errmsg = "";
-    if(errCode == 10000){
+    if (errCode == 10000) {
       $errmsg = "未初始化蓝牙适配器"
     }
 
-    if(errCode == 10001){
+    if (errCode == 10001) {
       $errmsg = "当前蓝牙适配器不可用"
     }
 
-    if(errCode == 10002){
+    if (errCode == 10002) {
       $errmsg = "没有找到指定设备"
     }
 
-    if(errCode == 10003){
+    if (errCode == 10003) {
       $errmsg = "连接失败"
     }
 
-    if(errCode == 10006){
+    if (errCode == 10006) {
       $errmsg = "当前连接已断开"
     }
 

+ 8 - 0
src/utils/game.js

@@ -95,3 +95,11 @@ function to_report() {
     }
   })
 }
+
+
+
+
+
+
+
+

+ 208 - 124
src/utils/index.js

@@ -74,7 +74,7 @@ export function formatBirthday(date) {
   return `${t1}`;
 }
 
-// 专注力与放松力图表
+// 专注力与放松力图表 小乌龟
 function getLineOption(lineData_att, lineData_med) {
   const that = this;
   var option = {
@@ -149,8 +149,7 @@ function getLineOption(lineData_att, lineData_med) {
       },
       show: false,
     },
-    series: [
-      {
+    series: [{
         name: "Att(专注度)",
         symbol: "none", //取消折点圆圈
         type: "line",
@@ -241,8 +240,7 @@ function getBaseOption(delta, theta, alpha, beta) {
       },
       show: false,
     },
-    series: [
-      {
+    series: [{
         name: "Delta",
         symbol: "none", //取消折点圆圈
         type: "line",
@@ -353,32 +351,39 @@ export function getHightPieChartOption($params, $total) {
       // trigger: 'item'
       show: false,
     },
-    series: [
-      {
-        name: "访问来源",
-        type: "pie",
-        radius: "80%",
-        labelLine: {
-          show: false,
+    series: [{
+      name: "访问来源",
+      type: "pie",
+      radius: "80%",
+      labelLine: {
+        show: false,
+      },
+      data: [
+        // {value: $params, name: '高专注占比'},
+        // {value: Math.abs(100-$params), name: '直接访问'},
+        {
+          value: $params,
+          name: ''
+        },
+        {
+          value: Math.abs($total - $params),
+          name: ''
         },
-        data: [
-          // {value: $params, name: '高专注占比'},
-          // {value: Math.abs(100-$params), name: '直接访问'},
-          {value: $params, name: ''},
-          {value: Math.abs($total - $params), name: ''},
-        ]
-      }
-    ]
+      ]
+    }]
   };
   return $option;
 }
 
+// 雷达图
 export function getRadarChartOption($params) {
-  console.log("雷达图参数会打印什么呢?", $params);
+
   let $option = {
-    tooltip: {},
+    tooltip: {
+
+    },
+    color: "#ffb72d",
     radar: {
-      // shape: 'circle',
       radius: "55%",
       name: {
         textStyle: {
@@ -388,32 +393,55 @@ export function getRadarChartOption($params) {
           padding: [3, 5],
         },
       },
-      indicator: [
-        { name: "专注力平均值指数", max: 100 },
-        { name: "专注力广度指数", max: 100 },
-        { name: "专注力爆发指数", max: 100 },
-        { name: "专注力抗性指数", max: 100 },
-        { name: "专注力启动指数", max: 100 },
-        { name: "高专注力占比指数", max: 100 },
+      indicator: [{
+          name: "专注力平均值指数",
+          max: 100
+        },
+        {
+          name: "专注力广度指数",
+          max: 100
+        },
+        {
+          name: "专注力爆发指数",
+          max: 100
+        },
+        {
+          name: "专注力抗性指数",
+          max: 100
+        },
+        {
+          name: "专注力启动指数",
+          max: 100
+        },
+        {
+          name: "高专注力占比指数",
+          max: 100
+        },
       ],
+      splitArea: {
+        show: true,
+        areaStyle: {
+          color: ['#423b97', '#5b55a6', '#7570b4', '#a6a3ce', '#dddcec'],
+          // 图表背景网格的颜色
+        }
+      },
+
     },
-    series: [
-      {
-        name: "预算 vs 开销(Budget vs spending)",
-        type: "radar",
-        // areaStyle: {normal: {}},
-        lineStyle: {
-          color: "#D28885",
-        },
-        data: [
-          {
-            value: $params,
-            // name: '实际开销(Actual Spending)'
-            name: "专注力要素分析数据",
-          },
-        ],
+    series: [{
+      name: "预算 vs 开销(Budget vs spending)",
+      type: "radar",
+
+      lineStyle: {
+        // color: "#D28885",
+        color: "#ffda93",
       },
-    ],
+      data: [{
+        value: $params,
+        // name: '实际开销(Actual Spending)'
+        name: "专注力要素分析数据",
+
+      }, ],
+    }, ],
   };
   return $option;
 }
@@ -433,30 +461,28 @@ export function getPieChartsOption($pie_datas) {
         top: "20%",
         data: $pie_datas["legends"],
       },
-      series: [
-        {
-          name: "访问来源",
-          type: "pie",
-          radius: ["40%", "70%"],
-          avoidLabelOverlap: false,
+      series: [{
+        name: "访问来源",
+        type: "pie",
+        radius: ["40%", "70%"],
+        avoidLabelOverlap: false,
+        label: {
+          show: false,
+          position: "center",
+        },
+        right: "40%",
+        emphasis: {
           label: {
-            show: false,
-            position: "center",
-          },
-          right: "40%",
-          emphasis: {
-            label: {
-              show: true,
-              fontSize: "30",
-              fontWeight: "bold",
-            },
-          },
-          labelLine: {
             show: true,
+            fontSize: "30",
+            fontWeight: "bold",
           },
-          data: $pie_datas["datas"],
         },
-      ],
+        labelLine: {
+          show: true,
+        },
+        data: $pie_datas["datas"],
+      }, ],
     };
     return option;
   }
@@ -466,28 +492,7 @@ export function getPieChartsOption($pie_datas) {
 export function filterPieData(datas) {
   let $this = this;
   let legends = [];
-  let $att_region = [
-    // {
-    //   min: 81,
-    //   max: 100
-    // },
-    // {
-    //   min: 61,
-    //   max: 80
-    // },
-    // {
-    //   min: 41,
-    //   max: 60
-    // },
-    // {
-    //   min: 21,
-    //   max: 40
-    // },
-    // {
-    //   min: 0,
-    //   max: 20
-    // },
-    {
+  let $att_region = [{
       min: 0,
       max: 20,
     },
@@ -511,14 +516,13 @@ export function filterPieData(datas) {
   datas.forEach(($val, $index) => {
     legends.push(
       $att_region[$index]["min"] +
-        "-" +
-        $att_region[$index]["max"] +
-        ":" +
-        formatSeconds($val)
+      "-" +
+      $att_region[$index]["max"] +
+      ":" +
+      formatSeconds($val)
     );
     let _data = {
-      name:
-        $att_region[$index]["min"] +
+      name: $att_region[$index]["min"] +
         "-" +
         $att_region[$index]["max"] +
         ":" +
@@ -527,16 +531,20 @@ export function filterPieData(datas) {
     };
     datas[$index] = _data;
   });
-  return { datas, legends };
+  return {
+    datas,
+    legends
+  };
 }
-// 受干扰次数 getInterfereChartsOption
+// 受干扰次数 getInterfereChartsOption 小乌龟
 export function getInterfereChartsOption(interfere_datas) {
-  console.log('干扰初始化',interfere_datas)
+  // console.log('干扰初始化', interfere_datas)
   if (interfere_datas) {
     let option = {
+      color: '#23CC92',
       // 标题
       title: {
-        left: 1220,
+        // left: 1220,
       },
       // 提示
       tooltip: {
@@ -545,37 +553,91 @@ export function getInterfereChartsOption(interfere_datas) {
           type: "shadow",
         },
       },
-   
- 
+      grid: {
+        top: 20,
+        bottom: 20
+      },
       // x轴数据显示
       xAxis: {
-        show: true,
+        type: 'category',
+        boundaryGap: false,
+        // data: ['0', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20'],
+        splitNumber: 11,
+      },
+      // y轴坐标显示
+      yAxis: {
+        color: '#23CC92',
+        type: "value",
+        splitNumber: 5,
+        min: -100,
+        max: 0,
+        axisLabel: {
+          formatter: '{value}',
+          textStyle: {
+            color: '#23CC92'
+          }
+        }
+      },
+      //数据配置项
+      series: [{
+        data: interfere_datas,
+        type: "line",
+        large: true,
+        areaStyle: {}
+      }, ],
+    }
+    return option
+  }
+}
 
-        type: "category",
-        //  data: [1,2,3,4,5,6,7,8,9],
-        // splitNumber: 10,
-        silent: false,
-        splitLine: {
-          show: false,
-        },
-        splitArea: {
-          show: false,
+//  能力调整 getAdjustmentChartsOption
+export function getAdjustmentChartsOption(interfere_datas) {
+  //   console.log('调整初始化', interfere_datas)
+  if (interfere_datas) {
+    let option = {
+      color: '#F3A100',
+      // 标题
+      title: {
+        // left: 1220,
+      },
+      grid: {
+        top: 20,
+        bottom: 20
+      },
+      // 提示
+      tooltip: {
+        trigger: "axis",
+        axisPointer: {
+          type: "shadow",
         },
       },
+      // x轴数据显示
+      xAxis: {
+        type: 'category',
+        boundaryGap: false,
+      },
       // y轴坐标显示
       yAxis: {
-        splitArea: {
-          show: false,
-        },
+        // x: "center",
+        type: "value",
+        splitNumber: 5,
+        min: 0,
+        max: 100,
+        axisLabel: {
+          formatter: '{value}',
+          textStyle: {
+            color: '#F3A100'
+          }
+        }
       },
       //数据配置项
-      series: [
-        {
-          type: "bar",
-          data: [1,2,3,4,5,6,7,8,9],
-          large: true,
-        },
-      ],
+      series: [{
+
+        data: interfere_datas,
+        type: "line",
+        large: true,
+        areaStyle: {}
+      }, ],
     }
     return option
   }
@@ -587,9 +649,9 @@ export function timestampToTimeS(timestamp) {
   var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
   var Y = date.getFullYear() + "-";
   var M =
-    (date.getMonth() + 1 < 10
-      ? "0" + (date.getMonth() + 1)
-      : date.getMonth() + 1) + "-";
+    (date.getMonth() + 1 < 10 ?
+      "0" + (date.getMonth() + 1) :
+      date.getMonth() + 1) + "-";
   var D = date.getDate() + " ";
   var h = date.getHours() + ":";
   var m = date.getMinutes() + ":";
@@ -597,11 +659,33 @@ export function timestampToTimeS(timestamp) {
   return Y + M + D + h + m + s;
 }
 
+
+// 成绩记录干扰图表数据处理  
+export function interfereAction($data) {
+  if ($data) {
+    let $interfereArr = []
+    let $objData = {};
+    //  自定义的对象 1200s 20分钟
+    for (var i = 0; i < 1200; i++) {
+      $objData[i] = 0;
+    }
+    var $newObj = Object.assign($objData, $data);
+    // 对象转数组
+    for (const key in $newObj) {
+      $interfereArr.push($newObj[key]);
+    }
+    return $interfereArr
+
+  } else {
+    console.log("无数据", $data)
+  }
+}
 export default {
   formatNumber,
   formatTime,
   getLineOption,
   getBaseOption,
   get_level_name,
-  timestampToTimeS
+  timestampToTimeS,
+  interfereAction
 };