<template>
  <div>
    <el-container>
        <el-aside width="210px" style="overflow:hidden" class="patent-articles-menu" :style="{height:height}">
          <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-main class="admin-main-box" :style="{height:height}">
            <component :is="activeMenu" :reportId="reportId" :signPatentNo="signPatentNo" :reportType="reportType" :patent="{patentNo:signPatentNo}"></component>
          </el-main>
        </el-container>
      </el-container>
  </div>
</template>

<script>
import BasicInformation from '@/views/report/reportDetails/components/basicMessage.vue';
import InvalidIndex from "./components/InvalidIndex.vue"
import EvidenceAndRequest from "./components/evidenceAndRequest.vue"
import ChoseOpinion from "./components/choseOpinion.vue"
import OpinionPlan from "./components/opinionPlan.vue"
import FlowPath from "./components/flowPath.vue"
import RemarryMatter from '@/views/report/components/matter/remarryMatter.vue';
import TaskDetails from '@/views/report/reportDetails/components/taskDetails.vue';
import Invalid from '@/views/workspace/folder/articles/components/history/invalid.vue'
export default {
  components: {
    BasicInformation,
    InvalidIndex,
    EvidenceAndRequest,
    ChoseOpinion,
    OpinionPlan,
    FlowPath,
    RemarryMatter,
    TaskDetails,
    Invalid
  },
  data() {
    return {
      activeMenu:'BasicInformation',
      menuList: [
        {title: '基本信息', path:"BasicInformation",show:true},
        {title: '标的专利无效历史', path:"Invalid",show:true},
        // {title: '无效应对流程', path:"FlowPath"},
        {title: '无效理由和证据', path:"InvalidIndex",show:true},
        {title: '证据文献', path:"EvidenceAndRequest",show:true},
        // {title: '生成陈述意见方案', path:"ChoseOpinion"},
        // {title: '导出陈述意见方案', path:"OpinionPlan"},
        
        {title: '后续跟进事项', path:"RemarryMatter",show:(this.row && this.row.status==3 && this.$permission('/rms/matter'))?true:false},
        // {title: '后续跟进事项', path:"RemarryMatter",},
        {title: '任务清单', path:"TaskDetails",show:(this.$reportPermission(this.reportId,[0,1]))?true:false},
      ],
      height:null,
    }
  },
  computed: {
    reportId() {
      return this.$s.getSession('params').id
    },
    signPatentNo() {
      return this.$s.getSession('params').signPatentNo
    },
    reportType() {
      return this.$s.getSession('params').type
    },
    row() {
      return this.$s.getSession('params')
    },
  },
  watch: {},
  created(){
    this.setData()
  },
  mounted() {
    this.changePageTitle()
    this.getHeight()
  },

  methods: {
    getHeight(){
      this.height = document.getElementsByClassName('el-main')[0].clientHeight - 20 + 'px'
    },
    setData() {
            this.menuList =[
              {title: '基本信息', path:"BasicInformation",show:true},
              {title: '标的专利无效历史', path:"Invalid",show:true},
              // {title: '无效应对流程', path:"FlowPath"},
              {title: '无效理由和证据', path:"InvalidIndex",show:true},
              {title: '证据文献', path:"EvidenceAndRequest",show:true},
              // {title: '生成陈述意见方案', path:"ChoseOpinion"},
              // {title: '导出陈述意见方案', path:"OpinionPlan"},
              
              {title: '后续跟进事项', path:"RemarryMatter",show:(this.row && this.row.status==3 && this.$permission('/rms/matter'))?true:false},
              // {title: '后续跟进事项', path:"RemarryMatter",},
              {title: '任务清单', path:"TaskDetails",show:(this.$reportPermission(this.reportId,[0,1]))?true:false},
            ]
        },
    changePageTitle() {
      document.title = `${this.row.name} ${'报告详情'}`
    },
    handleSelect(index, path) {
      this.activeMenu = index
    },
  },
}
</script>

<style lang="scss" scoped>

</style>