<template>
  <div class="app-container">
    <div>
      <div class="tab-header webtop">
        <div>{{ viewTitle }}</div>
        <div>
          <el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
        </div>
      </div>
      <div class="listconadd">
        <el-form ref="form_obj" :model="infoForm" :rules="rules" class="formadd">
          <div class="title">
            <div>详情信息</div>
          </div>
          <el-row>
            <el-col :span="4" class="tleftb">
              <span>设备验证码</span>
            </el-col>
            <el-col :span="8">
              <el-form-item>
                <span>{{ infoForm.vCode }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="4" class="tleftb">
              <span>设备位置</span>
            </el-col>
            <el-col :span="8">
              <el-form-item>
                <span>{{ infoForm.position }}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4" class="tleftb">
              <span>设备类型</span>
            </el-col>
            <el-col :span="8">
              <el-form-item>
                <span>{{ getSupplierType(infoForm.type) }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="4" class="tleftb">
              <span>备注</span>
            </el-col>
            <el-col :span="8">
              <el-form-item>
                <span>{{ infoForm.remarks }}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4" class="tleftb">
              <span>设备名称</span>
            </el-col>
            <el-col :span="8">
              <el-form-item>
                <span>{{ infoForm.name }}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <!-- <el-row>
            <el-col :span="4" class="tleftb">
              <span>状态</span>
            </el-col>
            <el-col :span="8">
              <el-form-item>
                <span>{{ getStatus(infoForm.status) }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="4" class="tleftb">
            </el-col>
            <el-col :span="8">
              <el-form-item>
              </el-form-item>
            </el-col>
          </el-row> -->
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'shebeitaizhangInfo',
  data() {
    return {
      // tableKey: 0,
      // index: 0,
      viewTitle: '',
      supplierType_list: [
        { title: '摄像头', id: '1' },
        { title: '电子围栏', id: '2' },
        { title: '门禁', id: '3' },
        { title: '机器人', id: '4' }
      ],
      status_list: [
        { title: '已损坏', id: '1' },
        { title: '已维修', id: '2' },
        { title: '完好', id: '3' },
      ],
      infoForm: {
      },
      // baseManufacturerBankDto: [],
      rules: {},
      // submitdisabled: false
    }
  },
  methods: {
    getStatus(item) {
      for (var i = 0; i < this.status_list.length; i++) {
        if (this.status_list[i].id == item) {
          return this.status_list[i].title
        }
      }
    },
    getSupplierType(item) {
      for (var i = 0; i < this.supplierType_list.length; i++) {
        if (this.supplierType_list[i].id == item) {
          return this.supplierType_list[i].title
        }
      }
    },
    showInfo(row) {
      this.$nextTick(() => {
        this.$refs['form_obj'].clearValidate()
      })
      this.viewTitle = '设备台账详情'
      this.infoForm = row.info
    },
    handleReturn() {
      this.$emit('doback')
    }
  }
}
</script>

<style scoped></style>
