浏览代码

上一篇下一篇

zhuliu 1 年之前
父节点
当前提交
3acfe5693c

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

@@ -7,4 +7,20 @@ export default {
      selectPatentDetail(data) {
         return axios.post("/xiaoshi/patent/selectPatentDetail", data);
     },
+    /**
+     * 专利数据库查询专利清单(分页)
+     * @param {*} data 
+     * @returns 
+     */
+    QueryPatent(data) {
+        return axios.post("/xiaoshi/patent/queryPatent", data);
+    },
+    /**
+     * 专利数据库查询专利清单(从第几条查多少条)
+     * @param {*} data 
+     * @returns 
+     */
+    getPatentPageMessage(data) {
+        return axios.post("/xiaoshi/patent/getPatentPageMessage", data);
+    },
 }

+ 1 - 8
src/api/newApi/project.js

@@ -41,12 +41,5 @@ export default {
     groupPatentProject(data) {
         return axios.post("/xiaoshi/patentProject/groupPatentProject", data);
     },
-    /**
-     * 专利数据库查询专利清单
-     * @param {*} data 
-     * @returns 
-     */
-    QueryPatent(data) {
-        return axios.post("/xiaoshi/patent/queryPatent", data);
-    },
+    
 };

+ 3 - 2
src/views/project/patentCollection/components/mixins/index.js

