zhuliu 9 ay önce
ebeveyn
işleme
207010bade

+ 10 - 1
src/api/newApi/importAndExport.js

@@ -31,7 +31,16 @@ export default {
     * 检索专利
     */
     patentSelect(data) {
-        return axios.post('/xiaoshi/patentStar/select', data)
+        // return axios.post('/xiaoshi/patentStar/select', data)
+        return axios(
+            {
+              url: '/xiaoshi/patentStar/select',
+              method: 'post',
+              data: data,
+              retry:true,
+              
+            }
+          )
     },
 
     /**

+ 73 - 10
src/api/newApi/patent.js

@@ -148,7 +148,14 @@ export default {
    * @returns 
    */
   queryExternalFamily(data) {
-    return axios.post("/xiaoshi/patentStar/queryExternalFamily", data);
+    // return axios.post("/xiaoshi/patentStar/queryExternalFamily", data);
+    return axios(
+      {
+        url: '/xiaoshi/patentStar/queryExternalFamily',
+        method: 'post',
+        data: data,
+      }
+    )
   },
   /**
    * 专利详情内部查询权利要求
@@ -164,15 +171,30 @@ export default {
    * @returns 
    */
   queryExternalClaim(params) {
-    return axios.get("/xiaoshi/patentStar/queryExternalClaim", {params});
+    // return axios.get("/xiaoshi/patentStar/queryExternalClaim", {params});
+    return axios(
+      {
+        url: '/xiaoshi/patentStar/queryExternalClaim',
+        method: 'get',
+        params: params,
+      }
+    )
   },
   /**
-   * 专利详情外部(检索)查询权利要求
+   * 专利详情外部(检索)著录信息
    * @param {*} data 
    * @returns 
    */
   queryExternalDetail(data) {
-    return axios.post("/xiaoshi/patentStar/queryExternalDetail", data);
+    // return axios.post("/xiaoshi/patentStar/queryExternalDetail", data);
+    return axios(
+      {
+        url: '/xiaoshi/patentStar/queryExternalDetail',
+        method: 'post',
+        data: data,
+        retry:true
+      }
+    )
   },
   /**
    * 专利详情外部(检索)获得中国专利pdf
@@ -180,7 +202,14 @@ export default {
    * @returns 
    */
   getCnPdf(params) {
-    return axios.get("/xiaoshi/patentStar/getExternalTextPdf", {params});
+    // return axios.get("/xiaoshi/patentStar/getExternalTextPdf", {params});
+    return axios(
+      {
+        url: '/xiaoshi/patentStar/getExternalTextPdf',
+        method: 'get',
+        params: params,
+      }
+    )
   },
   /**
    * 专利详情外部(检索)获得中国专利pdf全文文本
@@ -188,7 +217,14 @@ export default {
    * @returns 
    */
   getCnFullText(params) {
-    return axios.get("/xiaoshi/patentStar/getCnFullText", {params});
+    // return axios.get("/xiaoshi/patentStar/getCnFullText", {params});
+    return axios(
+      {
+        url: '/xiaoshi/patentStar/getCnFullText',
+        method: 'get',
+        params: params,
+      }
+    )
   },
   /**
    * 专利详情内部获得中国专利pdf
@@ -204,7 +240,14 @@ export default {
    * @returns 
    */
   getExternalFigure(params) {
-    return axios.get("/xiaoshi/patentStar/getExternalFigure", {params});
+    // return axios.get("/xiaoshi/patentStar/getExternalFigure", {params});
+    return axios(
+      {
+        url: '/xiaoshi/patentStar/getExternalFigure',
+        method: 'get',
+        params: params,
+      }
+    )
   },
   /**
    * 专利详情内部获得专利附图
@@ -220,7 +263,14 @@ export default {
    * @returns 
    */
   getLegalStatus(params) {
-    return axios.get("/xiaoshi/patentStar/getLegalStatus", {params});
+    // return axios.get("/xiaoshi/patentStar/getLegalStatus", {params});
+    return axios(
+      {
+        url: '/xiaoshi/patentStar/getLegalStatus',
+        method: 'get',
+        params: params,
+      }
+    )
   },
   /**
    * 专利详情外部获得摘要附图
@@ -228,7 +278,14 @@ export default {
    * @returns 
    */
   getPictureGuid(params) {
-    return axios.get("/xiaoshi/patentStar/getPictureGuid", {params});
+    // return axios.get("/xiaoshi/patentStar/getPictureGuid", {params});
+    return axios(
+      {
+        url: '/xiaoshi/patentStar/getPictureGuid',
+        method: 'get',
+        params: params,
+      }
+    )
   },
   /**
    * 专利列表导出PDF首页
@@ -367,6 +424,12 @@ export default {
    * @returns 
    */
   getPatentSimilarMess(data) {
-    return axios.post("/xiaoshi/patentStar/getPatentSimilarMess", data);
+    return axios(
+      {
+        url: '/xiaoshi/patentStar/getPatentSimilarMess',
+        method: 'post',
+        data: data,
+      }
+    )
   },
 }

