系统管理bug修改及添加个人修改密码
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
<label for="">航空公司: </label>
|
||||
<select [(ngModel)]="filterItems.ALCD" (ngModelChange)="selectChange('filter')" class="form-control">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let airline of airlinesSelections" [value]="airline.airlineCodeIata">{{airline.airlineName}}</option>
|
||||
<option *ngFor="let airline of airlinesSelections" [value]="airline['airlineCodeIata']">{{airline['airlineName']}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
@@ -111,10 +111,10 @@
|
||||
<label for="">异常状态: </label>
|
||||
<select [(ngModel)]="filterItems.Abnormal_state" (ngModelChange)="selectChange('filter')" class="form-control">
|
||||
<option value=""></option>
|
||||
<option value="CNCL">取消</option>
|
||||
<option value="DELY">延误</option>
|
||||
<option value="FDIV">备降</option>
|
||||
<option value="FRET">返航</option>
|
||||
<option value="CAN">取消</option>
|
||||
<option value="DLY">延误</option>
|
||||
<option value="ALT">备降</option>
|
||||
<option value="RTN">返航</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
|
||||
@@ -246,8 +246,8 @@ export class MainComponent implements OnInit {
|
||||
*/
|
||||
doSequence(combined_data) {
|
||||
this.raw_data.forEach(element => {
|
||||
if (this.airlinesSelections.findIndex(airline => airline.airlineCodeIata === element['ALCD']) === -1) {
|
||||
let index = this.airlines.findIndex(val => val.airlineCodeIata === element['ALCD']);
|
||||
if (this.airlinesSelections.findIndex(airline => airline['airlineCodeIata'] === element['ALCD']) === -1) {
|
||||
let index = this.airlines.findIndex(val => val['airlineCodeIata'] === element['ALCD']);
|
||||
this.airlinesSelections.push(this.airlines[index]);
|
||||
}
|
||||
if (this.flightTypeSelections.findIndex(flightType => flightType.flightTypeCode === element['FLTY']) === -1) {
|
||||
@@ -630,7 +630,7 @@ export class MainComponent implements OnInit {
|
||||
groupCode: 'userSettingSelected',
|
||||
settingContent: settingContent,
|
||||
}).subscribe(() => {
|
||||
console.log('保存UIsetting成功!');
|
||||
|
||||
})
|
||||
} else if (type === 'time') {
|
||||
this.positionedArray = [];
|
||||
@@ -651,7 +651,7 @@ export class MainComponent implements OnInit {
|
||||
for (const key in filterItems) {
|
||||
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||
if (key === 'Abnormal_state') {
|
||||
if (item['preFlight'][filterItems[key]] && item['preFlight'][filterItems[key]].length > 0) {
|
||||
if(item['preFlight']['ABN'].findIndex((val)=>val['TYPE']===filterItems[key])>-1){
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -687,7 +687,7 @@ export class MainComponent implements OnInit {
|
||||
for (const key in filterItems) {
|
||||
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||
if (key === 'Abnormal_state') {
|
||||
if (item['reaFlight'][filterItems[key]] && item['reaFlight'][filterItems[key]].length > 0) {
|
||||
if (item['reaFlight']['ABN'].findIndex((val)=>val['TYPE']===filterItems[key])>-1) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -724,7 +724,7 @@ export class MainComponent implements OnInit {
|
||||
for (const key in filterItems) {
|
||||
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||
if (key === 'Abnormal_state') {
|
||||
if (item['preFlight'][filterItems[key]] && item['preFlight'][filterItems[key]].length > 0) {
|
||||
if (item['preFlight']['ABN'].findIndex((val)=>val['TYPE']===filterItems[key])>-1) {
|
||||
pre_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -757,7 +757,7 @@ export class MainComponent implements OnInit {
|
||||
for (const key in filterItems) {
|
||||
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||
if (key === 'Abnormal_state') {
|
||||
if (item['reaFlight'][filterItems[key]] && item['reaFlight'][filterItems[key]].length > 0) {
|
||||
if (item['reaFlight']['ABN'].findIndex((val)=>val['TYPE']===filterItems[key])>-1) {
|
||||
rea_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -812,7 +812,7 @@ export class MainComponent implements OnInit {
|
||||
for (const key in filterItems) {
|
||||
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||
if (key === 'Abnormal_state') {
|
||||
if (item['preFlight'][filterItems[key]] && item['preFlight'][filterItems[key]].length > 0) {
|
||||
if (item['preFlight']['ABN'].findIndex((val)=>val['TYPE']===filterItems[key])>-1) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -837,7 +837,7 @@ export class MainComponent implements OnInit {
|
||||
for (const key in filterItems) {
|
||||
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||
if (key === 'Abnormal_state') {
|
||||
if (item['reaFlight'][filterItems[key]] && item['reaFlight'][filterItems[key]].length > 0) {
|
||||
if (item['reaFlight']['ABN'].findIndex((val)=>val['TYPE']===filterItems[key])>-1) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -863,7 +863,7 @@ export class MainComponent implements OnInit {
|
||||
for (const key in filterItems) {
|
||||
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||
if (key === 'Abnormal_state') {
|
||||
if (item['preFlight'][filterItems[key]] && item['preFlight'][filterItems[key]].length > 0) {
|
||||
if (item['preFlight']['ABN'].findIndex((val)=>val['TYPE']===filterItems[key])>-1) {
|
||||
pre_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -885,7 +885,7 @@ export class MainComponent implements OnInit {
|
||||
for (const key in filterItems) {
|
||||
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||
if (key === 'Abnormal_state') {
|
||||
if (item['reaFlight'][filterItems[key]] && item['reaFlight'][filterItems[key]].length > 0) {
|
||||
if (item['reaFlight']['ABN'].findIndex((val)=>val['TYPE']===filterItems[key])>-1) {
|
||||
rea_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
|
||||
@@ -23,40 +23,33 @@
|
||||
<span>{{role_type}}</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- <li class="nav-item dropdown mr-2">
|
||||
<a class="nav-icon nav-link" data-toggle="dropdown" id="messagesDropdown" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
<div class="icon-container">
|
||||
<i class="fa fa-bell-o"></i>
|
||||
<span>7</span>
|
||||
</div>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="messagesDropdown">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</li> -->
|
||||
<!-- <li class="nav-item dropdown mr-3">
|
||||
<a class="nav-icon nav-link" data-toggle="dropdown" id="alertsDropdown" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
<div class="icon-container">
|
||||
<i class="fa fa-envelope-o mr-1"></i>
|
||||
<label>消息</label>
|
||||
<span style="background:#0cc2aa">4</span>
|
||||
</div>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</li> -->
|
||||
<li class="nav-item mr-2">
|
||||
<a class="nav-link" nz-popconfirm nzTitle="确认退出?" (nzOnConfirm)="confirmLogout()" nzPlacement="bottom">
|
||||
<nz-dropdown [nzVisible]="dropdownVisible" [nzPlacement]="'bottomRight'" [nzTrigger]="'click'">
|
||||
<a nz-dropdown class="nav-link">
|
||||
<!-- <i nz-icon type="setting" theme="outline"></i> -->
|
||||
<i class="fa fa-cog mr-2" aria-hidden="true"></i>
|
||||
<span>设置</span>
|
||||
</a>
|
||||
<ul style="width:150px" nz-menu>
|
||||
<li nz-menu-item (click)="modifyPassword()">
|
||||
<i class="fa fa-chain-broken mr-3" aria-hidden="true"></i>
|
||||
<span>密码修改</span></li>
|
||||
<li nz-menu-divider></li>
|
||||
<li (click)="logoutClick()" nz-menu-item nz-popconfirm nzTitle="确认退出?" (nzOnConfirm)="confirmLogout()"
|
||||
nzPlacement="bottom">
|
||||
<i class="fa fa-sign-out mr-3"></i>
|
||||
<span>退出</span>
|
||||
</li>
|
||||
</ul>
|
||||
</nz-dropdown>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <a class="nav-link" nz-popconfirm nzTitle="确认退出?" (nzOnConfirm)="confirmLogout()" nzPlacement="bottom">
|
||||
<i class="fa fa-sign-out mr-1"></i>
|
||||
<span>退出</span>
|
||||
</a>
|
||||
</a> -->
|
||||
</li>
|
||||
<!-- <li class="nav-item dropdown">
|
||||
<a class="nav-link user-info" data-toggle="dropdown" id="userDropdown" aria-haspopup="true"
|
||||
@@ -91,4 +84,49 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nz-modal [(nzVisible)]="modalIsVisible" [nzTitle]="modalTitle" [nzContent]="modalContent" [nzFooter]="modalFooter"
|
||||
(nzOnCancel)="modifyHandleCancel()">
|
||||
<ng-template #modalTitle>
|
||||
修改密码
|
||||
</ng-template>
|
||||
|
||||
<ng-template #modalContent>
|
||||
<form nz-form [formGroup]="validateForm">
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>原密码</nz-form-label>
|
||||
<nz-form-control [nzSm]="14" [nzXs]="24">
|
||||
<input type="password" nz-input formControlName="oldPassword" placeholder="原密码">
|
||||
<nz-form-explain *ngIf="validateForm.get('oldPassword').dirty && validateForm.get('oldPassword').errors">请输入原密码</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>新密码</nz-form-label>
|
||||
<nz-form-control [nzSm]="14" [nzXs]="24">
|
||||
<input type="password" nz-input formControlName="newPassword" placeholder="新密码" (ngModelChange)="updateConfirmValidator()">
|
||||
<nz-form-explain *ngIf="validateForm.get('newPassword').dirty && validateForm.get('newPassword').errors">请输入新密码</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>确认新密码</nz-form-label>
|
||||
<nz-form-control [nzSm]="14" [nzXs]="24">
|
||||
<input type="password" nz-input formControlName="confirmPassword" placeholder="再次输入新密码">
|
||||
<nz-form-explain *ngIf="validateForm.get('confirmPassword')?.dirty && validateForm.get('confirmPassword')?.errors">
|
||||
<ng-container *ngIf="validateForm.get('confirmPassword')?.hasError('required')">
|
||||
请再次输入新密码!
|
||||
</ng-container>
|
||||
<ng-container *ngIf="validateForm.get('confirmPassword')?.hasError('confirm')">
|
||||
两次密码不一致!
|
||||
</ng-container>
|
||||
</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</form>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #modalFooter>
|
||||
<button nz-button nzType="default" (click)="modifyHandleCancel()">取消</button>
|
||||
<button nz-button nzType="primary" [disabled]="!validateForm.valid" (click)="modifyHandleOk()" [nzLoading]="isConfirmLoading">确定</button>
|
||||
</ng-template>
|
||||
</nz-modal>
|
||||
</div>
|
||||
@@ -5,6 +5,13 @@ import { OperateSpinServiceService } from '../services/operate-spin-service.serv
|
||||
import { HttpClientService } from '../services/http-client.service';
|
||||
import { NzMessageService } from 'ng-zorro-antd';
|
||||
|
||||
import {
|
||||
FormBuilder,
|
||||
FormControl,
|
||||
FormGroup,
|
||||
Validators
|
||||
} from '@angular/forms';
|
||||
|
||||
import { filter } from 'rxjs/operators';
|
||||
// import 'rxjs/add/operator/map';
|
||||
// import 'rxjs/add/operator/mergeMap';
|
||||
@@ -19,10 +26,18 @@ export class PagesComponent implements OnInit {
|
||||
public role_type: string;
|
||||
public menuClose: boolean = false;
|
||||
public isSpinning: any = false;
|
||||
menuData = []
|
||||
menuData = [];
|
||||
|
||||
modalIsVisible = false;
|
||||
isConfirmLoading = false;
|
||||
|
||||
dropdownVisible = false;
|
||||
|
||||
validateForm: FormGroup;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private basicDataService: BasicDataService,
|
||||
private operateSpinService: OperateSpinServiceService,
|
||||
private httpClient: HttpClientService,
|
||||
@@ -34,19 +49,6 @@ export class PagesComponent implements OnInit {
|
||||
this.basicDataService.loadBasicData();
|
||||
}
|
||||
|
||||
menuDataHandle(menu) {
|
||||
menu['name'] = menu.data.menu.title;
|
||||
menu['icon'] = menu.data.menu.icon;
|
||||
menu['isExpend'] = false;
|
||||
menu['isActive'] = false;
|
||||
delete menu.data;
|
||||
if (menu.children && menu.children.length > 0) {
|
||||
menu.children.forEach(menu => {
|
||||
this.menuDataHandle(menu);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.httpClient.get('/sysapi/common/menu/list', { sysid: 1 }).subscribe(
|
||||
res => {
|
||||
@@ -77,12 +79,116 @@ export class PagesComponent implements OnInit {
|
||||
).subscribe((event) => {
|
||||
this.selectActiveMenu(this.menuData, event['urlAfterRedirects'])
|
||||
});
|
||||
|
||||
this.validateForm = this.fb.group({
|
||||
oldPassword: ['', [Validators.required]],
|
||||
newPassword: ['', [Validators.required]],
|
||||
confirmPassword: ['', [Validators.required, this.confirmationValidator]],
|
||||
});
|
||||
}
|
||||
|
||||
confirmationValidator = (control: FormControl): { [s: string]: boolean } => {
|
||||
// console.log(control.value);
|
||||
if (!control.value) {
|
||||
return { required: true };
|
||||
} else if (control.value !== this.validateForm.controls.newPassword.value) {
|
||||
return { confirm: true, error: true };
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
||||
updateConfirmValidator(): void {
|
||||
/** wait for refresh value */
|
||||
Promise.resolve().then(() => this.validateForm.controls.confirmPassword.updateValueAndValidity());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*/
|
||||
modifyPassword() {
|
||||
this.dropdownVisible = false;
|
||||
this.modalIsVisible = true;
|
||||
}
|
||||
modifyHandleOk(): void {
|
||||
this.isConfirmLoading = true;
|
||||
|
||||
this.httpClient.post('/adminapi/xxxxx', this.validateForm.value).subscribe((response) => {
|
||||
// console.log(response);
|
||||
this.message.success('修改密码成功!');
|
||||
this.validateForm.patchValue({
|
||||
oldPassword: '',
|
||||
newPassword: '',
|
||||
confirmPassword: ''
|
||||
})
|
||||
for (const i in this.validateForm.controls) {
|
||||
this.validateForm.controls[i].markAsPristine();
|
||||
this.validateForm.controls[i].markAsUntouched();
|
||||
this.validateForm.controls[i].updateValueAndValidity();
|
||||
}
|
||||
this.modalIsVisible = false;
|
||||
this.isConfirmLoading = false;
|
||||
}, err => {
|
||||
// console.log(err);
|
||||
this.message.error('修改密码失败!');
|
||||
this.validateForm.patchValue({
|
||||
oldPassword: '',
|
||||
newPassword: '',
|
||||
confirmPassword: ''
|
||||
})
|
||||
for (const i in this.validateForm.controls) {
|
||||
this.validateForm.controls[i].markAsPristine();
|
||||
this.validateForm.controls[i].markAsUntouched();
|
||||
this.validateForm.controls[i].updateValueAndValidity();
|
||||
}
|
||||
this.modalIsVisible = false;
|
||||
this.isConfirmLoading = false;
|
||||
})
|
||||
|
||||
}
|
||||
modifyHandleCancel(): void {
|
||||
this.modalIsVisible = false;
|
||||
this.validateForm.patchValue({
|
||||
oldPassword: '',
|
||||
newPassword: '',
|
||||
confirmPassword: ''
|
||||
})
|
||||
for (const i in this.validateForm.controls) {
|
||||
this.validateForm.controls[i].markAsPristine();
|
||||
this.validateForm.controls[i].markAsUntouched();
|
||||
this.validateForm.controls[i].updateValueAndValidity();
|
||||
}
|
||||
}
|
||||
|
||||
//退出点击
|
||||
logoutClick() {
|
||||
this.dropdownVisible = true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 展开收起菜单
|
||||
*/
|
||||
toggleMenu() {
|
||||
this.menuClose = !this.menuClose;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 菜单数据处理
|
||||
*/
|
||||
menuDataHandle(menu) {
|
||||
menu['name'] = menu.data.menu.title;
|
||||
menu['icon'] = menu.data.menu.icon;
|
||||
menu['isExpend'] = false;
|
||||
menu['isActive'] = false;
|
||||
delete menu.data;
|
||||
if (menu.children && menu.children.length > 0) {
|
||||
menu.children.forEach(menu => {
|
||||
this.menuDataHandle(menu);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
* @param item
|
||||
|
||||
@@ -4,6 +4,7 @@ import { NgZorroAntdModule } from 'ng-zorro-antd';
|
||||
|
||||
import { PagesComponent } from './pages.component';
|
||||
import { PagesRoutingModule } from './pages-routing.module';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { SidebarMenuModule } from '../components/sidebar-menu/sidebar-menu.module';
|
||||
import { BarMenuModule } from '../components/bar-menu/bar-menu.module';
|
||||
@@ -14,6 +15,8 @@ import { BasicDataService } from '../services/basic-data-service';
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
NgZorroAntdModule,
|
||||
SidebarMenuModule,
|
||||
BarMenuModule,
|
||||
|
||||
+10
-8
@@ -63,7 +63,7 @@
|
||||
<span nzSpan="12" class="detail-item-text">{{parentName|null}}</span>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col nzSpan="24">
|
||||
<!-- <div nz-col nzSpan="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label class="mr-2" [nzXs]="24" [nzSm]="24" [nzMd]="3" [nzLg]="3" [nzXl]="3" [nzXXl]="3">机构负责人</nz-form-label>
|
||||
<div nz-col nzSpan="17" class="user-table">
|
||||
@@ -87,7 +87,7 @@
|
||||
</nz-table>
|
||||
</div>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
<!-- 详情 end -->
|
||||
<!-- 新增、修改 begin -->
|
||||
@@ -115,7 +115,8 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="7" nzFor="code" nzRequired>机构编码</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="code" formControlName="code" placeholder="请输入机构编码" (keyup)='checkName()' name="validating">
|
||||
<input nz-input id="code" formControlName="code" placeholder="请输入机构编码" (keyup)='checkName()'
|
||||
name="validating">
|
||||
<nz-form-explain *ngIf="validateForm.get('code').dirty && validateForm.get('code').errors?.required">请输入机构编码</nz-form-explain>
|
||||
<nz-form-explain *ngIf="validateForm.get('code').dirty && validateForm.get('code').errors?.maxlength">机构编码最长10个字符</nz-form-explain>
|
||||
<nz-form-explain *ngIf="!nameOnly" class="danger">该编码已存在</nz-form-explain>
|
||||
@@ -126,7 +127,7 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="7" nzFor="contact_person">联系人</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="contact_person" formControlName="contact_person" placeholder="请输入姓名">
|
||||
<input nz-input id="contact_person" formControlName="contact_person" placeholder="请输入联系人姓名">
|
||||
<nz-form-explain *ngIf="validateForm.get('contact_person').dirty && validateForm.get('contact_person').errors?.maxlength">联系人名称最长10个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
@@ -135,8 +136,8 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzSpan="7" nzFor="contact_method">联系方式</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="contact_method" formControlName="contact_method" placeholder="请输入姓名">
|
||||
<nz-form-explain *ngIf="validateForm.get('contact_method').dirty && validateForm.get('contact_method').errors">请输入联系方式</nz-form-explain>
|
||||
<input nz-input id="contact_method" formControlName="contact_method" placeholder="请输入联系方式">
|
||||
<nz-form-explain *ngIf="validateForm.get('contact_method').dirty && validateForm.get('contact_method').errors?.maxlength">联系方式最长20个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -145,6 +146,7 @@
|
||||
<nz-form-label nzSpan="7" nzFor="address">机构地址</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<textarea rows="3" id="address" nz-input formControlName="address" placeholder="请输入机构地址"></textarea>
|
||||
<nz-form-explain *ngIf="validateForm.get('address').dirty && validateForm.get('address').errors?.maxlength">机构地址最长30个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -171,7 +173,7 @@
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col nzSpan="24">
|
||||
<!-- <div nz-col nzSpan="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzXs]="7" [nzSm]="7" [nzMd]="7" [nzLg]="7" [nzXl]="3" [nzXXl]="3">机构负责人</nz-form-label>
|
||||
<nz-form-control [nzXs]="3" [nzSm]="3" [nzMd]="2" [nzLg]="2" [nzXl]="2" [nzXXl]="2">
|
||||
@@ -203,7 +205,7 @@
|
||||
</nz-table>
|
||||
</div>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</form>
|
||||
<div class="user-footer" *ngIf="modifyType!=3">
|
||||
|
||||
+36
-12
@@ -33,6 +33,7 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
real_name: '',
|
||||
}
|
||||
public orgDetail: any = ''; //左侧机构目录当前选中项机构的详情信息
|
||||
public sekOrgDetail: any = '';
|
||||
public orgSeleted: any = ''; //新增或者修改时,当前选中的所属机构的机构详情信息
|
||||
public modifyType: any = '3'; //操作状态 1新增 2修改 3详情
|
||||
public parentName: any = '';
|
||||
@@ -73,10 +74,9 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
shortName: ['', [Validators.maxLength(10)]],
|
||||
code: ['', [Validators.required, Validators.maxLength(10)]],
|
||||
contact_person: ['', [Validators.maxLength(10)]],
|
||||
contact_method: [''],
|
||||
contact_method: ['', [Validators.maxLength(20)]],
|
||||
organization_type: [''],
|
||||
address: [''],
|
||||
|
||||
address: ['', [Validators.maxLength(30)]],
|
||||
});
|
||||
this.initTree();
|
||||
this.queryTable();
|
||||
@@ -85,23 +85,35 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
addModify(type) {
|
||||
//数据清空重置
|
||||
this.modifyType = type;
|
||||
this.validateForm.reset();
|
||||
// this.validateForm.reset();
|
||||
this.userSelecteds = [];
|
||||
this.orgSeleted = '';
|
||||
this.checkNameStatus = '';
|
||||
this.nameOnly = true;
|
||||
this.validateForm.patchValue({ organization_type: 1, });
|
||||
// this.validateForm.patchValue({ organization_type: 1, });
|
||||
if (type == 1) {
|
||||
|
||||
this.sekOrgDetail = true;
|
||||
this.zNodesChild = this.zNodes.concat();
|
||||
$.fn.zTree.init($("#treeDemoChild"), this.settingChild, this.zNodesChild);
|
||||
this.validateForm.patchValue({
|
||||
organization: '',
|
||||
shortName: '',
|
||||
code: '',
|
||||
contact_person: '',
|
||||
contact_method: '',
|
||||
organization_type: 1,
|
||||
address: '',
|
||||
});
|
||||
} else if (type == 2) {
|
||||
this.sekOrgDetail = false;
|
||||
let item = this.orgDetail;
|
||||
this.zNodesChild = this.zNodes.concat();
|
||||
for (let i = 0; i < this.zNodesChild.length; i++) {
|
||||
if (this.zNodesChild[i].id === item.id) {
|
||||
this.zNodesChild.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// for (let i = 0; i < this.zNodesChild.length; i++) {
|
||||
// if (this.zNodesChild[i].id === item.id) {
|
||||
// this.zNodesChild.splice(i, 1);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
$.fn.zTree.init($("#treeDemoChild"), this.settingChild, this.zNodesChild);
|
||||
this.validateForm.patchValue({
|
||||
organization: item.organization,
|
||||
@@ -190,6 +202,18 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
//保存选择机构
|
||||
treeSave() {
|
||||
if (this.treeSelectedChild) {
|
||||
if (this.sekOrgDetail) {
|
||||
//新增
|
||||
} else {
|
||||
//修改
|
||||
if (this.orgDetail && this.orgDetail.id === this.treeSelectedChild.id) {
|
||||
this.message.create('warning', '不能选择自己作为所属机构!');
|
||||
this.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.orgSeleted = this.treeSelectedChild;
|
||||
this.close();
|
||||
// this.visible = false;
|
||||
|
||||
+5
-1
@@ -24,7 +24,7 @@
|
||||
nzPlaceHolder="请选择所属角色">
|
||||
<nz-option *ngFor="let option of listOfRole" [nzLabel]="option.role_name" [nzValue]="option.rid"></nz-option>
|
||||
</nz-select>
|
||||
<nz-form-explain *ngIf="(roleList.length<=0)&&saveCheck" class="red">请选择所属角色</nz-form-explain>
|
||||
<nz-form-explain *ngIf="(validateForm.get('roleList').value.length<=0)&&saveCheck" class="red">请选择所属角色</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -67,6 +67,7 @@
|
||||
<nz-form-label nzSpan="7" nzFor="remark">描述</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<textarea rows="3" id="remark" nz-input formControlName="remark" placeholder="请输入描述信息"></textarea>
|
||||
<nz-form-explain *ngIf="validateForm.get('remark').dirty && validateForm.get('remark').errors?.maxlength">描述最长20个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -75,6 +76,7 @@
|
||||
<nz-form-label nzSpan="7" nzFor="identify_num">身份证号</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="identify_num" formControlName="identify_num" placeholder="请输入身份证号">
|
||||
<nz-form-explain *ngIf="validateForm.get('identify_num').dirty && validateForm.get('identify_num').errors?.maxlength">身份证号最长20个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -83,6 +85,7 @@
|
||||
<nz-form-label nzSpan="7" nzFor="email">邮箱</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="email" formControlName="email" placeholder="请输入邮箱地址">
|
||||
<nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').errors?.maxlength">邮箱最长20个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -91,6 +94,7 @@
|
||||
<nz-form-label nzSpan="7" nzFor="mobile">电话</nz-form-label>
|
||||
<nz-form-control nzSpan="12">
|
||||
<input nz-input id="mobile" formControlName="mobile" placeholder="请输入电话号码">
|
||||
<nz-form-explain *ngIf="validateForm.get('mobile').dirty && validateForm.get('mobile').errors?.maxlength">电话最长12个字符</nz-form-explain>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
+5
-5
@@ -57,13 +57,13 @@ export class UserManagementModifyComponent implements OnInit {
|
||||
real_name: ['', [Validators.required, Validators.maxLength(20)]],
|
||||
login_name: ['', [Validators.required, Validators.maxLength(20)]],
|
||||
password: ['', [Validators.required, Validators.maxLength(20)]],
|
||||
identify_num: [''],
|
||||
email: [''],
|
||||
mobile: [''],
|
||||
identify_num: ['', [Validators.maxLength(18)]],
|
||||
email: ['', [Validators.maxLength(20)]],
|
||||
mobile: ['', [Validators.maxLength(12)]],
|
||||
sex: ['m'],
|
||||
status: ['1'],
|
||||
roleList: ['', [Validators.required]],
|
||||
remark: ['']
|
||||
roleList: [[], [Validators.required]],
|
||||
remark: ['', [Validators.maxLength(20)]]
|
||||
});
|
||||
//取路由参数
|
||||
this.route.queryParams.subscribe(routeParams => {
|
||||
|
||||
@@ -217,13 +217,12 @@ export class FlightsDataHandle {
|
||||
}
|
||||
|
||||
public basicDataTransHandle(item, airports, citys, airlines, flightStatus, flightTypes) {
|
||||
try {
|
||||
if (this.orderHandle.isArriFlight(item) || this.orderHandle.isDeptFlight(item)) {
|
||||
//航线处理
|
||||
try {
|
||||
let erutCodeArray = item['renderFlight']['ERUT'].split(' - ');
|
||||
let erutChnArray = []
|
||||
for (let i = 0; i < erutCodeArray.length; i++) {
|
||||
try {
|
||||
let airportIndex = airports.findIndex(val => val.airportCodeIata === erutCodeArray[i]);
|
||||
if (airportIndex > -1) {
|
||||
if (airports[airportIndex].briefNameChn) {
|
||||
@@ -234,24 +233,36 @@ export class FlightsDataHandle {
|
||||
} else {
|
||||
erutChnArray.push(erutCodeArray[i]);
|
||||
}
|
||||
} catch (error) {
|
||||
erutChnArray.push(erutCodeArray[i]);
|
||||
}
|
||||
}
|
||||
item['renderFlight']['ERUT'] = erutChnArray.join(' - ');
|
||||
} catch (error) {
|
||||
console.log("基础数据航线错误,处理失败,请检查数据 -- 纯到港或纯离港")
|
||||
}
|
||||
//航空公司处理
|
||||
try {
|
||||
let airlineIndex = airlines.findIndex(val => val.airlineCode === item['renderFlight']['ALCD']);
|
||||
item['renderFlight']['ALCD'] = airlines[airlineIndex].airlineName;
|
||||
} catch (error) {
|
||||
console.log("基础数据航空公司错误,处理失败,请检查数据 -- 纯到港或纯离港")
|
||||
}
|
||||
//运营状态处理
|
||||
try {
|
||||
item['renderFlight']['FTSS'] = flightStatus.find(val => val.sttc === item['renderFlight']['FTSS']).stdc;
|
||||
} catch (error) {
|
||||
console.log("基础数据运营状态错误,处理失败,请检查数据 -- 纯到港或纯离港")
|
||||
}
|
||||
//航班类型处理
|
||||
try {
|
||||
item['renderFlight']['FLTY'] = flightTypes.find(val => val.flightTypeCode === item['renderFlight']['FLTY']).flightTypeNameCn;
|
||||
} catch (error) {
|
||||
console.log("基础数据航班类型错误,处理失败,请检查数据 -- 纯到港或纯离港")
|
||||
}
|
||||
} else {
|
||||
//航线处理
|
||||
try {
|
||||
let erutLinkCodeArray = item['renderFlight']['ERUT'].split(' - ');
|
||||
let erutLinkChnArray = []
|
||||
for (let i = 0; i < erutLinkCodeArray.length; i++) {
|
||||
try {
|
||||
let airportIndex = airports.findIndex(val => val.airportCodeIata === erutLinkCodeArray[i]);
|
||||
if (airportIndex > -1) {
|
||||
if (airports[airportIndex].briefNameChn) {
|
||||
@@ -262,31 +273,45 @@ export class FlightsDataHandle {
|
||||
} else {
|
||||
erutLinkChnArray.push(erutLinkCodeArray[i]);
|
||||
}
|
||||
} catch (error) {
|
||||
erutLinkChnArray.push(erutLinkCodeArray[i]);
|
||||
}
|
||||
|
||||
}
|
||||
item['renderFlight']['ERUT'] = erutLinkChnArray.join(' - ');
|
||||
} catch (error) {
|
||||
console.log("基础数据航线错误,处理失败,请检查数据 -- 链接航班")
|
||||
}
|
||||
//航空公司处理
|
||||
try {
|
||||
let airlineLinkIndex = airlines.findIndex(val => val.airlineCode === item['renderFlight']['ALCD']);
|
||||
item['renderFlight']['ALCD'] = airlines[airlineLinkIndex].airlineName;
|
||||
} catch (error) {
|
||||
console.log("基础数据航空公司错误,处理失败,请检查数据 -- 链接航班")
|
||||
}
|
||||
//运营状态处理
|
||||
try {
|
||||
let ftssLinkCodeArray = item['renderFlight']['FTSS'].split(' / ');
|
||||
let ftssLinkChnArray = [];
|
||||
for (let i = 0; i < ftssLinkCodeArray.length; i++) {
|
||||
ftssLinkChnArray.push(flightStatus.find(val => val.sttc === ftssLinkCodeArray[i]).stdc)
|
||||
}
|
||||
item['renderFlight']['FTSS'] = ftssLinkChnArray.join(' / ');
|
||||
} catch (error) {
|
||||
console.log("基础数据运营状态错误,处理失败,请检查数据 -- 链接航班")
|
||||
}
|
||||
|
||||
//航班类型处理
|
||||
try {
|
||||
let fltyLinkCodeArray = item['renderFlight']['FLTY'].split(' / ');
|
||||
let fltyLinkChnArray = [];
|
||||
for (let i = 0; i < fltyLinkCodeArray.length; i++) {
|
||||
fltyLinkChnArray.push(flightTypes.find(val => val.flightTypeCode === fltyLinkCodeArray[i]).flightTypeNameCn)
|
||||
}
|
||||
item['renderFlight']['FLTY'] = fltyLinkChnArray.join(' / ');
|
||||
} catch (error) {
|
||||
console.log("基础数据航班类型错误,处理失败,请检查数据 -- 链接航班")
|
||||
}
|
||||
|
||||
//航线处理
|
||||
try {
|
||||
let erutPreCodeArray = item['renderPreFlight']['ERUT'].split(' - ');
|
||||
let erutPreChnArray = []
|
||||
for (let i = 0; i < erutPreCodeArray.length; i++) {
|
||||
@@ -306,16 +331,32 @@ export class FlightsDataHandle {
|
||||
}
|
||||
}
|
||||
item['renderPreFlight']['ERUT'] = erutPreChnArray.join(' - ');
|
||||
} catch (error) {
|
||||
console.log("基础数据航线错误,处理失败,请检查数据 -- 链接航班-到港航班")
|
||||
}
|
||||
//航空公司处理
|
||||
try {
|
||||
let airlinePreIndex = airlines.findIndex(val => val.airlineCode === item['renderPreFlight']['ALCD']);
|
||||
item['renderPreFlight']['ALCD'] = airlines[airlinePreIndex].airlineName;
|
||||
} catch (error) {
|
||||
console.log("基础数据航空公司错误,处理失败,请检查数据 -- 链接航班-到港航班")
|
||||
}
|
||||
//运营状态处理
|
||||
try {
|
||||
item['renderPreFlight']['FTSS'] = flightStatus.find(val => val.sttc === item['renderPreFlight']['FTSS']).stdc
|
||||
} catch (error) {
|
||||
console.log("基础数据运营状态错误,处理失败,请检查数据 -- 链接航班-到港航班")
|
||||
}
|
||||
//航班类型处理
|
||||
try {
|
||||
item['renderPreFlight']['FLTY'] = flightTypes.find(val => val.flightTypeCode === item['renderPreFlight']['FLTY']).flightTypeNameCn;
|
||||
} catch (error) {
|
||||
console.log("基础数据航班类型错误,处理失败,请检查数据 -- 链接航班-到港航班")
|
||||
}
|
||||
|
||||
|
||||
//航线处理
|
||||
try {
|
||||
let erutReaCodeArray = item['renderReaFlight']['ERUT'].split(' - ');
|
||||
let erutReaChnArray = []
|
||||
for (let i = 0; i < erutReaCodeArray.length; i++) {
|
||||
@@ -335,19 +376,31 @@ export class FlightsDataHandle {
|
||||
}
|
||||
}
|
||||
item['renderReaFlight']['ERUT'] = erutReaChnArray.join(' - ');
|
||||
} catch (error) {
|
||||
console.log("基础数据航线错误,处理失败,请检查数据 -- 链接航班-离港航班")
|
||||
}
|
||||
//航空公司处理
|
||||
try {
|
||||
let airlineReaIndex = airlines.findIndex(val => val.airlineCode === item['renderReaFlight']['ALCD']);
|
||||
item['renderReaFlight']['ALCD'] = airlines[airlineReaIndex].airlineName;
|
||||
//运营状态处理
|
||||
item['renderReaFlight']['FTSS'] = flightStatus.find(val => val.sttc === item['renderReaFlight']['FTSS']).stdc
|
||||
//航班类型处理
|
||||
item['renderReaFlight']['FLTY'] = flightTypes.find(val => val.flightTypeCode === item['renderReaFlight']['FLTY']).flightTypeNameCn;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('基础数据转换有误,处理失败,请检查数据');
|
||||
throw error;
|
||||
} finally {
|
||||
console.log("基础数据航空公司错误,处理失败,请检查数据 -- 链接航班-离港航班")
|
||||
}
|
||||
//运营状态处理
|
||||
try {
|
||||
item['renderReaFlight']['FTSS'] = flightStatus.find(val => val.sttc === item['renderReaFlight']['FTSS']).stdc
|
||||
} catch (error) {
|
||||
console.log("基础数据运营状态错误,处理失败,请检查数据 -- 链接航班-离港航班")
|
||||
}
|
||||
//航班类型处理
|
||||
try {
|
||||
item['renderReaFlight']['FLTY'] = flightTypes.find(val => val.flightTypeCode === item['renderReaFlight']['FLTY']).flightTypeNameCn;
|
||||
} catch (error) {
|
||||
console.log("基础数据航班类型错误,处理失败,请检查数据 -- 链接航班-离港航班")
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user