<template>
  <div class="app-container">
    <div v-if="sn=='jxxm'">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="换热器" name="first">
          <overhaul-exchanger :sub-id="Number(si)" :is-approve="Number(isApprove)" dev-name="换热器" :dev-type="Number(1)"/>
        </el-tab-pane>
        <el-tab-pane label="电仪" name="second">
          <overhaul-exchanger :sub-id="Number(si)" :is-approve="Number(isApprove)" dev-name="电仪" :dev-type="Number(2)"/>
        </el-tab-pane>
        <el-tab-pane label="反应器" name="third">
          <overhaul-exchanger :sub-id="Number(si)" :is-approve="Number(isApprove)" dev-name="反应器" :dev-type="Number(3)"/>
        </el-tab-pane>
        <el-tab-pane label="裂解炉" name="fourth">
          <overhaul-exchanger :sub-id="Number(si)" :is-approve="Number(isApprove)" dev-name="裂解炉" :dev-type="Number(4)"/>
        </el-tab-pane>
        <el-tab-pane label="塔罐" name="fifth">
          <overhaul-tower :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="阀门" name="sixth">
          <overhaul-valve :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="过滤器" name="seventh">
          <overhaul-filter :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="其他" name="eighth">
          <overhaul-exchanger :sub-id="Number(si)" :is-approve="Number(isApprove)" dev-name="其他" :dev-type="Number(5)"/>
        </el-tab-pane>
        <el-tab-pane label="动设备" name="ninth">
          <overhaul-exchanger :sub-id="Number(si)" :is-approve="Number(isApprove)" dev-name="动设备" :dev-type="Number(6)"/>
        </el-tab-pane>
        <el-tab-pane label="安全附件" name="tenth">
          <overhaul-exchanger :sub-id="Number(si)" :is-approve="Number(isApprove)" dev-name="安全附件" :dev-type="Number(7)"/>
        </el-tab-pane>
        <el-tab-pane label="管道" name="eleven">
          <overhaul-exchanger :sub-id="Number(si)" :is-approve="Number(isApprove)" dev-name="管道" :dev-type="Number(8)"/>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="sn=='kgfa'">
      <programme :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='mb'">
      <blind :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='qm'">
      <airtight :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='rsfh'">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="现场管道和设备保温防护检查表 " name="first">
          <protection :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="现场转动设备防护措施检查表" name="second">
          <measure :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="sn=='aqss'">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="安全阀" name="first">
          <safety-valve :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="爆破片" name="second">
          <safety-brust :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="呼吸阀" name="third">
          <safety-breath :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="泄放阀" name="fourth">
          <safety-bleed :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="阻火器" name="fifth">
          <safety-flamearrester :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="sn=='gygc'">
      <public :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='yfl'">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="裂解装置开车物料" name="first">
          <material :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="原材料" name="second">
          <material-raw :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="sn=='xcws'">
      <hygiene :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='sbqjd'">
      <cleaning :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='dj'">
      <circuit :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='xqf'">
      <patrol :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='txjk'">
      <patrol :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='hbss'">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="火炬" name="first">
          <torchvoc :sub-id="Number(si)" :is-approve="Number(isApprove)" :torchvocType="1"/>
        </el-tab-pane>
        <el-tab-pane label="VOC" name="second">
          <torchvoc :sub-id="Number(si)" :is-approve="Number(isApprove)" :torchvocType="2"/>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="sn=='bxsjcy'">
      <patrol :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='dqzh'">
      <nitrogen :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='sksgfmzt'">
      <lock :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='jb'">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="机泵过滤器清理工作清单" name="first">
          <pump-cleaning :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="机泵检修完成确认清单" name="second">
          <pump-overhaul :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="机泵润滑油加注确认清单" name="third">
          <pump-fill :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="sn=='zdj'">
      <frame :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='tzsb'">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="压力管道" name="first">
          <pipe :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="压力容器" name="second">
          <vessel :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="sn=='ybjy'">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="调节阀" name="first">
          <regulating-valve :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="液位计" name="second">
          <liquidometer :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
        <el-tab-pane label="流量计" name="thrid">
          <instrument-calibration :sub-id="Number(si)" :is-approve="Number(isApprove)"/>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="sn=='yblscs'">
      <instrument-test :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='bjlszqr'">
      <alarm :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='qtjcy'">
      <gasdetector :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='zmdbr'">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="照明" name="first">
          <lighting :sub-id="Number(si)" :is-approve="Number(isApprove)" :lightingType="1" />
        </el-tab-pane>
        <el-tab-pane label="电伴热" name="second">
          <lighting :sub-id="Number(si)" :is-approve="Number(isApprove)" :lightingType="2" />
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="sn=='djsb'">
      <motor :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='jdjdkj'">
      <franklinism :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='zxfxy'">
      <analyzer :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='sys'">
      <laboratory :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='sjbg'">
      <Moc :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
    <div v-if="sn=='lsdy'">
      <power :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
    </div>
  </div>
