diff --git a/proxy.conf.json b/proxy.conf.json
index d3fdba5..d0da7b1 100644
--- a/proxy.conf.json
+++ b/proxy.conf.json
@@ -12,6 +12,12 @@
"changeOrigin": true,
"ws": true
},
+ "/logout":{
+ "target": "http://130.120.3.231:91",
+ "secure": false,
+ "changeOrigin": true,
+ "ws": true
+ },
"/adminapi":{
"target": "http://130.120.3.231:91",
"secure": false,
diff --git a/src/app/pages/main/main.component.html b/src/app/pages/main/main.component.html
index d477413..0d7636b 100644
--- a/src/app/pages/main/main.component.html
+++ b/src/app/pages/main/main.component.html
@@ -19,8 +19,8 @@
-
\ No newline at end of file
diff --git a/src/app/pages/pages.component.scss b/src/app/pages/pages.component.scss
index a84adf0..9a92bbc 100644
--- a/src/app/pages/pages.component.scss
+++ b/src/app/pages/pages.component.scss
@@ -15,14 +15,26 @@
color: rgba(255, 255, 255, 1);
cursor: pointer;
}
+ .navbar-nav{
+ background-color: rgb(38,51,68);
+ padding: 0 10px;
+ border-radius: 20px;
+ }
// .bg-dark{
// }
+ .nav-link{
+ display: flex;
+ align-items: center;
+ label{
+ margin: 0;
+ }
+ }
.nav-icon {
- padding: 0.1rem 0.75rem;
+ // padding: 0.1rem 0.75rem;
cursor: pointer;
display: block;
- font-size: 1.5rem;
+ // font-size: 1.5rem;
transition: color 0.1s ease-in-out, color 0.1s ease-in-out;
&:hover {
color: $color-primary;
@@ -39,9 +51,9 @@
box-shadow: 0 0.1rem 0.2rem rgba(0, 0, 0, 0.05);
border-radius: 50%;
display: block;
- height: 18px;
- width: 18px;
- padding: 1px;
+ height: 14px;
+ width: 14px;
+ line-height: 14px;
position: absolute;
top: -4px;
right: -8px;
@@ -77,7 +89,7 @@
left: 0;
background-color: rgb(46, 59, 76);
padding-bottom: 30px;
- overflow-y: scroll;
+ overflow-y: auto;
.left-header {
height: 66px;
border-bottom: 1px solid $gray-900;
@@ -101,5 +113,18 @@
height: calc(100% - 66px);
margin-left: 235px;
}
+ .left-wrapper-o {
+ width: 235px;
+ }
+ .left-wrapper-c {
+ width: 0px;
+ display: none;
+ }
+ .right-wrapper-o {
+ margin-left: 235px;
+ }
+ .right-wrapper-c {
+ margin-left: 0px;
+ }
}
}
diff --git a/src/app/pages/pages.component.ts b/src/app/pages/pages.component.ts
index 8b63f4e..2757b7b 100644
--- a/src/app/pages/pages.component.ts
+++ b/src/app/pages/pages.component.ts
@@ -1,9 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
-import { BasicDataService } from './basic-data-service'
+import { BasicDataService } from './basic-data-service';
+import { HttpClientService } from '../services/http-client.service';
-import { map, filter, mergeMap } from 'rxjs/operators';
-import { pipe } from 'rxjs'
+import { ToastService } from '../components/toast/toast.service';
+import { ToastConfig, ToastType } from '../components/toast/toast-model';
+
+import { filter } from 'rxjs/operators';
// import 'rxjs/add/operator/map';
// import 'rxjs/add/operator/mergeMap';
@@ -13,7 +16,7 @@ import { pipe } from 'rxjs'
styleUrls: ['./pages.component.scss']
})
export class PagesComponent implements OnInit {
-
+ public menuClose: boolean = false;
menuData = [
{
"name": "航班动态",
@@ -185,9 +188,10 @@ export class PagesComponent implements OnInit {
}]
constructor(
private router: Router,
- private basicDataService:BasicDataService,
- private activatedRoute: ActivatedRoute
- ) {
+ private basicDataService: BasicDataService,
+ private httpClient: HttpClientService,
+ private toastService: ToastService,
+ ) {
this.basicDataService.loadBasicData();
}
@@ -203,6 +207,10 @@ export class PagesComponent implements OnInit {
}
+ toggleMenu() {
+ this.menuClose = !this.menuClose;
+ }
+
/**
* 判断是否有子节点
* @param item
@@ -225,4 +233,14 @@ export class PagesComponent implements OnInit {
})
}
+ confirmLogout() {
+ this.httpClient.post('/logout').subscribe(
+ data => {
+ const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '退出系统成功!', 3000);
+ this.toastService.toast(toastCfg);
+ this.router.navigate(['/login']);
+ }
+ )
+ }
+
}
diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts
index 4ddb755..e929922 100644
--- a/src/app/pages/pages.module.ts
+++ b/src/app/pages/pages.module.ts
@@ -1,16 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
-import { PagesComponent } from './pages.component';
-import { PagesRoutingModule } from './pages-routing.module'
+import { NgZorroAntdModule } from 'ng-zorro-antd';
-import { ComponentsModule } from '../components/components.module'
+import { PagesComponent } from './pages.component';
+import { PagesRoutingModule } from './pages-routing.module';
+
+import { SidebarMenuModule } from '../components/sidebar-menu/sidebar-menu.module';
+import { BarMenuModule } from '../components/bar-menu/bar-menu.module';
import { BasicDataService } from './basic-data-service'
@NgModule({
imports: [
CommonModule,
- ComponentsModule,
+ NgZorroAntdModule,
+ SidebarMenuModule,
+ BarMenuModule,
PagesRoutingModule,
],
declarations: [PagesComponent],
diff --git a/src/app/services/http-client.service.ts b/src/app/services/http-client.service.ts
index effe946..03062a1 100644
--- a/src/app/services/http-client.service.ts
+++ b/src/app/services/http-client.service.ts
@@ -51,9 +51,9 @@ export class HttpClientService {
paramsString.push([key, params[key]].join('='))
}
}
- return this.commonProcess(this.httpClient.get(encodeURI(url + paramsString.join('&') + '&t=' + t), options = {}));
+ return this.commonProcess(this.httpClient.get(encodeURI(url + paramsString.join('&') + '&t=' + t), options));
} else {
- return this.commonProcess(this.httpClient.get(url + 't=' + t, options = {}));
+ return this.commonProcess(this.httpClient.get(url + 't=' + t, options));
}
}
@@ -80,7 +80,7 @@ export class HttpClientService {
* @param url
* @param options
*/
- patch(url: string, body, options?): Observable
{
+ patch(url: string, body?, options?): Observable {
return this.commonProcess(this.httpClient.patch(url, body, options));
}
@@ -91,7 +91,7 @@ export class HttpClientService {
* @param body
* @param options
*/
- post(url: string, body, options?): Observable {
+ post(url: string, body?, options?): Observable {
return this.commonProcess(this.httpClient.post(url, body, options));
}
@@ -100,7 +100,7 @@ export class HttpClientService {
* @param url
* @param options
*/
- put(url: string, body, options?): Observable {
+ put(url: string, body?, options?): Observable {
return this.commonProcess(this.httpClient.put(url, body, options));
}
diff --git a/src/polyfills.ts b/src/polyfills.ts
index d310405..0f92b27 100644
--- a/src/polyfills.ts
+++ b/src/polyfills.ts
@@ -19,20 +19,20 @@
*/
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
-// import 'core-js/es6/symbol';
-// import 'core-js/es6/object';
-// import 'core-js/es6/function';
-// import 'core-js/es6/parse-int';
-// import 'core-js/es6/parse-float';
-// import 'core-js/es6/number';
-// import 'core-js/es6/math';
-// import 'core-js/es6/string';
-// import 'core-js/es6/date';
-// import 'core-js/es6/array';
-// import 'core-js/es6/regexp';
-// import 'core-js/es6/map';
-// import 'core-js/es6/weak-map';
-// import 'core-js/es6/set';
+import 'core-js/es6/symbol';
+import 'core-js/es6/object';
+import 'core-js/es6/function';
+import 'core-js/es6/parse-int';
+import 'core-js/es6/parse-float';
+import 'core-js/es6/number';
+import 'core-js/es6/math';
+import 'core-js/es6/string';
+import 'core-js/es6/date';
+import 'core-js/es6/array';
+import 'core-js/es6/regexp';
+import 'core-js/es6/map';
+import 'core-js/es6/weak-map';
+import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.