From 0f49a23a9d4dc7d3eb9a7309f8cd85a316cd4d97 Mon Sep 17 00:00:00 2001
From: zhangyanpeng <bob.zhang@highdatas.com>
Date: 星期四, 30 四月 2020 17:39:22 +0800
Subject: [PATCH] 功能调整

---
 src/views/Home.vue |   71 +++++++++++++++++------------------
 1 files changed, 34 insertions(+), 37 deletions(-)

diff --git a/src/views/Home.vue b/src/views/Home.vue
index 0befde0..8916265 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -5,7 +5,7 @@
 				<div style="width: 100%;height: 60px;"></div>
 				<el-menu
 				    class="el-menu-vertical-demo"
-				    :unique-opened="false"
+				    :unique-opened="true"
 						:default-active="defaultActive"
 				    @select ="menuSelect"
 				    @open ="menuSelect"
@@ -42,7 +42,7 @@
 		  <el-container>
 		    <el-header style="text-align: right; font-size: 15px;padding-right: 40px;">
 					<i class="el-icon-user-solid"></i>
-					<span>admin</span>
+					<span>{{userName}}</span>
 					<el-button size="small" type="primary" @click="Cancel">閫� 鍑�</el-button>
 		    </el-header>
 		    
@@ -65,37 +65,29 @@
 		return {
 			breadcrumbItems:[],
 			defaultActive: "",
-			navList:[
-				{
-					title:"棣栭〉", path:"mine",children:[]
-				},
-			  {
-			    title:"椤圭洰绠$悊", path:"0_1",children:[
-			      {title:"淇℃伅骞垮満", path:"project2",children:[]},
-			      {title:"椤圭洰鎬昏", path:"Overview",children:[]},
-			      {title:"椤圭洰鍒嗘瀽", path:"project3",children:[]},
-			      {title:"褰掓。鎶ュ憡", path:"project4",children:[]},
-			    ]
-			  },
-			  {
-			    title:"浠诲姟绠$悊", path:"0_2",children:[
-			      {title:"浠诲姟鍒楄〃", path:"calendarTask",children:[]},
-			    ]
-			  }
-			],
+			navList:[],
 		}
   },
 	created() {
 		let userId_ = localStorage.getItem('userId');
-		let userType = localStorage.getItem('userType');
-		if (!userId_) {
+		this.userName = localStorage.getItem('userName');
+		let departId = localStorage.getItem('departId');
+		if (!userId_ || !departId) {
 			this.$router.push('/login');
 		}
 		else {
 			this.defaultActive = "mine";
 			this.$router.push('/mine');
+			let type;
+			if(departId == "100" || departId == "500") {
+				type = departId;
+				 localStorage.setItem('assign', false);
+			}else {
+				type = "all";
+				localStorage.setItem('assign', true);
+			}
 			
-			this.getMenu(userType);
+			this.getMenu(type);
 		}
 	},
 	
@@ -106,21 +98,25 @@
 					{'id': "110", 'title': "棣栭〉", 'path': "mine"}, //杩斿洖鐨勬暟缁勫瓧娈�
 					{'id': "111", 'title': "椤圭洰绠$悊", 'path': "0_111"}, //杩斿洖鐨勬暟缁勫瓧娈�
 					{'id': "112", 'title': "浠诲姟绠$悊", 'path': "0_112"},
-					{'id': "111_1", 'title': "淇℃伅骞垮満", 'path': 'project2', 'parentId': "111"}, //
-					{'id': "111_2", 'title': "椤圭洰鎬昏", 'path': 'Overview', 'parentId': "111"}, //
-					{'id': "111_3", 'title': "椤圭洰鍒嗘瀽", 'path': 'project3', 'parentId': "111"}, //
-					{'id': "111_4", 'title': "褰掓。鎶ュ憡", 'path': 'project4', 'parentId': "111"}, //
+					{'id': "113", 'title': "璐㈠姟绠$悊", 'path': "0_113"},
+					{'id': "111_1", 'title': "淇℃伅骞垮満", 'path': 'square', 'parentId': "111"}, //
+					{'id': "111_2", 'title': "椤圭洰鎬昏", 'path': 'list', 'parentId': "111"}, //
+					{'id': "111_3", 'title': "椤圭洰鍒嗘瀽", 'path': 'Overview', 'parentId': "111"}, //
+					// {'id': "111_4", 'title': "褰掓。鎶ュ憡", 'path': 'project4', 'parentId': "111"}, //
 					{'id': "112_1", 'title': "浠诲姟鍒楄〃", 'path': 'calendarTask', 'parentId': "112"}, //
+					
+					{'id': "113_1", 'title': "瀹為檯鏀粯璐圭敤", 'path': 'actualPayment', 'parentId': "113"}, //
+					{'id': "113_2", 'title': "鍚堝悓瀹屾垚缁熻", 'path': 'completeStatistics', 'parentId': "113"}, //
+					{'id': "113_3", 'title': "鍏艰亴鏀粯纭", 'path': 'partTimeExpenses', 'parentId': "113"}, //
+				//	{'id': "113_4", 'title': "鎴愭湰鏍哥畻", 'path': 'costAccounting', 'parentId': "113"}, //
+					{'id': "113_5", 'title': "宸插洖娆剧粺璁�", 'path': 'collectionStatistics', 'parentId': "113"}, //
 				],
-				role1: [
-					{'id': "110", 'title': "棣栭〉", 'path': "mine"}, //杩斿洖鐨勬暟缁勫瓧娈�
-					{'id': "111", 'title': "椤圭洰绠$悊", 'path': "0_111"}, //杩斿洖鐨勬暟缁勫瓧娈�
-					{'id': "111_1", 'title': "淇℃伅骞垮満", 'path': 'project2', 'parentId': "111"}, //
-					{'id': "111_2", 'title': "椤圭洰鎬昏", 'path': 'Overview', 'parentId': "111"}, //
-					{'id': "111_3", 'title': "椤圭洰鍒嗘瀽", 'path': 'project3', 'parentId': "111"}, //
-					{'id': "111_4", 'title': "褰掓。鎶ュ憡", 'path': 'project4', 'parentId': "111"}, //
-				],
-				role2: [
+				100: [
+						{'id': "110", 'title': "棣栭〉", 'path': "mine"}, //杩斿洖鐨勬暟缁勫瓧娈�
+						{'id': "112", 'title': "浠诲姟绠$悊", 'path': "0_112"},
+						{'id': "112_1", 'title': "浠诲姟鍒楄〃", 'path': 'calendarTask', 'parentId': "112"}, //
+					],
+				500: [
 					{'id': "110", 'title': "棣栭〉", 'path': "mine"}, //杩斿洖鐨勬暟缁勫瓧娈�
 					{'id': "112", 'title': "浠诲姟绠$悊", 'path': "0_112"},
 					{'id': "112_1", 'title': "浠诲姟鍒楄〃", 'path': 'calendarTask', 'parentId': "112"}, //
@@ -128,7 +124,7 @@
 			};
 			
 			let list = [];
-			if (!userType) {
+			if (!userType || userType=='undefined') {
 				list = DayDatas['all'];
 			}
 			else {
@@ -164,6 +160,7 @@
 		
 		Cancel() {
 			this.$router.push('/login');
+			localStorage.setItem('userId', undefined);
 		},
 		menuSelect(index, a){
 		 let isPage = index.substring(0,2);

--
Gitblit v1.8.0