<template>
    <div>
      <el-drawer class="custom-drawer-form" size="900px" :with-header="false" :visible.sync="drawer" direction="rtl" :before-close="close" destroy-on-close append-to-body>
          <div style="padding:10px;height:100%">
              <el-tabs v-model="components">
                  <el-tab-pane v-for="item in menu" :key="item.components"  :label="item.name" :name="item.components"></el-tab-pane>
              </el-tabs>
              <component :is='components' style="height:calc(100% - 50px);" :isOperate='2' :scenarioId="[params.scenarioId]" :matterId="[params.matterId]" :eventId="params.eventId" :eventName="params.eventName" @submit="submit"></component>
          </div>
          
      </el-drawer>
    </div>
</template>
  
<script>
  import Project from '@/views/project/index.vue'
  import Report from '@/views/report/components/index.vue'
  import patentMining from '@/views/patentMining/components/viewIndex.vue'
  export default {
    components: {
      Project,
      Report,
      patentMining
    },
    props: {},
    data() {
      return {
          menu:[
              {
                  name:'相关专利数据库',
                  components:'Project'
              },
              {
                  name:'相关报告',
                  components:'Report'
              },
             
          ],
          drawer:false,
          components:'Project',
          params:{},
          isEdit:false
      };
    },
    watch: {},
    computed: {},
    created() {},
    mounted() {},
    methods: {
      open(data){
          this.params = data
          if(this.params.isPatentMining){
            this.menu.push(
              {
                  name:'专利挖掘',
                  components:'patentMining'
              },
            )
          }
          this.isEdit = false
          this.drawer = true
      },
      close(){
          if(this.isEdit){
            this.$emit('close')
          }
          this.drawer = false
          this.components='Project',
          this.menu=[
              {
                  name:'相关专利数据库',
                  components:'Project'
              },
              {
                  name:'相关报告',
                  components:'Report'
              },
             
          ]
      },
      submit(val){
        this.isEdit = val
      }
    },
  };
  </script>
  <style lang="scss">
  </style>