@@ -51,8 +51,9 @@ export const projectData = {
   },
   methods: {
     // 点击专利号
-    handleClick(row, key) {
-      this.$emit('clickPatentNo',row)
+    handleClick(row, index) {
+      var location = (index + 1) + ((this.queryParams.current - 1) * this.queryParams.size)
+      this.$emit('clickPatentNo',row,location)
     },
     changeSelect(patent){
       const index1 = this.patentNoList.indexOf(patent.patentNo)

+ 1 - 1
src/views/project/patentCollection/components/views/Abstract.vue

@@ -49,7 +49,7 @@
                 <div class="patent-abstract-title">
                   <el-link :disabled="!$permission('/workspace/details')"
                     :class="$permission('/workspace/details') ? '' : 'jinzhi'" type="success"
-                    @click.native="handleLink(patent)">
+                    @click.native="handleLink(patent,index)">
                     <span v-html="getView(patent, 'patentNo')"></span>
                   </el-link>
                   <el-tag class="margin-left_10" type="primary" effect="dark" size="small" v-if="patent.simpleStatus">{{

+ 1 - 1
src/views/project/patentCollection/components/views/Picture.vue

@@ -12,7 +12,7 @@
 
               <el-link :disabled="!$permission('/workspace/details')"
                 :class="$permission('/workspace/details') ? '' : 'jinzhi'" :type="item.read === 1 ? 'success' : 'danger'"
-                @click.native.prevent="handleLink(item)">
+                @click.native.prevent="handleLink(item,index)">
                 <span v-html="getView(item,'patentNo')"></span>
               </el-link>
 

+ 1 - 1
src/views/project/patentCollection/components/views/Table.vue

@@ -39,7 +39,7 @@
                 </td>
               </tr>
             </table>
-            <el-link slot="reference"  type="primary" @click="handleClick(scope.row, item.value)">
+            <el-link slot="reference"  type="primary" @click="handleClick(scope.row, scope.$index)">
               <span v-html="getView(scope.row, item.value,item.type)"></span>
             </el-link>
           </el-popover>

+ 6 - 1
src/views/project/patentCollection/index.vue

@@ -265,7 +265,12 @@ export default {
     this.getList()
   },
   methods: {
-    handleClick(row) {
+    handleClick(row,location) {
+      var search = {
+        searchOption:this.searchOption,
+        location:location
+      }
+      this.$s.setSession('search',search)
       this.$router.push(
         {
           path: '/patentDetails/' + row.patentNo,

+ 6 - 7
src/views/project/patentDetails/components/PatentLeft.vue

@@ -5,16 +5,12 @@
       style="display: flex;justify-content: space-evenly;height: 50px;line-height: 50px;border-bottom: 1px solid #ccc;">
       <div>总专利数量:{{ total }}</div>
     </div>
-    <div class="left-patentNo" v-for="item in patentList" :key="item.patentNo" @click="$emit('getPatentLeft',item.patentNo)">
+    <div class="left-patentNo"  v-for="(item,index) in patentList" :key="item.patentNo" :style="{background:(item.patentNo == patentNo)? '#cdd7eb':''}" @click="$emit('getPatentLeft',item.patentNo,index)">
       <div>{{ item.patentNo }}</div>
-      <el-tooltip :content="item.title.content" placement="bottom-start">
+      <my-tooltip :content="item.title.content" placement="bottom-start">
         <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ item.title.content }}</div>
-      </el-tooltip>
+      </my-tooltip>
     </div>
-    <!-- <div class="left-patentNo">
-      <div>CN202210250234.6</div>
-      <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">一种雨伞管加工设备</div>
-    </div> -->
 
   </div>
 </template>
@@ -31,6 +27,9 @@ export default {
     total: {
       type: Number,
       default: 0
+    },
+    patentNo:{
+      default:''
     }
   },
   data() {

+ 79 - 14
src/views/project/patentDetails/components/menu.vue

@@ -31,7 +31,7 @@
             </el-tooltip>
           </el-header>
           <el-main style="background: #FFFFFF;">
-            <PatentLeft :patentList="patentList" :total="total" v-on="$listeners"></PatentLeft>
+            <PatentLeft :patentList="patentList" :patentNo="patentNo" :total="total" @getPatentLeft="getPatentLeft" v-on="$listeners"></PatentLeft>
           </el-main>
           <el-footer style="text-align: center;">
             <el-pagination background layout=" prev, pager, next" :current-page.sync="queryParams.current"
@@ -74,21 +74,21 @@
         <el-tooltip placement="right-end">
           <template slot="content">
             <div>点击查看上一篇专利</div>
-            <div>专利:CN202210250237</div>
-            <div>数量:1</div>
+            <div>专利:{{currentLocation - 1!=0? patentList[index-1].patentNo:''}}</div>
+            <div>数量:{{currentLocation - 1}}</div>
           </template>
-          <div class="articles-Loop">
-            <i class="el-icon-arrow-up"></i>
+          <div class="articles-Loop" @click="prev">
+            <i class="el-icon-arrow-up" v-disabled="currentLocation - 1 == 0 || loading"></i>
           </div>
         </el-tooltip>
         <el-tooltip placement="right-end">
           <template slot="content">
             <div>点击查看下一篇专利</div>
-            <div>专利:CN202210250237</div>
-            <div>数量:1</div>
+            <div>专利:{{total - currentLocation!=0? patentList[index+1].patentNo:''}}</div>
+            <div>数量:{{total - currentLocation}}</div>
           </template>
-          <div class="articles-Loop" style="">
-            <i class="el-icon-arrow-down"></i>
+          <div class="articles-Loop" @click="next">
+            <i class="el-icon-arrow-down" v-disabled="total - currentLocation == 0 || loading"></i>
           </div>
         </el-tooltip>
       </div>
@@ -104,43 +104,89 @@ export default {
   props: {
     projectId:{
       default:0
+    },
+    searchOption:{
+      default:()=>{
+        return {}
+      }
+    },
+    location:{
+      default:0
+    },
+    patentNo:{
+      default:''
     }
   },
   data() {
     return {
         value:false,//对比
         isRight:false,//是否在右侧
-        isContract:false,//是否收缩
+        isContract:true,//是否收缩
         queryParams:{
             current:1,
             size:10,
         },
         total:0,
-        patentList:[]
+        loading:false,
+        patentList:[],
+        currentLocation:this.location,
+        index:0,
+        total:0
     };
   },
-  watch: {},
+  watch: {
+    isContract(){
+      this.getPatentList()
+    }
+  },
   computed: {},
   created() {},
   mounted() {
     this.getPatentList()
   },
   methods: {
+    getPatentLeft(patentNo,index){
+      this.currentLocation = (index + 1) + ((this.queryParams.current - 1) * this.queryParams.size)
+      this.updatePatentNo(patentNo)
+    },
+    updatePatentNo(patentNo){
+      var search = {
+        searchOption:this.searchOption,
+        location:this.currentLocation
+      }
+      this.$s.setSession('search',search)
+      this.$emit('getPatentLeft',patentNo)
+    },
     getPatentList(){
+
+      var api = ''
+      var current = 5
+      if(this.isContract){
+        this.queryParams.current = ((this.currentLocation-1) < current)? 0 : ((this.currentLocation-1) - current)
+        
+        api = 'getPatentPageMessage'
+      }else{
+        this.queryParams.current = parseInt((this.currentLocation-1) / this.queryParams.size) + 1
+        api = 'QueryPatent'
+      }
       let params = {
         ...this.queryParams,//分页信息
         projectId: this.projectId,
-        // searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
+        searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
         // orderDTOList: this.sort,//排序信息
       }
-      this.$api.QueryPatent(params).then(res => {
+      this.loading = true
+      this.$api[api](params).then(res => {
         if (res.code == 200) {
           this.patentList = res.data.data
           this.total = res.data.total
+          this.index = current - 1
+          this.loading = false
         }
       }).catch(error => {
         this.patentList = []
         this.total = 0
+        this.loading = false
       })
     },
     //分页
@@ -154,6 +200,25 @@ export default {
     contrast(){
       this.value = !this.value
       this.$emit('contrast',this.value)
+    },
+    //上一篇
+    prev(){
+      this.index -=1
+      this.currentLocation -=1
+      this.updatePatentNo(this.patentList[this.index].patentNo)
+      if(this.index <= 2 && this.currentLocation>2){
+        this.getPatentList()
+      }
+      
+    },
+    //下一篇
+    next(){
+      this.index +=1
+      this.currentLocation +=1
+      this.updatePatentNo(this.patentList[this.index].patentNo)
+      if(this.index >= 7  &&  this.currentLocation<this.total-2){
+        this.getPatentList()
+      }
     }
   },
 };

+ 13 - 1
src/views/project/patentDetails/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="height_100 article">
-    <articleMenu @contrast="contrast" :projectId="projectId"  @getPatentLeft="getPatentLeft"></articleMenu>
+    <articleMenu @contrast="contrast" :projectId="projectId" :searchOption="search.searchOption" :patentNo="patentNo" :location="search.location" @getPatentLeft="getPatentLeft" ></articleMenu>
     <div class="height_100 content">
         <my-View :showView="showView">
             <div slot="left" style="width:100%">
@@ -38,6 +38,10 @@ export default {
     taskId(){
       return this.$route.query.taskId
     },
+    search(){
+      return this.$s.getSession('search')
+    }
+    
   },
   created() {},
   mounted() {},
@@ -47,6 +51,14 @@ export default {
     },
     getPatentLeft(val) {
       this.patentNo=val
+      this.$router.push(
+        {
+          path: '/patentDetails/' + val,
+          query: {
+            projectId: this.projectId
+          }
+        }
+      )
     },
   },
 };

+ 2 - 2
src/views/report/components/dialog/addAndEditReport.vue

@@ -194,8 +194,8 @@
       </el-form>
       <div slot="footer" v-if="$reportPermission(form.id, [0, 1])">
         <el-button @click="handleClose(false)">取 消</el-button>
-        <el-button type="primary" @click="ifNext" v-if="form.reportType == 7 && !form.id">下一步</el-button>
-        <el-button type="primary" @click="submit" v-else>确 定</el-button>
+        <!-- <el-button type="primary" @click="ifNext" v-if="form.reportType == 7 && !form.id">下一步</el-button> -->
+        <el-button type="primary" @click="submit">确 定</el-button>
       </div>
     </el-dialog>