Bladeren bron

高亮、导入

zhuhao 1 jaar geleden
bovenliggende
commit
c3f6c97ffb

+ 24 - 0
src/api/newApi/patent.js

@@ -231,4 +231,28 @@ export default {
   exportPatentExcel(data) {
     return axios.post("/xiaoshi/patent/exportPatentExcel", data);
   },
+  /**
+   * 专利关键词高亮添加
+   * @param {*} data 
+   * @returns 
+   */
+  saveOrUpdate(data) {
+    return axios.post("/xiaoshi/hightlightTemplate/saveOrUpdate", data);
+  },
+  /**
+   * 专利关键词高亮查询
+   * @param {*} params 
+   * @returns 
+   */
+  queryHightLight(params) {
+    return axios.get("/xiaoshi/hightlightTemplate/query", {params});
+  },
+  /**
+   * 专利关键词高亮删除
+   * @param {*} data 
+   * @returns 
+   */
+  deleteHightLight(data) {
+    return axios.post("/xiaoshi/hightlightTemplate/delete", data);
+  },
 }

+ 1 - 1
src/utils/direct/drag.js

@@ -88,7 +88,7 @@
           // 执行移动
           target.style.left = zLeft + 'px';
           target.style.top = zTop + 'px';
-          console.log(target)
+          // console.log(target)
         }
    
         if (typeof callback == "function") {

+ 2 - 2
src/views/components/dialog/menuDialog/annotation.vue

@@ -111,8 +111,8 @@ export default {
     // 删除
     handleDelete() {
       console.log('批注删除');
-      return
-      this.$api.dele({id:this.mark.id}).then(response => {
+      let ids = [this.mark.id]
+      this.$api.dele(ids).then(response => {
         if (response.code == 200) {
           this.$message.success('删除批注成功')
           this.cancel()

+ 245 - 247
src/views/components/import/task/components/index.vue

@@ -1,74 +1,89 @@
 <template>
   <div class="height_100">
     <el-container v-if="showView">
-        <el-header>
-            <div id="step1">
-                <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch>
-            </div>
-        </el-header>
-        <el-main>
-            <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header" @sort-change="sortChange">
-                <el-table-column label="#" type="index" align="center" width="55">
-                <template slot-scope="scope">
-                    <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
-                </template>
-                </el-table-column>
-            <el-table-column v-for="item in columnList.filter(item=>!item.ifHidden)" :key="item.value" :label="item.name" :prop="item.value" :min-width="item.value == 'percentage'?'200':'100'" align="center" sortable="custom">
-                <template slot-scope="scope">
-                    <div v-if="item.value == 'type'" v-html="$commonJS.getColumnData(scope.row, item,null,{data:importType})"></div>
-                    <div v-else-if="item.value == 'state'" v-html="$commonJS.getColumnData(scope.row, item,null,{data:state})"></div>
-                    <div v-else-if="item.value == 'percentage'" style="display:flex;">
-                        <div style="width:100%">
-                            <el-progress :text-inside="true" :stroke-width="20" :percentage="scope.row.percentage>100?100:scope.row.percentage" :color="customColors"></el-progress>
-                        </div>
-                        <div style="min-width: 50px;">{{ scope.row.doneNum }}/{{ scope.row.allNum }}</div>
-                    </div>
-                    <div v-else  v-html="$commonJS.getColumnData(scope.row, item)"></div>
-                </template>
-            </el-table-column>
-            
-            <el-table-column label="操作" align="center" width="150">
-              <template slot-scope="scope" >
-                <div  class="operate">
-                    <!-- <el-link type="primary" @click.native="details(scope.row)">
+      <el-header>
+        <div id="step1">
+          <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
+          </mySearch>
+        </div>
+      </el-header>
+      <el-main>
+        <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header"
+          @sort-change="sortChange">
+          <el-table-column label="#" type="index" align="center" width="55">
+            <template slot-scope="scope">
+              <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column v-for="item in columnList.filter(item => !item.ifHidden)" :key="item.value" :label="item.name"
+            :prop="item.value" :min-width="item.value == 'percentage' ? '200' : '100'" align="center" sortable="custom">
+            <template slot-scope="scope">
+              <div v-if="item.value == 'type'"
+                v-html="$commonJS.getColumnData(scope.row, item, null, { data: importType })">
+              </div>
+              <div v-else-if="item.value == 'state'"
+                v-html="$commonJS.getColumnData(scope.row, item, null, { data: state })">
+              </div>
+              <div v-else-if="item.value == 'percentage'" style="display:flex;">
+                <div style="width:100%">
+                  <el-progress :text-inside="true" :stroke-width="20"
+                    :percentage="scope.row.percentage > 100 ? 100 : scope.row.percentage"
+                    :color="customColors"></el-progress>
+                </div>
+                <div style="min-width: 50px;">{{ scope.row.doneNum }}/{{ scope.row.allNum }}</div>
+              </div>
+              <div v-else v-html="$commonJS.getColumnData(scope.row, item)"></div>
+            </template>
+          </el-table-column>
+
+          <el-table-column label="操作" align="center" width="150">
+            <template slot-scope="scope">
+              <div class="operate">
+                <!-- <el-link type="primary" @click.native="details(scope.row)">
                         <el-tooltip class="item" effect="dark" content="下载" placement="top">
                         <i class="el-icon-document"></i>
                         </el-tooltip>  
                     </el-link> -->
-                  <el-link type="primary" @click.native="handleDownload(scope.row)" v-if="$permission('/workspace/common/taskDownload') && ((scope.row.type == 1 || scope.row.type == 2) && (scope.row.state !== 0 || scope.row.state !== 1))">
-                    <el-tooltip class="item" effect="dark" content="下载" placement="top">
-                      <i class="iconfont icon-xiazai"></i>
-                    </el-tooltip>  
-                  </el-link>
-                  
-                  <el-link class="margin-left_10" type="primary"  @click="updateImportTaskState(scope.row,4)" v-if="scope.row.state==1 || scope.row.state==0">
-                    <el-tooltip class="item" effect="dark" content="暂停" placement="top">
-                      <i class="iconfont icon-zanting1"></i>
-                    </el-tooltip>
-                  </el-link>
-                  <el-link class="margin-left_10" type="primary"  @click="updateImportTaskState(scope.row,0)" v-if="scope.row.state==4">
-                    <el-tooltip class="item" type="primary" effect="dark" content="继续" placement="top">
-                      <i class="iconfont icon-zanting" ></i> 
-                    </el-tooltip>
-                  </el-link>
-                  <el-link class="margin-left_10" type="primary"  v-if="scope.row.taskType == 1" @click="updateLog(scope.row)">
-                      <el-tooltip class="item" effect="dark" content="更新记录" placement="top">
-                        <i class="iconfont icon-banbengengxinjilu" style="font-size:18px"></i>
-                      </el-tooltip>
-                    </el-link>
-                    <el-link class="margin-left_10" type="danger" @click.native="updateImportTaskState(scope.row,5)" v-if="(scope.row.state!=2 && scope.row.state!=5) || scope.row.taskType == 1" >
-                    <el-tooltip class="item" effect="dark" content="取消" placement="top">
-                      <i class="iconfont icon-quxiaorenwu1"></i>
-                    </el-tooltip> 
-                  </el-link>
-                </div>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-main>
-        <el-footer class="pagination">
-            <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
-        </el-footer>
+                <el-link type="primary" @click.native="handleDownload(scope.row)"
+                  v-if="$permission('/workspace/common/taskDownload') && (scope.row.fileGuid && (scope.row.state !== 0 || scope.row.state !== 1))">
+                  <el-tooltip class="item" effect="dark" content="下载" placement="top">
+                    <i class="iconfont icon-xiazai"></i>
+                  </el-tooltip>
+                </el-link>
+
+                <el-link class="margin-left_10" type="primary" @click="updateImportTaskState(scope.row, 4)"
+                  v-if="scope.row.state == 1 || scope.row.state == 0">
+                  <el-tooltip class="item" effect="dark" content="暂停" placement="top">
+                    <i class="iconfont icon-zanting1"></i>
+                  </el-tooltip>
+                </el-link>
+                <el-link class="margin-left_10" type="primary" @click="updateImportTaskState(scope.row, 0)"
+                  v-if="scope.row.state == 4">
+                  <el-tooltip class="item" type="primary" effect="dark" content="继续" placement="top">
+                    <i class="iconfont icon-zanting"></i>
+                  </el-tooltip>
+                </el-link>
+                <el-link class="margin-left_10" type="primary" v-if="scope.row.taskType == 1"
+                  @click="updateLog(scope.row)">
+                  <el-tooltip class="item" effect="dark" content="更新记录" placement="top">
+                    <i class="iconfont icon-banbengengxinjilu" style="font-size:18px"></i>
+                  </el-tooltip>
+                </el-link>
+                <el-link class="margin-left_10" type="danger" @click.native="updateImportTaskState(scope.row, 5)"
+                  v-if="(scope.row.state != 2 && scope.row.state != 5) || scope.row.taskType == 1">
+                  <el-tooltip class="item" effect="dark" content="取消" placement="top">
+                    <i class="iconfont icon-quxiaorenwu1"></i>
+                  </el-tooltip>
+                </el-link>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-main>
+      <el-footer class="pagination">
+        <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total"
+          @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+      </el-footer>
     </el-container>
   </div>
 </template>
@@ -78,77 +93,77 @@ import { mapGetters } from "vuex";
 export default {
   components: {},
   props: {
-    importToId:''
+    importToId: ''
   },
   data() {
     return {
-        //固定检索字段
-        searchFiled2:{
-            projectId:this.importToId
-        },
-        //检索字段
-        searchFiled: [],
-        //检索条件
-        searchOption: {},
-         //加载中
-        loading: false,
-        //任务的数据集合
-        tableData: [],
-        //分页信息
-        queryParams: {
-            current: 1,
-            size: 10
-        },
-        //总条数
-        total: 0,
-        //排序
-        sort: [
-            {
-                "orderBy": "createTime",
-                "orderType": 1
-            }
-        ],
-        columnList:[],//搜索的栏位
-        showView:false,
+      //固定检索字段
+      searchFiled2: {
+        projectId: this.importToId
+      },
+      //检索字段
+      searchFiled: [],
+      //检索条件
+      searchOption: {},
+      //加载中
+      loading: false,
+      //任务的数据集合
+      tableData: [],
+      //分页信息
+      queryParams: {
+        current: 1,
+        size: 10
+      },
+      //总条数
+      total: 0,
+      //排序
+      sort: [
+        {
+          "orderBy": "createTime",
+          "orderType": 1
+        }
+      ],
+      columnList: [],//搜索的栏位
+      showView: false,
 
-        customColors: [
-        {color: '#f56c6c', percentage: 20},
-        {color: '#e6a23c', percentage: 40},
-        {color: '#5cb87a', percentage: 60},
-        {color: '#1989fa', percentage: 80},
-        {color: '#6f7ad3', percentage: 100}
+      customColors: [
+        { color: '#f56c6c', percentage: 20 },
+        { color: '#e6a23c', percentage: 40 },
+        { color: '#5cb87a', percentage: 60 },
+        { color: '#1989fa', percentage: 80 },
+        { color: '#6f7ad3', percentage: 100 }
       ],
     };
   },
   watch: {},
   computed: {
     ...mapGetters(['webSocket', 'userinfo']),
-    importType(){
-        var a = this.$store.state.dictMessage.dictMessage.IMPORT_TASK_TYPE || []
-        if(a.length>0){
-            var obj = this.searchFiled.find(item=>{
-                return item.value == 'type'
-            })
-            if(obj){
-                obj.options = a
-            } 
+    importType() {
+      var a = this.$store.state.dictMessage.dictMessage.IMPORT_TASK_TYPE || []
+      if (a.length > 0) {
+        var obj = this.searchFiled.find(item => {
+          return item.value == 'type'
+        })
+        if (obj) {
+          obj.options = a
         }
-        return this.$store.state.dictMessage.dictMessage.IMPORT_TASK_TYPE || []
+      }
+      return this.$store.state.dictMessage.dictMessage.IMPORT_TASK_TYPE || []
     },
-    state(){
-        var a = this.$store.state.dictMessage.dictMessage.IMPORT_TASK_TYPE || []
-        if(a.length>0){
-            var obj = this.searchFiled.find(item=>{
-                return item.value == 'state'
-            })
-            if(obj){
-                obj.options = a
-            } 
+    state() {
+      var a = this.$store.state.dictMessage.dictMessage.IMPORT_TASK_TYPE || []
+      if (a.length > 0) {
+        var obj = this.searchFiled.find(item => {
+          return item.value == 'state'
+        })
+        if (obj) {
+          obj.options = a
         }
-        return this.$store.state.dictMessage.dictMessage.IMPORT_TASk_STATE
+      }
+      return this.$store.state.dictMessage.dictMessage.IMPORT_TASk_STATE
     }
   },
-  created() {},
+  created() { },
   async mounted() {
     this.initTask()
     this.columnList = await this.$commonJS.getCustomField('importTask')
@@ -158,73 +173,57 @@ export default {
   },
   methods: {
     initTask() {
-        
-    //   var webSocket = this.webSocket
-    //   console.log(webSocket)
+
+      //   var webSocket = this.webSocket
+      //   console.log(webSocket)
       this.webSocket.onmessage = (e) => {
-        if(e.data.indexOf('{') == -1){
-            return false
+        if (e.data.indexOf('{') == -1) {
+          return false
         }
         const { code, data, message } = JSON.parse(e.data)
-        // console.log({ code, data, message });
-//         var a = {
-//     "code": 903,
-//     "data": {
-//         "total": 9,
-//         "index": 0,
-//         "taskId": 117,
-//         "taskStatus": 1,
-//         "complete": false,
-//         "url": "",
-//         "fileName": "cd30d6d6285d49229be2a73c6812f457",
-//         "taskType": 1,
-//         "percentage": 0,
-//         "oldName": ""
-//     },
-//     "message": "WebSocket请求成功"
-// }
-        if(code === 900){
-            if(data.doneType == -1){
-                const index = this.tableData.findIndex(item=>{return item.id == data.taskId})
-                if (index === -1) {
+        console.log({ code, data, message });
+        //         var a = {
+        //     "code": 903,
+        //     "data": {
+        //         "total": 9,
+        //         "index": 0,
+        //         "taskId": 117,
+        //         "taskStatus": 1,
+        //         "complete": false,
+        //         "url": "",
+        //         "fileName": "cd30d6d6285d49229be2a73c6812f457",
+        //         "taskType": 1,
+        //         "percentage": 0,
+        //         "oldName": ""
+        //     },
+        //     "message": "WebSocket请求成功"
+        // }
+        if (code === 900 || code === 602 || code === 604) {
+          if (data.doneType == -1 || code === 602 || code === 604) {
+            const index = this.tableData.findIndex(item => { return item.id == data.taskId })
+            if (index === -1) {
 
-                } else {
-                    this.$set(this.tableData[index],'doneNum',data.index)
-                    this.$set(this.tableData[index],'percentage',data.percentage)
-                    this.$set(this.tableData[index],'state',data.taskStatus)
-                }
+            } else {
+              this.$set(this.tableData[index], 'doneNum', data.index)
+              this.$set(this.tableData[index], 'percentage', data.percentage)
+              this.$set(this.tableData[index], 'state', data.taskStatus)
             }
+          }
         }
-        if (code === 903) {
-          const index = this.tableData.findIndex(item=>{return item.id == data.taskId})
-          if (index === -1) {
+        if (code === 903 || code === 603 || code === 605) {
+          // const index = this.tableData.findIndex(item => { return item.id == data.taskId })
+          // if (index === -1) {
 
-          } else {
-            this.$set(this.tableData[index],'doneNum',data.index)
-            this.$set(this.tableData[index],'percentage',data.percentage)
-            this.$set(this.tableData[index],'state',data.taskStatus)
-          }
+          // } else {
+          //   this.$set(this.tableData[index], 'doneNum', data.index)
+          //   this.$set(this.tableData[index], 'percentage', data.percentage)
+          //   this.$set(this.tableData[index], 'state', data.taskStatus)
+          // }
           if (data.complete) {
-            // if(data.taskType!=2){
-              // this.$message.success(`导入任务完成`)
-            //    for(var i = 0;i<this.tableData.length;i++){
-            //     if(this.tableData[i].complete==true){
-            //       this.tableData.splice(i,1)
-            //     }
-            //   }
-            // }else{
-            //   this.$message.success(`导出任务完成`)
-            // }
-            
-            // console.log(this.form)
-           
-            // this.getList()
+            this.getList()
           }
-        } 
-        // else if (code === 803 || code === 804) {
-        //   this.$message.error(message)
-        //   this.getList()
-        // }
+        }
+       
       }
     },
     //显示视图?
@@ -239,96 +238,96 @@ export default {
       let params = ['importTask']
       await this.$api.getParamsCommon(params).then(res => {
         if (res.code == 200) {
-          let conditionDTOList= JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
+          let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
           // 搜索字段
-          this.searchFiled = this.$commonJS.getField(conditionDTOList,(u)=> u.ifSearch == true ,{
+          this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
             label: 'name',
             value: 'value',
-            type:'type',
+            type: 'type',
           })
-          var options = ['type','state']
-          options.forEach(item=>{
+          var options = ['type', 'state']
+          options.forEach(item => {
             this.getOption(item)
           })
-          
+
         }
       })
       this.showViews()
     },
-    getOption(type){
-        var obj = this.searchFiled.find(item=>{
-            return item.value == type
-        })
-        if(!obj){
-           return false
-        }
-        switch(type){
-            case 'type':
-                obj.options = this.importType
-                break;
-            case 'state':
-                obj.options = this.state
-                break;
-        }
+    getOption(type) {
+      var obj = this.searchFiled.find(item => {
+        return item.value == type
+      })
+      if (!obj) {
+        return false
+      }
+      switch (type) {
+        case 'type':
+          obj.options = this.importType
+          break;
+        case 'state':
+          obj.options = this.state
+          break;
+      }
     },
     //获取检索条件检索
     search(val) {
       let params = {}
       val.forEach(item => {
         if (item.type == 3) {
-          params[item.value]=item.searchValue.map(itemValue => {
+          params[item.value] = item.searchValue.map(itemValue => {
             return itemValue.value
           })
         } else {
-          params[item.value]=item.searchValue.label
+          params[item.value] = item.searchValue.label
         }
       })
       // 返回条件对象
-      this.searchOption=this.$commonJS.ArrayToArray(val)
+      this.searchOption = this.$commonJS.ArrayToArray(val)
       // 调用查询接口
-      this.queryParams.current=1
+      this.queryParams.current = 1
       this.getList()
     },
     //获取任务
-    getList(){
-        // var params = {
-        //     ...this.searchFiled2,
-        //     ...this.searchOption
-        // }
-        var searchFiled2 = this.$commonJS.objectToArray(this.searchFiled2)
-        var searchOption1 = this.searchOption
-        if(this.searchOption.constructor == Object){
-          searchOption1 = this.$commonJS.objectToArray(this.searchOption)
-        }
-        let searchOption = [
-          ...searchFiled2,//固有检索字段
-          ...searchOption1
-        ]
-        var params = {
-            ...this.queryParams,
-            searchQuery:this.$commonJS.objectToString(searchOption),
-            orderDTOList:this.sort
+    getList() {
+      // var params = {
+      //     ...this.searchFiled2,
+      //     ...this.searchOption
+      // }
+      var searchFiled2 = this.$commonJS.objectToArray(this.searchFiled2)
+      var searchOption1 = this.searchOption
+      if (this.searchOption.constructor == Object) {
+        searchOption1 = this.$commonJS.objectToArray(this.searchOption)
+      }
+      let searchOption = [
+        ...searchFiled2,//固有检索字段
+        ...searchOption1
+      ]
+      var params = {
+        ...this.queryParams,
+        searchQuery: this.$commonJS.objectToString(searchOption),
+        orderDTOList: this.sort
+      }
+      this.$api.queryImportTask(params).then(res => {
+        if (res.code == 200) {
+          this.tableData = res.data.data
+          this.total = res.data.total
         }
-        this.$api.queryImportTask(params).then(res => {
-            if (res.code == 200) {
-                this.tableData = res.data.data
-                this.total=res.data.total
-            }
-        }).catch(err => {
-            this.tableData = []
-            this.total=0
-        })
+      }).catch(err => {
+        this.tableData = []
+        this.total = 0
+      })
     },
     //分页
-    handleCurrentChange(val){
-        this.queryParams.current = val 
-        this.getList()
+    handleCurrentChange(val) {
+      this.queryParams.current = val
+      this.getList()
     },
     //排序
     sortChange({ column, prop, order }) {
       //如需要多个字段排序,则不需要清空
       var params = {
-        sort:this.sort,
+        sort: this.sort,
         column,
         prop,
         order,
@@ -336,28 +335,27 @@ export default {
       this.sort = this.$commonJS.getSortData(params)
       this.queryParams.current = 0
       this.disabled = false
-      this.tableData=[]
+      this.tableData = []
       this.getList()
     },
-     // 网站导入暂停,继续任务操作
-    async updateImportTaskState(row,state) {
-        this.$api.updateImportTaskState({taskId:row.id,state:state}).then(response=>{
-            if(response.code == 200){
-                this.$set(row,'state',state)
-                this.$message.success('操作成功')
-            }
-        })
+    // 网站导入暂停,继续任务操作
+    async updateImportTaskState(row, state) {
+      this.$api.updateImportTaskState({ taskId: row.id, state: state }).then(response => {
+        if (response.code == 200) {
+          this.$set(row, 'state', state)
+          this.$message.success('操作成功')
+        }
+      })
     },
     //任务详情
-    details(){
+    details() {
 
     },
     //下载附件
-    handleDownload(row){
+    handleDownload(row) {
 
     }
   },
 };
 </script>
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 2 - 1
src/views/layout/components/contextMenu.vue

@@ -55,7 +55,8 @@ export default {
         return item.id == Id
         })
         if (index != -1) {
-          
+          // 打开批注框
+          this.$refs.annotation.open()
         }
       } else if (selectType == 'c') {//对比
         let a=this.highlight.contrastList.find(item => {

+ 4 - 3
src/views/layout/mixins/index.js

@@ -4,8 +4,8 @@ import Store from '@/store'
 export const webSocket = {
   methods: {
     connectWebSocket(userId) {
-      // let webSocket = new WebSocket(`ws://${this.$c.staticURL}:8879/api/xiaoshi/ws/` + userId)
-      let webSocket = new WebSocket(`ws://${this.$c.WebSocketPath}/api/xiaoshi/ws/` + userId)
+      let webSocket = new WebSocket(`ws://192.168.1.3:8877/api/xiaoshi/ws/` + userId)
+      // let webSocket = new WebSocket(`ws://${this.$c.WebSocketPath}/api/xiaoshi/ws/` + userId)
       Store.commit('SET_WEB_SOCKET', webSocket)
       webSocket.onopen = () => {
         console.log('WebSocket连接成功')
@@ -15,7 +15,8 @@ export const webSocket = {
           return false
       }
         const { code, data, message } = JSON.parse(e.data)
-        if(code == 903 || code == 600){
+        // 603导出专利完成605导出PDF完成
+        if(code == 903 || code == 600|| code == 603|| code == 605){
           if (data.complete) {
               this.$message.success(`导入完成`)
           }else{

+ 50 - 38
src/views/project/components/PatentKeywordsHighlight.vue

@@ -78,42 +78,46 @@ export default {
       }
       this.$store.commit('SET_PATENT_HIGHLIGHT', this.form)
     },
+    // 查询数据
     getList() {
-      this.dataList = [
-          {
-            "name": "默认模板",
-            "projectId": 425,
-            "userId": 103,
-            "enable": true,
-            "_default": true,
-            "configs": [
-                {
-                    "color": "#5470c6",
-                    "keywords": ""
-                },
-                {
-                    "color": "#91cc75",
-                    "keywords": ""
-                },
-                {
-                    "color": "#fac858",
-                    "keywords": ""
-                },
-                {
-                    "color": "#ee6666",
-                    "keywords": ""
-                },
-                {
-                    "color": "#73c0de",
-                    "keywords": ""
-                }
-            ],
-              "id": 1085
-          }
-        ]
-        this.onChange()
-        return
-      this.$api.getPatentKeywordsHighlight({ projectId: this.projectId }).then(response => {
+      // this.dataList = [
+      //     {
+      //       "name": "默认模板",
+      //       "projectId": 425,
+      //       "userId": 103,
+      //       "enable": true,
+      //       "_default": true,
+      //       "configs": [
+      //           {
+      //               "color": "#5470c6",
+      //               "keywords": ""
+      //           },
+      //           {
+      //               "color": "#91cc75",
+      //               "keywords": ""
+      //           },
+      //           {
+      //               "color": "#fac858",
+      //               "keywords": ""
+      //           },
+      //           {
+      //               "color": "#ee6666",
+      //               "keywords": ""
+      //           },
+      //           {
+      //               "color": "#73c0de",
+      //               "keywords": ""
+      //           }
+      //       ],
+      //         "id": 1085
+      //     }
+      //   ]
+      //   this.onChange()
+      //   return
+      let params = {
+        projectId:this.projectId
+      }
+      this.$api.queryHightLight(params).then(response => {
         this.dataList = response.data
         this.selected = 0
         this.onChange()
@@ -121,9 +125,13 @@ export default {
        
       })
     },
+    // 新增按钮
     handleAdd() {
       this.btnLoading = true
-      this.$api.addDefaultPatentKeywordsHighlight({ projectId: this.projectId }).then(response => {
+      let params = {
+        projectId: this.projectId
+      }
+      this.$api.saveOrUpdate(params).then(response => {
         this.dataList.push(response.data)
         this.$message.success('操作成功')
         this.btnLoading = false
@@ -133,14 +141,16 @@ export default {
         this.btnLoading = false
       })
     },
+    // 保存按钮事件
     handleSave() {
       this.visible = true
     },
+    // 保存弹窗中的确定
     submit() {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
           this.btnLoading = true
-          this.$api.updatePatentKeywordsHighlight(this.form).then(response => {
+          this.$api.saveOrUpdate(this.form).then(response => {
             this.$message.success('操作成功')
             this.btnLoading = false
             this.visible = false
@@ -151,9 +161,11 @@ export default {
         }
       })
     },
+    // 删除高亮
     handleDelete() {
       this.btnLoading2 = true
-      this.$api.deletePatentKeywordsHigh({ id: this.form.id }).then(response => {
+      let ids=[this.form.id]
+      this.$api.deletePatentKeywordsHigh(ids).then(response => {
         this.$message.success('操作成功')
         this.btnLoading2 = false
         this.dataList.splice(this.selected, 1)

+ 5 - 1
src/views/project/patentCollection/components/dialog/PatentBatchIndex.vue

@@ -83,6 +83,8 @@ export default {
       customFields: [],
       // 自定义字段选中或填写的值
       selectValue: [],
+      // 排序
+      orderDTOList:[],
     }
   },
   mounted() {
@@ -203,11 +205,12 @@ export default {
       })
     },
     // 打开弹窗
-    async open({ selectQuery, searchQuery, customFields }) {
+    async open({ selectQuery, searchQuery, customFields ,orderDTOList }) {
       // console.log(selectQuery, searchQuery, customFields);
       this.selectQuery = selectQuery
       this.searchQuery = searchQuery
       this.customFields = customFields
+      this.orderDTOList = orderDTOList
       await this.getList()
       this.getPatent()
       this.visible = true
@@ -219,6 +222,7 @@ export default {
         ...this.selectQuery,//选择的信息
         searchQuery: this.searchQuery,//检索的信息
         customFields: this.customFields,//自定义字段的信息
+        orderDTOList:this.orderDTOList,//排序
         esCustomFieldDTOS: this.selectValue,
       }
       this.$api.batchAddCustomField(params).then(res => {

+ 2 - 1
src/views/project/patentCollection/components/export/components/patent.vue

@@ -75,7 +75,7 @@ export default {
       this.field.map(item => item.selected = this.selected.indexOf(item.value) !== -1)
       let params = {
         projectId: this.projectId,
-        ...this.condition,//检索条件、自定义字段筛选条件、选择专利条件
+        ...this.condition,//检索条件、自定义字段筛选条件、选择专利条件、排序条件
         selected:this.field,
       }
       this.btnLoading = true
@@ -83,6 +83,7 @@ export default {
         this.btnLoading = false
         this.$message.success('导出任务请求成功')
         //调用查询任务的方法
+        this.$refs.systemTask.getList()
       }).catch(error => {
         this.btnLoading = false
       })

+ 20 - 7
src/views/project/patentCollection/components/mixins/index.js

@@ -31,7 +31,7 @@ export const projectData = {
     //选择专利
     refresh: {
       default: false
-    },  
+    },
 
     patentNoList: {
       type: Array,
@@ -39,9 +39,9 @@ export const projectData = {
         return []
       }
     },
-    outside:{
-      default:false
-    }
+    outside: {
+      default: false
+    },
   },
 
   data() {
@@ -281,9 +281,11 @@ export const handleData = {
     getObject(key, index, text, field) {
       var arr1 = ['color', 'Type', 'Id', 'column', 'index', 'text', 'remark', 'temNode', 'selectType']
       var obj = {
-        'piZhuContrastList': ['color', 'scratchType', 'id', 'scratchField', 'position', 'text', 'remark'],
+        // 'piZhuContrastList': ['color', 'scratchType', 'id', 'scratchField', 'position', 'text', 'remark'],
+        'piZhuContrastList': ['markColor', 'markType', 'id', 'scratchField', 'position', 'text', 'remark'],
         'contrastList': ['markColor', 'markType', 'id', 'fieldName', 'position', 'evidenceText'],
-        'opinionContrastList': ['color', 'scratchType', 'id', 'scratchField', 'position', 'content'],
+        // 'opinionContrastList': ['color', 'scratchType', 'id', 'scratchField', 'position', 'content'],
+        'opinionContrastList': ['markColor', 'markType', 'id', 'scratchField', 'position', 'content'],
       }
       var selectType = ['p', 'c', 'o']
       var row = this.highlight[key]
@@ -335,6 +337,17 @@ export const highlight = {
 
     }
   },
+  computed: {
+    piZhuContrastList() {
+      return this.$store.state.highlight.piZhuContrastList
+    },
+    // contrastList() {
+    //   return this.$store.state.highlight.contrastList
+    // },
+    // opinionContrastList() {
+    //   return this.$store.state.highlight.opinionContrastList
+    // },
+  },
   mounted() {
     window.mouseenter1 = this.mouseenter1
     window.mouseleave1 = this.mouseleave1
@@ -433,7 +446,7 @@ export const highlight = {
       let el = selectObject.temNode;
       // 将当前页面获取到的字符串进行处理,返回当前页面所有的标签及文本
       var splitStrings = this.SplitHtmlTag1(el);
-      let bgColor = selectObject.color;
+      let bgColor = selectObject.markColor;
       if (!bgColor) {
         selectObject.color = 'yellow'
       }

+ 13 - 4
src/views/project/patentCollection/index.vue

@@ -341,7 +341,8 @@ export default {
         {
           path: '/patentDetails/' + row.patentNo,
           query: {
-            projectId: this.projectId
+            projectId: this.projectId,
+            projectType:'1',//判断是不是从专题库进入专利详情1为专题库2为报告(报告未传2)
           }
         }
       )
@@ -518,7 +519,8 @@ export default {
           endNumber: this.endNumber,
         },
         searchQuery: this.searchStr,
-        customFields: this.customFields
+        customFields: this.customFields,
+        orderDTOList:this.sort,
       }
       this.$refs.PatentBatchIndexVue.open(obj)
     },
@@ -536,7 +538,12 @@ export default {
         startNumber: this.startNumber,
         endNumber: this.endNumber,
         searchQuery: this.searchStr,
-        customFields: this.customFields
+        customFields: this.customFields,
+        orderDTOList:this.sort,
+      }
+      if (!val) {
+        // 如果是导出全部,endNumber是当前的全部专利
+        obj.endNumber=this.total
       }
       let router = this.$router.resolve({
         path: '/exportPatent',
@@ -556,7 +563,9 @@ export default {
         isAdd: this.queryParams.isAdd,
         isDelete: this.queryParams.isDelete,
         startNumber: this.startNumber,
-        endNumber: this.endNumber,
+        // endNumber: this.endNumber,
+        endNumber: this.total,//默认是当前全部
+        orderDTOList:this.sort,
       }
       this.$api.exportPDFFirstPage(params).then(res => {
         if (res.code == 200) {

+ 54 - 14
src/views/project/patentDetails/components/patentDetails.vue

@@ -56,7 +56,8 @@
           </div>
 
           <div style="  position: relative; border-top: 1px solid #e6e6e6;text-align: center;" class="menu">
-            <el-link v-for="item in menuList" :type="activeMenu === item.value ? 'primary' : undefined" :key="item.value" v-if="!item.show" @click.native="handleSelect(item.value)">
+            <el-link v-for="item in menuList" :type="activeMenu === item.value ? 'primary' : undefined" :key="item.value"
+              v-if="!item.show" @click.native="handleSelect(item.value)">
               {{ item.label }}
               <span v-if="item.value == 'PatentImage' || item.value == 'PatentPDF'" @click.stop="ending(item.value)">
                 <el-popover placement="right" width="400" trigger="click">
@@ -66,8 +67,8 @@
                 </el-popover>
               </span>
             </el-link>
-            <el-link v-for="item in menuList2" :type="activeMenu === item.value ? 'primary' : undefined" :key="item.value" v-if="!outside"
-              @click.native="handleSelect(item.value)">{{ item.label }}</el-link>
+            <el-link v-for="item in menuList2" :type="activeMenu === item.value ? 'primary' : undefined" :key="item.value"
+              v-if="!outside" @click.native="handleSelect(item.value)">{{ item.label }}</el-link>
             <el-tooltip class="item" effect="dark" :content="(showRight ? '隐藏' : '显示') + '右侧菜单'" placement="top">
               <i :class="showRight ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
                 style="font-size: 25px;position: absolute; right: 10px; margin-top: 5px;color: #2f2f2f; cursor: pointer"
@@ -84,12 +85,13 @@
               <div slot="left">
                 <component :activeName="activeMenu" style="width:100%;padding-right: 10px;" :is="activeMenu"
                   :evidence="evidence" :signPatentNo="signPatentNo" :reportType="reportType" :project-id="projectId"
-                  :outside="outside" :patent="patent" :patentNo="[patent.patentNo]" :domId="patent.patentNo + '1'"
-                  @refresh="getPatent()"></component>
+                  :outside="outside" :projectType="projectType" :patent="patent" :patentNo="[patent.patentNo]"
+                  :domId="patent.patentNo + '1'" @refresh="getPatent()"></component>
               </div>
               <div slot="right">
-                <component :is="activeMenu2" :project-id="projectId" :outside="outside" :patent="patent"
-                  :signPatentNo="signPatentNo" :reportType="reportType" :sign="true" :evidence="evidence"></component>
+                <component :is="activeMenu2" :project-id="projectId" :outside="outside" :projectType="projectType"
+                  :patent="patent" :signPatentNo="signPatentNo" :reportType="reportType" :sign="true"
+                  :evidence="evidence"></component>
               </div>
             </my-view>
           </div>
@@ -169,11 +171,15 @@ export default {
     },
     outside: {
       default: false
-    }
+    },
+    projectType: {
+      type: String,
+      default: '2'//判断是不是从专题库进入专利详情1为专题库(专题库已传1)2为报告(报告未传2)
+    },
   },
   data() {
     return {
-      loading:false,
+      loading: false,
       radio: 1,
       positionList: [
         {
@@ -292,14 +298,47 @@ export default {
   computed: {
     condition() {
       return this.$s.getSession('import') || {}
+    },
+    // 批注相关信息
+    piZhuContrastList() {
+      return this.$store.state.highlight.piZhuContrastList
     }
   },
   created() { },
   mounted() {
 
     this.getPatent()
+    this.getPiZhuData()
   },
   methods: {
+    // 获取批注
+    getPiZhuData(val) {
+      if (val) {
+        var index = this.piZhuContrastList.findIndex(item => {
+          item.patentNo == val
+        })
+        if (index != -1) {
+          return false;
+        }
+      }
+      let params = {
+        patentNo: val ? val : this.patent.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)
+        }
+      })
+    },
     // 获取外部摘要附图的guid,获取外部的法律状态
     getData() {
       var params = {
@@ -312,10 +351,10 @@ export default {
       })
       this.$api.getLegalStatus(params).then(response => {
         if (response.code == 200) {
-          // this.$set(this.patent, 'affair', response.data.affair)
+          this.$set(this.patent, 'legalEvents', response.data.legalEvents)
         }
       })
-    },  
+    },
     //导入到专题库
     importToProject() {
       var form = {
@@ -337,7 +376,7 @@ export default {
       if (this.outside) {
         api = 'queryExternalDetail'
       }
-      this.loading=true
+      this.loading = true
       this.$api[api](params).then(response => {
         if (response.code == 200) {
           this.patent = response.data
@@ -346,7 +385,7 @@ export default {
             this.getData()
           }
         }
-      }).catch(error=>{
+      }).catch(error => {
         this.loading = false
       })
     },
@@ -400,4 +439,5 @@ export default {
   .el-link {
     margin-right: 20px;
   }
-}</style>
+}
+</style>

+ 13 - 9
src/views/project/patentDetails/components/patentMessage/PatentStatus.vue

@@ -16,12 +16,15 @@
     </div>
     <div class="block" style="width:100%">
       <el-timeline v-if="patent.legalEvents && patent.legalEvents.length > 0">
-        <el-timeline-item v-for="(item, index1) in patent.legalEvents" :key="index1"
-          :timestamp="item.eventDate" placement="top">
+        <el-timeline-item v-for="(item, index1) in patent.legalEvents" :key="index1" :timestamp="item.eventDate"
+          placement="top">
           <el-card>
-            <span>申请号:{{ item.appNo }}</span>
-            <span>公开号:{{ item.publicNo }}</span>
-            <span>授权号:{{ item.grantNo }}</span>
+            <span>申请号:{{ item.appNo || '--' }}</span>;
+            <span>公开号:{{ item.publicNo || '--' }}</span>;
+            <span>授权号:{{ item.grantNo || '--' }}</span>;
+            <span>名称:{{ item.name || '--' }}</span>;
+            <span>法律日期:{{ item.eventDate || '--' }}</span>;
+            <span>描述:{{ item.description || '--' }}</span>;
             <!-- <div v-for="(i, index) in item.inpadocData" :key="i.content" style="padding:5px 0;">
               <span v-if="index != 0 && index != 1 && i.content" v-html="getViewDom(i.content)"></span>
             </div> -->
@@ -44,13 +47,13 @@ export default {
     }
   },
   watch: {
- 
+
   },
   mounted() {
-   
+
   },
   methods: {
-    
+
   }
 }
 </script>
@@ -83,4 +86,5 @@ export default {
 // border:1px solid skyblue
 
 
-// }</style>
+// }
+</style>

+ 196 - 192
src/views/project/patentDetails/components/patentMessage/mixins/index.js

@@ -1,201 +1,205 @@
-import {projectData,handleData,highlight} from '@/views/project/patentCollection/components/mixins'
+import { projectData, handleData, highlight } from '@/views/project/patentCollection/components/mixins'
 import { mapGetters } from "vuex";
-export const patentDetails={
-    mixins:[projectData,handleData,highlight],
-    props:{
-        patent:{
-            default:()=>{
-                return {}
-            }
-        },
-        evidence:{},
-        signPatentNo:{},
-        reportType:{},
-        outside:{
-            default:false
+export const patentDetails = {
+  mixins: [projectData, handleData, highlight],
+  props: {
+    patent: {
+      default: () => {
+        return {}
+      }
+    },
+    evidence: {},
+    signPatentNo: {},
+    reportType: {},
+    outside: {
+      default: false
+    },
+    projectType: {
+      type: String,
+      default: 2//判断是不是从专题库进入专利详情1为专题库(专题库已传1)2为报告(报告未传2)
+    },
+  },
+  data() {
+    return {
+      name: '0',
+      anchorOffset: null
+    }
+  },
+  computed: {
+    ...mapGetters(["contextMenu"]),
+    textStyle() {
+      return this.$store.state.patent.style
+    },
+
+  },
+  methods: {
+    setStyle() {
+      if (!this.textStyle) {
+        return false
+      }
+      return 'font-size:' + this.textStyle.size + 'px;line-height:' + this.textStyle.lineHeight + ';padding:' + this.textStyle.padding[0] + 'px ' + this.textStyle.padding[1] + 'px ' + this.textStyle.padding[2] + 'px ' + this.textStyle.padding[3] + 'px'
+    },
+    //鼠标弹起
+    mouseup(e) {
+      let selectObj = document.getSelection();
+      this.anchorOffset = 0;
+      let temSelectObj = this.getSelectobj(selectObj);
+      var tempdt = this.getColumnName(selectObj.anchorNode);
+      var currentSelectObj = {}
+      if (tempdt != undefined && selectObj.toString() != '') {
+        currentSelectObj = temSelectObj;
+        currentSelectObj.color = this.contextMenu.mark.color;
+        currentSelectObj.Type = 0;
+        currentSelectObj.patentNo = this.patent.patentNo
+        // rangeId(专题库id/报告id)
+        currentSelectObj.projectId = this.projectId
+        // 创建来源(默认0/专题库1/报告2)
+        currentSelectObj.createFrom = this.outside ? 0 : this.projectType//来源0默认(专利)1专题库2报告
+        currentSelectObj.remark = ''
+      }
+      if (currentSelectObj.Id) {
+        var a = {}
+        a.Id = currentSelectObj.Id//划词生成的ID
+        a.patentNo = currentSelectObj.patentNo//专利号
+        a.signPatentNo = this.signPatentNo//标的专利号
+        a.text = currentSelectObj.text//选中的文本
+        a.projectId = currentSelectObj.projectId//项目Id
+        a.column = currentSelectObj.column//选中文本所在栏位
+        a.position = currentSelectObj.index//选中文本开始位置
+        a.id = null//对比记录Id
+        a.remark = null//备注
+        a.markType = 2//高亮类型
+        a.markColor = '#ff0000'//高亮颜色
+        a.permissionType = 1//高亮权限
+        // a.color = this.currentSelectObj.color
+        a.createFrom = this.outside ? 0 : this.projectType//来源0默认(专利)1专题库2报告
+        a.literatureId = this.evidence ? this.evidence.id : null
+        this.showMenu(e)
+
+        this.$store.commit("SET_PATENT_INDEX", a)
+      }
+    },
+    //打开弹窗
+    showMenu(e) {
+      var menuContent = []
+      if (this.reportType == 1 || this.reportType == 2) {
+        menuContent = [
+          {
+            name: "对比",
+            method: "contrast",
+          }
+        ]
+      }
+      this.$store.commit("SET_CONTEXT_MENU", {
+        clientX: e.pageX,
+        clientY: e.pageY,
+        displayContextMenu: true,
+        menuContent: menuContent
+      })
+    },
+    //获取选中的文本信息
+    getSelectobj(selectObj) {
+      var temNode = selectObj.anchorNode;
+      var a = temNode.parentElement
+      NotIncludeDataType(a)
+      function NotIncludeDataType(node) {
+        if (!node) {
+          return false
         }
+        if (node.getAttribute("data-type") != null) {
+          temNode = node
+        } else {
+          NotIncludeDataType(node.parentElement);
+        }
+      }
+      this.getColumn(temNode, selectObj);
+      if (temNode.nodeType == 3) {
+        return false
+      }
+      this.isFirst = true
+      return { "Id": this.uuid(), "column": temNode.getAttribute("data-type"), "index": this.anchorOffset, "text": selectObj.toString(), 'temNode': temNode.innerHTML };
+    },
+    //获取ID
+    uuid() {
+      var s = [];
+      var hexDigits = "0123456789abcdef";
+      for (var i = 0; i < 36; i++) {
+        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
+      }
+      s[14] = "4";  // bits 12-15 of the time_hi_and_version field to 0010
+      s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);  // bits 6-7 of the clock_seq_hi_and_reserved to 01
+      s[8] = s[13] = s[18] = s[23] = "-";
+      var uuid = s.join("");
+      return uuid;
+    },
+    //获取开始位置
+    getColumn(node, selectObj) {
+      var baseNode = this.getColumnNode(node);
+      var anchorNodePosition = this.getPosition(baseNode, selectObj.anchorNode, selectObj.anchorOffset);
+      var focusNodePosition = this.getPosition(baseNode, selectObj.focusNode, selectObj.focusOffset);
+      var num = Math.min(anchorNodePosition, focusNodePosition)
+      this.anchorOffset = num
+      return true;
     },
-    data() {
-        return {
-            name:'0',
-            anchorOffset:null
+    //获取节点所在的栏位节点
+    getColumnNode(node) {
+      if (node != null) {
+        if (node.nodeType == 9) {
+          return false
+        }
+        if (node.nodeType != 3 && node.getAttribute("data-type") != null) {
+          return node;
+        } else {
+          if (node == document.root) {
+            return node;
+          } else {
+            return this.getColumnNode(node.parentNode);
+          }
         }
+      }
     },
-    computed:{
-        ...mapGetters(["contextMenu"]),
-        textStyle(){
-          return this.$store.state.patent.style
-        },
-
-      },
-    methods: {
-        setStyle(){
-            if(!this.textStyle){
-              return false
-            }
-            return 'font-size:'+this.textStyle.size+'px;line-height:'+this.textStyle.lineHeight+';padding:'+this.textStyle.padding[0]+'px '+this.textStyle.padding[1]+'px '+this.textStyle.padding[2]+'px '+this.textStyle.padding[3]+'px'
-        },
-        //鼠标弹起
-      mouseup(e) {
-          let selectObj = document.getSelection();
-          this.anchorOffset = 0;
-          let temSelectObj = this.getSelectobj(selectObj);
-          var tempdt = this.getColumnName(selectObj.anchorNode);
-          var currentSelectObj = {}
-          if (tempdt != undefined && selectObj.toString() != '') {
-            currentSelectObj = temSelectObj;
-            currentSelectObj.color = this.contextMenu.mark.color;
-            currentSelectObj.Type = 0;
-            currentSelectObj.patentNo = this.patent.patentNo
-            // rangeId(专题库id/报告id)
-            currentSelectObj.projectId = this.projectId
-            // 创建来源(默认0/专题库1/报告2)
-            currentSelectObj.createFrom = 1
-            currentSelectObj.remark = ''
+    //根据节点获取给定node中offset位置在栏位中的实际位置
+    getPosition(baseNode, node, offset) {
+      let path = [];
+      this.getNodes(baseNode, path);
+      let retIdx = 0;
+      for (let i = 0; i < path.length; i++) {
+        if (path[i] == node) {
+          retIdx += offset;
+          return retIdx;
+        } else {
+          if (path[i].nodeType == 3) {
+            retIdx += path[i].nodeValue.length;
           }
-          if (currentSelectObj.Id) {
-            var a = {}
-            a.Id = currentSelectObj.Id//划词生成的ID
-            a.patentNo = currentSelectObj.patentNo//专利号
-            a.signPatentNo = this.signPatentNo//标的专利号
-            a.text = currentSelectObj.text//选中的文本
-            a.projectId = currentSelectObj.projectId//项目Id
-            a.column = currentSelectObj.column//选中文本所在栏位
-            a.position = currentSelectObj.index//选中文本开始位置
-            a.id = null//对比记录Id
-            a.remark=null//备注
-            a.markType = 2//高亮类型
-            a.markColor = '#ff0000'//高亮颜色
-            a.permissionType = 1//高亮权限
-            // a.color = this.currentSelectObj.color
-            a.createFrom =this.projectId? 1:0//来源0默认(专利)1专题库2报告
-            a.literatureId = this.evidence?this.evidence.id:null
-            this.showMenu(e)
-            
-            this.$store.commit("SET_PATENT_INDEX", a)
+        }
+      }
+    },
+    // 拿到所有类型的节点
+    getNodes(baseNode, path) {
+      var temPath = path;
+      if (baseNode != null) {
+        temPath.push(baseNode);
+        if (baseNode.childNodes && baseNode.childNodes.length > 0) {
+          for (let i = 0; i < baseNode.childNodes.length; i++) {
+            this.getNodes(baseNode.childNodes[i], temPath);
           }
-        },
-        //打开弹窗
-        showMenu(e){
-            var menuContent = []
-            if(this.reportType == 1 || this.reportType == 2){
-                menuContent=[
-                    {
-                        name: "对比",
-                        method: "contrast",
-                    }
-                ]
-            }
-            this.$store.commit("SET_CONTEXT_MENU", {
-                clientX:e.pageX,
-                clientY:e.pageY,
-                displayContextMenu:true,
-                menuContent:menuContent
-            })
-        },
-        //获取选中的文本信息
-        getSelectobj(selectObj) {
-            var temNode = selectObj.anchorNode;
-            var a = temNode.parentElement
-            NotIncludeDataType(a)
-            function NotIncludeDataType(node) {
-              if(!node){
-                return false
-              }
-              if (node.getAttribute("data-type") != null) {
-                temNode = node
-              } else {
-                NotIncludeDataType(node.parentElement);
-              }
-            }
-            this.getColumn(temNode, selectObj);
-            if(temNode.nodeType == 3){
-              return false
-            }
-            this.isFirst = true
-            return { "Id": this.uuid(), "column": temNode.getAttribute("data-type"), "index": this.anchorOffset, "text": selectObj.toString(), 'temNode': temNode.innerHTML };
-        },
-        //获取ID
-        uuid() {
-            var s = [];
-            var hexDigits = "0123456789abcdef";
-            for (var i = 0; i < 36; i++) {
-              s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
-            }
-            s[14] = "4";  // bits 12-15 of the time_hi_and_version field to 0010
-            s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);  // bits 6-7 of the clock_seq_hi_and_reserved to 01
-            s[8] = s[13] = s[18] = s[23] = "-";
-            var uuid = s.join("");
-            return uuid;
-        },
-        //获取开始位置
-        getColumn(node, selectObj) {
-            var baseNode = this.getColumnNode(node);
-            var anchorNodePosition = this.getPosition(baseNode, selectObj.anchorNode, selectObj.anchorOffset);
-            var focusNodePosition = this.getPosition(baseNode, selectObj.focusNode, selectObj.focusOffset);
-            var num = Math.min(anchorNodePosition, focusNodePosition)
-            this.anchorOffset = num
-            return true;
-          },
-          //获取节点所在的栏位节点
-          getColumnNode(node) { 
-            if (node != null) {
-              if(node.nodeType == 9){
-                return false
-              }
-              if (node.nodeType != 3 && node.getAttribute("data-type") != null) {
-                return node;
-              }else {
-                if (node == document.root) {
-                  return node;
-                } else {
-                  return this.getColumnNode(node.parentNode);
-                }
-              }
-            }
-          },
-          //根据节点获取给定node中offset位置在栏位中的实际位置
-          getPosition(baseNode, node, offset) {
-            let path = [];
-            this.getNodes(baseNode, path);
-            let retIdx = 0;
-            for (let i = 0; i < path.length; i++){
-              if (path[i] == node) {
-                retIdx += offset;
-                return retIdx;
-              } else {
-                if (path[i].nodeType == 3) {
-                  retIdx += path[i].nodeValue.length;
-                }
-              }
-            }
-          },
-          // 拿到所有类型的节点
-          getNodes(baseNode, path) {
-            var temPath = path;
-            if(baseNode != null){
-              temPath.push(baseNode);
-              if(baseNode.childNodes && baseNode.childNodes.length >0){
-                for(let i=0;i<baseNode.childNodes.length;i++){
-                  this.getNodes(baseNode.childNodes[i],temPath);
-                }
-              }
-            }
-          },
-        //获取所选文本所在节点
-        getColumnName(el) {
-            let root = el;
-            if (el == undefined) {
-              return undefined;
-            }
-            if (!(el instanceof HTMLElement)) {
-              root = el.parentElement;
-            }
-            let dt = root.getAttribute("data-Type");
-            if (dt != undefined) {
-              return root;
-            }
-            return dt = this.getColumnName(root.parentElement);
-          },
+        }
+      }
+    },
+    //获取所选文本所在节点
+    getColumnName(el) {
+      let root = el;
+      if (el == undefined) {
+        return undefined;
+      }
+      if (!(el instanceof HTMLElement)) {
+        root = el.parentElement;
+      }
+      let dt = root.getAttribute("data-Type");
+      if (dt != undefined) {
+        return root;
+      }
+      return dt = this.getColumnName(root.parentElement);
     },
+  },
 }

+ 6 - 3
src/views/project/patentDetails/index.vue

@@ -8,12 +8,12 @@
         <div slot="left" style="width:100%">
           <notPatentDetails v-if="evidenceType == 1" :projectId="projectId" :signPatentNo="signPatentNo" :reportType="reportType" :evidence="evidenceData"></notPatentDetails>
           <!-- <Patent-Details :patentNo="patentNo" :projectId="projectId" :taskId="taskId"></Patent-Details> -->
-          <component v-else :is='components' :patentNo="patentNo" :evidence="evidenceData" :outside="outside" :signPatentNo="signPatentNo"  :projectId="projectId" :taskId="taskId"
+          <component v-else :is='components' :patentNo="patentNo" :evidence="evidenceData" :outside="outside" :projectType="projectType" :signPatentNo="signPatentNo"  :projectId="projectId" :taskId="taskId"
             :reportType="reportType" :isResult="isResult"></component>
         </div>
         <div slot="right" style="width:100%">
           <notPatentDetails v-if="evidenceType == 1" :projectId="projectId" :signPatentNo="signPatentNo" :reportType="reportType" :evidence="evidenceData"></notPatentDetails>
-          <Patent-Details v-else :patentNo="patentNo" :outside="outside" :evidence="evidenceData" :signPatentNo="signPatentNo" :reportType="reportType" :projectId="projectId" :taskId="taskId"></Patent-Details>
+          <Patent-Details v-else :patentNo="patentNo" :outside="outside" :projectType="projectType" :evidence="evidenceData" :signPatentNo="signPatentNo" :reportType="reportType" :projectId="projectId" :taskId="taskId"></Patent-Details>
         </div>
       </my-View>
     </div>
@@ -82,7 +82,10 @@ export default {
     },
     outside() {
       return this.$route.query.outside
-    }
+    },
+    projectType() {
+      return this.$route.query.projectType//判断是不是从专题库进入专利详情1为专题库2为报告(报告未传2)
+    },
   },
   created() { },
   mounted() {