<template>
  <div>
    <myContextMenu @operateDirectory="getMethod"></myContextMenu>
    <contrast ref="contrast"></contrast>
    <!-- 批注 -->
    <annotation ref="annotation"></annotation>
  </div>
</template>

<script>
import {mapGetters} from 'vuex'
import contrast from '@/views/components/dialog/menuDialog/contrast.vue'
import annotation from '@/views/components/dialog/menuDialog/annotation.vue'
export default {
  components: {
    contrast,
    annotation,
  },
  props: {},
  data() {
    return {
    };
  },
  watch: {},
  computed: {
    ...mapGetters(["highlight"])
  },
  created() {},
  mounted() {
    window.selectMark = this.selectMark
  },
  methods: {
     //点击图标回显数据
     selectMark(id, selectType) {
      var Id = id.substring(1,id.length)
      if (selectType=='p') {//批注
        var index = this.piZhuContrastList.findIndex(item => {
        if (item.id == Id) {
          // 清空currentSelectObj，否则Id与id同时存在
          this.$store.commit("SET_PATENT_INDEX", item)
        }
        return item.id == Id
        })
        if (index != -1) {
          
        }
      } else if (selectType == 'c') {//对比
        let a=this.highlight.contrastList.find(item => {
          return item.id==Id
        })
        a.column = a.fieldName
        a.text = a.evidenceText
        this.$store.commit("SET_PATENT_INDEX", a)
        this.contrast()
      } else if (selectType == 'o') {
      }
      
    },
    getMethod(type){
        if(this[type]){
           this[type]() 
        }
    },
    //波浪线
    wave(){
        console.log('波浪线')
    },
    //下划线
    underscore(){
      console.log('下划线')
    },
    //高亮
    addHighlight(){
      console.log('高亮')
    },
    //批注
    mark(){
      console.log('批注')
      this.$refs.annotation.open()
    },
    //修改颜色
    changeColor(){
      console.log('修改颜色')
    },
    //对比
    contrast(){
      console.log('对比')
      this.$refs.contrast.open()
    },
    //删除批注
    deleteMark(){
      console.log('删除')
    },
  },
};
</script>
<style lang="scss" scoped>
</style>