Преглед на файлове

产品相关专利显示栏位bug修复

zhuhao преди 2 години
родител
ревизия
e2f97974ec

+ 1 - 0
RMS-FrontEnd/src/config/index.js

@@ -1,6 +1,7 @@
 export default {
     baseURL: "/api",
     host: window.location.host,
+    hostname: window.location.hostname,
     staticURL: process.env.NODE_ENV === 'production' ? window.location.protocol+'//'+window.location.hostname+':8084' : (process.env.NODE_ENV === 'test'?'http://139.224.24.90:8083':'http://192.168.1.24:8084'),
     staticURL2: process.env.NODE_ENV === 'production' ? window.location.protocol+'//'+window.location.hostname+':8081' : (process.env.NODE_ENV === 'test'?'http://139.224.24.90:8083':'http://192.168.1.24:8081'),
     pasURL:process.env.NODE_ENV === 'production' ? window.location.protocol+'//'+window.location.hostname+':80' :(process.env.NODE_ENV === 'test'?window.location.protocol+'//'+window.location.hostname+':8080':window.location.protocol+'//'+window.location.hostname+':8085') ,

+ 1 - 1
RMS-FrontEnd/src/views/components/common/menu/mixins.js

@@ -13,7 +13,7 @@ export const File = {
                 var FileUrl = this.$p + item.url
                 var isPicture = 0
             }else{
-                var FileUrl =  'http://139.224.24.90:8012/onlinePreview?url='+ btoa(encodeURIComponent(this.$p + item.url))
+                var FileUrl =  `http://${$c.hostname}:8012/onlinePreview?url=`+ btoa(encodeURIComponent(this.$p + item.url))
                 var isPicture = 0
             }
             const router = this.$router.resolve({

+ 1 - 1
RMS-FrontEnd/src/views/layout/mixins/index.js

@@ -4,7 +4,7 @@ import Store from '@/store'
 export const webSocket = {
   methods: {
     connectWebSocket(userId) {
-      let webSocket = new WebSocket(`ws://139.224.24.90:8872/api/report/api/ws/`+userId)
+      let webSocket = new WebSocket(`ws://${$c.hostname}:8872/api/report/api/ws/`+userId)
       // let webSocket = new WebSocket(`ws://192.168.1.24:8872/api/report/api/ws/`+userId)
       Store.commit('SET_WEB_SOCKET', webSocket)
       webSocket.onopen = () => {

+ 1 - 1
RMS-FrontEnd/src/views/product/components/relatedPatents/components/import/SystemTask.vue

@@ -151,7 +151,7 @@ export default {
   },
   methods: {
     connectWebSocket(userId) {
-      this.webSocket1 = new WebSocket(`ws://139.224.24.90:8877/api/v2/ws/` + userId)
+      this.webSocket1 = new WebSocket(`ws://${$c.hostname}:8877/api/v2/ws/` + userId)
       // this.webSocket1 = new WebSocket(`ws://192.168.1.24:8877/api/v2/ws/` + userId)
 
       // Store.commit('SET_WEB_SOCKET', webSocket)

+ 98 - 53
RMS-FrontEnd/src/views/product/components/relatedPatents/components/table.vue

@@ -3,7 +3,7 @@
     <div style="margin-bottom:20px">
       <span><span>{{ name }}</span>{{structureId?'架构':'产品'}}的相关专利</span>
     </div>
-    <div style="display: flex; justify-content: space-between;" v-if="!structureId">
+    <div style="display: flex; justify-content: space-between;flex-wrap: wrap;" v-if="!structureId">
       <div :style="{ visibility: selectedTotal > 0 ? 'visible' : 'hidden' }">
         已勾选 <b>{{ selectedTotal }}</b> 条
       </div>
@@ -69,30 +69,34 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column prop="name" label="专利标题" align="center" width="300px"></el-table-column>
-      <el-table-column v-for="item in fields" :prop="item.key" :label="item.name" align="center"></el-table-column>
-      <el-table-column prop="applicationNo" label="申请号" align="center" width=""></el-table-column>
-      <el-table-column prop="applicationDate" label="申请日" align="center" width=""></el-table-column>
-      <el-table-column prop="ipcList" label="IPC分类号" align="center" width=""></el-table-column>
-      <el-table-column prop="applicant" label="权利人" align="center" width="">
+      <el-table-column v-for="column in fields" :label="column.name" show-overflow-tooltip align="center">
+        <!-- <template slot="header">
+          <patent-table-view-sort :title="column.name" :prop="column.key" @on-sort="onSort" />
+        </template> -->
         <template slot-scope="scope">
-          <span v-for="item in scope.row.applicant">
-           <span v-if="item.dataType==1">
-              {{ item.name }}
-           </span> 
-          </span>
-        </template>
-      </el-table-column>
-      <el-table-column prop="applicant" label="申请人" align="center" width="">
-        <template slot-scope="scope">
-          <span v-for="item in scope.row.applicant">
-           <span v-if="item.dataType==2">
-              {{ item.name }}
-           </span> 
-          </span>
+          <div style="" v-for="data in getColumnValue(scope.row, column)">
+            <template v-if="column.key === 'name'">
+              <span v-html="getViewDom2(scope.row, 'name')"></span>
+              <br>
+              <el-link type="primary" @click.native="handleChange(scope.row, 'name')">
+                <span v-if="!scope.row.change">切换译文</span>
+                <span v-else>切换原文</span>
+              </el-link>
+            </template>
+            <template v-else-if="column.key === 'abstractStr'">
+              <span v-html="getViewDom2(scope.row, 'abstractStr')"></span>
+              <br>
+              <el-link type="primary" @click.native="handleChange(scope.row, 'abstractStr')">
+                <span v-if="!scope.row.change2">切换译文</span>
+                <span v-else>切换原文</span>
+              </el-link>
+            </template>
+            <template v-else>
+              <span v-html="getViewDom(data)"></span>
+            </template>
+          </div>
         </template>
       </el-table-column>
-      <el-table-column prop="simpleStatus" align="center" label="状态"></el-table-column>
 
     </el-table>
     <div class="pagination">
@@ -145,12 +149,14 @@
 <script>
 import SelectedPatent from "./SelectedPatent.vue";
 import PatentViewField from "./dialog/PatentViewField.vue";
+import { patentViewList, patentKeywordsHighlight} from '@/views/components/common/mixins'
 
 export default {
   components: {
     SelectedPatent,
     PatentViewField,
   },
+  mixins:[patentViewList, patentKeywordsHighlight],
   props: ['productId','structureId','name'],//name为产品名称或者架构名称
   data() {
     return {
@@ -162,7 +168,7 @@ export default {
       quickSelect: false,//是否快速选择
       loading: true,
       visible: false,
-      selected: [],
+      selecteds: [],
       checkList: [],//回显
       tableData: [],
       total: 0,
@@ -197,7 +203,7 @@ export default {
         },
         field: [],
         tree: [],
-        selected: [],
+        selecteds: [],
         startNumber: 1,
         endNumber: 0,
         family: 0,
@@ -252,15 +258,54 @@ export default {
     },
     handleFields(patentViewField) {
       this.fields=[]
-      const customField=patentViewField.filter(item => {
+      this.fields=patentViewField.filter(item => {
         return item.hidden==false
       })
-      let isIncludes = ['applicant4', 'applicant2', 'ipcList', 'applicationDate', 'applicationNo', 'name']
-      customField.forEach(item => {
-        if (!item.key.includes('applicant4') && !item.key.includes('applicant2') && !item.key.includes('name') && !item.key.includes('ipcList') && !item.key.includes('applicationDate')&& !item.key.includes('applicationNo')) {
-          this.fields.push(item)
+    },
+    getColumnValue(row, column) {
+      if (column.type !== 'list') {
+        const field = row.field.find(item => item.id === parseInt(column.key))
+        if (field) {
+          // return field.selecteds
         }
-      })
+      } else if (column.key === 'label') {
+        return row.label.map(item => item.name)
+      } else {
+        const value = row[column.key]
+        if (column.key === 'inventor' || column.key === 'agent') {
+          return value.map(item => item.name)
+        }
+        if (column.key === 'applicant1') {
+          return row.applicant.filter(a => a.dataType === 1).map(item => item.shortName)
+        }
+        if (column.key === 'applicant2') {
+          return row.applicant.filter(a => a.dataType === 1).map(item => item.name)
+        }
+        if (column.key === 'applicant3') {
+          return row.applicant.filter(a => a.dataType === 2).map(item => item.shortName)
+        }
+        if (column.key === 'applicant4') {
+          return row.applicant.filter(a => a.dataType === 2).map(item => item.name)
+        }
+        if (column.key === 'simpleFamily') {
+          return [row.family.simple.length]
+        }
+        if (column.key === 'inpadocFamily') {
+          return [row.family.inpadoc.length]
+        }
+        if (column.key === 'patSnapFamily') {
+          return [row.family.patSnap.length]
+        }
+        if (column.key === 'agency' && value) {
+          return [value.name]
+        }
+        if (value instanceof Array) {
+          return value
+        } else if (typeof value === 'string' || typeof value === 'number') {
+          return [value]
+        }
+        return ''
+      }
     },
     // 跳转专利详情
     toPatentDetails(val) {
@@ -419,10 +464,10 @@ export default {
       }
       switch (type) {
         case 0:
-          this.queryParams.selected = this.tableData.map(item => item.patentNo);
-          this.checkList = [...new Set(this.checkList.concat(this.queryParams.selected))]
+          this.queryParams.selecteds = this.tableData.map(item => item.patentNo);
+          this.checkList = [...new Set(this.checkList.concat(this.queryParams.selecteds))]
           // this.selectedTotal = this.checkList.length
-          this.queryParams.selected = []
+          this.queryParams.selecteds = []
           if (!this.quickSelect) {
             this.queryParams.patentNos = JSON.parse(JSON.stringify(this.checkList))
             this.getSelectedTotal()
@@ -479,9 +524,9 @@ export default {
           // this.selectNumberLoading = true
           // this.$api.getComPatentNos(params).then(response => {
           //   //console.log(response.data)
-          //   this.queryParams.selected = response.data
-          //   this.checkList = [...new Set(this.checkList.concat(this.queryParams.selected))]
-          //   // this.checkList = this.queryParams.selected
+          //   this.queryParams.selecteds = response.data
+          //   this.checkList = [...new Set(this.checkList.concat(this.queryParams.selecteds))]
+          //   // this.checkList = this.queryParams.selecteds
           //   this.selectNumberLoading = false
           //   this.getList()
           // }).catch(error => {
@@ -500,7 +545,7 @@ export default {
 
           }
 
-          // this.checkList =JSON.parse(JSON.stringify(this.queryParams.selected)) 
+          // this.checkList =JSON.parse(JSON.stringify(this.queryParams.selecteds)) 
           this.checkList = []
           this.queryParams.notInPatentNos = []
           this.queryParams.patentNos = []
@@ -550,7 +595,7 @@ export default {
         }
       }
       this.checkList = [...new Set(this.checkList)]
-      this.selected = this.checkList
+      this.selecteds = this.checkList
       this.getSelectedTotal()
       // //console.log(this.checkList)
 
@@ -564,7 +609,7 @@ export default {
       } else {
         this.checkList.push(this.tableData[y].patentNo)
       }
-      var index = this.queryParams.selected.findIndex(item => {
+      var index = this.queryParams.selecteds.findIndex(item => {
         return item == patentNo
       })
       if (index != -1) {
@@ -574,7 +619,7 @@ export default {
         if (index3 != -1) {
 
         } else {
-          this.queryParams.notInPatentNos.push(this.queryParams.selected[index])
+          this.queryParams.notInPatentNos.push(this.queryParams.selecteds[index])
         }
 
       }
@@ -588,7 +633,7 @@ export default {
     },
 
     handleCancelSelectNumber() {//取消选择
-      this.queryParams.selected = []
+      this.queryParams.selecteds = []
       this.queryParams.patentNos = []
       this.queryParams.notInPatentNos = []
       this.checkList = []
@@ -603,7 +648,7 @@ export default {
     getFunInfo(val) {
       //console.log(this.quickSelect);
       if (this.quickSelect) {
-        var index4 = this.queryParams.selected.findIndex(item => {
+        var index4 = this.queryParams.selecteds.findIndex(item => {
           return item == val
         })
         if (index4 != -1) {
@@ -614,7 +659,7 @@ export default {
           this.$api.deleteCompareNo(a).then(response => {
             if (response.code == 200) {
               // this.getList()
-              this.queryParams.selected.splice(index4, 1)
+              this.queryParams.selecteds.splice(index4, 1)
             }
           })
 
@@ -624,7 +669,7 @@ export default {
           this.isFind(val)
         }
       } else {
-        var index = this.queryParams.selected.findIndex(item => {
+        var index = this.queryParams.selecteds.findIndex(item => {
           return item == val
         })
         if (index != -1) {
@@ -653,13 +698,13 @@ export default {
     },
     isFind(val) {
       if (this.isFetch) {
-        var index = this.selected.findIndex(item => {
+        var index = this.selecteds.findIndex(item => {
           return item == val
         })
         if (index != -1) {
           //console.log(val)
           this.queryParams.notInPatentNos.push(val)
-          this.selected.splice(index, 1)
+          this.selecteds.splice(index, 1)
         } else {
           var index2 = this.queryParams.notInPatentNos.findIndex(i => {
             return i == val
@@ -693,11 +738,11 @@ export default {
           } else {
             // this.isFetch = true
             // this.getFunInfo()
-            var index = this.selected.findIndex(item => {
+            var index = this.selecteds.findIndex(item => {
               return item == val
             })
             if (index != -1) {
-              var index4 = this.queryParams.selected.findIndex(item => {
+              var index4 = this.queryParams.selecteds.findIndex(item => {
                 return item == val
               })
               if (index4 != -1) {
@@ -708,12 +753,12 @@ export default {
                 this.$api.deleteCompareNo(a).then(response => {
                   if (response.code == 200) {
                     // this.getList()
-                    this.queryParams.selected.splice(index4, 1)
+                    this.queryParams.selecteds.splice(index4, 1)
                   }
                 })
               } else {
                 this.queryParams.notInPatentNos.push(val)
-                this.selected.splice(index, 1)
+                this.selecteds.splice(index, 1)
               }
             } else {
               this.queryParams.patentNos.push(val)
@@ -810,10 +855,10 @@ export default {
         this.queryParams.startNumber = this.endNumber > 0 ? this.startNumber : 1
 
         this.tableData = response.data.records
-        // this.queryParams.selected = response.data.select
+        // this.queryParams.selecteds = response.data.select
         // this.queryParams.selectedTotal = response.data.selectedTotal
-        this.checkList = JSON.parse(JSON.stringify([...new Set(this.checkList.concat(this.queryParams.selected))]))
-        this.selected = this.checkList
+        this.checkList = JSON.parse(JSON.stringify([...new Set(this.checkList.concat(this.queryParams.selecteds))]))
+        this.selecteds = this.checkList
         this.isFetch = true