瀏覽代碼

诊断搜索增加搜索值为空情况

zhangxc 6 年之前
父節點
當前提交
a4f1c2776e
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/store/async-actions/diagnosticSearch.js

+ 8 - 0
src/store/async-actions/diagnosticSearch.js

@@ -19,6 +19,14 @@ export const getSearchResult = (value) =>{
                 type: SET_SEARCH_VALUE,
                 searchValue: value
             })
+            //如果搜索值为空,则直接将搜索结果设为空
+            if(value === '') {
+                dispatch({
+                    type: GET_SEARCH_RESULT,
+                    searchResult: []
+                })
+                return
+            }
             json(url, param).then((data)=>{
                 const searchRes = data.data.data;
                 const diagList = state.diagnosticList.diagnosticList;