<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' :params="params" style="height:calc(100% - 50px);"></component>
        </div>
        
    </el-drawer>
  </div>
</template>

<script>
import Project from './components/project.vue'
import Report from './components/report.vue'
import patentMining from './components/patentMining.vue'
export default {
  components: {
    Project,
    Report,
    patentMining
  },
  props: {},
  data() {
    return {
        menu:[
            {
                name:'相关专题库',
                components:'Project'
            },
            {
                name:'相关报告',
                components:'Report'
            },
           
        ],
        drawer:false,
        params:{},
        components:'Project',
    };
  },
  watch: {},
  computed: {},
  created() {},
  mounted() {},
  methods: {
    open(scenarioName, typeName, question){
        this.params = {
            scenarioName:scenarioName, 
            typeName:typeName, 
            question:question
        }
        if(typeName && typeName.indexOf('专利挖掘')!=-1){
          this.menu.push(
            {
                name:'专利挖掘',
                components:'patentMining'
            },
          )
        }
        this.drawer = true
    },
    close(){
        this.$emit('close')
        this.drawer = false
        this.components='Project',
        this.menu=[
            {
                name:'相关专题库',
                components:'Project'
            },
            {
                name:'相关报告',
                components:'Report'
            },
           
        ]
    }
  },
};
</script>
<style lang="scss">
</style>