From 6551cca7b2ebe63b618530e927f006489e52c69c Mon Sep 17 00:00:00 2001 From: weijianli Date: Fri, 13 Sep 2019 17:46:50 -0500 Subject: [PATCH 1/2] update plot --- src/utils/request.js | 4 ++-- src/views/VueUploader/index.vue | 12 +++++++----- src/views/plot/plot.vue | 9 +++++++++ 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 src/views/plot/plot.vue diff --git a/src/utils/request.js b/src/utils/request.js index 2fb95ac0..1b76a5d1 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -44,9 +44,9 @@ service.interceptors.response.use( */ response => { const res = response.data - + var x = false // if the custom code is not 20000, it is judged as an error. - if (res.code !== 20000) { + if (x) { Message({ message: res.message || 'Error', type: 'error', diff --git a/src/views/VueUploader/index.vue b/src/views/VueUploader/index.vue index a48aa507..705d4a5c 100644 --- a/src/views/VueUploader/index.vue +++ b/src/views/VueUploader/index.vue @@ -532,12 +532,14 @@ export default { this.$router.push({ name: "analyze" }) this.listLoading = true sendAnalyzeRequest().then(response => { - console.log("success!") - this.list = response.data.items - this.listLoading = false + // console.log("success!") + // this.list = response.data.items + // this.listLoading = false + var token = response['token'] + // if the response from the server indicating that it's running the analysis, then redirect to a loading view - if (this.list.indexOf('anylyzing') >= 0) { - // this.$router.push('@/views/Analyzing/analyzing') + if (token == 'success') { + this.$router.push({ name: "plot" }) // sendAnalyzeRequest().then(response => { // this.list = response.data.items diff --git a/src/views/plot/plot.vue b/src/views/plot/plot.vue new file mode 100644 index 00000000..b85df477 --- /dev/null +++ b/src/views/plot/plot.vue @@ -0,0 +1,9 @@ + + + \ No newline at end of file From 13a6ebf4e08af46a1d4150f2a0a6494cedb8b506 Mon Sep 17 00:00:00 2001 From: weijianli Date: Sun, 15 Sep 2019 23:29:01 -0500 Subject: [PATCH 2/2] update predict on date --- package.json | 1 + src/api/user.js | 9 ++++++++ src/test.vue | 13 +++++++++++ src/views/Analyzing/analyzing.vue | 12 +++++++---- src/views/plot/plot.vue | 36 +++++++++++++++++++++++++++++++ 5 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 src/test.vue diff --git a/package.json b/package.json index 9a9e6d99..3cb592c3 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "vue-splitpane": "1.0.4", "vue-upload-component": "^2.8.20", "vuedraggable": "2.20.0", + "vuejs-datepicker": "^1.6.2", "vuex": "3.1.0", "xlsx": "0.14.1" }, diff --git a/src/api/user.js b/src/api/user.js index 68fbfe03..45c13b4d 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -31,3 +31,12 @@ export function sendAnalyzeRequest(token) { params: { token } }) } + +export function sendAnalyzeOnDateRequest(token, fromDate, toDate) { + return request({ + url: '/predictOnDate', + method: 'get', + baseURL: 'http://localhost:8888', + params: { token, fromDate, toDate } + }) +} diff --git a/src/test.vue b/src/test.vue new file mode 100644 index 00000000..98a84d7f --- /dev/null +++ b/src/test.vue @@ -0,0 +1,13 @@ +
+ +
+ + + \ No newline at end of file diff --git a/src/views/Analyzing/analyzing.vue b/src/views/Analyzing/analyzing.vue index b138840e..6e162789 100644 --- a/src/views/Analyzing/analyzing.vue +++ b/src/views/Analyzing/analyzing.vue @@ -18,20 +18,24 @@ -->