From 125f6b80d847279f0119e00c677622dbecb23927 Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Fri, 3 Jan 2020 13:33:47 +0100 Subject: [PATCH] Incentive Page --- mock/article.js | 21 +- src/router/index.js | 39 ++- .../incentives/components/ArticleDetail.vue | 249 ++++++++++++++++++ .../components/Dropdown/Comment.vue | 41 +++ .../components/Dropdown/Platform.vue | 46 ++++ .../components/Dropdown/SourceUrl.vue | 38 +++ .../incentives/components/Dropdown/index.js | 3 + src/views/incentives/components/Warning.vue | 13 + src/views/incentives/create.vue | 13 + src/views/incentives/edit.vue | 13 + src/views/incentives/list.vue | 103 ++++++++ 11 files changed, 572 insertions(+), 7 deletions(-) create mode 100644 src/views/incentives/components/ArticleDetail.vue create mode 100644 src/views/incentives/components/Dropdown/Comment.vue create mode 100644 src/views/incentives/components/Dropdown/Platform.vue create mode 100644 src/views/incentives/components/Dropdown/SourceUrl.vue create mode 100644 src/views/incentives/components/Dropdown/index.js create mode 100644 src/views/incentives/components/Warning.vue create mode 100644 src/views/incentives/create.vue create mode 100644 src/views/incentives/edit.vue create mode 100644 src/views/incentives/list.vue diff --git a/mock/article.js b/mock/article.js index bc236eb..e9534c3 100644 --- a/mock/article.js +++ b/mock/article.js @@ -1,24 +1,35 @@ import Mock from 'mockjs' const List = [] -const count = 100 +const count = 10 const baseContent = '

I am testing data, I am testing data.

' const image_uri = 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3' - +const titles = [ + 'Special Coffee ☕️☕️☕️', + 'VR Experience im Vrei', + 'VR Experience im Vrei', + 'VR Experience im Vrei', + 'VR Experience im Vrei', + 'VR Experience im Vrei', + 'VR Experience im Vrei', + 'VR Experience im Vrei', + 'VR Experience im Vrei', + 'VR Experience im Vrei' +] for (let i = 0; i < count; i++) { List.push(Mock.mock({ - id: '@increment', + id: i * 5 + 5, timestamp: +Mock.Random.date('T'), author: '@first', reviewer: '@first', - title: '@title(5, 10)', + title: titles[i], content_short: 'mock data', content: baseContent, forecast: '@float(0, 100, 2, 2)', importance: '@integer(1, 3)', 'type|1': ['CN', 'US', 'JP', 'EU'], - 'status|1': ['published', 'draft', 'deleted'], + 'status|1': ['Aktiv', 'Entwurf', 'Gelöscht'], display_time: '@datetime', comment_disabled: true, pageviews: '@integer(300, 5000)', diff --git a/src/router/index.js b/src/router/index.js index 6f81131..ba8ce2f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -120,7 +120,7 @@ export const constantRoutes = [ */ export const asyncRoutes = [ { - path: '/find', + path: '/', // find component: Layout, alwaysShow: false, children: [ @@ -137,7 +137,7 @@ export const asyncRoutes = [ ] }, { - path: '/', + path: '/dashboard', component: Layout, redirect: '/dashboard', children: [ @@ -161,6 +161,41 @@ export const asyncRoutes = [ } ] }, + { + path: '/incentives', + component: Layout, + redirect: '/example/list', + name: 'Example Articles', + meta: { + title: 'Incentives', + icon: 'example' + }, + children: [ + { + path: 'create', + component: () => import('@/views/incentives/create'), + name: 'CreateIncentive', + meta: { title: 'Incentive anlegen', icon: 'edit' } + }, + { + path: 'list', + component: () => import('@/views/incentives/list'), + name: 'IncentiveList', + meta: { title: 'Incentive Liste', icon: 'list' } + }, + { + path: 'edit/:id(\\d+)', + component: () => import('@/views/incentives/edit'), + name: 'EditIncentive', + meta: { + title: 'Incentive bearbeiten', + noCache: true, + activeMenu: '/example/list' + }, + hidden: true + } + ] + }, { path: '/permission', component: Layout, diff --git a/src/views/incentives/components/ArticleDetail.vue b/src/views/incentives/components/ArticleDetail.vue new file mode 100644 index 0000000..c707ddc --- /dev/null +++ b/src/views/incentives/components/ArticleDetail.vue @@ -0,0 +1,249 @@ + + + + + diff --git a/src/views/incentives/components/Dropdown/Comment.vue b/src/views/incentives/components/Dropdown/Comment.vue new file mode 100644 index 0000000..d34b2b9 --- /dev/null +++ b/src/views/incentives/components/Dropdown/Comment.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/views/incentives/components/Dropdown/Platform.vue b/src/views/incentives/components/Dropdown/Platform.vue new file mode 100644 index 0000000..0a52726 --- /dev/null +++ b/src/views/incentives/components/Dropdown/Platform.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/views/incentives/components/Dropdown/SourceUrl.vue b/src/views/incentives/components/Dropdown/SourceUrl.vue new file mode 100644 index 0000000..8f47485 --- /dev/null +++ b/src/views/incentives/components/Dropdown/SourceUrl.vue @@ -0,0 +1,38 @@ + + + diff --git a/src/views/incentives/components/Dropdown/index.js b/src/views/incentives/components/Dropdown/index.js new file mode 100644 index 0000000..bc0c171 --- /dev/null +++ b/src/views/incentives/components/Dropdown/index.js @@ -0,0 +1,3 @@ +export { default as CommentDropdown } from './Comment' +export { default as PlatformDropdown } from './Platform' +export { default as SourceUrlDropdown } from './SourceUrl' diff --git a/src/views/incentives/components/Warning.vue b/src/views/incentives/components/Warning.vue new file mode 100644 index 0000000..8d2a7e5 --- /dev/null +++ b/src/views/incentives/components/Warning.vue @@ -0,0 +1,13 @@ + + diff --git a/src/views/incentives/create.vue b/src/views/incentives/create.vue new file mode 100644 index 0000000..f28ce28 --- /dev/null +++ b/src/views/incentives/create.vue @@ -0,0 +1,13 @@ + + + + diff --git a/src/views/incentives/edit.vue b/src/views/incentives/edit.vue new file mode 100644 index 0000000..87b6126 --- /dev/null +++ b/src/views/incentives/edit.vue @@ -0,0 +1,13 @@ + + + + diff --git a/src/views/incentives/list.vue b/src/views/incentives/list.vue new file mode 100644 index 0000000..7154b3e --- /dev/null +++ b/src/views/incentives/list.vue @@ -0,0 +1,103 @@ + + + + +