contextMenu.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <div>
  3. <myContextMenu @operateDirectory="getMethod"></myContextMenu>
  4. <contrast ref="contrast"></contrast>
  5. <!-- 批注 -->
  6. <annotation ref="annotation"></annotation>
  7. <my-ImageViewer v-if="showImg" :on-close="closeViewer" :url-list="[imgSrc]"></my-ImageViewer>
  8. </div>
  9. </template>
  10. <script>
  11. import { mapGetters } from 'vuex'
  12. import contrast from '@/views/components/dialog/menuDialog/contrast.vue'
  13. import annotation from '@/views/components/dialog/menuDialog/annotation.vue'
  14. export default {
  15. name: 'myCommonUse',
  16. components: {
  17. contrast,
  18. annotation,
  19. },
  20. props: {},
  21. data() {
  22. return {
  23. showImg: false,
  24. imgSrc: '',
  25. };
  26. },
  27. watch: {},
  28. computed: {
  29. ...mapGetters(["highlight"])
  30. },
  31. created() { },
  32. mounted() {
  33. // window.selectMark = this.selectMark
  34. },
  35. methods: {
  36. //查看图片
  37. checkImg(e) {
  38. this.imgSrc = e.target.src
  39. this.showImg = true
  40. },
  41. //关闭图片弹窗
  42. closeViewer() {
  43. this.showImg = false
  44. },
  45. //点击图标回显数据
  46. selectMark(id, selectType) {
  47. var Id = id.substring(1, id.length)
  48. if (selectType == 'p') {//批注
  49. var index = this.highlight.piZhuContrastList.findIndex(item => {
  50. if (item.id == Id) {
  51. // 清空currentSelectObj,否则Id与id同时存在
  52. this.$store.commit("SET_PATENT_INDEX", item)
  53. }
  54. return item.id == Id
  55. })
  56. if (index != -1) {
  57. // document.addEventListener("click", function (e) {
  58. // console.log(e.clientX)
  59. // console.log(e.clientY)
  60. // var menuContent = []
  61. // this.$store.commit("SET_CONTEXT_MENU", {
  62. // clientX: e.clientX,
  63. // clientY: e.clientY,
  64. // displayContextMenu: true,
  65. // menuContent: this.highlight.piZhuContrastList[index]
  66. // })
  67. // })
  68. // 打开批注框
  69. this.$refs.annotation.open()
  70. }
  71. } else if (selectType == 'c') {//对比
  72. let a = this.highlight.contrastList.find(item => {
  73. return item.id == Id
  74. })
  75. a.column = a.fieldName
  76. a.text = a.evidenceText
  77. this.$store.commit("SET_PATENT_INDEX", a)
  78. this.contrast()
  79. } else if (selectType == 'o') {
  80. }
  81. },
  82. getMethod(type) {
  83. if (this[type]) {
  84. this[type]()
  85. }
  86. },
  87. //波浪线
  88. wave() {
  89. this.$refs.annotation.submit2()
  90. },
  91. //下划线
  92. underscore() {
  93. this.$refs.annotation.submit2()
  94. },
  95. //高亮
  96. addHighlight() {
  97. this.$refs.annotation.submit2()
  98. },
  99. //批注
  100. mark() {
  101. this.$refs.annotation.open()
  102. },
  103. //修改颜色
  104. changeColor() {
  105. this.$refs.annotation.submit2()
  106. console.log('修改颜色')
  107. },
  108. //对比
  109. contrast() {
  110. console.log('对比')
  111. this.$refs.contrast.open()
  112. },
  113. //删除批注
  114. deleteMark() {
  115. console.log('删除')
  116. },
  117. },
  118. };
  119. </script>
  120. <style lang="scss" scoped></style>