<template>

  <div class="flex-row">
    <valve-control class="flex" v-if="isShowThisFunction && !isShowBatchOperationValve && !isShowMonthUseGas"
                style="width:100%;" v-on:refresh="refreshPage"
                @select-changed="selected"></valve-control>

    <!--表具面板-->
    <div style="width: 45%" v-if="showItem">
      <!--是否为物联网用户，如果是物联网用户则显示物联网操作面板-->
      <web-meter-operation-panel style="height: auto" v-if="isWebMeter" :data="rowData"></web-meter-operation-panel>
      <web-meter-instruct style="height: 49.5%" v-if="isWebMeter && isShowInstruct" :rowdata="rowData"
                          :user="false"></web-meter-instruct>
    </div>
  </div>
</template>

<script>


export default{
    title: '阀控管理页面',
    name: 'WebMeterValveManage',
    data() {
      return {
        showItem: false,
        isWebMeter: false,
        isShowInstruct: false,
        rowData: {},
        isShowThisFunction: true,
        isShowBatchOperationValve: false,
        isShowMonthUseGas: false,
        msg: "",
        parames: undefined,
        handplan: {
          f_batterylevel: '未查询到该值',
          f_signal: '未查询到该值',
          f_valvestate: '未查询到该值',
          f_tablebase: '未查询到该值',
          f_last_tablebase: '未查询到该值',
          f_hand_date: '未查询到该值',
          f_insert_date: '未查询到该值'
        },
        network: {
          f_network_valve: '123'
        }
      }
    },
    ready() {
    },
    methods: {
      refreshPage () {
        this.showItem = false
      },
      show() {
        this.showItem = this.showItem ? false : true
      },
      selected(row) {
        this.showItem = true
        if (row.val.f_meter_type === '物联网表') {
          this.isWebMeter = true
        } else {
          this.isWebMeter = false
        }
        this.isShowInstruct = false
        this.rowData = row.val
        this.showItem = true
        //不知道怎么回事，Parames无法触发监控指令，所以出此下策
        if (this.parames) {
          this.parames.dataValue = this.rowData.f_user_id
          this.parames.typeSearch('')
        }
      }
    }
  }
</script>

<style scoped>

</style>
