<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.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.orders">{{ detailInfo.orders }}</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.content">{{ detailInfo.content }}</span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="装配视频">
            <span v-if="detailInfo.videoUrl">
              <video width="250" height="200" controls :src="detailInfo.videoUrl"/>
            </span>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="装配图片">
            <el-image
              v-if="detailInfo.imgUrl"
              :src="detailInfo.imgUrl"
              :preview-src-list="[detailInfo.imgUrl]"
              :z-index="9999"
              style="width: 200px;height: 200px;"
            ></el-image>
            <span v-else>-</span>
          </el-form-item>
        </el-col>

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

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

<style scoped>

</style>
