Browse Source

:tangerine:

Pan 7 years ago
parent
commit
40a5977d1f

+ 5 - 0
build/webpack.prod.conf.js

@@ -11,6 +11,10 @@ var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
11 11
 
12 12
 var env = config.build.env
13 13
 
14
+function resolveApp(relativePath) {
15
+    return path.resolve(relativePath);
16
+}
17
+
14 18
 var webpackConfig = merge(baseWebpackConfig, {
15 19
   module: {
16 20
     rules: utils.styleLoaders({
@@ -53,6 +57,7 @@ var webpackConfig = merge(baseWebpackConfig, {
53 57
       filename: config.build.index,
54 58
       template: 'index.html',
55 59
       inject: true,
60
+      favicon: resolveApp('favicon.ico'),
56 61
       minify: {
57 62
         removeComments: true,
58 63
         collapseWhitespace: true,

BIN
favicon.ico


File diff suppressed because it is too large
+ 1 - 1
src/components/Hamburger/index.vue


+ 0 - 11
src/components/Icon-svg/index.js

@@ -1,11 +0,0 @@
1
-import Vue from 'vue'
2
-
3
-function registerAllComponents(requireContext) {
4
-  return requireContext.keys().forEach(comp => {
5
-    const vueComp = requireContext(comp)
6
-    const compName = vueComp.name ? vueComp.name.toLowerCase() : /\/([\w-]+)\.vue$/.exec(comp)[1]
7
-    Vue.component(compName, vueComp)
8
-  })
9
-}
10
-
11
-registerAllComponents(require.context('./', false, /\.vue$/))

+ 2 - 6
src/components/Icon-svg/wscn-icon-svg.vue

@@ -1,12 +1,12 @@
1 1
 <template>
2
-  <svg class="wscn-icon" aria-hidden="true">
2
+  <svg class="svg-icon" aria-hidden="true">
3 3
     <use :xlink:href="iconName"></use>
4 4
   </svg>
5 5
 </template>
6 6
 
7 7
 <script>
8 8
   export default {
9
-    name: 'wscn-icon-svg',
9
+    name: 'icon-svg',
10 10
     props: {
11 11
       iconClass: {
12 12
         type: String,
@@ -20,7 +20,3 @@
20 20
     }
21 21
   }
22 22
 </script>
23
-
24
-<style lang="scss" scoped>
25
-
26
-</style>

+ 0 - 52
src/components/Icon-svg/wscn-icon-stack.vue

@@ -1,52 +0,0 @@
1
-<template>
2
-  <div class="icon-container" :style="containerStyle">
3
-    <slot class="icon"></slot>
4
-  </div>
5
-</template>
6
-
7
-<script>
8
-  export default {
9
-    name: 'wscn-icon-stack',
10
-    props: {
11
-      width: {
12
-        type: Number,
13
-        default: 20
14
-      },
15
-      shape: {
16
-        type: String,
17
-        default: 'circle',
18
-        validator: val => {
19
-          const validShapes = ['circle', 'square']
20
-          return validShapes.indexOf(val) > -1
21
-        }
22
-      }
23
-    },
24
-    computed: {
25
-      containerStyle() {
26
-        return {
27
-          width: `${this.width}px`,
28
-          height: `${this.width}px`,
29
-          fontSize: `${this.width * 0.6}px`,
30
-          borderRadius: `${this.shape === 'circle' && '50%'}`
31
-        }
32
-      }
33
-    }
34
-  }
35
-</script>
36
-
37
-<style lang="scss" scoped>
38
-  .icon-container {
39
-    display: inline-block;
40
-    position: relative;
41
-    overflow: hidden;
42
-    background: #1482F0;
43
-
44
-    .icon {
45
-      position: absolute;
46
-      color: #ffffff;
47
-      top: 50%;
48
-      left: 50%;
49
-      transform: translate(-50%, -50%);
50
-    }
51
-  }
52
-</style>

+ 16 - 15
src/main.js

@@ -4,31 +4,32 @@ import Vue from 'vue'
4 4
 import App from './App'
5 5
 import router from './router'
6 6
 import store from './store'
7
-import ElementUI from 'element-ui';
7
+import ElementUI from 'element-ui'
8 8
 import 'element-ui/lib/theme-default/index.css'
9 9
 import NProgress from 'nprogress'
10
-import 'normalize.css/normalize.css';// normalize.css 样式格式化
11
-import '@/styles/index.scss'; // 全局自定义的css样式
12
-import '@/components/Icon-svg/index'; // 封装的svg组件
10
+import 'normalize.css/normalize.css'
11
+import '@/styles/index.scss' // 全局自定义的css样式
12
+import '@/assets/iconfont/iconfont'
13
+import IconSvg from '@/components/Icon-svg/index.vue'
13 14
 
14 15
 Vue.config.productionTip = false
15 16
 
16 17
 Vue.use(ElementUI);
18
+Vue.component('icon-svg', IconSvg)
17 19
 
18
-
19
-const whiteList = ['/login'];// 不重定向白名单
20
+const whiteList = ['/login'];
20 21
 router.beforeEach((to, from, next) => {
21
-  NProgress.start(); // 开启Progress
22
-  if (store.getters.token) { // 判断是否有token
22
+  NProgress.start();
23
+  if (store.getters.token) {
23 24
     if (to.path === '/login') {
24 25
       next({ path: '/' });
25 26
     } else {
26
-      if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
27
-        store.dispatch('GetInfo').then(res => { // 拉取user_info
27
+      if (store.getters.roles.length === 0) {
28
+        store.dispatch('GetInfo').then(res => {
28 29
           const roles = res.data.role;
29
-          store.dispatch('GenerateRoutes', { roles }).then(() => { // 生成可访问的路由表
30
-            router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
31
-            next(to.path); // hack方法 确保addRoutes已完成
30
+          store.dispatch('GenerateRoutes', { roles }).then(() => {
31
+            router.addRoutes(store.getters.addRouters)
32
+            next(to.path);
32 33
           })
33 34
         }).catch(err => {
34 35
           console.log(err);
@@ -38,10 +39,10 @@ router.beforeEach((to, from, next) => {
38 39
       }
39 40
     }
40 41
   } else {
41
-    if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入
42
+    if (whiteList.indexOf(to.path) !== -1) {
42 43
       next()
43 44
     } else {
44
-      next('/login'); // 否则全部重定向到登录页
45
+      next('/login');
45 46
       NProgress.done();
46 47
     }
47 48
   }

+ 0 - 4
src/store/getters.js

@@ -1,12 +1,8 @@
1 1
 const getters = {
2 2
   sidebar: state => state.app.sidebar,
3
-  visitedViews: state => state.app.visitedViews,
4 3
   token: state => state.user.token,
5 4
   avatar: state => state.user.avatar,
6 5
   name: state => state.user.name,
7
-  uid: state => state.user.uid,
8
-  email: state => state.user.email,
9
-  introduction: state => state.user.introduction,
10 6
   roles: state => state.user.roles,
11 7
   permission_routers: state => state.permission.routers,
12 8
   addRouters: state => state.permission.addRouters

+ 0 - 103
src/styles/btn.scss

@@ -1,103 +0,0 @@
1
-$blue:#324157;
2
-$light-blue:#3A71A8;
3
-$red:#C03639;
4
-$pink: #E65D6E;
5
-$green: #30B08F;
6
-$tiffany: #4AB7BD;
7
-$yellow:#FEC171;
8
-
9
-$panGreen: #30B08F;
10
-
11
-@mixin colorBtn($color) {
12
-  background: $color;
13
-  &:hover {
14
-    color: $color;
15
-    &:before, &:after {
16
-      background: $color;
17
-    }
18
-  }
19
-}
20
-
21
-
22
-.blue-btn {
23
-  @include colorBtn($blue)
24
-}
25
-
26
-.light-blue-btn{
27
-  @include colorBtn($light-blue)
28
-}
29
-
30
-
31
-.red-btn {
32
-  @include colorBtn($red)
33
-}
34
-
35
-.pink-btn {
36
-  @include colorBtn($pink)
37
-}
38
-
39
-.green-btn {
40
-  @include colorBtn($green)
41
-}
42
-
43
-
44
-.tiffany-btn {
45
-  @include colorBtn($tiffany)
46
-}
47
-
48
-
49
-.yellow-btn {
50
-  @include colorBtn($yellow)
51
-}
52
-
53
-.pan-btn {
54
-  font-size: 14px;
55
-  color: #fff;
56
-  padding: 14px 36px;
57
-  border-radius: 8px;
58
-  border: none;
59
-  outline: none;
60
-  margin-right: 25px;
61
-  transition: 600ms ease all;
62
-  position: relative;
63
-  display: inline-block;
64
-  &:hover {
65
-    background: #fff;
66
-    &:before, &:after {
67
-      width: 100%;
68
-      transition: 600ms ease all;
69
-    }
70
-  }
71
-  &:before, &:after {
72
-    content: '';
73
-    position: absolute;
74
-    top: 0;
75
-    right: 0;
76
-    height: 2px;
77
-    width: 0;
78
-    transition: 400ms ease all;
79
-  }
80
-  &::after {
81
-    right: inherit;
82
-    top: inherit;
83
-    left: 0;
84
-    bottom: 0;
85
-  }
86
-}
87
-
88
-.custom-button{
89
-    display: inline-block;
90
-    line-height: 1;
91
-    white-space: nowrap;
92
-    cursor: pointer;
93
-    background: #fff;
94
-    color: #fff;
95
-    -webkit-appearance: none;
96
-    text-align: center;
97
-    box-sizing: border-box;
98
-    outline: 0;
99
-    margin: 0;
100
-    padding: 10px 15px;
101
-    font-size: 14px;
102
-    border-radius: 4px;
103
-}

+ 1 - 55
src/styles/element-ui.scss

@@ -1,23 +1,4 @@
1
- //覆盖一些element-ui样式
2
-.block-checkbox {
3
-  display: block;
4
-}
5
-
6
-.operation-container {
7
-  .cell {
8
-    padding: 10px !important;
9
-  }
10
-  .el-button {
11
-    &:nth-child(3) {
12
-      margin-top: 10px;
13
-      margin-left: 0px;
14
-    }
15
-    &:nth-child(4) {
16
-      margin-top: 10px;
17
-    }
18
-  }
19
-}
20
-
1
+ //覆盖一些element-ui样式 覆盖css样式可在这里添加
21 2
 .el-upload {
22 3
   input[type="file"] {
23 4
     display: none !important;
@@ -28,29 +9,6 @@
28 9
   display: none;
29 10
 }
30 11
 
31
-.cell {
32
-  .el-tag {
33
-    margin-right: 8px;
34
-  }
35
-}
36
-
37
-.small-padding {
38
-  .cell {
39
-    padding-left: 8px;
40
-    padding-right: 8px;
41
-  }
42
-}
43
-
44
-.status-col {
45
-  .cell {
46
-    padding: 0 10px;
47
-    text-align: center;
48
-    .el-tag {
49
-      margin-right: 0px;
50
-    }
51
-  }
52
-}
53
-
54 12
 //暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461
55 13
 .el-dialog {
56 14
   transform: none;
@@ -59,18 +17,6 @@
59 17
   margin: 0 auto;
60 18
 }
61 19
 
62
-
63
-//文章页textarea修改样式
64
-.article-textarea {
65
-  textarea {
66
-    padding-right: 40px;
67
-    resize: none;
68
-    border: none;
69
-    border-radius: 0px;
70
-    border-bottom: 1px solid #bfcbd9;
71
-  }
72
-}
73
-
74 20
 //element ui upload
75 21
 .upload-container {
76 22
   .el-upload {

+ 14 - 209
src/styles/index.scss

@@ -1,4 +1,3 @@
1
-@import './btn.scss';
2 1
 @import './element-ui.scss';
3 2
 @import "./mixin.scss";
4 3
 body {
@@ -8,10 +7,6 @@ body {
8 7
   font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
9 8
 }
10 9
 
11
-label {
12
-  font-weight: 700;
13
-}
14
-
15 10
 html {
16 11
   box-sizing: border-box;
17 12
 }
@@ -22,14 +17,6 @@ html {
22 17
   box-sizing: inherit;
23 18
 }
24 19
 
25
-.no-padding {
26
-  padding: 0px !important;
27
-}
28
-
29
-.padding-content {
30
-  padding: 4px 0;
31
-}
32
-
33 20
 a:focus,
34 21
 a:active {
35 22
   outline: none;
@@ -43,49 +30,18 @@ a:hover {
43 30
   text-decoration: none;
44 31
 }
45 32
 
46
-.fr {
47
-  float: right;
48
-}
49
-
50
-.fl {
51
-  float: left;
52
-}
53
-
54
-.pr-5 {
55
-  padding-right: 5px;
56
-}
57
-
58
-.pl-5 {
59
-  padding-left: 5px;
60
-}
61
-
62
-.block {
63
-  display: block;
64
-}
65
-
66
-.pointer {
67
-  cursor: pointer;
68
-}
69
-
70
-.inlineBlock {
71
-  display: block;
72
-}
73
-
74
-code {
75
-  background: #eef1f6;
76
-  padding: 15px 10px;
77
-  margin-bottom: 20px;
78
-  display: block;
79
-  line-height: 36px;
80
-  a {
81
-    color: #337ab7;
82
-    cursor: pointer;
83
-    &:hover {
84
-      color: rgb(32, 160, 255);
85
-    }
33
+.clearfix {
34
+  &:after {
35
+    visibility: hidden;
36
+    display: block;
37
+    font-size: 0;
38
+    content: " ";
39
+    clear: both;
40
+    height: 0;
86 41
   }
87 42
 }
88 43
 
44
+//vue router transition css
89 45
 .fade-enter-active,
90 46
 .fade-leave-active {
91 47
   transition: all .2s ease
@@ -97,23 +53,15 @@ code {
97 53
 }
98 54
 
99 55
 //main-container全局样式
100
-.app-container {
101
-  padding: 20px;
102
-}
103
-.components-container {
104
-  margin: 30px 50px;
105
-  position: relative;
56
+.app-main{
57
+  min-height: 100%
106 58
 }
107
-.pagination-container {
108
-  margin-top: 30px;
109
-}
110
-
111 59
 
112
-.editor-container .CodeMirror {
113
-  height: 100%!important;
60
+.app-container {
61
+  padding: 20px;
114 62
 }
115 63
 
116
-.wscn-icon {
64
+.svg-icon {
117 65
   width: 1em;
118 66
   height: 1em;
119 67
   vertical-align: -0.15em;
@@ -121,146 +69,3 @@ code {
121 69
   overflow: hidden;
122 70
 }
123 71
 
124
-.sub-navbar {
125
-  height: 50px;
126
-  line-height: 50px;
127
-  position: relative;
128
-  width: 100%;
129
-  text-align: right;
130
-  padding-right: 20px;
131
-  transition: 600ms ease position;
132
-  background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%);
133
-  .subtitle {
134
-    font-size: 20px;
135
-    color: #fff;
136
-  }
137
-  &.draft {
138
-    background: #d0d0d0;
139
-  }
140
-  &.deleted {
141
-    background: #d0d0d0;
142
-  }
143
-}
144
-
145
-.link-type,
146
-.link-type:focus {
147
-  color: #337ab7;
148
-  cursor: pointer;
149
-  &:hover {
150
-    color: rgb(32, 160, 255);
151
-  }
152
-}
153
-
154
-.publishedTag,
155
-.draftTag,
156
-.deletedTag {
157
-  color: #fff;
158
-  background-color: $panGreen;
159
-  line-height: 1;
160
-  text-align: center;
161
-  margin: 0;
162
-  padding: 8px 12px;
163
-  font-size: 14px;
164
-  border-radius: 4px;
165
-  position: absolute;
166
-  left: 20px;
167
-  top: 10px;
168
-}
169
-
170
-.draftTag {
171
-  background-color: $yellow;
172
-}
173
-
174
-.deletedTag {
175
-  background-color: $red;
176
-}
177
-
178
-.input-label {
179
-  font-size: 14px;
180
-  color: #48576a;
181
-  line-height: 1;
182
-  padding: 11px 5px 11px 0;
183
-}
184
-
185
-.clearfix {
186
-  &:after {
187
-    visibility: hidden;
188
-    display: block;
189
-    font-size: 0;
190
-    content: " ";
191
-    clear: both;
192
-    height: 0;
193
-  }
194
-}
195
-
196
-.no-marginLeft {
197
-  .el-checkbox {
198
-    margin: 0 20px 15px 0;
199
-  }
200
-  .el-checkbox+.el-checkbox {
201
-    margin-left: 0px;
202
-  }
203
-}
204
-
205
-.filter-container {
206
-  padding-bottom: 10px;
207
-  .filter-item {
208
-    display: inline-block;
209
-    vertical-align: middle;
210
-    margin-bottom: 10px;
211
-  }
212
-}
213
-
214
-
215
-//refine vue-multiselect plugin
216
-.multiselect {
217
-  line-height: 16px;
218
-}
219
-
220
-.multiselect--active {
221
-  z-index: 1000 !important;
222
-}
223
-
224
-//refine simplemde
225
-.simplemde-container{
226
-  .editor-toolbar.fullscreen,.CodeMirror-fullscreen{
227
-    z-index: 1003;
228
-  }
229
-}
230
-
231
-//暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461
232
-.el-dialog {
233
-  transform: none;
234
-  left: 0;
235
-  position: relative;
236
-  margin: 0 auto;
237
-}
238
-
239
-//github-corner
240
-.github-corner:hover .octo-arm {
241
-  animation: octocat-wave 560ms ease-in-out
242
-}
243
-
244
-@keyframes octocat-wave {
245
-  0%,
246
-  100% {
247
-    transform: rotate(0)
248
-  }
249
-  20%,
250
-  60% {
251
-    transform: rotate(-25deg)
252
-  }
253
-  40%,
254
-  80% {
255
-    transform: rotate(10deg)
256
-  }
257
-}
258
-
259
-@media (max-width:500px) {
260
-  .github-corner:hover .octo-arm {
261
-    animation: none
262
-  }
263
-  .github-corner .octo-arm {
264
-    animation: octocat-wave 560ms ease-in-out
265
-  }
266
-}

+ 0 - 33
src/styles/mixin.scss

@@ -25,36 +25,3 @@
25 25
   height: 100%;
26 26
 }
27 27
 
28
-@mixin pct($pct) {
29
-  width: #{$pct};
30
-  position: relative;
31
-  margin: 0 auto;
32
-}
33
-
34
-@mixin triangle($width, $height, $color, $direction) {
35
-  $width: $width/2;
36
-  $color-border-style: $height solid $color;
37
-  $transparent-border-style: $width solid transparent;
38
-  height: 0;
39
-  width: 0;
40
-  @if $direction==up {
41
-    border-bottom: $color-border-style;
42
-    border-left: $transparent-border-style;
43
-    border-right: $transparent-border-style;
44
-  }
45
-  @else if $direction==right {
46
-    border-left: $color-border-style;
47
-    border-top: $transparent-border-style;
48
-    border-bottom: $transparent-border-style;
49
-  }
50
-  @else if $direction==down {
51
-    border-top: $color-border-style;
52
-    border-left: $transparent-border-style;
53
-    border-right: $transparent-border-style;
54
-  }
55
-  @else if $direction==left {
56
-    border-right: $color-border-style;
57
-    border-top: $transparent-border-style;
58
-    border-bottom: $transparent-border-style;
59
-  }
60
-}

+ 0 - 8
src/utils/createUniqueString.js

@@ -1,8 +0,0 @@
1
-/**
2
- * Created by jiachenpan on 17/3/8.
3
- */
4
-export default function createUniqueString() {
5
-  const timestamp = +new Date() + '';
6
-  const randomNum = parseInt((1 + Math.random()) * 65536) + '';
7
-  return (+(randomNum + timestamp)).toString(32);
8
-}

+ 0 - 144
src/utils/index.js

@@ -57,92 +57,6 @@
57 57
    }
58 58
  }
59 59
 
60
-// 格式化时间
61
- export function getQueryObject(url) {
62
-   url = url == null ? window.location.href : url;
63
-   const search = url.substring(url.lastIndexOf('?') + 1);
64
-   const obj = {};
65
-   const reg = /([^?&=]+)=([^?&=]*)/g;
66
-   search.replace(reg, (rs, $1, $2) => {
67
-     const name = decodeURIComponent($1);
68
-     let val = decodeURIComponent($2);
69
-     val = String(val);
70
-     obj[name] = val;
71
-     return rs;
72
-   });
73
-   return obj;
74
- }
75
-
76
-
77
-/**
78
- *get getByteLen
79
- * @param {Sting} val input value
80
- * @returns {number} output value
81
- */
82
- export function getByteLen(val) {
83
-   let len = 0;
84
-   for (let i = 0; i < val.length; i++) {
85
-     if (val[i].match(/[^\x00-\xff]/ig) != null) {
86
-       len += 1;
87
-     } else { len += 0.5; }
88
-   }
89
-   return Math.floor(len);
90
- }
91
-
92
- export function cleanArray(actual) {
93
-   const newArray = [];
94
-   for (let i = 0; i < actual.length; i++) {
95
-     if (actual[i]) {
96
-       newArray.push(actual[i]);
97
-     }
98
-   }
99
-   return newArray;
100
- }
101
-
102
- export function param(json) {
103
-   if (!json) return '';
104
-   return cleanArray(Object.keys(json).map(key => {
105
-     if (json[key] === undefined) return '';
106
-     return encodeURIComponent(key) + '=' +
107
-            encodeURIComponent(json[key]);
108
-   })).join('&');
109
- }
110
-
111
- export function param2Obj(url) {
112
-   const search = url.split('?')[1];
113
-   return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}')
114
- }
115
-
116
- export function html2Text(val) {
117
-   const div = document.createElement('div');
118
-   div.innerHTML = val;
119
-   return div.textContent || div.innerText;
120
- }
121
-
122
- export function objectMerge(target, source) {
123
-    /* Merges two  objects,
124
-     giving the last one precedence */
125
-
126
-   if (typeof target !== 'object') {
127
-     target = {};
128
-   }
129
-   if (Array.isArray(source)) {
130
-     return source.slice();
131
-   }
132
-   for (const property in source) {
133
-     if (source.hasOwnProperty(property)) {
134
-       const sourceProperty = source[property];
135
-       if (typeof sourceProperty === 'object') {
136
-         target[property] = objectMerge(target[property], sourceProperty);
137
-         continue;
138
-       }
139
-       target[property] = sourceProperty;
140
-     }
141
-   }
142
-   return target;
143
- }
144
-
145
-
146 60
  export function scrollTo(element, to, duration) {
147 61
    if (duration <= 0) return;
148 62
    const difference = to - element.scrollTop;
@@ -154,61 +68,3 @@
154 68
      scrollTo(element, to, duration - 10);
155 69
    }, 10);
156 70
  }
157
-
158
- export function toggleClass(element, className) {
159
-   if (!element || !className) {
160
-     return;
161
-   }
162
-   let classString = element.className;
163
-   const nameIndex = classString.indexOf(className);
164
-   if (nameIndex === -1) {
165
-     classString += '' + className;
166
-   } else {
167
-     classString = classString.substr(0, nameIndex) + classString.substr(nameIndex + className.length);
168
-   }
169
-   element.className = classString;
170
- }
171
-
172
- export const pickerOptions = [
173
-   {
174
-     text: '今天',
175
-     onClick(picker) {
176
-       const end = new Date();
177
-       const start = new Date(new Date().toDateString());
178
-       end.setTime(start.getTime());
179
-       picker.$emit('pick', [start, end]);
180
-     }
181
-   }, {
182
-     text: '最近一周',
183
-     onClick(picker) {
184
-       const end = new Date(new Date().toDateString());
185
-       const start = new Date();
186
-       start.setTime(end.getTime() - 3600 * 1000 * 24 * 7);
187
-       picker.$emit('pick', [start, end]);
188
-     }
189
-   }, {
190
-     text: '最近一个月',
191
-     onClick(picker) {
192
-       const end = new Date(new Date().toDateString());
193
-       const start = new Date();
194
-       start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
195
-       picker.$emit('pick', [start, end]);
196
-     }
197
-   }, {
198
-     text: '最近三个月',
199
-     onClick(picker) {
200
-       const end = new Date(new Date().toDateString());
201
-       const start = new Date();
202
-       start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
203
-       picker.$emit('pick', [start, end]);
204
-     }
205
-   }]
206
-
207
- export function getTime(type) {
208
-   if (type === 'start') {
209
-     return new Date().getTime() - 3600 * 1000 * 24 * 90
210
-   } else {
211
-     return new Date(new Date().toDateString())
212
-   }
213
- }
214
-

+ 0 - 27
src/utils/openWindow.js

@@ -1,27 +0,0 @@
1
-/**
2
- *Created by jiachenpan on 16/11/29.
3
- * @param {Sting} url
4
- * @param {Sting} title
5
- * @param {Number} w
6
- * @param {Number} h
7
- */
8
-
9
-export default function openWindow(url, title, w, h) {
10
-      // Fixes dual-screen position                         Most browsers      Firefox
11
-  const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left;
12
-  const dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top;
13
-
14
-  const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
15
-  const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
16
-
17
-  const left = ((width / 2) - (w / 2)) + dualScreenLeft;
18
-  const top = ((height / 2) - (h / 2)) + dualScreenTop;
19
-  const newWindow = window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
20
-
21
-  // Puts focus on the newWindow
22
-  if (window.focus) {
23
-    newWindow.focus();
24
-  }
25
-}
26
-
27
-

+ 0 - 6
src/utils/validate.js

@@ -20,12 +20,6 @@ export function validateLowerCase(str) {
20 20
   return reg.test(str);
21 21
 }
22 22
 
23
-/* 验证key*/
24
-// export function validateKey(str) {
25
-//     var reg = /^[a-z_\-:]+$/;
26
-//     return reg.test(str);
27
-// }
28
-
29 23
 /* 大写字母*/
30 24
 export function validateUpperCase(str) {
31 25
   const reg = /^[A-Z]+$/;

+ 1 - 1
src/views/layout/AppMain.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-    <section class="app-main" style="min-height: 100%">
2
+    <section class="app-main">
3 3
         <transition name="fade" mode="out-in">
4 4
             <router-view :key="key"></router-view>
5 5
         </transition>

+ 3 - 3
src/views/layout/Layout.vue

@@ -1,11 +1,11 @@
1 1
 <template>
2 2
     <div class="app-wrapper" :class="{hideSidebar:!sidebar.opened}">
3 3
         <div class="sidebar-wrapper">
4
-            <Sidebar class="sidebar-container" />
4
+            <sidebar class="sidebar-container"></sidebar>
5 5
         </div>
6 6
         <div class="main-container">
7
-            <Navbar/>
8
-            <App-main/>
7
+            <navbar></navbar>
8
+            <app-main></app-main>
9 9
         </div>
10 10
     </div>
11 11
 </template>

+ 0 - 5
src/views/layout/Navbar.vue

@@ -13,11 +13,6 @@
13 13
                         首页
14 14
                     </el-dropdown-item>
15 15
                 </router-link>
16
-                <router-link class='inlineBlock' to="/admin/profile">
17
-                    <el-dropdown-item>
18
-                        设置
19
-                    </el-dropdown-item>
20
-                </router-link>
21 16
                 <el-dropdown-item divided><span @click="logout" style="display:block;">退出登录</span></el-dropdown-item>
22 17
             </el-dropdown-menu>
23 18
         </el-dropdown>

+ 3 - 3
src/views/layout/SidebarItem.vue

@@ -3,12 +3,12 @@
3 3
         <template v-for="item in routes">
4 4
             <router-link v-if="!item.hidden&&item.noDropdown&&item.children.length>0" :to="item.path+'/'+item.children[0].path">
5 5
                 <el-menu-item :index="item.path+'/'+item.children[0].path">
6
-                    <wscn-icon-svg v-if='item.icon' :icon-class="item.icon" /> {{item.children[0].name}}
6
+                    <icon-svg v-if='item.icon' :icon-class="item.icon" /> {{item.children[0].name}}
7 7
                 </el-menu-item>
8 8
             </router-link>
9 9
             <el-submenu :index="item.name" v-if="!item.noDropdown&&!item.hidden">
10 10
                 <template slot="title">
11
-                    <wscn-icon-svg v-if='item.icon' :icon-class="item.icon" /> {{item.name}}
11
+                    <icon-svg v-if='item.icon' :icon-class="item.icon" /> {{item.name}}
12 12
                 </template>
13 13
                 <template v-for="child in item.children" v-if='!child.hidden'>
14 14
                     <sidebar-item class='menu-indent' v-if='child.children&&child.children.length>0' :routes='[child]'> </sidebar-item>
@@ -36,7 +36,7 @@
36 36
 </script>
37 37
 
38 38
 <style rel="stylesheet/scss" lang="scss" scoped>
39
-    .wscn-icon {
39
+    .svg-icon {
40 40
         margin-right: 10px;
41 41
     }
42 42
     .hideSidebar .menu-indent{

+ 0 - 45
src/views/layout/TabsView.vue

@@ -1,45 +0,0 @@
1
-<template>
2
-  <div class='tabs-view-container'>
3
-    <router-link class="tabs-view" v-for="tag in Array.from(visitedViews)" :to="tag.path" :key="tag.path">
4
-      <el-tag :closable="true" @close='closeViewTabs(tag,$event)'>
5
-        {{tag.name}}
6
-      </el-tag>
7
-    </router-link>
8
-    </div>
9
-</template>
10
-
11
-<script>
12
-    export default {
13
-      computed: {
14
-        visitedViews() {
15
-          return this.$store.state.app.visitedViews.slice(-6)
16
-        }
17
-      },
18
-      methods: {
19
-        closeViewTabs(view, $event) {
20
-          this.$store.dispatch('delVisitedViews', view)
21
-          $event.preventDefault()
22
-        },
23
-        addViewTabs() {
24
-          this.$store.dispatch('addVisitedViews', this.$route.matched[this.$route.matched.length - 1])
25
-        }
26
-      },
27
-      watch: {
28
-        $route() {
29
-          this.addViewTabs()
30
-        }
31
-      }
32
-    }
33
-</script>
34
-
35
-<style rel="stylesheet/scss" lang="scss" scoped>
36
-  .tabs-view-container{
37
-    display: inline-block;
38
-    vertical-align: top;
39
-    margin-left: 10px;
40
-    .tabs-view{
41
-      margin-left: 10px;
42
-    }
43
-  }
44
-
45
-</style>

+ 7 - 38
src/views/login/index.vue

@@ -5,12 +5,16 @@
5 5
                  class="card-box login-form">
6 6
             <h3 class="title">系统登录</h3>
7 7
             <el-form-item prop="email">
8
-                <span class="svg-container"><wscn-icon-svg icon-class="jiedianyoujian"/></span>
8
+                <span class="svg-container">
9
+                  <icon-svg icon-class="jiedianyoujian"></icon-svg>
10
+                </span>
9 11
                 <el-input name="email" type="text" v-model="loginForm.email" autoComplete="on"
10 12
                           placeholder="邮箱"></el-input>
11 13
             </el-form-item>
12 14
             <el-form-item prop="password">
13
-                <span class="svg-container"><wscn-icon-svg icon-class="mima"/></span>
15
+                <span class="svg-container">
16
+                  <icon-svg icon-class="mima" ></icon-svg>
17
+                </span>
14 18
                 <el-input name="password" type="password" @keyup.enter.native="handleLogin" v-model="loginForm.password"
15 19
                           autoComplete="on" placeholder="密码"></el-input>
16 20
             </el-form-item>
@@ -21,15 +25,11 @@
21 25
             </el-form-item>
22 26
             <div class='tips'>admin账号为:admin@wallstreetcn.com 密码随便填</div>
23 27
             <div class='tips'>editor账号:editor@wallstreetcn.com 密码随便填</div>
24
-            <router-link to="/sendpwd" class="forget-pwd">
25
-                忘记密码?(或首次登录)
26
-            </router-link>
27 28
         </el-form>
28 29
     </div>
29 30
 </template>
30 31
 
31 32
 <script>
32
-    import { mapGetters } from 'vuex';
33 33
     import { isWscnEmail } from '@/utils/validate';
34 34
 
35 35
     export default {
@@ -62,15 +62,9 @@
62 62
                 { required: true, trigger: 'blur', validator: validatePass }
63 63
             ]
64 64
           },
65
-          loading: false,
66
-          showDialog: false
65
+          loading: false
67 66
         }
68 67
       },
69
-      computed: {
70
-        ...mapGetters([
71
-          'auth_type'
72
-        ])
73
-      },
74 68
       methods: {
75 69
         handleLogin() {
76 70
           this.$refs.loginForm.validate(valid => {
@@ -79,7 +73,6 @@
79 73
               this.$store.dispatch('Login', this.loginForm).then(() => {
80 74
                 this.loading = false;
81 75
                 this.$router.push({ path: '/' });
82
-                // this.showDialog = true;
83 76
               }).catch(() => {
84 77
                 this.loading = false;
85 78
               });
@@ -88,31 +81,7 @@
88 81
               return false;
89 82
             }
90 83
           });
91
-        },
92
-        afterQRScan() {
93
-          // const hash = window.location.hash.slice(1);
94
-          // const hashObj = getQueryObject(hash);
95
-          // const originUrl = window.location.origin;
96
-          // history.replaceState({}, '', originUrl);
97
-          // const codeMap = {
98
-          //   wechat: 'code',
99
-          //   tencent: 'code'
100
-          // };
101
-          // const codeName = hashObj[codeMap[this.auth_type]];
102
-          // if (!codeName) {
103
-          //   alert('第三方登录失败');
104
-          // } else {
105
-          //   this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
106
-          //     this.$router.push({ path: '/' });
107
-          //   });
108
-          // }
109 84
         }
110
-      },
111
-      created() {
112
-        // window.addEventListener('hashchange', this.afterQRScan);
113
-      },
114
-      destroyed() {
115
-        // window.removeEventListener('hashchange', this.afterQRScan);
116 85
       }
117 86
     }
118 87
 </script>