From 53d681b9d137785a02255b5300deb3b34bf8298f Mon Sep 17 00:00:00 2001 From: yemeng-lhq Date: Wed, 22 Apr 2020 16:41:23 +0800 Subject: [PATCH 01/18] =?UTF-8?q?1=E3=80=81=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E5=8A=9F=E8=83=BDbugfix=202=E3=80=81=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/i18n/lang/en.js | 1 + src/assets/i18n/lang/zh-CN.js | 1 + src/main.js | 2 + src/plugins/utils/StoreUtils.js | 77 ++++++++++++++++++++------------- src/router.js | 4 ++ src/store.js | 7 +++ src/views/admin/login/Login.vue | 57 +++++++++++++++++++++--- 7 files changed, 113 insertions(+), 36 deletions(-) diff --git a/src/assets/i18n/lang/en.js b/src/assets/i18n/lang/en.js index 343d96c..2bc98c5 100644 --- a/src/assets/i18n/lang/en.js +++ b/src/assets/i18n/lang/en.js @@ -1,4 +1,5 @@ export default { + lang: 'English', login: { loginBtn: 'Login', mobile: 'mobile', diff --git a/src/assets/i18n/lang/zh-CN.js b/src/assets/i18n/lang/zh-CN.js index 5a7e67b..b1c1290 100644 --- a/src/assets/i18n/lang/zh-CN.js +++ b/src/assets/i18n/lang/zh-CN.js @@ -1,4 +1,5 @@ export default { + lang: '中文', login: { loginBtn: '登录', mobile: '手机号', diff --git a/src/main.js b/src/main.js index 84b5497..5b8e033 100644 --- a/src/main.js +++ b/src/main.js @@ -29,6 +29,7 @@ if (userInfo !== null) { RouteUtils.addRoutes(userRoutes) } +// 页面路由前处理 router.beforeEach((to, from, next) => { // 动态修改标题 if (to.meta.title) { @@ -53,6 +54,7 @@ router.beforeEach((to, from, next) => { } }) +// 页面路由后处理 router.afterEach(to => { PageUtils.addPageTab(to) NProgress.done() diff --git a/src/plugins/utils/StoreUtils.js b/src/plugins/utils/StoreUtils.js index 807e598..a1f75be 100644 --- a/src/plugins/utils/StoreUtils.js +++ b/src/plugins/utils/StoreUtils.js @@ -1,34 +1,51 @@ import store from '../../store' -const resetAll = function () { - store.commit('resetAll') -} - -const resetPageTab = function () { - store.commit('resetPageTab') -} - -const setCollapse = function (collapse) { - store.commit('setCollapse', collapse) -} - -const setActivePage = function (activePage) { - store.commit('setActivePage', activePage) -} - -const setPageTabs = function (tabs) { - store.commit('setPageTabs', tabs) -} - -const setPageTabLink = function (tabs) { - store.commit('setPageTabLink', tabs) -} - export default { - resetAll, - resetPageTab, - setActivePage, - setPageTabs, - setPageTabLink, - setCollapse + /** + * 重置vuex + */ + resetAll: function () { + store.commit('resetAll') + }, + /** + * 重置页面页签 + */ + resetPageTab: function () { + store.commit('resetPageTab') + }, + /** + * 设置菜单折叠状态 + * @param collapse 是否折叠 + */ + setCollapse: function (collapse) { + store.commit('setCollapse', collapse) + }, + /** + * 设置当前激活的页面 + * @param activePage 激活的页面对象 + */ + setActivePage: function (activePage) { + store.commit('setActivePage', activePage) + }, + /** + * 设置页面的页签 + * @param tabs 页签数组 + */ + setPageTabs: function (tabs) { + store.commit('setPageTabs', tabs) + }, + /** + * 设置页面页签的打开顺序 + * @param tabs 有序的页签数组 + */ + setPageTabLink: function (tabs) { + store.commit('setPageTabLink', tabs) + }, + /** + * 设置语言 + * @param lang 语言(zh-CN,en) + */ + setLang: function (lang) { + store.commit('setLang', lang) + } } diff --git a/src/router.js b/src/router.js index 5eaa82a..f93468f 100644 --- a/src/router.js +++ b/src/router.js @@ -4,6 +4,10 @@ import Login from './views/admin/login/Login' Vue.use(Router) +/** + * 初始化路由 + * @return {VueRouter} + */ const initRouter = function () { return new Router({ routes: [ diff --git a/src/store.js b/src/store.js index ad33ecc..2f38986 100644 --- a/src/store.js +++ b/src/store.js @@ -13,6 +13,7 @@ const homePageTab = { } export default new Vuex.Store({ state: { + lang: 'zh-CN', collapse: false, hasAddRoutes: false, activePage: {}, @@ -20,6 +21,9 @@ export default new Vuex.Store({ pageTabLink: [homePageTab] }, mutations: { + setLang: function (state, value) { + state.lang = value + }, resetAll: function (state) { state.collapse = false state.hasAddRoutes = false @@ -48,6 +52,9 @@ export default new Vuex.Store({ } }, actions: { + setLang: function (context, value) { + context.commit('setLang', value) + }, resetAll: function (context) { context.commit('resetAll') }, diff --git a/src/views/admin/login/Login.vue b/src/views/admin/login/Login.vue index d67c133..f57f2a6 100644 --- a/src/views/admin/login/Login.vue +++ b/src/views/admin/login/Login.vue @@ -1,7 +1,18 @@ @@ -11,9 +12,10 @@ import YcHeaderBarLock from './YcHeaderBarLock' import YcHeaderBarNotice from './YcHeaderBarNotice' import YcHeaderBarUser from './YcHeaderBarUser' +import YcHeaderBarLang from './YcHeaderBarLang' export default { - name: 'YcHeaderBarRight', - components: { YcHeaderBarUser, YcHeaderBarNotice, YcHeaderBarLock }, + name: 'YcHeaderBarBoxRight', + components: { YcHeaderBarLang, YcHeaderBarUser, YcHeaderBarNotice, YcHeaderBarLock }, methods: { } } @@ -22,7 +24,6 @@ export default { diff --git a/src/components/layout/YcHeaderBarLock.vue b/src/components/layout/YcHeaderBarLock.vue index 3ea682a..486bb2b 100644 --- a/src/components/layout/YcHeaderBarLock.vue +++ b/src/components/layout/YcHeaderBarLock.vue @@ -1,10 +1,11 @@ From a8ac9c93906e3f10a58b8284fd8a2bc07c94e65a Mon Sep 17 00:00:00 2001 From: yemeng-lhq Date: Thu, 23 Apr 2020 13:51:34 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E3=80=81github=E4=B8=BB=E9=A1=B5=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/YcHeaderBox.vue | 9 +++++++-- src/components/layout/YcLayout.vue | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/layout/YcHeaderBox.vue b/src/components/layout/YcHeaderBox.vue index 81d143b..54af1c8 100644 --- a/src/components/layout/YcHeaderBox.vue +++ b/src/components/layout/YcHeaderBox.vue @@ -5,7 +5,7 @@ - +
首页 @@ -15,7 +15,12 @@
-   + + 个人博客 + GitHub + diff --git a/src/components/layout/YcLayout.vue b/src/components/layout/YcLayout.vue index 0e00894..f87369e 100644 --- a/src/components/layout/YcLayout.vue +++ b/src/components/layout/YcLayout.vue @@ -10,7 +10,7 @@ - + From 78321e9870ae47ce3b74ddb296faf300efd0c32b Mon Sep 17 00:00:00 2001 From: yemeng-lhq Date: Thu, 23 Apr 2020 16:22:13 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/config/log.js | 20 ++++++++++++++++++++ src/views/admin/Home.vue | 40 ++++++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 src/assets/config/log.js diff --git a/src/assets/config/log.js b/src/assets/config/log.js new file mode 100644 index 0000000..929ec57 --- /dev/null +++ b/src/assets/config/log.js @@ -0,0 +1,20 @@ +export default [ + { + date: '2020-04-22', + title: 'IT小跟班Admin管理系统Layout大改版', + items: [ + '系统主题色由灰色变成黑色', + '整体代码优化,大型布局组件化', + '系统基本信息可配置化', + '新增个人博客、GitHub链接', + '国际化支持,目前支持中文简体、英文', + '顶部工具栏改版,新增锁屏、通知、语言切换功能' + ] + }, { + date: '2020-04-20', + title: 'IT小跟班Admin管理系统上线啦', + items: [ + '希望有序能够持续更新' + ] + } +] diff --git a/src/views/admin/Home.vue b/src/views/admin/Home.vue index 5a3b734..29cb7f1 100644 --- a/src/views/admin/Home.vue +++ b/src/views/admin/Home.vue @@ -1,30 +1,34 @@ From ff2d1497d74e00e82d47698beece13c52b55d696 Mon Sep 17 00:00:00 2001 From: yemeng-lhq Date: Thu, 23 Apr 2020 16:22:32 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/config/log.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/config/log.js b/src/assets/config/log.js index 929ec57..25a3643 100644 --- a/src/assets/config/log.js +++ b/src/assets/config/log.js @@ -11,7 +11,7 @@ export default [ '顶部工具栏改版,新增锁屏、通知、语言切换功能' ] }, { - date: '2020-04-20', + date: '2019-05-20', title: 'IT小跟班Admin管理系统上线啦', items: [ '希望有序能够持续更新' From 9334fb6f4951dd5c999305f30162eb805f331ca2 Mon Sep 17 00:00:00 2001 From: yemeng-lhq Date: Fri, 24 Apr 2020 10:55:37 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=EF=BC=8C=E6=8F=90=E5=8F=96?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E7=BB=84=E4=BB=B6DemoSection=20=E9=9B=86?= =?UTF-8?q?=E6=88=90InputNumber=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- src/assets/config/full-router.js | 8 + src/views/admin/example/DemoSection.vue | 45 ++++ src/views/admin/example/basic/Button.vue | 226 ++++++++++--------- src/views/admin/example/basic/Container.vue | 59 ++--- src/views/admin/example/basic/Icon.vue | 28 ++- src/views/admin/example/basic/Layout.vue | 60 ++--- src/views/admin/example/basic/Link.vue | 58 +++-- src/views/admin/example/form/Checkbox.vue | 104 +++++---- src/views/admin/example/form/Input.vue | 102 +++++---- src/views/admin/example/form/InputNumber.vue | 54 +++++ src/views/admin/example/form/Radio.vue | 74 +++--- 12 files changed, 490 insertions(+), 330 deletions(-) create mode 100644 src/views/admin/example/DemoSection.vue create mode 100644 src/views/admin/example/form/InputNumber.vue diff --git a/src/App.vue b/src/App.vue index 3269a57..eafce03 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,7 +18,7 @@ export default { width: 100%; padding: 0; margin: 0; - font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif; + font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,SimSun,sans-serif; #app { width: 100%; height: 100%; diff --git a/src/assets/config/full-router.js b/src/assets/config/full-router.js index b1557a3..ce33da9 100644 --- a/src/assets/config/full-router.js +++ b/src/assets/config/full-router.js @@ -106,6 +106,14 @@ const initFullRouters = function () { title: 'Input', icon: 'el-icon-set-up' } + }, { + path: 'input-number', + name: 'InputNumber', + component: () => import('../../views/admin/example/form/InputNumber'), + meta: { + title: 'InputNumber', + icon: 'el-icon-set-up' + } } ] } diff --git a/src/views/admin/example/DemoSection.vue b/src/views/admin/example/DemoSection.vue new file mode 100644 index 0000000..b2f4d53 --- /dev/null +++ b/src/views/admin/example/DemoSection.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/views/admin/example/basic/Button.vue b/src/views/admin/example/basic/Button.vue index 3f4d676..2d338a0 100644 --- a/src/views/admin/example/basic/Button.vue +++ b/src/views/admin/example/basic/Button.vue @@ -1,119 +1,133 @@ diff --git a/src/views/admin/example/basic/Container.vue b/src/views/admin/example/basic/Container.vue index 761f20d..aee6cd7 100644 --- a/src/views/admin/example/basic/Container.vue +++ b/src/views/admin/example/basic/Container.vue @@ -1,40 +1,39 @@ diff --git a/src/views/admin/example/basic/Icon.vue b/src/views/admin/example/basic/Icon.vue index 567cc7a..1b0042b 100644 --- a/src/views/admin/example/basic/Icon.vue +++ b/src/views/admin/example/basic/Icon.vue @@ -1,28 +1,32 @@ diff --git a/src/views/admin/example/basic/Link.vue b/src/views/admin/example/basic/Link.vue index 38ddf36..a6c56a1 100644 --- a/src/views/admin/example/basic/Link.vue +++ b/src/views/admin/example/basic/Link.vue @@ -1,44 +1,52 @@ diff --git a/src/views/admin/example/form/Checkbox.vue b/src/views/admin/example/form/Checkbox.vue index 9e1be71..26e77dd 100644 --- a/src/views/admin/example/form/Checkbox.vue +++ b/src/views/admin/example/form/Checkbox.vue @@ -1,73 +1,83 @@ + + diff --git a/src/views/admin/example/form/Radio.vue b/src/views/admin/example/form/Radio.vue index ce17bcb..0dff771 100644 --- a/src/views/admin/example/form/Radio.vue +++ b/src/views/admin/example/form/Radio.vue @@ -1,51 +1,59 @@ + + diff --git a/src/components/layout/YcHeaderBarBoxMid.vue b/src/components/layout/YcHeaderBarBoxMid.vue new file mode 100644 index 0000000..94f8370 --- /dev/null +++ b/src/components/layout/YcHeaderBarBoxMid.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/components/layout/YcHeaderBarBoxRight.vue b/src/components/layout/YcHeaderBarBoxRight.vue index ea21b6c..028bfc3 100644 --- a/src/components/layout/YcHeaderBarBoxRight.vue +++ b/src/components/layout/YcHeaderBarBoxRight.vue @@ -1,37 +1,88 @@ diff --git a/src/components/layout/YcHeaderBarLang.vue b/src/components/layout/YcHeaderBarLang.vue index da1d6bc..340be05 100644 --- a/src/components/layout/YcHeaderBarLang.vue +++ b/src/components/layout/YcHeaderBarLang.vue @@ -1,14 +1,12 @@ diff --git a/src/components/layout/YcHeaderBarLock.vue b/src/components/layout/YcHeaderBarLock.vue index 486bb2b..04c9669 100644 --- a/src/components/layout/YcHeaderBarLock.vue +++ b/src/components/layout/YcHeaderBarLock.vue @@ -1,5 +1,5 @@ diff --git a/src/components/layout/YcHeaderBarNotice.vue b/src/components/layout/YcHeaderBarNotice.vue index 59a173d..d5befb6 100644 --- a/src/components/layout/YcHeaderBarNotice.vue +++ b/src/components/layout/YcHeaderBarNotice.vue @@ -1,19 +1,17 @@ diff --git a/src/components/layout/YcHeaderBarUser.vue b/src/components/layout/YcHeaderBarUser.vue deleted file mode 100644 index 47bcc02..0000000 --- a/src/components/layout/YcHeaderBarUser.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/src/components/layout/YcHeaderBox.vue b/src/components/layout/YcHeaderBox.vue index 9138869..f6c8539 100644 --- a/src/components/layout/YcHeaderBox.vue +++ b/src/components/layout/YcHeaderBox.vue @@ -1,34 +1,20 @@ From 81c136e08e1c2d4e895bd51fd8fd8183c88171d0 Mon Sep 17 00:00:00 2001 From: yemeng-lhq Date: Sun, 26 Apr 2020 13:30:34 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E9=A1=B6=E9=83=A8=E9=9D=A2=E5=8C=85?= =?UTF-8?q?=E5=B1=91=E5=AF=BC=E8=88=AA=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/YcHeaderBarBoxLeft.vue | 40 ++++++++++++++------ src/components/layout/YcHeaderBarBoxMid.vue | 7 ---- src/components/layout/YcHeaderBox.vue | 1 + 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/components/layout/YcHeaderBarBoxLeft.vue b/src/components/layout/YcHeaderBarBoxLeft.vue index 1c2a7a5..dfd3939 100644 --- a/src/components/layout/YcHeaderBarBoxLeft.vue +++ b/src/components/layout/YcHeaderBarBoxLeft.vue @@ -2,11 +2,13 @@
- - 首页 - - {{ title }} - + + + 首页 + + {{ item.meta.title }} + +
@@ -17,14 +19,14 @@ import StoreUtils from '../../plugins/utils/StoreUtils' export default { name: 'YcHeaderBarBoxLeft', computed: { - activeFullTitle: function () { - let fullTitle = [] + activePage: function () { + let target = [] this.$route.matched.forEach(route => { if (route.meta.title) { - fullTitle.push(route.meta.title) + target.push(route) } }) - return fullTitle + return target }, collapse: function () { return this.$store.state.collapse @@ -51,13 +53,29 @@ export default { transition: 0.3s; transform-origin: 50% 50%; display: inline-block; + margin-right: 20px; &.is-active { transform: rotate(90deg); } } - .yc-title-breads { - margin-left: 20px; + .breadcrumb-enter-active, + .breadcrumb-leave-active { + transition: all .5s; + } + + .breadcrumb-enter, + .breadcrumb-leave-active { + opacity: 0; + transform: translateX(20px); + } + + .breadcrumb-move { + transition: all .5s; + } + + .breadcrumb-leave-active { + position: absolute; } diff --git a/src/components/layout/YcHeaderBarBoxMid.vue b/src/components/layout/YcHeaderBarBoxMid.vue index 94f8370..be60888 100644 --- a/src/components/layout/YcHeaderBarBoxMid.vue +++ b/src/components/layout/YcHeaderBarBoxMid.vue @@ -52,13 +52,6 @@ export default { } } - .yc-title-breads { - line-height: 60px; - position: absolute; - left: 60px; - display: inline-block; - } - .top-bar-link { margin: 0 5px; } diff --git a/src/components/layout/YcHeaderBox.vue b/src/components/layout/YcHeaderBox.vue index f6c8539..9f06b20 100644 --- a/src/components/layout/YcHeaderBox.vue +++ b/src/components/layout/YcHeaderBox.vue @@ -46,6 +46,7 @@ export default { align-items: center; &.is-left { display: flex; + width: 380px; } &.is-mid { box-sizing: border-box; From 83255dcf78e8efdfce45332337b458fb6d3bd544 Mon Sep 17 00:00:00 2001 From: yemeng-lhq Date: Sun, 26 Apr 2020 14:14:54 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E9=A1=B6=E9=83=A8=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/YcFooterBox.vue | 22 ---------------------- src/components/layout/YcHeaderBox.vue | 2 +- src/components/layout/YcLayout.vue | 15 +++++++++++---- 3 files changed, 12 insertions(+), 27 deletions(-) delete mode 100644 src/components/layout/YcFooterBox.vue diff --git a/src/components/layout/YcFooterBox.vue b/src/components/layout/YcFooterBox.vue deleted file mode 100644 index cdc1f94..0000000 --- a/src/components/layout/YcFooterBox.vue +++ /dev/null @@ -1,22 +0,0 @@ - - - - - diff --git a/src/components/layout/YcHeaderBox.vue b/src/components/layout/YcHeaderBox.vue index 9f06b20..c123a64 100644 --- a/src/components/layout/YcHeaderBox.vue +++ b/src/components/layout/YcHeaderBox.vue @@ -1,5 +1,5 @@