<template>
  <el-dialog title="详情" :visible.sync="detailOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
    <el-form label-width="90px">
      <el-row class="el-row-table">
        <el-col :span="12">
          <el-form-item label="批次号">
            <span v-if="detailInfo.batchNo">{{ detailInfo.batchNo }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="设备编号">
            <span v-if="detailInfo.deviceNo">{{ detailInfo.deviceNo }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="设备名称">
            <span v-if="detailInfo.title">{{ detailInfo.title }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="设备状态">
            <span v-if="detailInfo.title">{{ $parent.statusFormat(detailInfo) }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="创建时间">
            <span v-if="detailInfo.createTime">{{ detailInfo.createTime }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="创建人">
            <span v-if="detailInfo.createBy">{{ detailInfo.createBy }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="设备备注">
            <span v-if="detailInfo.remark">{{ detailInfo.remark }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

      </el-row>
    </el-form>
  </el-dialog>
</template>

<script>
  import { getDevice } from "@/api/track/device";
  export default {
    name: "detail-info",
    data(){
        return{
          detailOpen: false,
          detailInfo: {}
        }
    },
    methods:{
      getDetailInfo(id){
        getDevice(id).then(res =>{
          if(res.code == 200){
              this.detailInfo = res.data;
              this.detailOpen = true;
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
