group_footer.html 4.92 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="../../css/api.css"/>
      <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
      <link rel="stylesheet" type="text/css" href="../../css/home.css"/>
      <link rel="stylesheet" type="text/css" href="../../css/element.css"/>
      <link rel="stylesheet" type="text/css" href="../../css/style.css"/>

      <style>
          html,
          body{
            background: #FFFFFF;
          }
      </style>
  </head>
  <body>
    <div id="app">
      <template>
        <div style="box-shadow:0px 1px 0px  rgba(0, 0, 0, 0.3) inset;border-bottom:1px solid rgba(217,229,255,1);">
          <div style="margin-left:15px;margin-right:15px;">
            <div class="aui-row aui-row-flex" style="height:64px;">
              <div class="aui-col aui-col-span-12" style="margin-top:18px;height:28px;">
                <div class="aui-row aui-row-flex" style="line-height:28px;" tapmode @click="selectAll()">
                    <img src="../../image/alarm/icon-unselected.png" id="img_select" style="width:18px;height:18px;margin-top:0.2rem;"  />
                    <span>&nbsp;全部选择</span>
                </div>
              </div>
              <div v-if="api.pageParam.from === 'groupManage_win'" class="aui-col aui-col-span-12 aui-row-flex-center aui-row-flex-middle aui-row-flex-end" style="margin-top:18px;height:28px;" tapmode @click="signRead">
                <div style="border:1px solid #F26161;border-radius:17px;">
                  <span style="font-size:14px;font-family:PingFang SC;font-weight:500;color:#F26161;margin-left:10px;margin-right:10px;margin-top:5px;margin-bottom:5px;">删除分组</span>
                </div>
              </div>
              <div v-if="api.pageParam.from === 'groupDetail'" class="aui-col aui-col-span-12 aui-row-flex-center aui-row-flex-middle aui-row-flex-end" style="margin-top:18px;height:28px;" tapmode @click="signRead">
                <div style="border:1px solid #F26161;border-radius:17px;">
                  <span style="font-size:14px;font-family:PingFang SC;font-weight:500;color:#F26161;margin-left:10px;margin-right:10px;margin-top:5px;margin-bottom:5px;">删除设备</span>
                </div>
              </div>
            </div>
          </div>
        </div>
      </template>
    </div>
  </body>
  <script type="text/javascript" src="../../script/api.js"></script>
  <script type="text/javascript" src="../../script/jquery-3.3.1.min.js"></script>
  <script type="text/javascript" src="../../script/vue.min.js"></script>
  <script type="text/javascript" src="../../script/common.js"></script>
  <script type="text/javascript" src="../../script/element.js"></script>
  <script type="text/javascript" src="../../script/ctrl.js"></script>
  <script type="text/javascript" src="../../script/fastclick.js "></script>
  <script type="text/javascript">
      var vm;
      apiready = function(){
      api.parseTapmode();
      $(function() {
        FastClick.attach(document.body);
      }); 

        //---------初始化vue
        vm = new Vue({
          el: '#app',
          data: {
            ischooseall: false,
          },
	        mounted() {
            //window.chooseProduct = this.chooseProduct;
          },
          created() {

          },
          methods: {
            selectAll() {
              this.ischooseall = !this.ischooseall;
              if (api.pageParam.from === 'groupDetail') {
                api.sendEvent({
                  name: 'groupDetailSelectAll',
                  extra: {
                      chooseAll: this.ischooseall,
                  }
                });
              }
              if (api.pageParam.from === 'groupManage_win') {
                api.sendEvent({
                  name: 'groupSelectAll',
                  extra: {
                      chooseAll: this.ischooseall,
                  }
                });
              }

              let dom = $api.byId('img_select');
              if (this.ischooseall) {
                dom.src = '../../image/alarm/icon-selected.png';
              }else {
                dom.src = '../../image/alarm/icon-unselected.png';
              }
            },
            signRead() {
              if (api.pageParam.from === 'groupDetail') {
                api.sendEvent({
                  name: 'group_device_batch_del',
                });
              }
              if (api.pageParam.from === 'groupManage_win') {
                api.sendEvent({
                    name: 'group_bach_del'
                });
              }
            }
          }
        })
      };
  </script>
</html>