<template>
    <div>
        <Patent-Details :patentNo="patentNo" :reportId="reportId"></Patent-Details>
    </div>
</template>
<script>
import PatentDetails from '@/views/workspace/folder/articles/ContrastIndex.vue'
export default{
    components:{
        PatentDetails
    },
    data() {
        return {
        }
    },
    computed:{
        patentNo(){
            return this.$route.query.patentNo
        },
        reportId(){
            return this.$route.query.reportId
        },
        piZhuContrastList() {
            return this.$store.state.report.piZhuContrastList
        }
  },
  created() {
    },
  mounted() {
    },
    methods: {
        // 查询批注
    getPiZhuContrastList(val) {
      if (val) {
        var index = this.piZhuContrastList.findIndex(item => {
          item.patentNo == val
        })
        if (index != -1) {
          return false;
        }
      }
      let params = {
        patentNo: val?val:this.patentNo,
        id: this.reportId,
        createFrom:this.reportId?2:0
      }
      this.$api.scratchWordsQuery(params).then(response => {
        if (response.code==200) {
          if (this.piZhuContrastList.length > 0) {
             var a = this.piZhuContrastList.filter(item => {
              return item.patentNo != params.patentNo
             }).concat(response.data)
          } else {
             var a = response.data
          }
           this.$store.commit('SET_PATENT_PIZHU_CONTRAST', a)
        }
      })
    },
    },
}
</script>

<style lang="scss" scoped>
.btn{
    display: flex;
    justify-content: flex-end;
}

</style>