This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new 41a32ce  Support search without conditions in Lite Console's history 
pages (#78)
41a32ce is described below

commit 41a32cef4036a1f8590f58e1dca08482c80679af
Author: 吴伟杰 <[email protected]>
AuthorDate: Mon Dec 21 10:06:39 2020 +0800

    Support search without conditions in Lite Console's history pages (#78)
---
 .../src/views/history-status/module/historyStatus.vue       | 13 +++++++++++--
 .../src/views/history-trace/module/historyTrace.vue         | 13 +++++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git 
a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/views/history-status/module/historyStatus.vue
 
b/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/views/history-status/module/historyStatus.vue
index 8af8d4a..cd6a43c 100644
--- 
a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/views/history-status/module/historyStatus.vue
+++ 
b/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/views/history-status/module/historyStatus.vue
@@ -165,18 +165,27 @@ export default {
         pageSize: this.pageSize,
         pageNumber: val
       }
-      API.loadStatus(Object.assign(this.searchForm, page)).then(res => {
+      API.loadStatus(Object.assign(this.getSearchForm(), page)).then(res => {
         const data = res.model.rows
         this.total = res.model.total
         this.tableData = data
       })
     },
     getJobStatus() {
-      API.loadStatus(this.searchForm).then(res => {
+      API.loadStatus(this.getSearchForm()).then(res => {
         const data = res.model.rows
         this.total = res.model.total
         this.tableData = data
       })
+    },
+    getSearchForm() {
+      const requestBody = Object.assign({}, this.searchForm)
+      requestBody.jobName = this.getNullIfEmpty(requestBody.jobName)
+      requestBody.state = this.getNullIfEmpty(requestBody.state)
+      return requestBody
+    },
+    getNullIfEmpty(value) {
+      return value === '' ? null : value
     }
   }
 }
diff --git 
a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/views/history-trace/module/historyTrace.vue
 
b/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/views/history-trace/module/historyTrace.vue
index aaac065..6813c43 100644
--- 
a/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/views/history-trace/module/historyTrace.vue
+++ 
b/shardingsphere-elasticjob-lite-ui/shardingsphere-elasticjob-lite-ui-frontend/src/views/history-trace/module/historyTrace.vue
@@ -183,18 +183,27 @@ export default {
         pageSize: this.pageSize,
         pageNumber: val
       }
-      API.loadExecution(Object.assign(this.searchForm, page)).then(res => {
+      API.loadExecution(Object.assign(this.getSearchForm(), page)).then(res => 
{
         const data = res.model.rows
         this.total = res.model.total
         this.tableData = data
       })
     },
     getJobTrace() {
-      API.loadExecution(this.searchForm).then(res => {
+      API.loadExecution(this.getSearchForm()).then(res => {
         const data = res.model.rows
         this.total = res.model.total
         this.tableData = data
       })
+    },
+    getSearchForm() {
+      const requestBody = Object.assign({}, this.searchForm)
+      requestBody.jobName = this.getNullIfEmpty(requestBody.jobName)
+      requestBody.ip = this.getNullIfEmpty(requestBody.ip)
+      return requestBody
+    },
+    getNullIfEmpty(value) {
+      return value === '' ? null : value
     }
   }
 }

Reply via email to