historyChartDaliySelecter.html 3.41 KB
<!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">
      <meta name="referrer" content="no-referrer">
      <title>历史报表选择器</title>
      <link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/api.css"/>
      <link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/aui.css"/>
      <link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/style.css"/>
      <link rel="stylesheet" type="text/css" href="http://iot.uccc.cc:9090/app/css/aui-flex.css" />
      <style>
          html,
          body{
            background: rgba(0,0,0,0.4);
            width: 100%;
            height: 100%;
          }
      </style>
  </head>
  <body>
    <div style="height:100%;z-index:10;" tapmode onclick="closeSelecter();"></div>
    <div style="bottom: 0;position:fixed;background-color: #FFFFFF;z-index:11;width:100%;">
      <div class="store01001-statistic-alarm-type-selecter-title">报警类型</div>
      <div class="aui-row aui-row-flex" style="margin-top:15px;margin-left:15px;margin-right:15px;">
        <div class="aui-col aui-col-span-8 aui-row-flex-center" tapmode onclick="chooseType('type1',1);">
          <div class="store01001-statistic-type-btn" id="type1">按日</div>
        </div>
        <div class="aui-col aui-col-span-8 aui-row-flex-center" tapmode onclick="chooseType('type2',2);">
          <div class="store01001-statistic-type-btn" id="type2">按月</div>
        </div>
        <div class="aui-col aui-col-span-8 aui-row-flex-center" tapmode onclick="chooseType('type3',3);">
          <div class="store01001-statistic-type-btn" id="type3">按年</div>
        </div>
      </div>
      <div style="height:30px;"></div>
    </div>
    <footer></footer>
  </body>
  <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/api.js"></script>
  <script type="text/javascript" src="http://iot.uccc.cc:9090/app/js/common.js"></script>
  <script type="text/javascript">
    var userId;
    var token;
      apiready = function(){
        api.parseTapmode();
        var footer = $api.dom('footer'); // 获取 footer 标签元素
        var footerH = $api.fixTabBar(footer);
        userId = api.getPrefs({sync: true,key: 'userID'});
        token = api.getPrefs({sync: true,key: 'userToken'});

        getCurSelect(api.pageParam.selected);
      };


      function chooseType(idName,value) {
        var allDom = $api.domAll('.type-btn');
        for (var i = 0; i < allDom.length; i++) {
          $api.removeCls(allDom[i], 'store01001-statistic-type-btn-selecttype-btn-select');
        }
        $api.addCls($api.byId(idName), 'store01001-statistic-type-btn-select');
        api.sendEvent({
            name: 'changeHistoryChartType',
            extra: {
                curSelect: value,
            }
        });


        closeSelecter();
      }

      function getCurSelect(value) {
        var allDom = $api.domAll('.type-btn');
        for (var i = 0; i < allDom.length; i++) {
          $api.removeCls(allDom[i], 'store01001-statistic-type-btn-select');
        }

        $api.addCls($api.byId('type'+value), 'store01001-statistic-type-btn-select');
      }

      function closeSelecter() {
        api.closeFrame();
      }
  </script>
</html>