<template>
  <tab-button class="foot_tabset" :active="-1">
    <tabs header="指令查询" v-if="permission('指令查询')">
      <instruct-manage v-if="show.includes('指令查询')"></instruct-manage>
    </tabs>
    <tabs header="历史指令查询" v-if="permission('历史指令查询')">
      <instruct-manage-history v-if="show.includes('历史指令查询')"></instruct-manage-history>
    </tabs>
    <tabs header="上报查询" v-if="permission('上报查询')">
      <report-list v-if="show.includes('上报查询')"></report-list>
    </tabs>
    <tabs header="结算查询" v-if="permission('结算查询')">
      <report-data-query v-if="show.includes('结算查询')"></report-data-query>
    </tabs>
    <tabs header="缴费查询" v-if="permission('缴费查询')">
      <recharge-instruct-query v-if="show.includes('缴费查询')"></recharge-instruct-query>
    </tabs>
    <tabs header="异常查询" v-if="permission('异常查询')">
      <meter-exception-list v-if="show.includes('异常查询')"></meter-exception-list>
    </tabs>
    <tabs header="用户失联" v-if="permission('用户失联')">
      <user-lost-contact-analysis v-if="show.includes('用户失联')"></user-lost-contact-analysis>
    </tabs>
    <tabs header="失联查询" v-if="permission('失联查询')">
      <lost-contact-analysis-list v-if="show.includes('失联查询')"></lost-contact-analysis-list>
    </tabs>
    <tabs header="未用气查询" v-if="permission('未用气查询')">
      <get-no-meteread-query v-if="show.includes('未用气查询')"></get-no-meteread-query>
    </tabs>
    <tabs header="物联网表结算分析" v-if="!newWebHand && permission('物联网表结算分析')">
      <webmeter-settlement-analysis v-if="show.includes('物联网表结算分析')"></webmeter-settlement-analysis>
    </tabs>
    <tabs header="物联网表结算分析" v-if="newWebHand &&permission('物联网表结算分析')">
      <new-webmeter-settlement-analysis v-if="show.includes('物联网表结算分析')"></new-webmeter-settlement-analysis>
    </tabs>
    <tabs header="物联用户月度结算查询" v-if="permission('物联用户月度结算查询')">
      <webhand-month-gas v-if="show.includes('物联用户月度结算查询')"></webhand-month-gas>
    </tabs>
  </tab-button>

</template>

<script>
import TabButton from '../../components/sale/common/TabButton'
import Tabs from '../../components/sale/common/Tabs'

  export default {
    title: '物联查询',
    data () {
      return {
        newWebHand: this.$appdata.getSingleValue('新抄表'),
        show: []
      }
    },
    components: {Tabs, TabButton},
    methods: {
      permission (name) {
        // 保留是为了后面可能也会和综合查询一样加权限
        if (this.$login.r.find(value => value === '物联查询') || name === '历史指令查询') {
          if (!this.$login.r.find(value => value === name)) {
            return false
          }
        }
        return true
      }
    }
  }
</script>

<style scoped>
</style>
