From 91b6977310fbdfa74d0ef37b58e9f357726ae3f3 Mon Sep 17 00:00:00 2001 From: weijianli Date: Wed, 18 Sep 2019 14:20:05 -0500 Subject: [PATCH 1/6] debug --- src/views/VueUploader/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/VueUploader/index.vue b/src/views/VueUploader/index.vue index 744f86b9..71ff88a8 100644 --- a/src/views/VueUploader/index.vue +++ b/src/views/VueUploader/index.vue @@ -332,7 +332,7 @@ export default { thread: 3, name: 'file', postAction: '/upload/post', - putAction: 'http://localhost:8888/uploader', + putAction: 'http://localhost:8010/uploader', headers: { 'X-Csrf-Token': 'xxxx', }, From 26afda8af0c924890d2727bfc7f5df5106e692ca Mon Sep 17 00:00:00 2001 From: weijianli Date: Wed, 18 Sep 2019 14:24:16 -0500 Subject: [PATCH 2/6] add and delete tasks --- src/layout/components/Sidebar/SidebarItem.vue | 8 +++ src/layout/components/Sidebar/index.vue | 1 + src/layout/index.vue | 2 +- src/router/index.js | 10 ++-- src/utils/request.js | 2 +- src/views/VueUploader/components/taskList.vue | 49 +++++++++++++++++++ src/views/VueUploader/index.vue | 8 +-- src/views/plot/plot.vue | 4 ++ 8 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 src/views/VueUploader/components/taskList.vue diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index 2d49dd87..82f6b78f 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -21,6 +21,7 @@ class="nest-menu" /> + @@ -57,6 +58,12 @@ export default { return {} }, methods: { + // addNewTask() { + // this.item.children.push({ + // name: "Task 2", + // path: "" + // }) + // }, hasOneShowingChild(children = [], parent) { const showingChildren = children.filter(item => { if (item.hidden) { @@ -67,6 +74,7 @@ export default { return true } }) + // console.log(showingChildren) // When there is only one child router, the child router is displayed by default if (showingChildren.length === 1) { diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index fb014a23..5b2c16c5 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -15,6 +15,7 @@ + diff --git a/src/layout/index.vue b/src/layout/index.vue index 316bf698..4f0b244a 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -5,7 +5,7 @@
- +

Data Uploader

@@ -309,11 +310,12 @@ import Cropper from 'cropperjs' import ImageCompressor from '@xkeshi/image-compressor' import FileUpload from 'vue-upload-component' import { sendAnalyzeRequest } from '@/api/user' +import taskList from '@/views/VueUploader/components/taskList' // import 'bootstrap' // import 'bootstrap/dist/css/bootstrap.min.css' export default { components: { - FileUpload, + FileUpload, taskList }, data() { return { diff --git a/src/views/plot/plot.vue b/src/views/plot/plot.vue index c8ad9a4c..ba90d922 100644 --- a/src/views/plot/plot.vue +++ b/src/views/plot/plot.vue @@ -9,6 +9,7 @@
+ + + From e1fb05b4b2ac301a60542408951cffdadca45900 Mon Sep 17 00:00:00 2001 From: weijianli Date: Sun, 29 Sep 2019 11:04:51 -0500 Subject: [PATCH 6/6] 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 @@