From ea60729c0a2f69a482b89d9c118789d227119f5a Mon Sep 17 00:00:00 2001
From: Pan
Date: Wed, 21 Nov 2018 12:36:20 +0800
Subject: [PATCH 01/60] add sponsors
---
README.md | 5 +++++
README.zh-CN.md | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/README.md b/README.md
index e2d9c034..d0ff7d74 100644
--- a/README.md
+++ b/README.md
@@ -69,6 +69,11 @@ Understanding and learning this knowledge in advance will greatly help the use o
+## Sponsors
+Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor]](https://www.patreon.com/panjiachen)
+
+Admin Dashboard Templates made with Vue, React and Angular.
+
## Features
```
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 28fc0240..55882115 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -81,6 +81,11 @@
+## Sponsors
+Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor]](https://www.patreon.com/panjiachen)
+
+Admin Dashboard Templates made with Vue, React and Angular.
+
## 功能
```
From c6843f9646451fda65256441ad4434068470e351 Mon Sep 17 00:00:00 2001
From: Pan
Date: Mon, 26 Nov 2018 17:53:06 +0800
Subject: [PATCH 02/60] update vue-router to fixed url path for non ascii urls
#1362
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index d795d163..36045c4d 100644
--- a/package.json
+++ b/package.json
@@ -57,7 +57,7 @@
"vue": "2.5.17",
"vue-count-to": "1.0.13",
"vue-i18n": "7.3.2",
- "vue-router": "3.0.1",
+ "vue-router": "3.0.2",
"vue-splitpane": "1.0.2",
"vuedraggable": "^2.16.0",
"vuex": "3.0.1",
From 54dc9ddfaaa765d8245bac1005fefa9feaa9e54b Mon Sep 17 00:00:00 2001
From: Heedong Im
Date: Mon, 26 Nov 2018 19:17:06 +0900
Subject: [PATCH 03/60] fix[Pagination]: apply PageSizes property to
el-pagination (#1355)
Apply PageSizes property to el-pagination
---
src/components/Pagination/index.vue | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue
index 9698232b..8d104e84 100644
--- a/src/components/Pagination/index.vue
+++ b/src/components/Pagination/index.vue
@@ -5,6 +5,7 @@
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
+ :page-sizes="pageSizes"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
From b37a789f636004c23b55ce92aaa51bc21e1f9be7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Wed, 28 Nov 2018 11:05:41 +0800
Subject: [PATCH 04/60] add tui.editor (#1374)
---
package.json | 3 +-
.../MarkdownEditor/defaultOptions.js | 31 ++++
src/components/MarkdownEditor/index.vue | 171 +++++++++---------
src/views/components-demo/markdown.vue | 63 +++++--
4 files changed, 166 insertions(+), 102 deletions(-)
create mode 100644 src/components/MarkdownEditor/defaultOptions.js
diff --git a/package.json b/package.json
index 36045c4d..e02be220 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,6 @@
"echarts": "4.1.0",
"element-ui": "2.4.6",
"file-saver": "1.3.8",
- "font-awesome": "4.7.0",
"js-cookie": "2.2.0",
"jsonlint": "1.6.3",
"jszip": "3.1.5",
@@ -52,8 +51,8 @@
"nprogress": "0.2.0",
"screenfull": "3.3.3",
"showdown": "1.8.6",
- "simplemde": "1.11.2",
"sortablejs": "1.7.0",
+ "tui-editor": "1.2.7",
"vue": "2.5.17",
"vue-count-to": "1.0.13",
"vue-i18n": "7.3.2",
diff --git a/src/components/MarkdownEditor/defaultOptions.js b/src/components/MarkdownEditor/defaultOptions.js
new file mode 100644
index 00000000..303aa13d
--- /dev/null
+++ b/src/components/MarkdownEditor/defaultOptions.js
@@ -0,0 +1,31 @@
+// doc: https://nhnent.github.io/tui.editor/api/latest/ToastUIEditor.html#ToastUIEditor
+export default {
+ minHeight: '200px',
+ previewStyle: 'vertical',
+ useCommandShortcut: true,
+ useDefaultHTMLSanitizer: true,
+ usageStatistics: false,
+ hideModeSwitch: false,
+ toolbarItems: [
+ 'heading',
+ 'bold',
+ 'italic',
+ 'strike',
+ 'divider',
+ 'hr',
+ 'quote',
+ 'divider',
+ 'ul',
+ 'ol',
+ 'task',
+ 'indent',
+ 'outdent',
+ 'divider',
+ 'table',
+ 'image',
+ 'link',
+ 'divider',
+ 'code',
+ 'codeblock'
+ ]
+}
diff --git a/src/components/MarkdownEditor/index.vue b/src/components/MarkdownEditor/index.vue
index 9847668a..4a6d8b0f 100644
--- a/src/components/MarkdownEditor/index.vue
+++ b/src/components/MarkdownEditor/index.vue
@@ -1,16 +1,18 @@
-
-
-
+
-
-
diff --git a/src/views/components-demo/markdown.vue b/src/views/components-demo/markdown.vue
index f60911d0..5fb39569 100644
--- a/src/views/components-demo/markdown.vue
+++ b/src/views/components-demo/markdown.vue
@@ -1,15 +1,40 @@
+
Markdown is based on
- simplemde-markdown-editor ,Simply encapsulated in Vue.
+ tui.editor ,Simply encapsulated in Vue.
相关文章
+
-
+ Basic:
+
-
To HTML
+
+
+ Markdown Mode:
+
+
+
+
+ Customize Toolbar:
+
+
+
+
+ I18n:
+
+
+
+
+
Get HTML
+
@@ -17,32 +42,46 @@
import MarkdownEditor from '@/components/MarkdownEditor'
const content = `
-**this is test**
+**This is test**
* vue
* element
* webpack
-## Simplemde
`
-
export default {
name: 'MarkdownDemo',
components: { MarkdownEditor },
data() {
return {
content: content,
- html: ''
+ html: '',
+ languageTypeList: {
+ 'en': 'en_US',
+ 'zh': 'zh_CN',
+ 'es': 'es_ES'
+ }
+ }
+ },
+ computed: {
+ language() {
+ return this.languageTypeList[this.$store.getters.language]
}
},
methods: {
- markdown2Html() {
- import('showdown').then(showdown => {
- const converter = new showdown.Converter()
- this.html = converter.makeHtml(this.content)
- })
+ getHtml() {
+ this.html = this.$refs.markdownEditor.getHtml()
+ console.log(this.html)
}
}
}
+
From c68e68897bf8b2807c6ab939194cbf84eb7b2e3a Mon Sep 17 00:00:00 2001
From: Pan
Date: Wed, 28 Nov 2018 14:24:30 +0800
Subject: [PATCH 05/60] tweak
---
src/views/components-demo/markdown.vue | 4 ++--
src/views/login/index.vue | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/views/components-demo/markdown.vue b/src/views/components-demo/markdown.vue
index 5fb39569..de2e817e 100644
--- a/src/views/components-demo/markdown.vue
+++ b/src/views/components-demo/markdown.vue
@@ -3,8 +3,8 @@
Markdown is based on
tui.editor ,Simply encapsulated in Vue.
-
- 相关文章
+
+ Documentation
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index d25b519d..bbd3287b 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -107,7 +107,6 @@ export default {
},
immediate: true
}
-
},
created() {
// window.addEventListener('hashchange', this.afterQRScan)
From 4d6e9a535835e192b6b83dc5348e302b383e9e9c Mon Sep 17 00:00:00 2001
From: Pan
Date: Thu, 29 Nov 2018 18:17:30 +0800
Subject: [PATCH 06/60] fix return back bug
---
src/views/errorPage/404.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/errorPage/404.vue b/src/views/errorPage/404.vue
index c3eafea0..6483fd5f 100644
--- a/src/views/errorPage/404.vue
+++ b/src/views/errorPage/404.vue
@@ -14,7 +14,7 @@
{{ message }}
请检查您输入的网址是否正确,请点击以下按钮返回主页或者发送错误报告
- 返回首页
+ 返回首页
From 46d6f455afb596b6d05a8a61676cbc52ba9214c6 Mon Sep 17 00:00:00 2001
From: Pan
Date: Tue, 4 Dec 2018 14:00:30 +0800
Subject: [PATCH 07/60] fix[Guide-Page]: fix guide page style bug #1391
---
package.json | 2 +-
src/views/guide/defineSteps.js | 3 ++-
src/views/guide/index.vue | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index e02be220..75d88dd4 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,7 @@
"clipboard": "1.7.1",
"codemirror": "5.39.2",
"connect": "3.6.6",
- "driver.js": "0.5.2",
+ "driver.js": "0.8.1",
"dropzone": "5.2.0",
"echarts": "4.1.0",
"element-ui": "2.4.6",
diff --git a/src/views/guide/defineSteps.js b/src/views/guide/defineSteps.js
index fde78926..405a3f72 100644
--- a/src/views/guide/defineSteps.js
+++ b/src/views/guide/defineSteps.js
@@ -45,7 +45,8 @@ const steps = [
title: 'Tags view',
description: 'The history of the page you visited',
position: 'bottom'
- }
+ },
+ padding: 0
}
]
diff --git a/src/views/guide/index.vue b/src/views/guide/index.vue
index c30c52cf..49502aef 100644
--- a/src/views/guide/index.vue
+++ b/src/views/guide/index.vue
@@ -10,7 +10,7 @@
+
+
diff --git a/src/views/pdf/index.vue b/src/views/pdf/index.vue
new file mode 100644
index 00000000..b7728152
--- /dev/null
+++ b/src/views/pdf/index.vue
@@ -0,0 +1,9 @@
+
+
+ {{ $t('pdf.tips') }}
+
+ Click to download PDF
+
+
+
+
From cc7572820e7cec835548bcc54e2728be4c466f97 Mon Sep 17 00:00:00 2001
From: Pan
Date: Thu, 27 Dec 2018 18:19:11 +0800
Subject: [PATCH 17/60] perf[v-permission]: refine v-permission demo
---
src/lang/en.js | 3 +-
src/lang/es.js | 3 +-
src/lang/zh.js | 3 +-
src/views/permission/directive.vue | 71 +++++++++++++++++++++---------
4 files changed, 55 insertions(+), 25 deletions(-)
diff --git a/src/lang/en.js b/src/lang/en.js
index 656b746b..2af355b1 100644
--- a/src/lang/en.js
+++ b/src/lang/en.js
@@ -87,7 +87,8 @@ export default {
},
permission: {
roles: 'Your roles',
- switchRoles: 'Switch roles'
+ switchRoles: 'Switch roles',
+ tips: 'In some cases it is not suitable to use v-permission, such as element Tab component or el-table-column and other asynchronous rendering dom cases which can only be achieved by manually setting the v-if.'
},
guide: {
description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ',
diff --git a/src/lang/es.js b/src/lang/es.js
index 69218ad2..1268f083 100755
--- a/src/lang/es.js
+++ b/src/lang/es.js
@@ -87,7 +87,8 @@ export default {
},
permission: {
roles: 'Tus permisos',
- switchRoles: 'Cambiar permisos'
+ switchRoles: 'Cambiar permisos',
+ tips: 'In some cases it is not suitable to use v-permission, such as element Tab component or el-table-column and other asynchronous rendering dom cases which can only be achieved by manually setting the v-if.'
},
guide: {
description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ',
diff --git a/src/lang/zh.js b/src/lang/zh.js
index 021a5fa7..4371713f 100644
--- a/src/lang/zh.js
+++ b/src/lang/zh.js
@@ -87,7 +87,8 @@ export default {
},
permission: {
roles: '你的权限',
- switchRoles: '切换权限'
+ switchRoles: '切换权限',
+ tips: '在某些情况下,不适合使用 v-permission。例如:Element-UI 的 Tab 组件或 el-table-column 以及其它动态渲染 dom 的场景。你只能通过手动设置 v-if 来实现。'
},
guide: {
description: '引导页对于一些第一次进入项目的人很有用,你可以简单介绍下项目的功能。本 Demo 是基于',
diff --git a/src/views/permission/directive.vue b/src/views/permission/directive.vue
index 2817f1c5..df277ddc 100644
--- a/src/views/permission/directive.vue
+++ b/src/views/permission/directive.vue
@@ -2,29 +2,53 @@
-
- Only
- admin can see this
-
-
- Only
- editor can see this
-
-
- Both
- admin and
- editor can see this
-
+
+
+ Only
+ admin can see this
+
+ v-permission="['admin']"
+
+
+
+
+ Only
+ editor can see this
+
+ v-permission="['editor']"
+
+
+
+
+ Both
+ admin and
+ editor can see this
+
+ v-permission="['admin','editor']"
+
-
-
In some cases it is not suitable to use v-permission, such as element Tab component which can only be achieved by manually setting the v-if.
+
+
+ {{ $t('permission.tips') }}
e.g.
-
- Admin can see this
- Editor can see this
- Both admin or editor can see this
+
+
+
+ Admin can see this
+ v-if="checkPermission(['admin'])"
+
+
+
+ Editor can see this
+ v-if="checkPermission(['editor'])"
+
+
+
+ Both admin or editor can see this
+ v-if="checkPermission(['admin','editor'])"
+
@@ -57,14 +81,17 @@ export default{
.app-container {
/deep/ .permission-alert {
width: 320px;
- margin-top: 30px;
+ margin-top: 15px;
background-color: #f0f9eb;
color: #67c23a;
padding: 8px 16px;
border-radius: 4px;
- display: block;
+ display: inline-block;
}
- /deep/ .permission-tag{
+ /deep/ .permission-sourceCode {
+ margin-left: 15px;
+ }
+ /deep/ .permission-tag {
background-color: #ecf5ff;
}
}
From 311796a14b034fdd6e670fbb0f415dc12f3a3df6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Fri, 28 Dec 2018 15:28:26 +0800
Subject: [PATCH 18/60] perf[Sidebar]: refine sidebar store #1473 (#1474)
---
src/store/modules/app.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/store/modules/app.js b/src/store/modules/app.js
index bc4fb478..fba4b05c 100644
--- a/src/store/modules/app.js
+++ b/src/store/modules/app.js
@@ -3,7 +3,7 @@ import Cookies from 'js-cookie'
const app = {
state: {
sidebar: {
- opened: !+Cookies.get('sidebarStatus'),
+ opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
withoutAnimation: false
},
device: 'desktop',
@@ -12,16 +12,16 @@ const app = {
},
mutations: {
TOGGLE_SIDEBAR: state => {
+ state.sidebar.opened = !state.sidebar.opened
+ state.sidebar.withoutAnimation = false
if (state.sidebar.opened) {
Cookies.set('sidebarStatus', 1)
} else {
Cookies.set('sidebarStatus', 0)
}
- state.sidebar.opened = !state.sidebar.opened
- state.sidebar.withoutAnimation = false
},
CLOSE_SIDEBAR: (state, withoutAnimation) => {
- Cookies.set('sidebarStatus', 1)
+ Cookies.set('sidebarStatus', 0)
state.sidebar.opened = false
state.sidebar.withoutAnimation = withoutAnimation
},
From c98d5787575e6048a7a65f1aed45cafcf7d3acd8 Mon Sep 17 00:00:00 2001
From: Pan
Date: Mon, 31 Dec 2018 21:22:20 +0800
Subject: [PATCH 19/60] [release] 3.10.0
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 75d88dd4..66bfe789 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-element-admin",
- "version": "3.9.3",
+ "version": "3.10.0",
"description": "A magical vue admin. Typical templates for enterprise applications. Newest development stack of vue. Lots of awesome features",
"author": "Pan ",
"license": "MIT",
From 3dd29ab07abba639e5ab581e699d3c4b03d53fbc Mon Sep 17 00:00:00 2001
From: Pan
Date: Wed, 9 Jan 2019 14:48:19 +0800
Subject: [PATCH 20/60] chore: update webpack-dev-server
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 66bfe789..8ba9aadf 100644
--- a/package.json
+++ b/package.json
@@ -115,7 +115,7 @@
"webpack": "4.16.5",
"webpack-bundle-analyzer": "2.13.1",
"webpack-cli": "3.1.0",
- "webpack-dev-server": "3.1.5",
+ "webpack-dev-server": "3.1.14",
"webpack-merge": "4.1.4"
},
"engines": {
From 68a19d55deddec5c34ee2f81f49b9407b184a6ab Mon Sep 17 00:00:00 2001
From: Pan
Date: Wed, 9 Jan 2019 14:53:36 +0800
Subject: [PATCH 21/60] fix[chore]: fix error when enable gzip
---
build/webpack.prod.conf.js | 1 -
package.json | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js
index 946a134a..4f84e0c6 100644
--- a/build/webpack.prod.conf.js
+++ b/build/webpack.prod.conf.js
@@ -150,7 +150,6 @@ if (config.build.productionGzip) {
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
- asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' + config.build.productionGzipExtensions.join('|') + ')$'
diff --git a/package.json b/package.json
index 8ba9aadf..e5b0b9ec 100644
--- a/package.json
+++ b/package.json
@@ -75,6 +75,7 @@
"babel-preset-env": "1.7.0",
"babel-preset-stage-2": "6.24.1",
"chalk": "2.4.1",
+ "compression-webpack-plugin": "2.0.0",
"copy-webpack-plugin": "4.5.2",
"cross-env": "5.2.0",
"css-loader": "1.0.0",
From 9cea3c3abe31746c044db1388d24ee86e343a623 Mon Sep 17 00:00:00 2001
From: Pan
Date: Wed, 9 Jan 2019 16:04:24 +0800
Subject: [PATCH 22/60] refine: GetUserInfo error message
---
src/permission.js | 2 +-
src/store/modules/user.js | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/permission.js b/src/permission.js
index 81f9d113..e556cb00 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -33,7 +33,7 @@ router.beforeEach((to, from, next) => {
})
}).catch((err) => {
store.dispatch('FedLogOut').then(() => {
- Message.error(err || 'Verification failed, please login again')
+ Message.error(err)
next({ path: '/' })
})
})
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 0f7e2296..38e81a36 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -63,15 +63,16 @@ const user = {
GetUserInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getUserInfo(state.token).then(response => {
- if (!response.data) { // 由于mockjs 不支持自定义状态码只能这样hack
- reject('error')
+ // 由于mockjs 不支持自定义状态码只能这样hack
+ if (!response.data) {
+ reject('Verification failed, please login again.')
}
const data = response.data
if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', data.roles)
} else {
- reject('getInfo: roles must be a non-null array !')
+ reject('getInfo: roles must be a non-null array!')
}
commit('SET_NAME', data.name)
From 1bb9283eddbba310b72c876dc8807a66b76c26c8 Mon Sep 17 00:00:00 2001
From: Nikita Sobolev
Date: Thu, 10 Jan 2019 05:05:17 +0300
Subject: [PATCH 23/60] fix typo (#1505)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d0ff7d74..cf67c757 100644
--- a/README.md
+++ b/README.md
@@ -92,7 +92,7 @@ Become a sponsor and get your logo on our README on GitHub with a link to your s
- Multiple dynamic themes
- Dynamic sidebar (supports multi-level routing)
- Dynamic breadcrumb
- - Tags-view(Tab page Support right-click operation)
+ - Tags-view (Tab page Support right-click operation)
- Svg Sprite
- Mock data
- Screenfull
From 5ea614fe5d1fead70f62879410d2cd4358b34e7c Mon Sep 17 00:00:00 2001
From: Duy Nguyen Hoang
Date: Fri, 11 Jan 2019 15:37:59 +0800
Subject: [PATCH 24/60] perf: add sidebar width to variables.scss (#1494)
---
src/styles/sidebar.scss | 18 +++++++++---------
src/styles/variables.scss | 2 ++
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss
index faa7366e..2de9fd91 100644
--- a/src/styles/sidebar.scss
+++ b/src/styles/sidebar.scss
@@ -1,15 +1,15 @@
#app {
- // 主体区域
+ // 主体区域 Main container
.main-container {
min-height: 100%;
transition: margin-left .28s;
- margin-left: 180px;
+ margin-left: $sideBarWidth;
position: relative;
}
- // 侧边栏
+ // 侧边栏 Sidebar container
.sidebar-container {
transition: width 0.28s;
- width: 180px !important;
+ width: $sideBarWidth !important;
height: 100%;
position: fixed;
font-size: 0px;
@@ -90,29 +90,29 @@
}
.sidebar-container .nest-menu .el-submenu>.el-submenu__title,
.sidebar-container .el-submenu .el-menu-item {
- min-width: 180px !important;
+ min-width: $sideBarWidth !important;
background-color: $subMenuBg !important;
&:hover {
background-color: $menuHover !important;
}
}
.el-menu--collapse .el-menu .el-submenu {
- min-width: 180px !important;
+ min-width: $sideBarWidth !important;
}
- //适配移动端
+ // 适配移动端, Mobile responsive
.mobile {
.main-container {
margin-left: 0px;
}
.sidebar-container {
transition: transform .28s;
- width: 180px !important;
+ width: $sideBarWidth !important;
}
&.hideSidebar {
.sidebar-container {
transition-duration: 0.3s;
- transform: translate3d(-180px, 0, 0);
+ transform: translate3d(-$sideBarWidth, 0, 0);
}
}
}
diff --git a/src/styles/variables.scss b/src/styles/variables.scss
index acc77a82..1af649c4 100644
--- a/src/styles/variables.scss
+++ b/src/styles/variables.scss
@@ -11,3 +11,5 @@ $panGreen: #30B08F;
$menuBg:#304156;
$subMenuBg:#1f2d3d;
$menuHover:#001528;
+
+$sideBarWidth: 180px;
From c54e99d0a9c9a5ec18300ad60409b8b444771cd9 Mon Sep 17 00:00:00 2001
From: Pan
Date: Fri, 11 Jan 2019 15:42:53 +0800
Subject: [PATCH 25/60] tweak
---
src/styles/btn.scss | 7 +-
src/styles/element-ui.scss | 129 +++++++++++++++++++------------------
src/styles/index.scss | 20 ++++--
src/styles/mixin.scss | 6 ++
src/styles/sidebar.scss | 40 ++++++++++--
src/styles/transition.scss | 3 +-
src/styles/variables.scss | 2 +-
7 files changed, 128 insertions(+), 79 deletions(-)
diff --git a/src/styles/btn.scss b/src/styles/btn.scss
index 0c5ee768..e6ba1a8e 100644
--- a/src/styles/btn.scss
+++ b/src/styles/btn.scss
@@ -2,8 +2,10 @@
@mixin colorBtn($color) {
background: $color;
+
&:hover {
color: $color;
+
&:before,
&:after {
background: $color;
@@ -49,14 +51,17 @@
transition: 600ms ease all;
position: relative;
display: inline-block;
+
&:hover {
background: #fff;
+
&:before,
&:after {
width: 100%;
transition: 600ms ease all;
}
}
+
&:before,
&:after {
content: '';
@@ -67,6 +72,7 @@
width: 0;
transition: 400ms ease all;
}
+
&::after {
right: inherit;
top: inherit;
@@ -91,4 +97,3 @@
font-size: 14px;
border-radius: 4px;
}
-
diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss
index dc59591e..494dcfa4 100644
--- a/src/styles/element-ui.scss
+++ b/src/styles/element-ui.scss
@@ -1,82 +1,85 @@
- //覆盖一些element-ui样式
+//覆盖一些element-ui样式
- .el-breadcrumb__inner, .el-breadcrumb__inner a{
- font-weight: 400!important;
+.el-breadcrumb__inner,
+.el-breadcrumb__inner a {
+ font-weight: 400 !important;
}
- .el-upload {
- input[type="file"] {
- display: none !important;
- }
- }
+.el-upload {
+ input[type="file"] {
+ display: none !important;
+ }
+}
- .el-upload__input {
- display: none;
- }
+.el-upload__input {
+ display: none;
+}
- .cell {
- .el-tag {
- margin-right: 0px;
- }
- }
+.cell {
+ .el-tag {
+ margin-right: 0px;
+ }
+}
- .small-padding {
- .cell {
- padding-left: 5px;
- padding-right: 5px;
- }
- }
+.small-padding {
+ .cell {
+ padding-left: 5px;
+ padding-right: 5px;
+ }
+}
- .fixed-width{
- .el-button--mini{
+.fixed-width {
+ .el-button--mini {
padding: 7px 10px;
width: 60px;
}
- }
+}
- .status-col {
- .cell {
- padding: 0 10px;
- text-align: center;
- .el-tag {
- margin-right: 0px;
- }
- }
- }
+.status-col {
+ .cell {
+ padding: 0 10px;
+ text-align: center;
- //暂时性解决dialog 问题 https://github.com/ElemeFE/element/issues/2461
- .el-dialog {
- transform: none;
- left: 0;
- position: relative;
- margin: 0 auto;
- }
+ .el-tag {
+ margin-right: 0px;
+ }
+ }
+}
- //文章页textarea修改样式
- .article-textarea {
- textarea {
- padding-right: 40px;
- resize: none;
- border: none;
- border-radius: 0px;
- border-bottom: 1px solid #bfcbd9;
- }
- }
+//暂时性解决dialog 问题 https://github.com/ElemeFE/element/issues/2461
+.el-dialog {
+ transform: none;
+ left: 0;
+ position: relative;
+ margin: 0 auto;
+}
- //element ui upload
- .upload-container {
- .el-upload {
- width: 100%;
- .el-upload-dragger {
- width: 100%;
- height: 200px;
- }
- }
- }
+//文章页textarea修改样式
+.article-textarea {
+ textarea {
+ padding-right: 40px;
+ resize: none;
+ border: none;
+ border-radius: 0px;
+ border-bottom: 1px solid #bfcbd9;
+ }
+}
+
+//element ui upload
+.upload-container {
+ .el-upload {
+ width: 100%;
+
+ .el-upload-dragger {
+ width: 100%;
+ height: 200px;
+ }
+ }
+}
//dropdown
- .el-dropdown-menu{
- a{
+.el-dropdown-menu {
+ a {
display: block
}
}
diff --git a/src/styles/index.scss b/src/styles/index.scss
index b6fd924e..93f2157e 100644
--- a/src/styles/index.scss
+++ b/src/styles/index.scss
@@ -22,7 +22,7 @@ html {
box-sizing: border-box;
}
-#app{
+#app {
height: 100%;
}
@@ -53,9 +53,9 @@ a:hover {
text-decoration: none;
}
-div:focus{
+div:focus {
outline: none;
- }
+}
.fr {
float: right;
@@ -104,23 +104,26 @@ code {
line-height: 36px;
font-size: 15px;
font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
+
a {
color: #337ab7;
cursor: pointer;
+
&:hover {
color: rgb(32, 160, 255);
}
}
}
-.warn-content{
- background: rgba(66,185,131,.1);
+.warn-content {
+ background: rgba(66, 185, 131, .1);
border-radius: 2px;
padding: 16px;
padding: 1rem;
line-height: 1.6rem;
word-spacing: .05rem;
- a{
+
+ a {
color: #42b983;
font-weight: 600;
}
@@ -153,13 +156,16 @@ code {
padding-right: 20px;
transition: 600ms ease position;
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%);
+
.subtitle {
font-size: 20px;
color: #fff;
}
+
&.draft {
background: #d0d0d0;
}
+
&.deleted {
background: #d0d0d0;
}
@@ -169,6 +175,7 @@ code {
.link-type:focus {
color: #337ab7;
cursor: pointer;
+
&:hover {
color: rgb(32, 160, 255);
}
@@ -176,6 +183,7 @@ code {
.filter-container {
padding-bottom: 10px;
+
.filter-item {
display: inline-block;
vertical-align: middle;
diff --git a/src/styles/mixin.scss b/src/styles/mixin.scss
index 822ab92a..06fa0612 100644
--- a/src/styles/mixin.scss
+++ b/src/styles/mixin.scss
@@ -10,9 +10,11 @@
&::-webkit-scrollbar-track-piece {
background: #d3dce6;
}
+
&::-webkit-scrollbar {
width: 6px;
}
+
&::-webkit-scrollbar-thumb {
background: #99a9bf;
border-radius: 20px;
@@ -37,21 +39,25 @@
$transparent-border-style: $width solid transparent;
height: 0;
width: 0;
+
@if $direction==up {
border-bottom: $color-border-style;
border-left: $transparent-border-style;
border-right: $transparent-border-style;
}
+
@else if $direction==right {
border-left: $color-border-style;
border-top: $transparent-border-style;
border-bottom: $transparent-border-style;
}
+
@else if $direction==down {
border-top: $color-border-style;
border-left: $transparent-border-style;
border-right: $transparent-border-style;
}
+
@else if $direction==left {
border-right: $color-border-style;
border-top: $transparent-border-style;
diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss
index 2de9fd91..723f9a12 100644
--- a/src/styles/sidebar.scss
+++ b/src/styles/sidebar.scss
@@ -1,4 +1,5 @@
#app {
+
// 主体区域 Main container
.main-container {
min-height: 100%;
@@ -6,6 +7,7 @@
margin-left: $sideBarWidth;
position: relative;
}
+
// 侧边栏 Sidebar container
.sidebar-container {
transition: width 0.28s;
@@ -18,62 +20,79 @@
left: 0;
z-index: 1001;
overflow: hidden;
+
//reset element-ui css
.horizontal-collapse-transition {
transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
}
+
.scrollbar-wrapper {
- overflow-x: hidden!important;
+ overflow-x: hidden !important;
+
.el-scrollbar__view {
height: 100%;
}
}
- .el-scrollbar__bar.is-vertical{
+
+ .el-scrollbar__bar.is-vertical {
right: 0px;
}
+
.is-horizontal {
display: none;
}
+
a {
display: inline-block;
width: 100%;
overflow: hidden;
}
+
.svg-icon {
margin-right: 16px;
}
+
.el-menu {
border: none;
height: 100%;
width: 100% !important;
}
- .is-active > .el-submenu__title{
- color: #f4f4f5!important;
+
+ .is-active>.el-submenu__title {
+ color: #f4f4f5 !important;
}
}
+
.hideSidebar {
.sidebar-container {
width: 36px !important;
}
+
.main-container {
margin-left: 36px;
}
+
.submenu-title-noDropdown {
padding-left: 10px !important;
position: relative;
+
.el-tooltip {
padding: 0 10px !important;
}
}
+
.el-submenu {
overflow: hidden;
+
&>.el-submenu__title {
padding-left: 10px !important;
+
.el-submenu__icon-arrow {
display: none;
}
}
}
+
.el-menu--collapse {
.el-submenu {
&>.el-submenu__title {
@@ -88,14 +107,17 @@
}
}
}
+
.sidebar-container .nest-menu .el-submenu>.el-submenu__title,
.sidebar-container .el-submenu .el-menu-item {
min-width: $sideBarWidth !important;
background-color: $subMenuBg !important;
+
&:hover {
background-color: $menuHover !important;
}
}
+
.el-menu--collapse .el-menu .el-submenu {
min-width: $sideBarWidth !important;
}
@@ -105,10 +127,12 @@
.main-container {
margin-left: 0px;
}
+
.sidebar-container {
transition: transform .28s;
width: $sideBarWidth !important;
}
+
&.hideSidebar {
.sidebar-container {
transition-duration: 0.3s;
@@ -116,7 +140,9 @@
}
}
}
+
.withoutAnimation {
+
.main-container,
.sidebar-container {
transition: none;
@@ -124,9 +150,9 @@
}
}
-.el-menu--vertical{
- & >.el-menu{
- .svg-icon{
+.el-menu--vertical {
+ &>.el-menu {
+ .svg-icon {
margin-right: 16px;
}
}
diff --git a/src/styles/transition.scss b/src/styles/transition.scss
index 04e16279..ab68317d 100644
--- a/src/styles/transition.scss
+++ b/src/styles/transition.scss
@@ -16,10 +16,12 @@
.fade-transform-enter-active {
transition: all .5s;
}
+
.fade-transform-enter {
opacity: 0;
transform: translateX(-30px);
}
+
.fade-transform-leave-to {
opacity: 0;
transform: translateX(30px);
@@ -44,4 +46,3 @@
.breadcrumb-leave-active {
position: absolute;
}
-
diff --git a/src/styles/variables.scss b/src/styles/variables.scss
index 1af649c4..09c3e9b0 100644
--- a/src/styles/variables.scss
+++ b/src/styles/variables.scss
@@ -1,3 +1,4 @@
+// base color
$blue:#324157;
$light-blue:#3A71A8;
$red:#C03639;
@@ -11,5 +12,4 @@ $panGreen: #30B08F;
$menuBg:#304156;
$subMenuBg:#1f2d3d;
$menuHover:#001528;
-
$sideBarWidth: 180px;
From 109c393cc6ee0cb1fc7fe097645cd4ddf1bf980a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Mon, 14 Jan 2019 14:07:56 +0800
Subject: [PATCH 26/60] fix[ThemePicker]: fixed bug when oldVal is null (#1517)
---
src/components/ThemePicker/index.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue
index e797d6c2..5d1ff8bd 100644
--- a/src/components/ThemePicker/index.vue
+++ b/src/components/ThemePicker/index.vue
@@ -18,7 +18,8 @@ export default {
}
},
watch: {
- theme(val, oldVal) {
+ theme(val) {
+ const oldVal = this.theme
if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
From 77a40745bb702e3f99ce1d2e7110ad3cb7202c69 Mon Sep 17 00:00:00 2001
From: Pan
Date: Tue, 15 Jan 2019 14:14:39 +0800
Subject: [PATCH 27/60] update README.md
---
README.zh-CN.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 55882115..d6cacf56 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -40,7 +40,7 @@
- [Wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
-- [Donate](https://panjiachen.github.io/vue-element-admin-site/zh/donate/)
+- [Donate](https://panjiachen.gitee.io/vue-element-admin-site/zh/donate)
- [Gitee](https://panjiachen.gitee.io/vue-element-admin/) 国内用户可访问该地址在线预览
@@ -214,6 +214,8 @@ Detailed changes for each release are documented in the [release notes](https://
如果你觉得这个项目帮助到了你,你可以帮作者买一杯果汁表示鼓励 :tropical_drink:

+[更多捐赠方式](https://panjiachen.gitee.io/vue-element-admin-site/zh/donate)
+
[Paypal Me](https://www.paypal.me/panfree23)
## Browsers support
From f767fab4cc085361d6177c8ddd492cf4cf791f94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Tue, 15 Jan 2019 16:36:03 +0800
Subject: [PATCH 28/60] fix[Breadcrumb]: fixed eslint error (#1521)
---
src/components/Breadcrumb/index.vue | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue
index 4b321e06..5bc7a1b8 100644
--- a/src/components/Breadcrumb/index.vue
+++ b/src/components/Breadcrumb/index.vue
@@ -1,7 +1,7 @@
-
+
{{
generateTitle(item.meta.title) }}
{{ generateTitle(item.meta.title) }}
@@ -31,16 +31,14 @@ export default {
methods: {
generateTitle,
getBreadcrumb() {
- let matched = this.$route.matched.filter(item => {
- if (item.name) {
- return true
- }
- })
+ let matched = this.$route.matched.filter(item => item.name)
+
const first = matched[0]
if (first && first.name.trim().toLocaleLowerCase() !== 'Dashboard'.toLocaleLowerCase()) {
matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched)
}
- this.levelList = matched
+
+ this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
},
pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
From d84a17688d3717a649dabf72e5e2213d0887f2db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Wed, 16 Jan 2019 10:18:32 +0800
Subject: [PATCH 29/60] fix[DndList]: fixed drag bug (#1527)
https://github.com/PanJiaChen/vue-element-admin/issues/1524
---
src/components/DndList/index.vue | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/src/components/DndList/index.vue b/src/components/DndList/index.vue
index 43e0bb28..7587daa7 100644
--- a/src/components/DndList/index.vue
+++ b/src/components/DndList/index.vue
@@ -4,7 +4,7 @@
{{ list1Title }}
-
[{{ element.author }}] {{ element.title }}
+
{{ element.id }}[{{ element.author }}] {{ element.title }}
@@ -15,9 +15,9 @@
{{ list2Title }}
-
-
-
[{{ element.author }}] {{ element.title }}
+
+
+
{{ element.id }} [{{ element.author }}] {{ element.title }}
@@ -60,16 +60,6 @@ export default {
default: '48%'
}
},
- computed: {
- filterList2() {
- return this.list2.filter(v => {
- if (this.isNotInList1(v)) {
- return v
- }
- return false
- })
- }
- },
methods: {
isNotInList1(v) {
return this.list1.every(k => v.id !== k.id)
@@ -90,7 +80,16 @@ export default {
}
},
pushEle(ele) {
- this.list1.push(ele)
+ for (const item of this.list2) {
+ if (item.id === ele.id) {
+ const index = this.list2.indexOf(item)
+ this.list2.splice(index, 1)
+ break
+ }
+ }
+ if (this.isNotInList1(ele)) {
+ this.list1.push(ele)
+ }
}
}
}
From 6234db924e572e3106ccdf7450621af29486f753 Mon Sep 17 00:00:00 2001
From: Jiankian
Date: Wed, 16 Jan 2019 15:05:12 +0800
Subject: [PATCH 30/60] pref[Hamburger]: refactor Hamburger component (#1528)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* 美化侧栏菜单切换按钮
* tweak
---
src/components/Hamburger/index.vue | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue
index 26472e23..220d67ec 100644
--- a/src/components/Hamburger/index.vue
+++ b/src/components/Hamburger/index.vue
@@ -2,26 +2,13 @@
@@ -48,12 +35,8 @@ export default {
cursor: pointer;
width: 20px;
height: 20px;
- transform: rotate(90deg);
- transition: .38s;
- transform-origin: 50% 50%;
}
-
.hamburger.is-active {
- transform: rotate(0deg);
+ transform: rotate(180deg);
}
From ac8eddf3d7662a36c8ad3f3fde52af12e0a77150 Mon Sep 17 00:00:00 2001
From: Pan
Date: Tue, 22 Jan 2019 16:35:53 +0800
Subject: [PATCH 31/60] update element-ui version
---
README.md | 2 +-
README.zh-CN.md | 2 +-
package.json | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index cf67c757..bf0e08be 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
-
+
diff --git a/README.zh-CN.md b/README.zh-CN.md
index d6cacf56..5dc9f1d7 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -7,7 +7,7 @@
-
+
diff --git a/package.json b/package.json
index e5b0b9ec..83e93bce 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,7 @@
"driver.js": "0.8.1",
"dropzone": "5.2.0",
"echarts": "4.1.0",
- "element-ui": "2.4.6",
+ "element-ui": "2.4.11",
"file-saver": "1.3.8",
"js-cookie": "2.2.0",
"jsonlint": "1.6.3",
From 8cf279fbe1e6b698b147a869290138934e003455 Mon Sep 17 00:00:00 2001
From: Yuga Sun
Date: Wed, 23 Jan 2019 11:18:02 +0800
Subject: [PATCH 32/60] perf[Login Form]: optimize eye icon style (#1545)
* optimiz: eye icon style for login form
* change eye-open svg
---
src/icons/svg/eye-open.svg | 1 +
src/views/login/index.vue | 28 +++++++++++++++++-----------
2 files changed, 18 insertions(+), 11 deletions(-)
create mode 100644 src/icons/svg/eye-open.svg
diff --git a/src/icons/svg/eye-open.svg b/src/icons/svg/eye-open.svg
new file mode 100644
index 00000000..88dcc98e
--- /dev/null
+++ b/src/icons/svg/eye-open.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 5e872595..a44c6ad3 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -1,11 +1,11 @@
-
-
-
{{ $t('login.title') }}
-
+
+ {{ $t('login.title') }}
+
+
@@ -26,18 +26,21 @@
+ @keyup.enter.native="handleLogin"
+ />
-
+
- {{ $t('login.logIn') }}
+
+ {{ $t('login.logIn') }}
+
@@ -45,11 +48,15 @@
{{ $t('login.password') }} : {{ $t('login.any') }}
- {{ $t('login.username') }} : editor
+
+ {{ $t('login.username') }} : editor
+
{{ $t('login.password') }} : {{ $t('login.any') }}
-
{{ $t('login.thirdparty') }}
+
+ {{ $t('login.thirdparty') }}
+
@@ -60,7 +67,6 @@
-
From eb1d3381f48ff81632b22f944e1f53563ef22a86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Thu, 24 Jan 2019 11:14:23 +0800
Subject: [PATCH 33/60] perf[Sticky]: export reset method (#1550)
---
src/components/Sticky/index.vue | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/components/Sticky/index.vue b/src/components/Sticky/index.vue
index e0fb7c57..a287216d 100644
--- a/src/components/Sticky/index.vue
+++ b/src/components/Sticky/index.vue
@@ -56,10 +56,13 @@ export default {
this.width = this.width + 'px'
this.isSticky = true
},
- reset() {
+ handleReset() {
if (!this.active) {
return
}
+ this.reset()
+ },
+ reset() {
this.position = ''
this.width = 'auto'
this.active = false
@@ -72,7 +75,7 @@ export default {
this.sticky()
return
}
- this.reset()
+ this.handleReset()
},
handleReize() {
if (this.isSticky) {
From 8ef6c7ee7dc7cd78ccbc2545a1ec29fad5243cee Mon Sep 17 00:00:00 2001
From: Pan
Date: Thu, 24 Jan 2019 13:48:19 +0800
Subject: [PATCH 34/60] perf[Sticky]: refine width default value
---
src/components/Sticky/index.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/components/Sticky/index.vue b/src/components/Sticky/index.vue
index a287216d..5624a989 100644
--- a/src/components/Sticky/index.vue
+++ b/src/components/Sticky/index.vue
@@ -69,7 +69,8 @@ export default {
this.isSticky = false
},
handleScroll() {
- this.width = this.$el.getBoundingClientRect().width
+ const width = this.$el.getBoundingClientRect().width
+ this.width = width || 'auto'
const offsetTop = this.$el.getBoundingClientRect().top
if (offsetTop < this.stickyTop) {
this.sticky()
From 23055c9b2c332930bddac1d25d099fde14390f76 Mon Sep 17 00:00:00 2001
From: xbigcat
Date: Thu, 24 Jan 2019 15:32:35 +0800
Subject: [PATCH 35/60] perf[utils]: refine parseTime function (#1546)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* 优化 parseTime
修复传入的时间戳是字符串类型,不能转换时间的问题
例:parseTime("1548221490638")
* Update index.js
---
src/utils/index.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/utils/index.js b/src/utils/index.js
index 0445827b..821392e9 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -11,7 +11,12 @@ export function parseTime(time, cFormat) {
if (typeof time === 'object') {
date = time
} else {
- if (('' + time).length === 10) time = parseInt(time) * 1000
+ if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
+ time = parseInt(time)
+ }
+ if ((typeof time === 'number') && (time.toString().length === 10)) {
+ time = time * 1000
+ }
date = new Date(time)
}
const formatObj = {
From 3153a1b10bc32e1650c644d829f284d37ee044c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Fri, 25 Jan 2019 12:50:21 +0800
Subject: [PATCH 36/60] perf[UploadExcel]: optimized code (#1552)
---
src/components/UploadExcel/index.vue | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/src/components/UploadExcel/index.vue b/src/components/UploadExcel/index.vue
index 20e16398..a6b8dbce 100644
--- a/src/components/UploadExcel/index.vue
+++ b/src/components/UploadExcel/index.vue
@@ -82,8 +82,7 @@ export default {
const reader = new FileReader()
reader.onload = e => {
const data = e.target.result
- const fixedData = this.fixData(data)
- const workbook = XLSX.read(btoa(fixedData), { type: 'base64' })
+ const workbook = XLSX.read(data, { type: 'array' })
const firstSheetName = workbook.SheetNames[0]
const worksheet = workbook.Sheets[firstSheetName]
const header = this.getHeaderRow(worksheet)
@@ -95,14 +94,6 @@ export default {
reader.readAsArrayBuffer(rawFile)
})
},
- fixData(data) {
- let o = ''
- let l = 0
- const w = 10240
- for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
- o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
- return o
- },
getHeaderRow(sheet) {
const headers = []
const range = XLSX.utils.decode_range(sheet['!ref'])
From 9daeb1cb340136fdbbec021fe20941a97dc41d5b Mon Sep 17 00:00:00 2001
From: Pan
Date: Tue, 29 Jan 2019 16:54:38 +0800
Subject: [PATCH 37/60] perf: adjust the import order to make it more elegant
#1537
---
src/main.js | 2 +-
src/store/modules/permission.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main.js b/src/main.js
index 1ce709c9..7739639d 100644
--- a/src/main.js
+++ b/src/main.js
@@ -10,8 +10,8 @@ import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // global css
import App from './App'
-import router from './router'
import store from './store'
+import router from './router'
import i18n from './lang' // Internationalization
import './icons' // icon
diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js
index 97de701e..13f60efb 100644
--- a/src/store/modules/permission.js
+++ b/src/store/modules/permission.js
@@ -36,7 +36,7 @@ function filterAsyncRouter(routes, roles) {
const permission = {
state: {
- routers: constantRouterMap,
+ routers: [],
addRouters: []
},
mutations: {
From 727c1a45dd15bd668cfe584a2af8b5b0a9cd28ec Mon Sep 17 00:00:00 2001
From: Pan
Date: Tue, 29 Jan 2019 18:00:59 +0800
Subject: [PATCH 38/60] perf[Sidebar]: use sass variables in vue template
---
src/styles/variables.scss | 12 ++++++++++++
src/views/layout/components/Sidebar/index.vue | 10 +++++++---
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/styles/variables.scss b/src/styles/variables.scss
index 09c3e9b0..87a5dd50 100644
--- a/src/styles/variables.scss
+++ b/src/styles/variables.scss
@@ -12,4 +12,16 @@ $panGreen: #30B08F;
$menuBg:#304156;
$subMenuBg:#1f2d3d;
$menuHover:#001528;
+$menuText:#bfcbd9;
+$menuActiveText:#409EFF;
$sideBarWidth: 180px;
+
+// the :export directive is the magic sauce for webpack
+:export {
+ menuBg: $menuBg;
+ subMenuBg: $subMenuBg;
+ menuHover: $menuHover;
+ menuText:$menuText;
+ menuActiveText:$menuActiveText;
+ sideBarWidth: $sideBarWidth;
+}
diff --git a/src/views/layout/components/Sidebar/index.vue b/src/views/layout/components/Sidebar/index.vue
index dff85f18..48407286 100644
--- a/src/views/layout/components/Sidebar/index.vue
+++ b/src/views/layout/components/Sidebar/index.vue
@@ -4,10 +4,10 @@
:show-timeout="200"
:default-active="$route.path"
:collapse="isCollapse"
+ :background-color="variables.menuBg"
+ :text-color="variables.menuText"
+ :active-text-color="variables.menuActiveText"
mode="vertical"
- background-color="#304156"
- text-color="#bfcbd9"
- active-text-color="#409EFF"
>
@@ -17,6 +17,7 @@
-
-
diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue
index 4cdcb568..5801ba4a 100644
--- a/src/components/Screenfull/index.vue
+++ b/src/components/Screenfull/index.vue
@@ -1,29 +1,6 @@
@@ -32,20 +9,6 @@ import screenfull from 'screenfull'
export default {
name: 'Screenfull',
- props: {
- width: {
- type: Number,
- default: 22
- },
- height: {
- type: Number,
- default: 22
- },
- fill: {
- type: String,
- default: '#48576a'
- }
- },
data() {
return {
isFullscreen: false
diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue
index a92a17c3..6d3cd43a 100644
--- a/src/components/SizeSelect/index.vue
+++ b/src/components/SizeSelect/index.vue
@@ -53,12 +53,3 @@ export default {
}
-
-
-
diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue
index 5d1ff8bd..332b07e7 100644
--- a/src/components/ThemePicker/index.vue
+++ b/src/components/ThemePicker/index.vue
@@ -136,7 +136,10 @@ export default {
diff --git a/src/icons/svg/search.svg b/src/icons/svg/search.svg
new file mode 100644
index 00000000..84233dda
--- /dev/null
+++ b/src/icons/svg/search.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
index 018ef0f9..dcb09ec1 100644
--- a/src/views/layout/components/Navbar.vue
+++ b/src/views/layout/components/Navbar.vue
@@ -6,24 +6,26 @@