</template>
<script lang="ts">
import OverhaulPipe from "@/views/pssr/overhaulPipe/index.vue";
import OverhaulPump from "@/views/pssr/overhaulPump/index.vue";
import OverhaulExchanger from "@/views/pssr/overhaulExchanger/index.vue";
import OverhaulTower from "@/views/pssr/overhaulTower/index.vue";
import OverhaulValve from "@/views/pssr/overhaulValve/index.vue";
import OverhaulFilter from "@/views/pssr/overhaulFilter/index.vue";
import Programme from "@/views/pssr/programme/index.vue";
import Blind from "@/views/pssr/blind/index.vue";
import Airtight from "@/views/pssr/airtight/index.vue";
import Protection from "@/views/pssr/protection/index.vue";
import SafetyValve from "@/views/pssr/safetyValve/index.vue";
import SafetyBrust from "@/views/pssr/safetyBrust/index.vue";
import SafetyBreath from "@/views/pssr/safetyBreath/index.vue";
import SafetyBleed from "@/views/pssr/safetyBleed/index.vue";
import SafetyFlamearrester from "@/views/pssr/safetyFlamearrester/index.vue";
import Public from "@/views/pssr/public/index.vue";
import Material from "@/views/pssr/material/index.vue";
import Hygiene from "@/views/pssr/hygiene/index.vue";
import Cleaning from "@/views/pssr/cleaning/index.vue";
import Circuit from "@/views/pssr/circuit/index.vue";
import Patrol from "@/views/pssr/patrol/index.vue";
import Torchvoc from "@/views/pssr/torchvoc/index.vue";
import Nitrogen from "@/views/pssr/nitrogen/index.vue";
import Lock from "@/views/pssr/lock/index.vue";
import Frame from "@/views/pssr/frame/index.vue";
import Pipe from "@/views/pssr/pipe/index.vue";
import InstrumentCalibration from "@/views/pssr/instrumentCalibration/index.vue";
import InstrumentTest from "@/views/pssr/instrumentTest/index.vue";
import Alarm from "@/views/pssr/alarm/index.vue";
import Gasdetector from "@/views/pssr/gasdetector/index.vue";
import Lighting from "@/views/pssr/lighting/index.vue";
import Motor from "@/views/pssr/motor/index.vue";
import Franklinism from "@/views/pssr/franklinism/index.vue";
import Analyzer from "@/views/pssr/analyzer/index.vue";
import PumpCleaning from "@/views/pssr/pumpCleaning/index.vue";
import PumpOverhaul from "@/views/pssr/pumpOverhaul/index.vue";
import PumpFill from "@/views/pssr/pumpFill/index.vue";
import Laboratory from "@/views/pssr/laboratory/index.vue";
import Power from "@/views/pssr/power/index.vue";
import Moc from "@/views/pssr/moc/index.vue";
import Measure from "@/views/pssr/measure/index.vue";
import MaterialRaw from "@/views/pssr/materialRaw/index.vue";
import Vessel from "@/views/pssr/vessel/index.vue";
import Liquidometer from "@/views/pssr/instrumentCalibration/liquidometer.vue";
import RegulatingValve from "@/views/pssr/instrumentCalibration/regulatingValve.vue";

export default {
  name: "Subitem",
  components: {
    RegulatingValve,
    Liquidometer,
    Vessel,
    MaterialRaw,
    Measure,
    Moc,
    PumpFill,
    PumpOverhaul,
    PumpCleaning,
    Analyzer,
    Franklinism,
    Motor,
    Lighting,
    Gasdetector,
    Alarm,
    InstrumentTest,
    InstrumentCalibration,
    Pipe,
    Frame,
    Lock,
    Nitrogen,
    Torchvoc,
    Patrol,
    Circuit,
    Cleaning,
    Hygiene,
    Material,
    Public,
    SafetyFlamearrester,
    SafetyBleed,
    SafetyBreath,
    SafetyBrust,
    SafetyValve,
    Protection,
    Airtight,
    Blind,
    Programme, OverhaulFilter, OverhaulValve, OverhaulTower, OverhaulExchanger, OverhaulPump, OverhaulPipe,
    Laboratory,
    Power
  },
  props: {
    subId: {
      type: Number,
      default: 0
    },
    serialNumber: {
      type: String,
      default: null
    },
    isApprove: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      // 默认第一个Tab
      activeName: 'first',
      si: null,
      sn: '',
    }
  },
  created() {
    this.sn = ''
    const id = this.$route.params.subId
    const serialNumber = this.$route.params.serialNumber
    if (typeof id !== 'undefined') {
      this.si = id
    } else {
      this.si = this.subId
    }
    if (typeof serialNumber !== 'undefined') {
      this.sn = serialNumber
    } else {
      this.sn = this.serialNumber
    }


  },
  methods: {
    handleClick(tab) {
    },
    refreshHisList() {
      this.$emit('refreshHisList')
    }
  }
}
</script>
