<template>
  <el-dialog title="详情" :visible.sync="open" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
    <el-form :model="detailInfo" label-width="100px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="预案标题">
            <span>{{ detailInfo.title }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="预案类型">
            <!--<span>{{ $parent.planTypeFormatter(detailInfo)}}</span>-->
            <span>{{ detailInfo.type }}</span>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="12">
          <el-form-item label="预案等级" prop="level">
            <span>{{ $parent.planLevelFormatter(detailInfo) }}</span>
          </el-form-item>
        </el-col>
      </el-row>

      <el-form-item label="预案附件" prop="fileUrl">
        <span v-if="detailInfo.fileUrl!=null && detailInfo.fileUrl != ''">
          <a style="color: #1c84c6" :href="detailInfo.fileUrl" target="_blank">查看/下载</a>
        </span>
        <span v-else>-</span>
      </el-form-item>
      <el-form-item label="预案内容" prop="content">
        <editor :readOnly="true" v-model="detailInfo.content" :min-height="192"/>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
  import { getPlan } from "@/api/urgent/plan";
  import Editor from '@/components/Editor';
  export default {
    name: "detail-info",
    components:{
      Editor
    },
    data(){
        return{
          open: false,
          detailInfo: {}
        }
    },
    methods:{
      openDetail(id){
        getPlan(id).then(res =>{
          if(res.code == 200){
             this.detailInfo = res.data;
             this.open = true;
          }
        })

      }
    }
  }
</script>

<style scoped>

</style>
