<template>
  <div>
      <el-container>
      <el-aside width="210px" style="overflow:hidden" class="patent-articles-menu">
        <el-menu class="theme-dark" :default-active="activeMenu" @select="handleSelect">
          <el-menu-item v-for="item in menuList" :key="item.path" :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">
          <!-- <component :row="row" :is="activeMenu" :reportId="reportId" :patentNo="signPatentNo" :signPatentNo="signPatentNo" :reportId2="reportId"></component> -->
          <component :row="row" :is="activeMenu" :reportId="reportId"  :reportId2="reportId" :patentNo="signPatentNo" :splitBy="splitBy" :splitType="splitType"></component>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import BasicInformation from '@/views/report/reportDetails/components/basicMessage.vue';
import SignPatent from '@/views/workspace/folder/articles/components/features.vue';
import avoid from '@/views/report/avoid/avoidPage/avoidDirection.vue';
import direction from '@/views/report/avoid/avoidPage/direction.vue';
import ReportFile from '@/views/report/reportDetails/components/reportFile.vue';
import TaskDetails from '@/views/report/reportDetails/components/taskDetails.vue';
import remarryMatter from '@/views/report/components/matter/remarryMatter.vue';
export default {
  components:{
    BasicInformation,
    avoid,
    direction,
      SignPatent,
      ReportFile,
      TaskDetails,
      remarryMatter
  },
  data() {
      return {
          activeMenu: "BasicInformation",
          menuList: [
            { title: '基本信息', path: "BasicInformation" }, 
            { title: '标的专利特征拆分详情', path:"SignPatent"}, 
              { title: '回避设计方案', path:"avoid"}, 
              { title: '回避设计结果', path:"direction"}, 
              { 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}, 
          ],
      }
  },
  watch: {
    // show(){
    //       this.setData()
    //     }
  },
  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
      },
      splitBy(){
          return this.$s.getSession('row').splitBy
      },
      splitType(){
          return this.$s.getSession('row').splitType
      },
      signPatentNo(){
          return this.$s.getSession('row').signPatentNo
      }
  },
  created(){
    this.setData()
  },
  mounted() {
    this.changePageTitle()
      // console.log(this.row);
  },
  methods: {
    setData(){
            this.menuList =[
                  { title: '基本信息', path: "BasicInformation" }, 
                  { title: '标的专利特征拆分详情', path:"SignPatent"}, 
                  { title: '回避设计方案', path:"avoid"}, 
                  { title: '回避设计结果', path:"direction"}, 
                  { 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>