44 <div
55 class =" layout-header-menu-icon"
66 @click =" goHome"
7- @mouseleave =" mouseleave"
8- @mouseover =" mouseover" >
9- <div style =" margin-top :5px ; display :inline-block ;" >
7+ >
8+ <div style =" margin-top :5px ; display :inline-block ;"
9+ @mouseleave =" mouseleave"
10+ @mouseover =" mouseover" >
1011 <svg t =" 1572957725118" viewBox =" 0 0 1024 1024" version =" 1.1" xmlns =" http://www.w3.org/2000/svg" p-id =" 1115" width =" 20" height =" 20" >
1112 <path d="M896 1024h-213.333333a128 128 0 0 1-128-128v-213.333333a128 128 0 0 1 128-128h213.333333a128 128 0 0 1 128 128v213.333333a128 128 0 0 1-128 128z m-213.333333-384a42.666667 42.666667 0 0 0-42.666667 42.666667v213.333333a42.666667 42.666667 0 0 0 42.666667 42.666667h213.333333a42.666667 42.666667 0 0 0 42.666667-42.666667v-213.333333a42.666667 42.666667 0 0 0-42.666667-42.666667z m-341.333334 384H128a128 128 0 0 1-128-128v-213.333333a128 128 0 0 1 128-128h213.333333a128 128 0 0 1 128 128v213.333333a128 128 0 0 1-128 128z m-213.333333-384a42.666667 42.666667 0 0 0-42.666667 42.666667v213.333333a42.666667 42.666667 0 0 0 42.666667 42.666667h213.333333a42.666667 42.666667 0 0 0 42.666667-42.666667v-213.333333a42.666667 42.666667 0 0 0-42.666667-42.666667z m768-170.666667h-213.333333a128 128 0 0 1-128-128V128a128 128 0 0 1 128-128h213.333333a128 128 0 0 1 128 128v213.333333a128 128 0 0 1-128 128z m-213.333333-384a42.666667 42.666667 0 0 0-42.666667 42.666667v213.333333a42.666667 42.666667 0 0 0 42.666667 42.666667h213.333333a42.666667 42.666667 0 0 0 42.666667-42.666667V128a42.666667 42.666667 0 0 0-42.666667-42.666667z m-341.333334 384H128a128 128 0 0 1-128-128V128a128 128 0 0 1 128-128h213.333333a128 128 0 0 1 128 128v213.333333a128 128 0 0 1-128 128zM128 85.333333a42.666667 42.666667 0 0 0-42.666667 42.666667v213.333333a42.666667 42.666667 0 0 0 42.666667 42.666667h213.333333a42.666667 42.666667 0 0 0 42.666667-42.666667V128a42.666667 42.666667 0 0 0-42.666667-42.666667z" p-id="1116" fill="#00FFFF">
1213 </path >
2223 </div >
2324 </div >
2425
25- <workspaceMenu v-if =" $route.path.indexOf('workspace')!==-1 " :projectList =" workspaces" :currentId =" parseInt($route.query.workspaceId, 10)" :changeWorkSpace =" changeWorkspace" ></workspaceMenu >
26+ <workspaceMenu v-if =" isShowWorkspaceMenu " :projectList =" workspaces" :currentId =" parseInt($route.query.workspaceId, 10)" :changeWorkSpace =" changeWorkspace" ></workspaceMenu >
2627 <span
2728 v-if =" currentProject.id"
2829 class =" proj-select"
5152 </div >
5253 </DropdownMenu >
5354 </Dropdown >
54- <ul v-if =" $route.path.indexOf('workspace')!==-1 " class =" menu" >
55+ <ul v-if =" $route.query& & $route.query.workspaceId " class =" menu" >
5556 <li class =" menu-item" @click =" goSpaceHome" >首页</li >
5657 <li class =" menu-item" @click =" goConsole" >控制台</li >
5758 </ul >
@@ -156,9 +157,16 @@ export default {
156157 ' $route' (newValue) {
157158 this .projectID = newValue .query .projectID ;
158159 this .getCurrentProject ();
160+ this .getWorkSpace ();
159161 }
160162 },
161163 methods: {
164+ isShowWorkspaceMenu (){
165+ return (! this .currentProject .id && this .isShowHomeNav ());
166+ },
167+ isShowHomeNav (){
168+ return (this .$route .query && this .$route .query .workspaceId || this .$route .path .indexOf (' workspace' )!== - 1 );
169+ },
162170 init () {
163171 api .fetch (' /dss/getBaseInfo' , ' get' ).then ((rst ) => {
164172 if (! isEmpty (rst)) {
@@ -170,14 +178,15 @@ export default {
170178
171179 this .$emit (' set-init' );
172180 }
173- api .fetch (` /dss/workspaces` , ' get' ).then (rst => {
174- if (! isEmpty (rst)) {
175- this .workspaces = rst .workspaces ;
176- }
177- })
181+ this .getWorkSpace ();
178182 });
179-
180-
183+ },
184+ getWorkSpace (){
185+ api .fetch (` /dss/workspaces` , ' get' ).then (rst => {
186+ if (! isEmpty (rst)) {
187+ this .workspaces = rst .workspaces ;
188+ }
189+ })
181190 },
182191 goto (name ) {
183192 this .$router .push ({
@@ -265,15 +274,13 @@ export default {
265274 }, 500 );
266275 },
267276 goSpaceHome (){
268- console .log (' workspaceId' , this .$route .query .workspaceId )
269- this .$router .push ({path: ' /home' ,query: Object .assign ({}, this .$route .query )});
277+ this .$router .push ({path: ' /workspace' ,query: Object .assign ({}, this .$route .query )});
270278 },
271279 goConsole (){
272- console .log (' workspaceId' , this .$route .query .workspaceId )
273280 this .$router .push ({path: ' /console' ,query: Object .assign ({}, this .$route .query )});
274281 },
275282 changeWorkspace (data ){
276- this .$router .push ({path : ' /workspace ' , query: Object .assign ({}, this .$route .query , {workspaceId: data .id })});
283+ this .$router .push ({query: Object .assign ({}, this .$route .query , {workspaceId: data .id })});
277284 }
278285 },
279286};
0 commit comments