|
|
|
@ -6,6 +6,7 @@ import {NzMessageService} from 'ng-zorro-antd'; |
|
|
|
|
import {Router} from '@angular/router'; |
|
|
|
|
import {IconService} from '../../services/icon.service'; |
|
|
|
|
import {RechargeService} from '../../services/recharge.service'; |
|
|
|
|
import {CommonsService} from '../../services/commons.service'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-navigation', |
|
|
|
@ -18,10 +19,12 @@ export class NavigationComponent implements OnInit { |
|
|
|
|
userInfo: any; |
|
|
|
|
menuList: any; |
|
|
|
|
routeName: string; |
|
|
|
|
switchValue = false; |
|
|
|
|
constructor( |
|
|
|
|
private storage: LocalStorageService, |
|
|
|
|
private loginService: LoginService, |
|
|
|
|
private message: NzMessageService, |
|
|
|
|
private commonsService: CommonsService, |
|
|
|
|
private iconService: IconService, |
|
|
|
|
private router: Router, |
|
|
|
|
) { } |
|
|
|
@ -29,6 +32,9 @@ export class NavigationComponent implements OnInit { |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.routeName = this.storage.get(ROUTENAME) == null ? 'index' : this.storage.get(ROUTENAME); |
|
|
|
|
this.userInfo = this.storage.getList(ADMIN_INFO_OBJECT); |
|
|
|
|
this.commonsService.mappingSysNameOl('RECHARGE', data => { |
|
|
|
|
this.switchValue = data['return_data']['codeValue'] === '1'; |
|
|
|
|
}); |
|
|
|
|
this.menuList = this.storage.getList(ADMIN_INFO_OBJECT)['menuList']; // 定义菜单数据
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -62,4 +68,15 @@ export class NavigationComponent implements OnInit { |
|
|
|
|
history.back(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
clickSwitch(): void { |
|
|
|
|
this.switchValue = !this.switchValue; |
|
|
|
|
this.commonsService.updateDictionary('RECHARGE' , this.switchValue === true ? '1' : '0' , data => { |
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
this.message.success(data['return_data']); |
|
|
|
|
} else { |
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|