<style scoped>
  label{
  }
</style>
<template >
  <div class="flex auto" style="padding:20px">
    <!-- 民用 -->
    <span >
      <input type="checkbox" v-model="hinvestigation.twofire" :false-value='0' :true-value='1' class="magic-checkbox" id="twofire" v-if="!show">
      <label for="twofire">两种火源
      <span v-if='hinvestigation.twofire'>**是</span><span v-else>**否</span></label>
    </span>
    <span>
      <input type="checkbox" v-model="hinvestigation.plumbing" :false-value='0' :true-value='1'class="magic-checkbox" id="plumbing" v-if="!show">
      <label for="plumbing">擅自改动燃气管道及设施
      <span v-if='hinvestigation.plumbing'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="hinvestigation.environment" :false-value='0' :true-value='1'class="magic-checkbox" id="environment" v-if="!show">
      <label for="environment">用户改变用气环境
      <span v-if='hinvestigation.environment'>**是</span><span v-else>**否</span></label>
    </span>
    <span>
      <input type="checkbox" v-model="hinvestigation.accommodate" :false-value='0' :true-value='1'class="magic-checkbox" id="accommodate" v-if="!show">
      <label for="accommodate">燃气设施房间内住人
      <span v-if='hinvestigation.accommodate'>**是</span><span v-else>**否</span></label>
    </span><!--  -->
    <span v-show='!usertypestate'>
       <input type="checkbox" v-model="hinvestigation.cookingoil" :false-value='0' :true-value='1'class="magic-checkbox" id="cookingoil" v-if="!show">
       <label for="cookingoil">告诉用户应该定期清除厨油污
       <span v-if='hinvestigation.cookingoil'>**是</span><span v-else>**否</span></label>
     </span>  <!-- 非民用 -->
    <span v-show='!usertypestate'>
      <input type="checkbox" v-model="hinvestigation.annunciator" :false-value='0' :true-value='1'class="magic-checkbox" id="annunciator" v-if="!show">
      <label for="annunciator">未安装燃气泄露报警器
      <span v-if='hinvestigation.annunciator;'>**是</span><span v-else>**否</span></label>
    </span><!-- 非民用 -->
    <span v-show='!usertypestate'>
      <input type="checkbox" v-model="hinvestigation.floodlight" :false-value='0' :true-value='1'class="magic-checkbox" id="floodlight" v-if="!show">
      <label for="floodlight">未安装防爆照明灯
      <span v-if='hinvestigation.floodlight'>**是</span><span v-else>**否</span></label>
    </span><!-- 非民用 -->
    <span>
       <input type="checkbox" v-model="hinvestigation.groundconnection" :false-value='0' :true-value='1'class="magic-checkbox" id="groundconnection" v-if="!show">
       <label for="groundconnection">作为其他电器设备的地接线
       <span v-if='hinvestigation.groundconnection'>**是</span><span v-else>**否</span></label>
     </span>   <!--  -->
    <span>
       <input type="checkbox" v-model="hinvestigation.hitched" :false-value='0' :true-value='1'class="magic-checkbox" id="hitched" v-if="!show">
       <label for="hitched">管道及其气表上有物体搭挂
       <span v-if='hinvestigation.hitched'>**是</span><span v-else>**否</span></label>
     </span> <!--  -->
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="hinvestigation.flexiblehose" :false-value='0' :true-value='1'class="magic-checkbox" id="flexiblehose" v-if="!show">
      <label for="flexiblehose">连接灶具软管不牢固
      <span v-if='hinvestigation.flexiblehose'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
      <input type="checkbox" v-model="hinvestigation.piplong" :false-value='0' :true-value='1'class="magic-checkbox" id="piplong" v-if="!show">
      <label for="piplong">软管长度超过两米
      <span v-if='hinvestigation.piplong'>**是</span><span v-else>**否</span></label>
    </span>
    <span v-show='usertypestate'>
       <input type="checkbox" v-model="hinvestigation.yearlong" :false-value='0' :true-value='1'class="magic-checkbox" id="yearlong" v-if="!show">
       <label for="yearlong">软管使用超过两年
       <span v-if='hinvestigation.yearlong'>**是</span><span v-else>**否</span></label>
     </span>
    <span v-show='usertypestate'>
       <input type="checkbox" v-model="hinvestigation.changeflexi" :false-value='0' :true-value='1'class="magic-checkbox" id="changeflexi" v-if="!show">
       <label for="changeflexi">告知用户更换软管
       <span v-if='hinvestigation.changeflexi'>**是</span><span v-else>**否</span></label>
     </span>
    <span>
       <input type="checkbox" v-model="hinvestigation.pipelinecorrosion" :false-value='0' :true-value='1'class="magic-checkbox" id="pipelinecorrosion" v-if="!show">
       <label for="pipelinecorrosion">管道生锈
       <span v-if='hinvestigation.pipelinecorrosion'>**是</span><span v-else>**否</span></label>
     </span><!--  -->
    <span v-show='!usertypestate'>
       <input type="checkbox" v-model="hinvestigation.boosterhose" :false-value='0' :true-value='1'class="magic-checkbox" id="boosterhose" v-if="!show">
       <label for="boosterhose">告知用户定期更换点火棒胶管
       <span v-if='hinvestigation.boosterhose'>**是</span><span v-else>**否</span></label>
     </span><!-- 非民用 -->
    <span v-show='!usertypestate'>
       <input type="checkbox" v-model="hinvestigation.strongconnection" :false-value='0' :true-value='1'class="magic-checkbox" id="strongconnection" v-if="!show">
       <label for="strongconnection">连接不牢固
       <span v-if='hinvestigation.strongconnection'>**是</span><span v-else>**否</span></label>
     </span><!-- 非民用 -->
    <span>
      <input type="checkbox" v-model="hinvestigation.hiddendanger" :false-value='0' :true-value='1'class="magic-checkbox" id="hiddendanger" v-if="!show">
      <label for="hiddendanger">存在其他安全隐患
      <span v-if='hinvestigation.hiddendanger'>**是</span><span v-else>**否</span></label>
    </span><!--  -->
    <span>
      <input type="checkbox" v-model="hinvestigation.publicitymaterial" :false-value='0' :true-value='1'class="magic-checkbox" id="publicitymaterial" v-if="!show">
      <label for="publicitymaterial">发放用户安全宣传资料
      <span v-if='hinvestigation.publicitymaterial'>**是</span><span v-else>**否</span></label>
    </span><!--  -->
    <span>
       <input type="checkbox" v-model="hinvestigation.noticeofrectification" :false-value='0' :true-value='1'class="magic-checkbox" id="noticeofrectification" v-if="!show">
       <label for="noticeofrectification">下达隐患整改通知书
       <span v-if='hinvestigation.noticeofrectification'>**是</span><span v-else>**否</span></label>
     </span><!--  -->
    <span>
      <label>通知书编号：</label>
      <span v-if="show">{{hinvestigation.numid}}</span>
      <input type="text" v-model="hinvestigation.numid" v-if="!show">
     </span><!--  -->
    <div v-for="src in imgs" class="col-sm-12" v-if="show">
      <div class="col-sm-4"></div>
      <img-self  :src='src.path'  :width="150" :height="200"></img-self>
    </div>
    <img-area :model="imgs" v-if="!show"></img-area>
  </div>
