From 715a47a1839aa5be48aba56d93007dedad38ed8b Mon Sep 17 00:00:00 2001
From: smallwei <1634566606@qq.com>
Date: Fri, 9 Mar 2018 16:50:10 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0avue=20=E4=BF=AE=E6=94=B9side?=
=?UTF-8?q?var=E7=BB=84=E4=BB=B6=E5=AF=B9=E6=8E=A5=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 38 +------
src/api/menu.js | 2 +-
src/page/index/index.vue | 2 +-
src/page/index/sidebar/index.vue | 13 +--
src/page/index/sidebar/sidebarItem.vue | 32 +++---
src/page/index/tags.vue | 144 +++++++++++++++----------
src/page/index/top.vue | 78 --------------
src/page/index/top/index.vue | 84 +++++++++++++++
src/page/index/top/top-lock.vue | 63 +++++++++++
src/store/modules/common.js | 13 ++-
src/store/modules/tags.js | 17 ++-
src/styles/top.scss | 92 ++++++++--------
12 files changed, 319 insertions(+), 259 deletions(-)
delete mode 100644 src/page/index/top.vue
create mode 100644 src/page/index/top/index.vue
create mode 100644 src/page/index/top/top-lock.vue
diff --git a/src/App.vue b/src/App.vue
index 5aebbd6e..ed185194 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,8 +1,6 @@
-
-
@@ -11,21 +9,10 @@ export default {
name: "app",
data() {
return {
- transitionName: "slide-right" // 默认动态路由变化为slide-right
+
};
},
- watch: {
- $route(to, from) {
- let isBack = this.$router.isBack; // 监听路由变化时的状态为前进还是后退
-
- if (isBack) {
- this.transitionName = "slide-right";
- } else {
- this.transitionName = "slide-left";
- }
- this.$router.isBack = false;
- }
- },
+ watch: {},
created() {},
methods: {},
computed: {}
@@ -35,25 +22,6 @@ export default {
#app {
width: 100%;
height: 100%;
- overflow: hidden;
-}
-.Router {
- position: absolute;
- width: 100%;
- min-height: 100%;
- overflow-y: hidden;
- transition: all 0.5s ease;
-}
-
-.slide-left-enter,
-.slide-right-leave-active {
- -webkit-transform: translate(100%, 0);
- transform: translate(100%, 0);
-}
-
-.slide-left-leave-active,
-.slide-right-enter {
- -webkit-transform: translate(-100%, 0);
- transform: translate(-100% 0);
+ overflow:hidden;
}
\ No newline at end of file
diff --git a/src/api/menu.js b/src/api/menu.js
index aa301f41..1cd0ff0f 100644
--- a/src/api/menu.js
+++ b/src/api/menu.js
@@ -1,7 +1,7 @@
import request from '@/router/axios'
export function GetMenu() {
return request({
- url: '/admin/menu/userTree',
+ url: '/admin/menu/getUserTree',
method: 'get'
})
}
\ No newline at end of file
diff --git a/src/page/index/index.vue b/src/page/index/index.vue
index 81f307fb..8b6f9043 100644
--- a/src/page/index/index.vue
+++ b/src/page/index/index.vue
@@ -14,7 +14,7 @@
-
-
-
diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue
new file mode 100644
index 00000000..fd728188
--- /dev/null
+++ b/src/page/index/top/index.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
diff --git a/src/page/index/top/top-lock.vue b/src/page/index/top/top-lock.vue
new file mode 100644
index 00000000..8a3208ea
--- /dev/null
+++ b/src/page/index/top/top-lock.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/store/modules/common.js b/src/store/modules/common.js
index 9b6b3e68..8e49decd 100644
--- a/src/store/modules/common.js
+++ b/src/store/modules/common.js
@@ -1,4 +1,4 @@
-import { setStore, getStore } from '@/util/store'
+import { setStore, getStore, removeStore } from '@/util/store'
import { validatenull } from '@/util/validate'
import { getDic } from '@/api/admin'
import { baseUrl } from '@/config/env';
@@ -8,6 +8,7 @@ const common = {
isCollapse: false,
isFullScren: false,
isLock: getStore({ name: 'isLock' }) || false,
+ lockPasswd: getStore({ name: 'lockPasswd' }) || '',
},
actions: {
//获取字典公用类
@@ -34,11 +35,17 @@ const common = {
},
SET_LOCK: (state, action) => {
state.isLock = true;
- setStore({ name: 'isLock', content: state.isLock })
+ setStore({ name: 'isLock', content: state.isLock, type: 'session' })
+ },
+ SET_LOCK_PASSWD: (state, lockPasswd) => {
+ state.lockPasswd = lockPasswd;
+ setStore({ name: 'lockPasswd', content: state.lockPasswd, type: 'session' })
},
CLEAR_LOCK: (state, action) => {
state.isLock = false;
- setStore({ name: 'isLock', content: state.isLock })
+ state.lockPasswd = '';
+ removeStore({ name: 'lockPasswd' });
+ removeStore({ name: 'isLock' });
},
}
}
diff --git a/src/store/modules/tags.js b/src/store/modules/tags.js
index 161e1778..e8311395 100644
--- a/src/store/modules/tags.js
+++ b/src/store/modules/tags.js
@@ -1,4 +1,4 @@
-import { setStore, getStore } from '@/util/store'
+import { setStore, getStore, removeStore } from '@/util/store'
import { validatenull } from "@/util/validate"
const tagObj = {
label: '',
@@ -40,21 +40,20 @@ const navs = {
if (state.tagList.some(a => a.value === action.value)) return
state.tagList.push({
label: action.label,
- num: action.num,
value: action.value,
})
state.tagList = setFistTag(state.tagList);
- setStore({ name: 'tagList', content: state.tagList, type: 'session' })
+ setStore({ name: 'tagList', content: state.tagList })
},
SET_TAG_CURRENT: (state, tagCurrent) => {
state.tagCurrent = tagCurrent;
- setStore({ name: 'tagCurrent', content: state.tagCurrent, type: 'session' })
+ setStore({ name: 'tagCurrent', content: state.tagCurrent })
},
SET_TAG: (state, value) => {
for (const [i, v] of state.tagList.entries()) {
if (v.value === value) {
state.tag = state.tagList[i];
- setStore({ name: 'tag', content: state.tag, type: 'session' })
+ setStore({ name: 'tag', content: state.tag })
break
}
}
@@ -62,8 +61,8 @@ const navs = {
DEL_ALL_TAG: (state, action) => {
state.tag = tagObj;
state.tagList = [];
- setStore({ name: 'tag', content: state.tagList, type: 'session' })
- setStore({ name: 'tagList', content: state.tagList, type: 'session' })
+ removeStore({ name: 'tag' });
+ removeStore({ name: 'tagList' });
},
DEL_TAG_OTHER: (state, action) => {
for (const [i, v] of state.tagList.entries()) {
@@ -71,8 +70,8 @@ const navs = {
state.tagList = state.tagList.slice(i, i + 1)
state.tag = state.tagList[0];
state.tagList[0].close = false;
- setStore({ name: 'tag', content: state.tag, type: 'session' })
- setStore({ name: 'tagList', content: state.tagList, type: 'session' })
+ setStore({ name: 'tag', content: state.tag })
+ setStore({ name: 'tagList', content: state.tagList })
break
}
}
diff --git a/src/styles/top.scss b/src/styles/top.scss
index e153fc7a..8dbcce0e 100644
--- a/src/styles/top.scss
+++ b/src/styles/top.scss
@@ -1,51 +1,43 @@
.header {
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- background-color: #fff;
- border-bottom:2px solid $menuBg;
- color: #333;
- box-sizing: border-box;
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- font-size: 18px;
- height: 60px;
- line-height: 1;
- padding: 0 10px;
- text-align: center;
- white-space: nowrap;
- }
-
- .header-title {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: inherit;
- font-weight: 400;
- flex: 1;
- }
-
- .header-button.is-left {
- text-align: left;
- }
-
- .header-button.is-right {
- text-align: right;
- }
- .header-userImg{
- margin: 0 3px 0 10px;
- padding: 2px;
- width: 35px;
- height:35px;
- border-radius: 100%;
- box-sizing: border-box;
- border:1px solid #eee;
- }
- .header-button {
- display: flex;
- align-items: center;
- }
- .header-button>.header-item{
- margin-right: 12px;
- }
\ No newline at end of file
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ background-color: #fff;
+ border-bottom:2px solid $menuBg;
+ color: #333;
+ box-sizing: border-box;
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ font-size: 18px;
+ height: 60px;
+ line-height: 1;
+ padding: 0 10px;
+ white-space: nowrap;
+}
+
+.header-title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: inherit;
+ font-weight: 400;
+ flex: 1;
+}
+
+.header-userImg{
+ margin: 0 3px 0 10px;
+ padding: 2px;
+ width: 35px;
+ height:35px;
+ border-radius: 100%;
+ box-sizing: border-box;
+ border:1px solid #eee;
+}
+.header-button {
+ display: flex;
+ align-items: center;
+}
+.header-button>.header-item{
+ margin-right: 12px;
+}
\ No newline at end of file