index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <div class="height_100 article" :style="{ 'flex-direction': isRight ? 'row-reverse' : 'row' }">
  3. <articleMenu @event="event" :value="showView" :reportType="reportType" :menu="menuList" :isRight="isRight" :outside="outside"
  4. :projectId="projectId" :productId="productId" :taskId="taskId" :searchOption="search.searchOption" :patentNo="patentNo" :fromPath="search.fromPath"
  5. :location="search.location" @getPatentLeft="getPatentLeft" :handlerType="handlerType" :projectType="projectType"></articleMenu>
  6. <div class="height_100 content">
  7. <my-View :showView="showView">
  8. <div slot="left" style="width:100%">
  9. <notPatentDetails v-if="evidenceType == 1" :projectId="projectId" :signPatentNo="signPatentNo" :reportType="reportType" :evidence="evidenceData"></notPatentDetails>
  10. <!-- <Patent-Details :patentNo="patentNo" :projectId="projectId" :taskId="taskId"></Patent-Details> -->
  11. <component v-else :is='components' :patentNo="(signPatentNo && showView)?signPatentNo:patentNo" :value="showView" :evidence="evidenceData" :outside="outside" :projectType="projectType" :lock="signPatentNo?true:false" :signPatentNo="signPatentNo" :projectId="projectId" :taskId="taskId"
  12. :reportType="reportType" :isResult="isResult"></component>
  13. </div>
  14. <div slot="right" style="width:100%">
  15. <notPatentDetails v-if="evidenceType == 1" :projectId="projectId" :signPatentNo="signPatentNo" :reportType="reportType" :evidence="evidenceData"></notPatentDetails>
  16. <Patent-Details v-else :patentNo="patentNo" :outside="outside" :value="showView" :projectType="projectType" :evidence="evidenceData" :signPatentNo="signPatentNo" :reportType="reportType" :projectId="projectId" :taskId="taskId"></Patent-Details>
  17. </div>
  18. </my-View>
  19. </div>
  20. <teamwork ref="teamwork" :patentNo="patentNo" :projectId="projectId" :reportType="reportType"></teamwork>
  21. </div>
  22. </template>
  23. <script>
  24. import articleMenu from './components/menu.vue'
  25. import PatentDetails from './components/patentDetails.vue'
  26. import tortContrast from '@/views/report/tort/components/tortContrast1.vue'
  27. import teamwork from '@/views/report/components/dialog/teamwork.vue'
  28. import notPatentDetails from './components/notPatentDetails.vue'
  29. import {mapGetters} from 'vuex'
  30. export default {
  31. components: {
  32. articleMenu,
  33. PatentDetails,
  34. tortContrast,
  35. teamwork,
  36. notPatentDetails
  37. },
  38. props: {},
  39. data() {
  40. return {
  41. showView: false,
  42. isRight: false,
  43. patentNo: this.$route.params.patentNo,
  44. components: 'PatentDetails',
  45. menuList: [],
  46. evidenceData: {},
  47. currentState:0,
  48. };
  49. },
  50. watch: {},
  51. computed: {
  52. ...mapGetters(['highlight']),
  53. projectId() {
  54. return this.$route.query.projectId
  55. },
  56. taskId() {
  57. return this.$route.query.taskId
  58. },
  59. reportType() {
  60. return this.$route.query.reportType
  61. },
  62. search() {
  63. return this.$s.getSession('search') || {}
  64. },
  65. isResult() {
  66. return this.$route.query.isResult
  67. },
  68. taskType() {
  69. return this.$route.query.taskType
  70. },
  71. handlerType() {//1外部人员0内部人员(只有外部协同人做协同任务才会传递)
  72. return this.$route.query.handlerType
  73. },
  74. evidenceType() {//证据文献类型,专利类型:0;非专利:1
  75. return this.$route.query.evidenceType
  76. },
  77. evidence() {
  78. return this.$route.query.evidence
  79. },
  80. signPatentNo(){
  81. return this.$route.query.signPatentNo
  82. },
  83. outside() {
  84. return this.$route.query.outside
  85. },
  86. projectType() {
  87. return this.$route.query.projectType//判断是不是从专题库进入专利详情1为专题库2为报告(报告未传2)3是产品,4是标注库,5是检索
  88. },
  89. productId(){
  90. return this.$route.query.productId
  91. }
  92. },
  93. created() { },
  94. mounted() {
  95. if(this.search && !this.search.fromPath){
  96. this.search.fromPath = window.history.length
  97. if(window.history.state){
  98. this.currentState = window.history.state.key
  99. }
  100. var that = this
  101. window.addEventListener('popstate', function(event) {
  102. // console.log(event,that.currentState,event.state.key)
  103. // 在这里处理历史记录变化时的逻辑
  104. if(that.currentState<event.state.key){
  105. that.search.fromPath += 1
  106. }else{
  107. that.search.fromPath -= 1
  108. }
  109. that.currentState = event.state.key
  110. })
  111. this.$s.setSession('search',this.search)
  112. }
  113. if (this.evidence) {
  114. this.evidenceData = JSON.parse(this.evidence)
  115. } else {
  116. this.evidenceData = this.evidence
  117. }
  118. this.getMenuPrice()
  119. this.getComponents()
  120. if(this.reportType == 1 || this.reportType == 2){
  121. this.$store.commit("SET_PATENT_CONTRAST",[])
  122. this.getContrast()
  123. }
  124. this.$store.commit('SET_PATENT_PIZHU_CONTRAST', [])
  125. this.getPiZhuData()
  126. },
  127. methods: {
  128. //获取对比记录
  129. getContrast(){
  130. if(!this.evidence){
  131. return false
  132. }
  133. var params = {
  134. literatureId:this.evidenceData.id
  135. }
  136. var contrastList = this.highlight.contrastList
  137. var index = contrastList.findIndex(item=>{
  138. return item.literatureId == this.evidenceData.id
  139. })
  140. if(index !=-1){
  141. return
  142. }
  143. this.$api.queryCompareRecord(params).then(response=>{
  144. if(response.code == 200){
  145. if(response.data.data.length>0){
  146. // var obj = response.data.data[0]
  147. // var newContrastList = contrastList.filter(item=>{
  148. // return item.literatureId != obj.literatureId
  149. // })
  150. var data = response.data.data.map(item=>{
  151. item.signPatentNo = this.signPatentNo
  152. item.projectId = this.projectId
  153. item.patentNo = this.evidenceData.literatureNo
  154. return item
  155. })
  156. contrastList.push(...data)
  157. this.$store.commit("SET_PATENT_CONTRAST",contrastList)
  158. }
  159. }
  160. })
  161. },
  162. // 获取批注
  163. getPiZhuData(val) {
  164. let params = {
  165. patentNo: val ? val : this.patentNo,
  166. projectId: this.projectId,
  167. }
  168. this.$api.queryScratchWords(params).then(response => {
  169. if (response.code == 200) {
  170. if (this.highlight.piZhuContrastList.length > 0) {
  171. var a = this.highlight.piZhuContrastList.filter(item => {
  172. return item.patentNo != params.patentNo
  173. }).concat(response.data.data)
  174. } else {
  175. var a = response.data.data
  176. }
  177. this.$store.commit('SET_PATENT_PIZHU_CONTRAST', a)
  178. }
  179. })
  180. },
  181. // 获取协同按钮
  182. getMenuPrice() {
  183. if (this.reportType == 4 && !this.taskId) {
  184. this.menuList = [
  185. {
  186. content: '协同',
  187. event: 'coordination',
  188. icon: 'el-icon-s-custom',
  189. }
  190. ]
  191. }
  192. },
  193. getComponents() {
  194. if (this.taskType == '3' || this.taskType == '4') {
  195. this.components = 'tortContrast'
  196. }
  197. },
  198. //菜单事件
  199. event(val) {
  200. this[val]()
  201. },
  202. //对比
  203. contrast() {
  204. this.showView = !this.showView
  205. },
  206. //设置左边或者右边
  207. setting() {
  208. this.isRight = !this.isRight
  209. },
  210. //返回
  211. goBack() {
  212. if(this.search.fromPath){
  213. var now = window.history.length
  214. var history= this.search.fromPath
  215. var len = Number(now) - Number(history) + 1
  216. window.history.go(-len)
  217. }
  218. },
  219. //协同
  220. coordination() {
  221. this.$refs.teamwork.open()
  222. },
  223. getPatentLeft(val, sign) {
  224. var evidenceType = null
  225. var evidence = null
  226. if (sign) {
  227. this.evidenceData = val
  228. this.patentNo = val.literatureNo
  229. evidenceType = val.type
  230. evidence = JSON.stringify(val)
  231. } else {
  232. this.patentNo = val
  233. }
  234. if(this.reportType == 1 || this.reportType == 2){
  235. this.getContrast()
  236. }
  237. this.getPiZhuData()
  238. if(window.history.state){
  239. this.currentState = window.history.state.key
  240. }
  241. this.$router.push(
  242. {
  243. path: '/patentDetails/' + this.patentNo,
  244. query: {
  245. projectId: this.projectId,
  246. taskId: this.taskId,
  247. reportType: this.reportType,
  248. isResult:this.isResult,
  249. taskType:this.taskType,
  250. handlerType:this.handlerType,
  251. evidenceType: evidenceType,
  252. evidence: evidence,
  253. signPatentNo:this.signPatentNo,
  254. outside:this.outside,
  255. projectType:this.projectType,
  256. productId:this.productId
  257. }
  258. }
  259. )
  260. },
  261. },
  262. destroyed(){
  263. window.removeEventListener('popstate', function(event) {
  264. // 在这里处理历史记录变化时的逻辑
  265. })
  266. }
  267. };
  268. </script>
  269. <style lang="scss" scoped>
  270. .article {
  271. display: flex;
  272. .content {
  273. width: 100%
  274. }
  275. }</style>