<template>
  <div>
    <el-container>
        <el-aside width="300px">
            <el-form ref="form" :model="form" label-width="120px" size="mini">
                <el-form-item label="事件名称：">
                    <span>{{ form.questionName }}</span>
                </el-form-item>
                <el-form-item label="相关报告数量：">
                    <el-link type="primary">{{ form.reportNum||0 }}</el-link>
                </el-form-item>
                <el-form-item label="相关专题库数量：">
                    <el-link type="primary">{{ form.reportNum||0 }}</el-link>
                </el-form-item>
                <el-form-item label="事件场景：">
                    <span class="cursor_pointer" v-for="item in form.scenarioNames?form.scenarioNames:[]" :key="item">
                        {{ item }}<br />
                    </span>
                </el-form-item>
                <el-form-item label="事件时间：">
                    <span>{{form.eventDate}}</span>
                </el-form-item>
                <el-form-item label="事件描述：">
                    <span>{{form.description}}</span>
                </el-form-item>
                <el-form-item label="创建人：">
                    <span>{{form.createPersonName}}</span>
                </el-form-item>
                <el-form-item label="创建时间：">
                    <span>{{form.createTime}}</span>
                </el-form-item>
            </el-form>
        </el-aside>
        <el-main>
            <visual :visuals="visuals" v-if="show"></visual>
        </el-main>
    </el-container>
  </div>
</template>

<script>
import visual from '@/views/home/components/visual.vue'
export default {
  components: {
    visual
  },
  props: {},
  data() {
    return {
        form:{},
        show:true
    };
  },
  watch: {},
  computed: {
    visuals(){
        return JSON.parse(this.$route.query.visuals)
    },
  },
  created() {},
  mounted() {
    this.getQuestionDetails()
  },
  methods: {
    getQuestionDetails(){
        var params = {
            questionName:this.visuals.eventName,
            current:1,
            size:10
        }
        this.$api.eventQuery(params).then(res => {
            if (res.code == 200) {
                this.form = res.data.list[0]
                if(!this.visuals.eventId){
                    this.visuals.eventId = this.form.id
                    this.visuals.Scenario = this.form.scenarioNames
                    this.show = false
                    this.$nextTick(()=>{
                        this.show = true
                    })
                }
                
            }
        })
    }
  },
};
</script>
<style lang="scss" scoped>
</style>
