|
|
|
@ -1,6 +1,14 @@ |
|
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
|
import {Component, OnInit} from '@angular/core'; |
|
|
|
|
import {LocalStorageService} from '../../services/local-storage.service'; |
|
|
|
|
import {DATA, ROUTENAME, MENUNAME, CHILDMENUNAME, INIT_FLAG, ADMIN_INFO_OBJECT, TOKEN} from '../../services/local-storage.namespace'; |
|
|
|
|
import { |
|
|
|
|
DATA, |
|
|
|
|
ROUTENAME, |
|
|
|
|
MENUNAME, |
|
|
|
|
CHILDMENUNAME, |
|
|
|
|
INIT_FLAG, |
|
|
|
|
ADMIN_INFO_OBJECT, |
|
|
|
|
TOKEN |
|
|
|
|
} from '../../services/local-storage.namespace'; |
|
|
|
|
import {LoginService} from '../../services/login.service'; |
|
|
|
|
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; |
|
|
|
|
import {Router} from '@angular/router'; |
|
|
|
@ -12,11 +20,12 @@ import {Md5} from 'ts-md5'; |
|
|
|
|
import {environment} from '../../../environments/environment'; |
|
|
|
|
import {HttpClient} from '@angular/common/http'; |
|
|
|
|
import {CompanyTwoPwdService} from '../../services/company-two-pwd.service'; |
|
|
|
|
import {WebsocketService} from '../../services/websocket.service'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-navigation', |
|
|
|
|
templateUrl: './navigation.component.html', |
|
|
|
|
styleUrls: ['./navigation.component.less'] |
|
|
|
|
styleUrls: ['./navigation.component.less'], |
|
|
|
|
}) |
|
|
|
|
export class NavigationComponent implements OnInit { |
|
|
|
|
|
|
|
|
@ -29,6 +38,7 @@ export class NavigationComponent implements OnInit { |
|
|
|
|
menuList: any; |
|
|
|
|
routeName: string; |
|
|
|
|
switchValue = false; |
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
|
private storage: LocalStorageService, |
|
|
|
|
private loginService: LoginService, |
|
|
|
@ -37,10 +47,13 @@ export class NavigationComponent implements OnInit { |
|
|
|
|
private companyTwoPwdService: CompanyTwoPwdService, |
|
|
|
|
private http: HttpClient, // http请求
|
|
|
|
|
private iconService: IconService, |
|
|
|
|
private webSocketService: WebsocketService, |
|
|
|
|
private store: LocalStorageService, // 数据请求
|
|
|
|
|
private modal: NzModalService, |
|
|
|
|
private fb: FormBuilder, // 表单
|
|
|
|
|
private router: Router, |
|
|
|
|
) { } |
|
|
|
|
) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
@ -55,6 +68,10 @@ export class NavigationComponent implements OnInit { |
|
|
|
|
this.switchValue = data['return_data']['codeValue'] === '1'; |
|
|
|
|
}); |
|
|
|
|
this.menuList = this.storage.getList(ADMIN_INFO_OBJECT)['menuList']; // 定义菜单数据
|
|
|
|
|
|
|
|
|
|
// 连接websocket
|
|
|
|
|
// this.webSocketService.connect(`wss://hsgcs.dctpay.com/msg/WebSocket/` + this.store.get(ADMIN_INFO_OBJECT)['merchantStore'].id);
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public activeLi(routeName): void { |
|
|
|
@ -63,7 +80,7 @@ export class NavigationComponent implements OnInit { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 菜单姓名
|
|
|
|
|
public getRouteName(menuName , childMenuName): void { |
|
|
|
|
public getRouteName(menuName, childMenuName): void { |
|
|
|
|
this.storage.set(MENUNAME, menuName); |
|
|
|
|
this.storage.set(CHILDMENUNAME, childMenuName); |
|
|
|
|
} |
|
|
|
@ -89,7 +106,7 @@ export class NavigationComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
clickSwitch(): void { |
|
|
|
|
this.switchValue = !this.switchValue; |
|
|
|
|
this.commonsService.updateDictionary('RECHARGE' , this.switchValue === true ? '1' : '0' , data => { |
|
|
|
|
this.commonsService.updateDictionary('RECHARGE', this.switchValue === true ? '1' : '0', data => { |
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
this.message.success(data['return_data']); |
|
|
|
|
} else { |
|
|
|
@ -163,13 +180,12 @@ export class NavigationComponent implements OnInit { |
|
|
|
|
*/ |
|
|
|
|
checkPwd = (control: FormControl): { [s: string]: boolean } => { |
|
|
|
|
if (!control.value) { |
|
|
|
|
return { required: true }; |
|
|
|
|
return {required: true}; |
|
|
|
|
} else if (control.value !== this.validateForm.controls.newPassword.value) { |
|
|
|
|
return { confirm: true, error: true }; |
|
|
|
|
return {confirm: true, error: true}; |
|
|
|
|
} |
|
|
|
|
return {}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|