home_frm.html 25.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600
<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
      <title>首页frm</title>
      <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
      <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
      <link rel="stylesheet" type="text/css" href="../../css/home/home.css"/>
      <style>
          html,
          body{

          }
      </style>
  </head>
  <body>
    <!-- <div id="demo">滚动高度:</div> -->
    <div class="panel-and-count">
      <div class="panel-area">
        <div class="device-name" id="deviceName">创意产业园机房003号</div>
        <div class="device-imei" id="deviceImei">设备编号:165746546463412</div>
        <!--aui-hide-->
        <div class="statusList">
          <div class="aui-row aui-row-flex">
              <div class="aui-col aui-col-span-7 aui-row-flex-center aui-row-flex-middle" style="height:111px;">
                <div class="device-state">
                  <div class="cur-state-value" id="cur_state1">离线</div>
                  <div class="short-line"></div>
                  <div class="state-title">状态</div>
                </div>
              </div>
              <div class="aui-col aui-col-span-10 aui-row-flex-center aui-row-flex-middle" style="height:111px;">
                <img src="../../image/top-middle.png" style="height:100%;"/>
              </div>
              <div class="aui-col aui-col-span-7 aui-row-flex-center aui-row-flex-middle" style="height:111px;">
                <div class="device-state">
                  <div class="cur-state-value" id="cur_state2">合闸</div>
                  <div class="short-line"></div>
                  <div class="state-title">开关</div>
                </div>
              </div>
          </div>
        </div>
        <div class="panel-count">
          <div class="aui-row aui-row-flex">
            <div class="aui-col aui-col-span-8 aui-row-flex-center aui-row-flex-middle" style="height:64px;">
              <div class="aui-row aui-row-flex">
                <div class="aui-col aui-col-span-24 aui-row-flex-center aui-row-flex-middle">
                  <div class="device-count" id="deviceCount" style="color:rgba(91,127,248,1);"></div>
                </div>
                <div class="aui-col aui-col-span-24 aui-row-flex-center aui-row-flex-middle">
                  <p class="count-tip">设备总数</p>
                </div>
              </div>
            </div>
            <div class="aui-col aui-col-span-8 aui-row-flex-center aui-row-flex-middle" style="height:64px;">
              <div class="aui-row aui-row-flex">
                <div class="aui-col aui-col-span-24 aui-row-flex-center aui-row-flex-middle">
                  <div class="device-count" id="deviceOnlineCount" style="color:rgba(112,194,72,1);">45</div>
                </div>
                <div class="aui-col aui-col-span-24 aui-row-flex-center aui-row-flex-middle">
                  <p class="count-tip">在线设备</p>
                </div>
              </div>
            </div>
            <div class="aui-col aui-col-span-8 aui-row-flex-center aui-row-flex-middle" style="height:64px;">
              <div class="aui-row aui-row-flex">
                <div class="aui-col aui-col-span-24 aui-row-flex-center aui-row-flex-middle">
                  <div class="device-count" id="deviceOfflineCount" style="color:rgba(242,97,97,1);">23</div>
                </div>
                <div class="aui-col aui-col-span-24 aui-row-flex-center aui-row-flex-middle">
                  <p class="count-tip">离线设备</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="tab-btns"> <!--八大按钮-->
          <section class="aui-grid" style="padding-left:10px;">
          <div class="aui-row aui-row-flex">
              <div class="aui-col aui-col-span-6 aui-row-flex-center aui-row-flex-middle" tapmode onclick="alert('click')" style="margin-top:0px;">
                <div class="tool-infos">
                  <img style="width:33px;height:33px;" src="../../image/home_menu1.png"/>
                </div>
                <div class="description">测量信息</div>
              </div>
              <div class="aui-col aui-col-span-6 aui-row-flex-center aui-row-flex-middle" tapmode onclick="alert('click')">
                <div class="aui-badge aui-hide" id="protectCount"></div>
                <div class="tool-infos">
                  <img style="width:33px;height:33px;" src="../../image/home_menu2.png"/>
                </div>
                <div class="description">保护动作</div>
              </div>
              <div class="aui-col aui-col-span-6 aui-row-flex-center aui-row-flex-middle" tapmode onclick="alert('click')">
                <div class="aui-badge aui-hide" id="alarmCount"></div>
                <div class="tool-infos">
                  <img style="width:33px;height:33px;" src="../../image/home_menu3.png"/>
                </div>
                <div class="description">报警信息</div>
              </div>
              <div class="aui-col aui-col-span-6 aui-row-flex-center aui-row-flex-middle" tapmode onclick="alert('click')">
                <div class="tool-infos">
                  <img style="width:33px;height:33px;" src="../../image/home_menu4.png"/>
                </div>
                <div class="description">统计分析</div>
              </div>
              <div class="aui-col aui-col-span-6 aui-row-flex-center aui-row-flex-middle" tapmode onclick="alert('click')">
                <div class="tool-infos">
                  <img style="width:33px;height:33px;" src="../../image/home_menu5.png"/>
                </div>
                <div class="description">设备信息</div>
              </div>
              <div class="aui-col aui-col-span-6 aui-row-flex-center aui-row-flex-middle" tapmode onclick="alert('click')">
                <div class="tool-infos">
                  <img style="width:33px;height:33px;" src="../../image/home_menu6.png"/>
                </div>
                <div class="description">参数设置</div>
              </div>
              <div class="aui-col aui-col-span-6 aui-row-flex-center aui-row-flex-middle" tapmode onclick="alert('click')">
                <div class="tool-infos">
                  <img style="width:33px;height:33px;" src="../../image/home_menu7.png"/>
                </div>
                <div class="description">操作日志</div>
              </div>
              <div class="aui-col aui-col-span-6 aui-row-flex-center aui-row-flex-middle" tapmode onclick="alert('click')">
                <div class="tool-infos">
                  <img style="width:33px;height:33px;" src="../../image/home_menu8.png"/>
                </div>
                <div class="description">故障报修</div>
              </div>
          </div>
        </section>
    </div>
    <div class="info-title">远程操作</div>
    <div class="operation-menu-list">
      <div class="aui-row">
        <div class="aui-col aui-col-span-12 aui-row-flex-center aui-row-flex-middle">
          <div class="operation-panel" style="margin-right:5px;">
            <div style="margin-left:15px;margin-right:15px;margin-bottom:10px;">
              <span class="operation-description">分闸</span>
              <div class="aui-row aui-row-flex">
                <div class="aui-col aui-col-span-12 aui-row-flex-start" style="margin-top:12.5px;">
                  <img src="../../image/home_peration_menu1.png" style="height:44px;width:44px;">
                </div>
                <div class="aui-col aui-col-span-12 aui-row-flex-end" >
                  <!-- <div style="background-color:red;width:100%;"> -->
                    <div class="operation-btn" tapmode onclick="alert('click')">执行</div>
                  <!-- </div> -->
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="aui-col aui-col-span-12 aui-row-flex-center aui-row-flex-middle">
          <div class="operation-panel" style="margin-left:5px;">
            <div style="margin-left:15px;margin-right:15px;margin-bottom:10px;">
              <span class="operation-description">自检</span>
              <div class="aui-row aui-row-flex">
                <div class="aui-col aui-col-span-12 aui-row-flex-start" style="margin-top:12.5px;">
                  <img src="../../image/home_peration_menu2.png" style="height:44px;width:44px;">
                </div>
                <div class="aui-col aui-col-span-12 aui-row-flex-end" >
                  <!-- <div style="background-color:red;width:100%;"> -->
                    <div class="operation-btn" tapmode onclick="alert('click')">执行</div>
                  <!-- </div> -->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="aui-row" style="margin-top:10px;">
        <div class="aui-col aui-col-span-12 aui-row-flex-center aui-row-flex-middle">
          <div class="operation-panel" style="margin-right:5px;">
            <div style="margin-left:15px;margin-right:15px;margin-bottom:10px;">
              <span class="operation-description">复位</span>
              <div class="aui-row aui-row-flex">
                <div class="aui-col aui-col-span-12 aui-row-flex-start" style="margin-top:12.5px;">
                  <img src="../../image/home_peration_menu3.png" style="height:44px;width:44px;">
                </div>
                <div class="aui-col aui-col-span-12 aui-row-flex-end" >
                  <!-- <div style="background-color:red;width:100%;"> -->
                    <div class="operation-btn" tapmode onclick="alert('click')">执行</div>
                  <!-- </div> -->
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="aui-col aui-col-span-12 aui-row-flex-center aui-row-flex-middle" >
          <div class="operation-panel" style="margin-left:5px;">
            <div style="margin-left:15px;margin-right:15px;margin-bottom:10px;">
              <span class="operation-description">消音</span>
              <div class="aui-row aui-row-flex">
                <div class="aui-col aui-col-span-12 aui-row-flex-start" style="margin-top:12.5px;">
                  <img src="../../image/home_peration_menu4.png" style="height:44px;width:44px;">
                </div>
                <div class="aui-col aui-col-span-12 aui-row-flex-end" >
                  <!-- <div style="background-color:red;width:100%;"> -->
                    <div class="operation-btn" tapmode onclick="alert('click')">执行</div>
                  <!-- </div> -->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="info-title">测量信息</div>
    <div class="chart-panel">
      <div style="margin-left:10px;margin-right:10px;">
        <div class="wrap">
          <div class="cont">
            <div class="aui-tab state" id="tab">
                <div class="aui-tab-item ati aui-active">电流</div>
                <div class="aui-tab-item ati">剩余电流</div>
                <div class="aui-tab-item ati">电压</div>
                <div class="aui-tab-item ati">频率</div>
                <div class="aui-tab-item ati">线缆温度</div>
                <div class="aui-tab-item ati">内部温区1</div>
                <div class="aui-tab-item ati">内部温区2</div>
            </div>
          </div>
        </div>
        <div style="height:1px;background:rgba(240,245,255,1);"></div>
        <div class="tab-view-list" id="echarts_view" style="height:11.5rem;">
          <!-- <div id="echarts_1" class="echarts_view_item"></div>
          <div id="echarts_2" class="echarts_view_item"></div>
          <div id="echarts_3" class="echarts_view_item"></div>
          <div id="echarts_4" class="echarts_view_item"></div>
          <div id="echarts_5" class="echarts_view_item"></div>
          <div id="echarts_6" class="echarts_view_item"></div>
          <div id="echarts_7" class="echarts_view_item"></div> -->
        </div>
      </div>
    </div>
    <div style="height:15px;width:auto"></div>
  </body>
  <script type="text/javascript" src="../../script/api.js"></script>
  <script type="text/javascript" src="../../script/aui-scroll.js" ></script>
  <script type="text/javascript" src="../../script/common.js" ></script>
  <script type="text/javascript" src="../../script/aui-tab.js" ></script>
  <script type="text/javascript" src="../../script/echarts.min.js"></script>
  <script type="text/javascript">
      var token='';
      var imei='';
      var userId='';
      var defaultImei = '';
      var defaultName = '';
      var chartTypeArr = ["current","rest_current", "voltage", "rate", "line_temp","temp1", "temp2"];
      var chartTypeUnitArr = ["A", "mA", "V","Hz", "℃", "℃", "℃"];
      var chartNameArr = ["电流", "剩余电流", "电压","频率", "线缆温度", "内部温度1", "内部温度2"];
      var scroll = new auiScroll({
          listen:true,
          distance:200 //判断到达底部的距离,isToBottom为true
      },function(ret){
        if (ret.scrollTop > 70) {
          api.sendEvent({
            name: 'changeHeader',
            extra: {
              hide: false,
              deviceName: defaultName,
            }
          });
        }else {
          api.sendEvent({
              name: 'changeHeader',
              extra: {
                hide: true
              }
          });
        }
      });
      apiready = function(){
        api.parseTapmode();
        /** 下拉刷新 */
        api.setRefreshHeaderInfo({
            loadingImg:'',
            bgColor: '#5397f3',
            textColor: '#000',
            textDown: '下拉刷新...',
            textUp: '松开刷新...'
        }, function(ret, err) {
          loadInfoIndex();
          api.refreshHeaderLoadDone();
        });

        // 置底部
        // api.pageDown({
        //     bottom: true
        // })
        //登录方式切换
        var tab = new auiTab({
            element:document.getElementById("tab"),
        },function(ret){
          loadDailyChart(ret.index);
        })
        loadInfoIndex();

        api.addEventListener({
            name: 'change_device'
        }, function(ret, err){
            if( ret ){
              loadInfoIndex();
            }
        });

      };

      function loadInfoIndex() {
        api.showProgress({
            style: 'default',
            animationType: 'fade',
            title: '加载中...',
            text: '',
            modal: true
        });
        token = $api.getStorage('userToken');
        userId = $api.getStorage('userID');
        if (!check()) {
          return false;
        }else {
          api.ajax({
            url: HOST + '/iot_api/v1/app/bind_list?user_id='+userId,
            method: 'GET',
            headers: {
              'Content-Type': 'application/json;charset=utf-8',
              'token': token
            },
          }, function(ret, err) {
            api.hideProgress();
            if (ret) {
              if (ret.code == 0) {
                var deviceList = ret.data.list;
                $api.html($api.byId("deviceCount"), deviceList.length);
                if(!deviceList || deviceList.length==0){
                  $api.setStorage('devices', JSON.stringify([]));
                  api.alert({
                    title: '添加设备',
                    msg: '暂无设备,请先添加设备...',
                  }, function(ret, err){
                    if( ret ){
                    //  openCanner(true);
                    console.log('这里要打开扫描器');
                    }
                  });
                  return false;
                }else {
                  $api.setStorage('devices', JSON.stringify(deviceList));
                }
                //确认默认设备
                for(var i in deviceList){
                  if (deviceList[i].default == true) {
                    $api.setStorage('defaultDevice', deviceList[i].imei);
                    defaultImei = deviceList[i].imei;
                    deviceList[i].storename == null ? defaultName = deviceList[i].imei :  defaultName = deviceList[i].storename;
                    break;
                  }
                }
                loadDeviceInfo();//加载头部信息
                loadDailyChart(1);//默认加载电流的折线图
              }else {
                api.toast({msg: '网络错误',duration: 2000,location: 'bottom'});
              }
            }

          })
        }
      }

      function loadDeviceInfo() {
        $api.html($api.byId("deviceImei"), "设备编号:"+ defaultImei);
        $api.html($api.byId("deviceName"), defaultName);
        api.ajax({ //总报警数
          url: HOST + '/iot_api/v1/app/get_unsloved_warning_count?user_id='+userId,
          method: 'GET',
          headers: {
            'Content-Type': 'application/json;charset=utf-8',
            'token': token
          },
        }, function(ret, err) {
          if (ret) {
            api.sendEvent({
                name: 'changeAlarmCount',
                extra: {
                  count: ret.data,
                }
            });
          }else {
            api.toast({msg: '网络错误',duration: 2000,location: 'bottom'});
          }
        });

        //当前单个设备的所有信息
        api.ajax({
          url: HOST + '/iot_api/v1/app/device?imei='+defaultImei,
          method: 'GET',
          headers: {
            'Content-Type': 'application/json;charset=utf-8',
            'token': token
          },
        }, function(ret, err) {
          //专门搞个方法填页面数据
          showDevice(ret.data.device);
        });
        //------------------
        //保护动作和报警信息数量需要另外获取
        getProtectAndAlarm();
      }

      function showDevice(info) {
        if(info.online){
          $api.html($api.byId("cur_state1"), '在线');
        }else{
          $api.html($api.byId("cur_state1"), '离线');
        }
        if(info.gate_status == "1"){
          $api.html($api.byId("cur_state2"), '合闸');
        }else{
          $api.html($api.byId("cur_state2"), '分闸');
        }
      }

      function getProtectAndAlarm() {
        api.ajax({
          url: HOST + '/iot_api/v1/app/get_warning_and_action_count?imei='+defaultImei,
          method: 'GET',
          headers: {
            'Content-Type': 'application/json;charset=utf-8',
            'token': token
          },
        }, function(ret, err) {
          var protect_dom = $api.byId("protectCount");
          var alarm_dom = $api.byId("alarmCount");
          if (ret.data.action_count>0) {
            if ($api.hasCls(protect_dom,'aui-hide')) {
              $api.removeCls(protect_dom, 'aui-hide');
              $api.html(protect_dom, ret.data.action_count);
            }else {
              $api.html(protect_dom, ret.data.action_count);
            }
          }else {
            $api.addCls(protect_dom, 'aui-hide');
            $api.html(protect_dom, 0);
          }

          if (ret.data.warning_count>0) {
            if ($api.hasCls(alarm_dom,'aui-hide')) {
              $api.removeCls(alarm_dom, 'aui-hide');
              $api.html(alarm_dom, ret.data.warning_count);
            }else {
              $api.html(alarm_dom, ret.data.warning_count);
            }
          }else {
            $api.addCls(alarm_dom, 'aui-hide');
            $api.html(alarm_dom, 0);
          }

        });
      }

      function loadDailyChart(index) {
        var echartDom = document.getElementById("echarts_view");
        var chartType = chartTypeArr[index-1];
        var imei = defaultImei;
        var chartTypeUnit = chartTypeUnitArr[index-1];
        var chartName = chartNameArr[index-1];
        api.ajax({
          url: HOST + '/iot_api/v1/app/chart_daily?imei='+imei+'&type='+chartType,
          method: 'GET',
          headers: {
            'Content-Type': 'application/json;charset=utf-8',
            'token': token
          },
        }, function(ret, err) {
          if (ret.code == 0) {
            var myChart = echarts.init(echartDom);
            var option = {
              // legend: {
              //   data: chartName
              // }
              title: {
                  left: 'center',
                  text: chartName+'趋势变化图',
              },
              grid: {
                //  top: 50,
                 x: 40,
                 x2: 20,
                 y: 50,
              },
            tooltip: {
                trigger: 'axis',
                position: 'top',
                formatter: function (params) {
                      params = params[0];
                      return params.axisValue+'<br />'+params.marker+params.seriesName+'值 '+params.data+chartTypeUnit;
                  },
            },
              xAxis: {
                  type: 'category',
                  boundaryGap: false,
                  data: ret.data.date.map(function(item){
                    return item.substring(11,16)
                  }),
                  axisLine: {
                      lineStyle: {
                          color: '#B0C8FF'
                      }
                  },
                  axisLabel: {
                    textStyle: {
                      color: function (value, index) {
                          return '#818295';
                      }
                    },
                    rotate:330
                  }
              },
              yAxis: {
                  type: 'value',
                  boundaryGap: [0, '100%'],
                  //y轴颜色
                  axisLine: {
                     lineStyle: {
                         color: '#fff'
                     }
                  },
                  axisLabel: {
                      formatter: '{value}'+chartTypeUnit,
                      textStyle: {
                        color: function (value, index) {
                            return value >= 0 ? '#818295' : 'red';
                        }
                      }
                  }
              },
              dataZoom: [
                {
                  type: 'slider',
                  fillerColor: '#B0C8FF',
                  backgroundColor: '#F0F5FF',
                  start: 0,
                  end: 100,
                  handleIcon: 'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAABgCAMAAABL/ICqAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAb1BMVEUAAABVgP9bgflbgPhbgPlagPhagPhcgPhagPhaf/lggP9agPhagPhZgPhXg/hagPlcgPpagPhagPhVjv9bgPlagPhagPhagPhiif9ZgPhagPhbgPlag/hbgPhmgP9agPlagPlagPhagPlagPj////onej4AAAAI3RSTlMADFeYyOn4JJv0CIj5iSPPMujqCdDR+pwNmuv1JYoK9liZyeT+oW0AAAABYktHRCS0BvmZAAAAB3RJTUUH4wkHDRkT26Xi0QAAANlJREFUSMftl1kWgjAMAMMmi61s0rKpQO5/RwF9yFJSD9D5zbwE/qYAC5btuN7l4rmObcERPwhxIQz83Ti6MtzAeLSe32I8EK+WJCkqSJPlfIZKsu+O/I4nFPkscDyFzx8ozgUxHQmQQAKUISWEJdhIYkNFCxW4tOBCTQs1MFpggBqMYAQjGMEIRjCCEfaCNjC0iaKNHG0maUOLTrWmBJCUIKcepXKx1QTn45Osxdm8eP4XvfpsHncorhSbeo/47l/ENt1H2qD5jV+yVbwPrK4fMiGyoe9Wz4c3GHSDjQDTa9cAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDktMDdUMjA6MjU6MTktMDc6MDC6P1BmAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA5LTA3VDIwOjI1OjE5LTA3OjAwy2Lo2gAAAABJRU5ErkJggg==',
                  // handleSize: '60%',
                  handleStyle: {
                      color: '#5B7FF8',
                      shadowBlur: 1,
                      shadowColor: 'rgba(0, 0, 0, 0.6)',
                      shadowOffsetX: 2,
                      shadowOffsetY: 2
                  },

                  dataBackground:{
                      lineStyle:{
                          color:'#F0F5FF'
                      },
                      areaStyle:{
                          color:'#F0F5FF',
                          opacity:1,
                      }
                  },
                  bottom:'0%'
                },{
                    type: 'inside',//这个 dataZoom 组件是 inside 型 dataZoom 组件(能在坐标系内进行拖动,以及用滚轮(或移动触屏上的两指滑动)进行缩放)
                    xAxisIndex: 0,//控制x轴
                }
              ],
              series: [{
                  data: ret.data[chartType],
                  name:chartName,
                  type:'line',
                  showSymbol: true,
                  hoverAnimation: false,
                  symbol: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z',
                  symbolSize: 8,
                  // 折线颜色
                  itemStyle: {
                   normal: {
                       color: '#5B7FF8',
                       lineStyle: {
                           color: '#5B7FF8'
                       }
                   }
                  },
              }]
            };
            if (option && typeof option === "object") {
              myChart.setOption(option, true);
            }
          }
        });
      }
  </script>
  </html>