<template>
    <div>
        <el-container>
        <el-aside width="210px" style="overflow:auto" class="patent-articles-menu">
          <el-menu class="theme-dark" :default-active="activeMenu" @select="handleSelect">
            <el-menu-item v-for="item in menuList" :index="item.path" v-if="!item.show">
              <i class="el-icon-film"></i>
              <span slot="title">{{item.title}}</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <!-- <el-container> -->
          <!-- <el-header></el-header> -->
          <el-main class="admin-main-box" :style="{height : height + 'px'}">
            <component :height="height" :row="row" :is="activeMenu" :reportId="reportId" :patentNo="signPatentNo" :signPatentNo="signPatentNo" :reportId2="reportId"></component>
          </el-main>
        <!-- </el-container> -->
      </el-container>
    </div>
</template>

<script>
import BasicInformation from './components/basicMessage.vue';
import SignPatent from '@/views/workspace/folder/articles/components/features.vue';
import ContrastFile from './components/SelectedPatent.vue';
import ContrastResult from '../Invalid/InvalidPage/Result.vue';
import ContrastPlan from './components/ContrastPlan.vue';
import ReportFile from './components/reportFile.vue';
// import referenceFile from './components/referenceFile.vue';
import TaskDetails from './components/taskDetails.vue';
import remarryMatter from '../components/matter/remarryMatter.vue';
export default {
    components:{
        BasicInformation,
        SignPatent,
        ContrastFile,
        ContrastResult,
        ContrastPlan,
        ReportFile,
        TaskDetails,
        remarryMatter,
    // referenceFile
    },
    data() {
        return {
          activeMenu: "BasicInformation",
          height:'',
            menuList: [
                { title: '基本信息', path:"BasicInformation"}, 
                { title: '标的专利特征拆分详情', path:"SignPatent"}, 
                { title: '对比文件', path:"ContrastFile"}, 
                // { title: '新对比文件', path:"referenceFile"}, 
                { title: '对比结果', path:"ContrastResult"}, 
                { title: '对比方案', path:"ContrastPlan"}, 
                { title: '报告文档', path:"ReportFile"}, 
                { title: '后续跟进事项', path:"remarryMatter",show:!(this.$permission('/rms/matter') && this.row && this.row.status == 3)}, 
                { title: '任务清单', path:"TaskDetails",show:(this.$reportPermission(this.reportId,[0,1]))?false:true}, 
            ],
        }
    },
    watch: {
    },
    computed:{
        // show(){
        //     return this.$permission('/rms/matter')
        // },
        dictMessage() {
            return this.$s.getSession('row').dictMessage.REPORT_TYPE
        },
        row(){
            return this.$s.getSession('row')
        },
        reportId(){
            return this.$s.getSession('row').id
        },
        signPatentNo(){
            return this.$s.getSession('row').signPatentNo
        }
    },
    created(){

        this.setData()
    },
  mounted() {
        this.height = document.querySelector('.admin-main-box').clientHeight
        this.changePageTitle()
    },
    methods: {
        setData(){
            this.menuList =[
                { title: '基本信息', path:"BasicInformation"}, 
                { title: '标的专利特征拆分详情', path:"SignPatent"}, 
                { title: '对比文件', path:"ContrastFile"}, 
                // { title: '新对比文件', path:"referenceFile"}, 
                { title: '对比结果', path:"ContrastResult"}, 
                { title: '对比方案', path:"ContrastPlan"}, 
                { title: '报告文档', path:"ReportFile"}, 
                { title: '后续跟进事项', path:"remarryMatter",show:(this.row && this.row.status==3 && this.$permission('/rms/matter'))?false:true}, 
                { title: '任务清单', path:"TaskDetails",show:(this.$reportPermission(this.reportId,[0,1]))?false:true}, 
            ]
        },
        changePageTitle() {
            document.title = `${this.row.name} ${'报告详情'}`
        },
        handleSelect(index, path) {
            // console.log(index, path);
            this.activeMenu = index
        },
    },
}
</script>