From e1fb05b4b2ac301a60542408951cffdadca45900 Mon Sep 17 00:00:00 2001 From: weijianli Date: Sun, 29 Sep 2019 11:04:51 -0500 Subject: [PATCH] add plotting function --- mock/user.js | 12 ++ src/api/user.js | 10 +- src/router/index.js | 15 +++ src/views/VueUploader/index.vue | 48 ++++--- .../dashboard/admin/components/LineChart.vue | 60 ++++----- src/views/login/index.vue | 7 +- src/views/plotTest/plotTest.vue | 121 ++++++++++++++++++ 7 files changed, 216 insertions(+), 57 deletions(-) create mode 100644 src/views/plotTest/plotTest.vue diff --git a/mock/user.js b/mock/user.js index aa896b84..9810b161 100644 --- a/mock/user.js +++ b/mock/user.js @@ -80,5 +80,17 @@ export default [ data: 'success' } } + }, + + // plot prediction graph + { + url: '/testpredict', + type: 'get', + response: _ => { + return { + code: 20000, + token: 'success' + } + } } ] diff --git a/src/api/user.js b/src/api/user.js index adac38f6..883e00b8 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -3,7 +3,7 @@ import request from '@/utils/request' export function login(data) { return request({ url: '/user/login', - baseURL: 'http://localhost:8888', + baseURL: 'http://localhost:8010', method: 'post', data }) @@ -29,9 +29,9 @@ export function sendAnalyzeRequest(token) { return request({ url: '/testpredict', method: 'get', - baseURL: 'http://localhost:8888', - authorization: token, - params: { token } + // baseURL: 'http://localhost:8010', + // authorization: token, + // params: { token } }) } @@ -39,7 +39,7 @@ export function sendAnalyzeOnDateRequest(token, fromDate, toDate) { return request({ url: '/predictOnDate', method: 'get', - baseURL: 'http://localhost:8888', + baseURL: 'http://localhost:8010', authorization: token, params: { token, fromDate, toDate } }) diff --git a/src/router/index.js b/src/router/index.js index 6eff2127..5aad5f3c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -110,6 +110,21 @@ export const constantRoutes = [ } ] }, + { + path: '/plotTest', + hidden: true, + component: Layout, + props: true, + children: [ + { + path: 'plotTest', + component: () => import('@/views/plotTest/plotTest'), + props: true, + name: 'plotTest', + meta: { title: 'plotTest', icon: 'chart' } + } + ] + }, { path: '/analyzing', hidden: true, diff --git a/src/views/VueUploader/index.vue b/src/views/VueUploader/index.vue index 723b6846..9a804818 100644 --- a/src/views/VueUploader/index.vue +++ b/src/views/VueUploader/index.vue @@ -114,7 +114,7 @@