Selaa lähdekoodia

fix:表格展示数据置空处理

zhangsiya 1 vuosi sitten
vanhempi
commit
9709afaa3d

+ 1 - 1
apps/bigmember_pc/src/views/search/bidding/components/search-list-table.vue

@@ -166,7 +166,7 @@ function toDetail (item) {
   /*全文搜索 表格*/
   width:100%;
   position: relative;
-  border-bottom: 1px solid #e0e0e0;
+  //border-bottom: 1px solid #e0e0e0;
   table {
 
     width: 100%;

+ 21 - 13
apps/bigmember_pc/src/views/search/bidding/model/base.js

@@ -596,7 +596,7 @@ export default function () {
     return result
   }
 
-  function beforeSearch (searchType) {
+  function beforeSearchCheck (searchType) {
     // 第一次搜索或者tab切换不校验白名单规则
     if (searchType) {
       return true
@@ -629,16 +629,8 @@ export default function () {
     }
     return true
   }
-  /**
-   * 统一查询入口
-   * - 拦截 doQuery 进行一些返回值处理
-   * @param [params] - 可选值,默认会和 getParams(params) 返回值进行合并
-   */
-  function doQuery(params = {}, searchType, pageNum) {
-    const bSearch = beforeSearch(searchType)
-    if(!bSearch) {
-      return
-    }
+  // 搜索前 处理一些事情
+  function beforeSearch (pageNum) {
     // 列表清空
     list.value = []
     // 列表重新获取时
@@ -667,6 +659,18 @@ export default function () {
       getCustomReportData({ keywords:  inputKeywordsState.value.input })
     }
 
+  }
+  /**
+   * 统一查询入口
+   * - 拦截 doQuery 进行一些返回值处理
+   * @param [params] - 可选值,默认会和 getParams(params) 返回值进行合并
+   */
+  function doQuery(params = {}, searchType, pageNum) {
+    const bSearch = beforeSearchCheck(searchType)
+    if(!bSearch) {
+      return
+    }
+    beforeSearch (pageNum)
     // Ajax请求
     return doRunQuery(getParams(params)).then((res) => {
       afterQueryAjax(res)
@@ -697,8 +701,12 @@ export default function () {
     inputKeywordsState.value.matchKeys = res.origin?.keyWords?.split(' ') || matchKeys
 
     //表格列表数据--只取第一页的前20条展示
-    if(listState.pageNum === 1 && listState.total > 0) {
-      tableList.value = list.value.slice(0, 20)
+    if(listState.pageNum === 1) {
+      if(listState.total > 0) {
+        tableList.value = list.value.slice(0, 20)
+      } else {
+        tableList.value = []
+      }
     }
 
     // 列表无数据,禁用数据导出按钮