</template>

<script>
export default {
  props: {
    user: {
      type: Object
    },
    // 隐患
    hinvestigation: {
      type: Object
    },
    // 安检图片
    imgs: {
      type: Array
    },
    //是否显示
    show:{
      type:Boolean,
      default:false
    }
  },
  title:'隐患检查',
  data() {
    return {
      model:{
        // 存放照片
        imgs: []
      },
      usertypestate: false,
      // hiddentrouble: {
      //   plumbing: 0,
      //   environment: 0,
      //   accommodate: 0,
      //   cookingoil: 0,
      //   annunciator: 0,
      //   floodlight: 0,
      //   groundconnection: 0,
      //   hitched: 0,
      //   flexiblehose: 0,
      //   piplong: 0,
      //   yearlong: 0,
      //   changeflexi: 0,
      //   pipelinecorrosion: 0,
      //   boosterhose: 0,
      //   strongconnection: 0,
      //   hiddendanger: 0,
      //   publicitymaterial: 0,
      //   noticeofrectification: 0,
      //   numid:''
      // }
    }
  },
  methods: {

  },
  watch: {
  user:{
      handler:function (val,oldVal) {
          this.model = Object.assign({}, this.model, this.user)
      },
      deep:true
  },
  'model.f_usertype' (val) {
    if (val === '非民用') {
      this.usertypestate = false
    } else {
      this.usertypestate =true
    }
  }
},
ready() {
  //this.model = Object.assign({}, this.model, this.user)
}
}
</script>

<style lang="css">
</style>