BIN
src/assets/img/404.jpg


+ 120 - 61
src/router/index.js

@@ -663,10 +663,22 @@ const routes = [
             meta: {
               title: '无权限',
               sign: '403',
-              belong: 'errorPage'
+              belong: 'errorPage',
+              notReturn:true
             },
             component: () => import('@/views/components/errorPage/403.vue'),
           },
+          {
+            path: '/404',
+            name:'/404',
+            meta: {
+              title: '页面不存在',
+              sign: '404',
+              belong: 'errorPage',
+              notReturn:true
+            },
+            component: () => import('@/views/components/errorPage/404.vue'),
+          },
         ],
       },
 
@@ -714,75 +726,122 @@ export function getLastRoute(){
 }
 
 
-router.beforeEach((to, from, next) => {
+router.beforeEach(async (to, from, next) => {
   setLastRoute(to,from)
   savePreviousRoute(to)
-  if(to.path == '/login'){
-    Cookies.remove("token")
-    localStorage.removeItem('vuex')
-  }
-  if(from.path.indexOf('/patentDetails/')!=-1 && to.path.indexOf('/patentDetails/')==-1){
-    sessionStorage.setItem('search', JSON.stringify({}))
+  // if(to.path == '/login'){
+  //   Cookies.remove("token")
+  //   localStorage.removeItem('vuex')
+  // }
+  // if(from.path.indexOf('/patentDetails/')!=-1 && to.path.indexOf('/patentDetails/')==-1){
+  //   sessionStorage.setItem('search', JSON.stringify({}))
+  // }
+  const tokenStr = Cookies.get('token')
+  if (to.meta.title) {
+    document.title = to.meta.title;
   }
-  if (to.path === '/login' || to.path === '/' || to.path == '/agreeConceal') {
-    if (to.meta.title) {
-      document.title = to.meta.title;
+  if(to.path === '/login' || to.path === '/' || to.path == '/agreeConceal' || to.meta.allowPath){
+    if(to.path === '/login'){
+      if(to.query.url){
+        if(tokenStr){
+          var url = to.query.url
+            if(url){
+              next({
+                path: url
+              })
+              return
+            }
+        }
+      }else{
+        Cookies.remove("token")
+        localStorage.removeItem('vuex')
+      }
     }
     next()
-  }
-  else if(to.meta.permission && !Permission.FunPermissions(to.meta.permission)){
-    next({ path: '/403' })
-  }
-  else if (to.meta.allowPath) {
-    if (to.meta.title) {
-      document.title = to.meta.title;
+  }else{
+    if(tokenStr === undefined){
+      if (to.meta.title) {
+        document.title = to.meta.title;
+      }
+      next({ name: 'Login' })
+      return
+    }
+    if(to.meta.permission && !Permission.FunPermissions(to.meta.permission)){
+      next({ path: '/403' })
+      return
     }
-    next()
-  }
-  else {
-    const tokenStr = Cookies.get('token')
 
-    switch (tokenStr) {
-      case undefined:
-        if (to.meta.title) {
-          document.title = to.meta.title;
-        }
-        // if(to.matched && to.matched.length>0){
-        //   var path = to.path
-          // var redirectUrl = null
-          // for(var i = to.matched.length-1;i>=0;i--){
-          //   var item = to.matched[i]
-          //   if(item.meta.notReturn){
-          //     continue
-          //   }
-          //   redirectUrl = {
-          //     userName:localStorage.getItem('username'),
-          //     path:to.path,
-          //     query:to.query,
-          //     params:to.params
-          //   }
-          //   break;
-          // }
-          // if(to.matched.findIndex(item=>{ return item.path == path}) !=-1){
-          //   var redirectUrl = {
-          //     userName:localStorage.getItem('username'),
-          //     path:to.path,
-          //     query:to.query,
-          //     params:to.params
-          //   }
-          //   localStorage.setItem('redirectUrl',JSON.stringify(redirectUrl))
-          // }
-        // }
-        next({ name: 'Login' })
-        break
-      default:
-        if (to.meta.title) {
-          document.title = to.meta.title;
-        }
-        next()
-        break;
+    if((to.path=='/403' || to.path=='/404') && from.path=='/login'){
+      next({ path:'/home'})
+      return
     }
+
+    //单个页面设置权限
+    if(to.path=='/project/patentCollection'){
+      var projectId = to.query.id
+      if(!projectId){
+        next({ path: '/404' })
+        return
+      }
+      var sign = await Permission.projectPermission(projectId)
+      if(sign === 0){
+        next({ path: '/403' })
+        return
+      }
+      next()
+      return
+    }
+    next()
   }
+
+
+  // if (to.path === '/login' || to.path === '/' || to.path == '/agreeConceal') {
+  //   if(to.path === '/login'){
+  //     if(to.query.url){
+  //       if(tokenStr){
+  //         var url = to.query.url
+  //           if(url){
+  //             next({
+  //               path: url
+  //             })
+  //             return
+  //           }
+  //       }
+  //     }else{
+  //       Cookies.remove("token")
+  //       localStorage.removeItem('vuex')
+  //     }
+  //   }
+  //   if (to.meta.title) {
+  //     document.title = to.meta.title;
+  //   }
+  //   next()
+  // }
+  // else if(to.meta.permission && !Permission.FunPermissions(to.meta.permission)){
+  //   next({ path: '/403' })
+  // }
+  // else if (to.meta.allowPath) {
+  //   if (to.meta.title) {
+  //     document.title = to.meta.title;
+  //   }
+  //   next()
+  // }
+  // else {
+  //   switch (tokenStr) {
+  //     case undefined:
+  //       if (to.meta.title) {
+  //         document.title = to.meta.title;
+  //       }
+  //       next({ name: 'Login' })
+  //       break
+  //     default:
+  //       if (to.meta.title) {
+  //         document.title = to.meta.title;
+  //       }
+  //       next()
+  //       break;
+  //   }
+  // }
 })
 
 router.afterEach((to, from) => {

+ 31 - 26
src/utils/axios.js

@@ -21,26 +21,14 @@ let isRefreshing = false
 let retryRequests = []
 let loadingInstance = {}
 let config = {
-  baseURL: Config.baseURL
+  baseURL: Config.baseURL,
   // timeout: 60 * 1000, // Timeout
   // withCredentials: true, // Check cross-site Access-Control
+  retries:3
 };
 
 const _axios = axios.create(config);
 
-async function getLocalIPAddress() {
-  try {
-    var data = storage.getCookie('X-Forwarded-For')
-    if(data){
-      return data
-    }
-    const response = await axios.get('https://api.ipify.org');
-    storage.setCookie('X-Forwarded-For',response.data)
-    return response.data; // 提取并返回 IP 地址
-  } catch (error) {
-    return null; // 如果获取失败,返回null或其他错误处理
-  }
-}
 
 _axios.interceptors.request.use(
   async function (config) {
@@ -50,11 +38,14 @@ _axios.interceptors.request.use(
       // config.headers[constants.tokenHeader] = token
     }
     config.headers['x-project-id'] = Store.getters.projectId || ''
-    // config.headers['X-Forwarded-For'] = await getLocalIPAddress()
     if (config.loading) {
       loadingInstance = Loading.service({})
     }
-    // console.log(config)
+
+    //重试
+    if(config.retry){
+      config.timeout = 5000
+    }
     return config;
   },
   function (error) {
@@ -76,16 +67,6 @@ _axios.interceptors.response.use(
       return response.data
     }
     if (code === 401) {
-      // var redirectUrl = Router.app._route
-      // if(redirectUrl.path!='/login'){
-      //   var route1 = {
-      //     userName:localStorage.getItem('username'),
-      //     path:redirectUrl.path,
-      //     query:redirectUrl.query,
-      //     params:redirectUrl.params
-      //   }
-      //   storage.setObj('redirectUrl',route1)
-      // }
       Router.push({
         path: `/login`
       }).then(r => {})
@@ -126,6 +107,30 @@ _axios.interceptors.response.use(
     // return response;
   },
   function (error) {
+    const obj = error.config
+    if(error.code =='ECONNABORTED' && obj.retry){
+      obj.__retryCount = obj.__retryCount || 0
+       // 检查是否达到最大重试次数
+      if (obj.__retryCount >= config.retries) {
+        return Promise.reject(error)
+      }
+      obj.isPagination = false
+      // 增加重试计数器
+      obj.__retryCount += 1
+       // 创建一个新的Promise来处理每次重试之前等待一段时间
+      const backoff = new Promise((resolve) => {
+        setTimeout(() => {
+          resolve('重新请求:' + obj.__retryCount)
+        }, obj.timeout || 3000)
+      })
+  
+      // 返回Promise,以便Axios知道我们已经处理了错误
+      return backoff.then((txt) => {
+        console.log(txt)
+        obj.url = obj.url.replace('/api','')
+        return _axios(obj)
+      })
+    }
     if(error.response.status == 404){
       Notification.error({
         title: '接口不存在',

+ 7 - 2
src/utils/permissions.js

@@ -72,13 +72,18 @@ export default {
       })
     }
     if(!obj){
-      return false
+      return 0
     }
     // 0创建人 1负责人 3被分享人 2参与人
     if(obj.includes('0')||obj.includes('1')||obj.includes('2')){
       return true
     }
-    return false
+    if(obj.includes('3')){
+      return false
+    }else{
+      return 0
+    }
+    
   },
   /**
    * 功能权限

+ 63 - 0
src/views/components/errorPage/404.vue

@@ -0,0 +1,63 @@
+<template>
+  <div class="page404">
+    <div class="content">
+        <el-image style="width: 100%;height:100%" :src="require('@/assets/img/404.jpg')" fits="contain"></el-image>
+        <div class="btn">
+            <el-button  type="text" @click="to">回到首页</el-button> 
+        </div>
+        
+        
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+        timer:null
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    // var that = this
+    // this.timer = setTimeout(()=>{
+    //   that.to()
+    // },5000)
+  },
+  beforeDestroy() {
+    clearTimeout(this.timer)
+  },
+  methods: {
+    to(){
+      this.$router.replace(
+        {
+          path:'/home'
+        }
+      )
+      clearTimeout(this.timer)
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.page404{
+    position: relative;
+    height: 100%;
+    .content{
+        width: 1000px;
+        height: 600px;
+        position: absolute;
+        inset: 0;
+        margin: auto;
+    }
+    .btn{
+        display: flex;
+        justify-content: center;
+    }
+}
+</style>

+ 1 - 1
src/views/components/errorPage/components/ErrorPageLayout.vue

@@ -40,7 +40,7 @@ export default {
   },
   methods: {
     to(){
-      this.$router.push(
+      this.$router.replace(
         {
           path:'/home'
         }

+ 7 - 2
src/views/components/import/conditionImport/searchResult.vue

@@ -466,8 +466,13 @@ export default {
     },
     //获取最大页数
     getPageCount() {
-      var a = Math.ceil(Number(this.total) / Number(this.queryParams.size))
-      return a > 200 ? 200 : a
+      if(this.outside){
+        var a = Math.ceil(Number(this.total) / Number(this.queryParams.size))
+        return a > 200 ? 200 : a
+      }else{
+        return Math.ceil(Number(this.total) / Number(this.queryParams.size))
+      }
+      
     },
     //开始条数校验
     change1(val) {

+ 10 - 5
src/views/project/patentCollection/components/drawer/merge.vue

@@ -334,11 +334,16 @@ export default {
       var data = this.ruleFormTableData.filter(item=>{
         return !item.sign
       })
-      var disabled = [
-        {
-          mergeId:this.ruleForm.id
-        }
-      ]
+      if(this.ruleForm.id){
+        var disabled = [
+          {
+            mergeId:this.ruleForm.id
+          }
+        ]
+      }else{
+        var disabled = []
+      }
+      
       this.$refs.mergeTableDialog.open(titles[this.mergeType],data,disabled)
     },
     getChecked(value){

+ 1 - 0
src/views/project/patentCollection/components/drawer/mergeTableDialog.vue

@@ -84,6 +84,7 @@ export default {
         this.title=title
         this.mergedList = checked || []
         this.disabled=disabled||[]
+        this.searchOption = []
         this.getList()
         this.visible = true
     },

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

@@ -5,13 +5,13 @@
       style="display: flex;justify-content: space-evenly;height: 50px;line-height: 50px;border-bottom: 1px solid #ccc;">
       <div>总专利数量:{{ total }}</div>
     </div>
-    <div class="list" v-if="[1,2,7].findIndex(item=>{return item == reportType}) == -1 && patentList.length>0">
+    <div class="list" v-if="[1,2,7].findIndex(item=>{return item == reportType}) == -1 && patentList.length>0" v-loading="loading">
       <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>
         <div v-if="item.title && (typeof item.title)=='object'">
-          <my-tooltip :content="item.title.filter(item=> item.if_origin)[0].text_content" placement="bottom-start">
+          <!-- <my-tooltip :content="item.title.filter(item=> item.if_origin)[0].text_content" placement="bottom-start"> -->
             <div class="noWrap">{{ item.title.filter(item=> item.if_origin)[0].text_content }}</div>
-          </my-tooltip>
+          <!-- </my-tooltip> -->
         </div>
       </div>
     </div>
@@ -46,6 +46,10 @@ export default {
     },
     noveltySearch:{
       default:false
+    },
+    loading:{
+      type:Boolean,
+      default:false
     }
   },
   data() {

+ 168 - 83
src/views/project/patentDetails/components/menu.vue

@@ -38,11 +38,11 @@
             </el-tooltip>
           </el-header>
           <el-main style="background: #FFFFFF;">
-            <PatentLeft :patentList="patentList" :reportType="reportType" :patentNo="patentNo" :total="total" @getPatentLeft="getPatentLeft" :noveltySearch="noveltySearch"></PatentLeft>
+            <PatentLeft :patentList="patentList" :loading="loading" :reportType="reportType" :patentNo="patentNo" :total="total" @getPatentLeft="getPatentLeft" :noveltySearch="noveltySearch"></PatentLeft>
           </el-main>
           <el-footer style="text-align: center;" v-if="[1,2,7].findIndex(item=>{return item == reportType}) == -1">
-            <el-pagination background layout=" prev, pager, next" :current-page.sync="queryParams.current" :pager-count="5"
-              :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="total">
+            <el-pagination background layout=" prev, pager, next" :current-page.sync="queryParams.current" :pager-count="5" :page-count="getPageCount()"
+              :page-size.sync="queryParams.size" @current-change="handleCurrentChange">
             </el-pagination>
           </el-footer>
         </el-container>
@@ -87,26 +87,30 @@
         </el-tooltip>
         <template v-if="patentList.length>1">
           <el-tooltip placement="right-end">
-          <template slot="content" v-if="patentList[index-1]">
+          <template slot="content" >
             <div>点击查看上一篇文献</div>
-            <div v-if="[1,2,7].findIndex(item=>{return item == reportType}) == -1">专利:{{index!=0? patentList[index-1].patentNo:''}}</div>
-            <div v-else>文献:{{index!=0? patentList[index-1].name:''}}</div>
+            <!-- <div v-if="[1,2,7].findIndex(item=>{return item == reportType}) == -1">
+              专利:{{index!=0? patentList[index-1].patentNo:""}}
+            </div>
+            <div v-else>文献:{{index!=0? patentList[index-1].name:''}}</div> -->
             <div>数量:{{currentLocation - 1}}</div>
           </template>
-          <div class="articles-Loop">
+          <div class="articles-Loop" v-loading="loading">
             <div  @click="prev" v-disabled="currentLocation - 1 == 0 || loading">
               <i class="el-icon-arrow-up" ></i>
             </div>
           </div>
         </el-tooltip>
         <el-tooltip placement="right-end">
-          <template slot="content" v-if="patentList[index+1]">
+          <template slot="content">
             <div>点击查看下一篇文献</div>
-            <div v-if="[1,2,7].findIndex(item=>{return item == reportType}) == -1">专利:{{(total - currentLocation!=0 && total!=0)? patentList[index+1].patentNo:''}}</div>
-            <div v-else>文献:{{(total - currentLocation!=0 && total!=0)? patentList[index+1].name:''}}</div>
+            <!-- <div v-if="[1,2,7].findIndex(item=>{return item == reportType}) == -1">
+              专利:{{(total - currentLocation!=0 && total!=0)? patentList[index+1].patentNo:''}}
+            </div>
+            <div v-else>文献:{{(total - currentLocation!=0 && total!=0)? patentList[index+1].name:''}}</div> -->
             <div>数量:{{total - currentLocation}}</div>
           </template>
-          <div class="articles-Loop" >
+          <div class="articles-Loop" v-loading="loading">
             <div  @click="next" v-disabled="total - currentLocation == 0 || loading">
               <i class="el-icon-arrow-down"></i>
             </div>
@@ -182,23 +186,22 @@ export default {
         isContract:true,//是否收缩
         queryParams:{
             current:1,
-            size:10,
+            size:50,
         },
         total:0,
         loading:false,
         patentList:[],
         currentLocation:this.location,
         index:0,
-        total:0
     };
   },
   watch: {
-    isContract(){
-      if(this.projectType != 4){
-        this.setQueryParams()
-        this.getData()
-      }
-    }
+    // isContract(){
+    //   if(this.projectType != 4){
+    //     this.setQueryParams()
+    //     this.getData()
+    //   }
+    // }
   },
   computed: {},
   created() {},
@@ -211,69 +214,92 @@ export default {
   methods: {
     setQueryParams(){
       if(!this.outside){
-        if(this.isContract){
-          this.queryParams.current = ((this.currentLocation-1) <= 5)? 1 : ((this.currentLocation-1) - 5)
-        }else{
-          this.queryParams.current = parseInt((this.currentLocation-1) / this.queryParams.size) + 1
-        }
+        // if(this.isContract){
+        //   this.queryParams.current = ((this.currentLocation-1) <= 5)? 1 : ((this.currentLocation-1) - 5)
+        // }else{
+        //   this.queryParams.current = parseInt((this.currentLocation-1) / this.queryParams.size) + 1
+        // }
+        this.queryParams.current = parseInt((this.currentLocation-1) / this.queryParams.size) + 1
       }else{
         this.queryParams.current = parseInt((this.currentLocation-1) / this.queryParams.size) + 1
       }
       
     },
-    getData(){
+    async getData(){
       if(this.outside){
-        this.getPatentSelect()
+        await this.getPatentSelect()
       }else{
         this.getPatentList() 
       }
     },
+    //获取最大页数
+    getPageCount() {
+      if(this.outside){
+        var a = Math.ceil(Number(this.total) / Number(this.queryParams.size))
+        return a > 200 ? 200 : a
+      }else{
+        return Math.ceil(Number(this.total) / Number(this.queryParams.size))
+      }
+      
+    },
     async getPatentSelect(){
-      // this.queryParams.current = parseInt((this.currentLocation-1) / this.queryParams.size) + 1
-      var prevParams={
-        current:(this.queryParams.current-1) * this.queryParams.size,
-        size:1
-      },
-      params={
+      var params = {
         current:this.queryParams.current,
         size:this.queryParams.size
-      },
-      nextParams={
-        current:(this.queryParams.current * this.queryParams.size)+1,
-        size:1
       }
       this.loading = true
-      const [data1,data2,data3] = await Promise.allSettled([this.getList(prevParams),this.getList(params),this.getList(nextParams)])
-      this.patentList = []
-      var prevData = data1.status =='fulfilled'?data1.value:{}
-      var data = data2.status =='fulfilled'?data2.value:[]
-      var nextData = data3.status =='fulfilled'?data3.value:{}
-      if(Object.keys(prevData).length>0){
-        this.patentList.push(prevData.data[0])
-      }
-      if(Object.keys(data).length>0){
-        this.patentList.push(...data.data)
-        this.total = data.total>10000?10000:data.total
-      }
-      if(Object.keys(nextData).length>0){
-        this.patentList.push(nextData.data[0])
-      }
-      var index = this.patentList.findIndex(item=>{
-            return item.patentNo == this.patentNo
-          })
-          if(index!=-1){
-            this.index = index
-          }
+      this.$commonJS.scrollToTop()
+      const [data] = await Promise.allSettled([this.getList(params)])
+      this.patentList=data.status =='fulfilled'?data.value.data:[]
+      this.total = data.value.total
       this.loading = false
+
+      
+      // this.queryParams.current = parseInt((this.currentLocation-1) / this.queryParams.size) + 1
+      // var prevParams={
+      //   current:(this.queryParams.current-1) * this.queryParams.size,
+      //   size:1
+      // },
+      // params={
+      //   current:this.queryParams.current,
+      //   size:this.queryParams.size
+      // },
+      // nextParams={
+      //   current:(this.queryParams.current * this.queryParams.size)+1,
+      //   size:1
+      // }
+      // this.loading = true
+      // const [data1,data2,data3] = await Promise.allSettled([this.getList(prevParams),this.getList(params),this.getList(nextParams)])
+      // this.patentList = []
+      // var prevData = data1.status =='fulfilled'?data1.value:{}
+      // var data = data2.status =='fulfilled'?data2.value:[]
+      // var nextData = data3.status =='fulfilled'?data3.value:{}
+      // if(Object.keys(prevData).length>0){
+      //   this.patentList.push(prevData.data[0])
+      // }
+      // if(Object.keys(data).length>0){
+      //   this.patentList.push(...data.data)
+      //   this.total = data.total>10000?10000:data.total
+      // }
+      // if(Object.keys(nextData).length>0){
+      //   this.patentList.push(nextData.data[0])
+      // }
+      // var index = this.patentList.findIndex(item=>{
+      //       return item.patentNo == this.patentNo
+      //     })
+      //     if(index!=-1){
+      //       this.index = index
+      //     }
+      // this.loading = false
     },
     //查询专利
     getList(queryParams) {
-      if( queryParams.current == 0 && this.isContract){
-        return {}
-      }
-      if(queryParams.size == 1 && !this.isContract){
-        return {}
-      }
+      // if( queryParams.current == 0 && this.isContract){
+      //   return {}
+      // }
+      // if(queryParams.size == 1 && !this.isContract){
+      //   return {}
+      // }
       var params = {
         CurrentQuery: this.searchOption.searchCondition, //检索式
         DBType: this.searchOption.DBType, //”CN”或”WD”,表示检索中文库或世界库
@@ -287,7 +313,7 @@ export default {
       return this.$api.patentSelect(params).then(response=> response.data)
     },
     getPatentLeft(patentNo,index,sign){
-      
+      this.index = index
       if(sign){
         this.currentLocation = index + 1
         this.updatePatentNo(patentNo,sign)
@@ -410,16 +436,19 @@ export default {
     other(event){
       this.$emit('event',event)
     },
+
+
     //上一篇
-    prev(){
-      this.index -=1
+    async prev(){
+      if(this.index == 0){
+        this.queryParams.current -= 1
+        await this.getData()
+        this.index = this.patentList.length
+      }
+      this.index -= 1
       this.currentLocation -=1
       if(this.outside){
         this.updatePatentNo(this.patentList[this.index].patentNo)
-        if(this.index==0 &&  this.currentLocation>0){
-          this.setQueryParams()
-          this.getData()
-        }
         return 
       }
       var reportType = [1,2,7]
@@ -431,21 +460,26 @@ export default {
         return false
       }
       this.updatePatentNo(this.patentList[this.index].patentNo)
-      if(this.index <= 2 && this.currentLocation>2){
-        this.setQueryParams()
-        this.getData()
-      }
     },
     //下一篇
-    next(){
+    async next(){
+      if(this.index == this.patentList.length - 1){
+        if(this.queryParams.current * this.queryParams.size >= this.total){
+            this.$message.warning('已经是最后一件专利')
+            return
+          }
+        if(this.outside && this.queryParams.current>=200){
+          this.$message.warning('无法查看更多专利详情')
+          return 
+        }
+        this.queryParams.current += 1
+        await this.getData()
+        this.index = -1
+      }
       this.index +=1
       this.currentLocation +=1
       if(this.outside){
         this.updatePatentNo(this.patentList[this.index].patentNo)
-        if(this.index==10 &&  this.currentLocation<this.total){
-          this.setQueryParams()
-          this.getData()
-        }
         return
       }
       var reportType = [1,2,7]
@@ -457,11 +491,62 @@ export default {
         return false
       }
       this.updatePatentNo(this.patentList[this.index].patentNo)
-      if(this.index >= 7  &&  this.currentLocation<this.total-2){
-        this.setQueryParams()
-        this.getData()
-      }
     }
+
+
+
+    //上一篇
+    // prev(){
+    //   this.index -=1
+    //   this.currentLocation -=1
+    //   if(this.outside){
+    //     this.updatePatentNo(this.patentList[this.index].patentNo)
+    //     if(this.index==0 &&  this.currentLocation>0){
+    //       this.setQueryParams()
+    //       this.getData()
+    //     }
+    //     return 
+    //   }
+    //   var reportType = [1,2,7]
+    //   var index = reportType.findIndex(item=>{
+    //     return item == this.reportType
+    //   })
+    //   if(index !=-1){
+    //     this.updatePatentNo(this.patentList[this.index],true)
+    //     return false
+    //   }
+    //   this.updatePatentNo(this.patentList[this.index].patentNo)
+    //   if(this.index <= 2 && this.currentLocation>2){
+    //     this.setQueryParams()
+    //     this.getData()
+    //   }
+    // },
+    // //下一篇
+    // next(){
+    //   this.index +=1
+    //   this.currentLocation +=1
+    //   if(this.outside){
+    //     this.updatePatentNo(this.patentList[this.index].patentNo)
+    //     if(this.index==10 &&  this.currentLocation<this.total){
+    //       this.setQueryParams()
+    //       this.getData()
+    //     }
+    //     return
+    //   }
+    //   var reportType = [1,2,7]
+    //   var index = reportType.findIndex(item=>{
+    //     return item == this.reportType
+    //   })
+    //   if(index !=-1){
+    //     this.updatePatentNo(this.patentList[this.index],true)
+    //     return false
+    //   }
+    //   this.updatePatentNo(this.patentList[this.index].patentNo)
+    //   if(this.index >= 7  &&  this.currentLocation<this.total-2){
+    //     this.setQueryParams()
+    //     this.getData()
+    //   }
+    // }
   },
 };
 </script>