Merge branch 'develop-1'

This commit is contained in:
zhouyuejun
2019-04-16 15:10:23 +08:00
10 changed files with 365 additions and 135 deletions
+5 -5
View File
@@ -65,7 +65,7 @@
<label for="">航空公司:&nbsp;&nbsp;</label> <label for="">航空公司:&nbsp;&nbsp;</label>
<select [(ngModel)]="filterItems.ALCD" (ngModelChange)="selectChange('filter')" class="form-control"> <select [(ngModel)]="filterItems.ALCD" (ngModelChange)="selectChange('filter')" class="form-control">
<option value=""></option> <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> </select>
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
@@ -111,10 +111,10 @@
<label for="">异常状态:&nbsp;&nbsp;</label> <label for="">异常状态:&nbsp;&nbsp;</label>
<select [(ngModel)]="filterItems.Abnormal_state" (ngModelChange)="selectChange('filter')" class="form-control"> <select [(ngModel)]="filterItems.Abnormal_state" (ngModelChange)="selectChange('filter')" class="form-control">
<option value=""></option> <option value=""></option>
<option value="CNCL">取消</option> <option value="CAN">取消</option>
<option value="DELY">延误</option> <option value="DLY">延误</option>
<option value="FDIV">备降</option> <option value="ALT">备降</option>
<option value="FRET">返航</option> <option value="RTN">返航</option>
</select> </select>
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
+11 -11
View File
@@ -246,8 +246,8 @@ export class MainComponent implements OnInit {
*/ */
doSequence(combined_data) { doSequence(combined_data) {
this.raw_data.forEach(element => { this.raw_data.forEach(element => {
if (this.airlinesSelections.findIndex(airline => airline.airlineCodeIata === element['ALCD']) === -1) { if (this.airlinesSelections.findIndex(airline => airline['airlineCodeIata'] === element['ALCD']) === -1) {
let index = this.airlines.findIndex(val => val.airlineCodeIata === element['ALCD']); let index = this.airlines.findIndex(val => val['airlineCodeIata'] === element['ALCD']);
this.airlinesSelections.push(this.airlines[index]); this.airlinesSelections.push(this.airlines[index]);
} }
if (this.flightTypeSelections.findIndex(flightType => flightType.flightTypeCode === element['FLTY']) === -1) { if (this.flightTypeSelections.findIndex(flightType => flightType.flightTypeCode === element['FLTY']) === -1) {
@@ -630,7 +630,7 @@ export class MainComponent implements OnInit {
groupCode: 'userSettingSelected', groupCode: 'userSettingSelected',
settingContent: settingContent, settingContent: settingContent,
}).subscribe(() => { }).subscribe(() => {
console.log('保存UIsetting成功!');
}) })
} else if (type === 'time') { } else if (type === 'time') {
this.positionedArray = []; this.positionedArray = [];
@@ -651,7 +651,7 @@ export class MainComponent implements OnInit {
for (const key in filterItems) { for (const key in filterItems) {
if (filterItems.hasOwnProperty(key) && filterItems[key]) { if (filterItems.hasOwnProperty(key) && filterItems[key]) {
if (key === 'Abnormal_state') { 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; is_satis = true;
continue; continue;
} else { } else {
@@ -687,7 +687,7 @@ export class MainComponent implements OnInit {
for (const key in filterItems) { for (const key in filterItems) {
if (filterItems.hasOwnProperty(key) && filterItems[key]) { if (filterItems.hasOwnProperty(key) && filterItems[key]) {
if (key === 'Abnormal_state') { 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; is_satis = true;
continue; continue;
} else { } else {
@@ -724,7 +724,7 @@ export class MainComponent implements OnInit {
for (const key in filterItems) { for (const key in filterItems) {
if (filterItems.hasOwnProperty(key) && filterItems[key]) { if (filterItems.hasOwnProperty(key) && filterItems[key]) {
if (key === 'Abnormal_state') { 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; pre_satis = true;
continue; continue;
} else { } else {
@@ -757,7 +757,7 @@ export class MainComponent implements OnInit {
for (const key in filterItems) { for (const key in filterItems) {
if (filterItems.hasOwnProperty(key) && filterItems[key]) { if (filterItems.hasOwnProperty(key) && filterItems[key]) {
if (key === 'Abnormal_state') { 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; rea_satis = true;
continue; continue;
} else { } else {
@@ -812,7 +812,7 @@ export class MainComponent implements OnInit {
for (const key in filterItems) { for (const key in filterItems) {
if (filterItems.hasOwnProperty(key) && filterItems[key]) { if (filterItems.hasOwnProperty(key) && filterItems[key]) {
if (key === 'Abnormal_state') { 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; is_satis = true;
continue; continue;
} else { } else {
@@ -837,7 +837,7 @@ export class MainComponent implements OnInit {
for (const key in filterItems) { for (const key in filterItems) {
if (filterItems.hasOwnProperty(key) && filterItems[key]) { if (filterItems.hasOwnProperty(key) && filterItems[key]) {
if (key === 'Abnormal_state') { 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; is_satis = true;
continue; continue;
} else { } else {
@@ -863,7 +863,7 @@ export class MainComponent implements OnInit {
for (const key in filterItems) { for (const key in filterItems) {
if (filterItems.hasOwnProperty(key) && filterItems[key]) { if (filterItems.hasOwnProperty(key) && filterItems[key]) {
if (key === 'Abnormal_state') { 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; pre_satis = true;
continue; continue;
} else { } else {
@@ -885,7 +885,7 @@ export class MainComponent implements OnInit {
for (const key in filterItems) { for (const key in filterItems) {
if (filterItems.hasOwnProperty(key) && filterItems[key]) { if (filterItems.hasOwnProperty(key) && filterItems[key]) {
if (key === 'Abnormal_state') { 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; rea_satis = true;
continue; continue;
} else { } else {
+69 -31
View File
@@ -23,40 +23,33 @@
<span>{{role_type}}</span> <span>{{role_type}}</span>
</a> </a>
</li> </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"> <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> <i class="fa fa-sign-out mr-1"></i>
<span>退出</span> <span>退出</span>
</a> </a> -->
</li> </li>
<!-- <li class="nav-item dropdown"> <!-- <li class="nav-item dropdown">
<a class="nav-link user-info" data-toggle="dropdown" id="userDropdown" aria-haspopup="true" <a class="nav-link user-info" data-toggle="dropdown" id="userDropdown" aria-haspopup="true"
@@ -91,4 +84,49 @@
</div> </div>
</div> </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> </div>
+120 -14
View File
@@ -5,6 +5,13 @@ import { OperateSpinServiceService } from '../services/operate-spin-service.serv
import { HttpClientService } from '../services/http-client.service'; import { HttpClientService } from '../services/http-client.service';
import { NzMessageService } from 'ng-zorro-antd'; import { NzMessageService } from 'ng-zorro-antd';
import {
FormBuilder,
FormControl,
FormGroup,
Validators
} from '@angular/forms';
import { filter } from 'rxjs/operators'; import { filter } from 'rxjs/operators';
// import 'rxjs/add/operator/map'; // import 'rxjs/add/operator/map';
// import 'rxjs/add/operator/mergeMap'; // import 'rxjs/add/operator/mergeMap';
@@ -19,10 +26,18 @@ export class PagesComponent implements OnInit {
public role_type: string; public role_type: string;
public menuClose: boolean = false; public menuClose: boolean = false;
public isSpinning: any = false; public isSpinning: any = false;
menuData = [] menuData = [];
modalIsVisible = false;
isConfirmLoading = false;
dropdownVisible = false;
validateForm: FormGroup;
constructor( constructor(
private router: Router, private router: Router,
private fb: FormBuilder,
private basicDataService: BasicDataService, private basicDataService: BasicDataService,
private operateSpinService: OperateSpinServiceService, private operateSpinService: OperateSpinServiceService,
private httpClient: HttpClientService, private httpClient: HttpClientService,
@@ -34,19 +49,6 @@ export class PagesComponent implements OnInit {
this.basicDataService.loadBasicData(); 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() { ngOnInit() {
this.httpClient.get('/sysapi/common/menu/list', { sysid: 1 }).subscribe( this.httpClient.get('/sysapi/common/menu/list', { sysid: 1 }).subscribe(
res => { res => {
@@ -77,12 +79,116 @@ export class PagesComponent implements OnInit {
).subscribe((event) => { ).subscribe((event) => {
this.selectActiveMenu(this.menuData, event['urlAfterRedirects']) 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() { toggleMenu() {
this.menuClose = !this.menuClose; 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 * @param item
+3
View File
@@ -4,6 +4,7 @@ import { NgZorroAntdModule } from 'ng-zorro-antd';
import { PagesComponent } from './pages.component'; import { PagesComponent } from './pages.component';
import { PagesRoutingModule } from './pages-routing.module'; import { PagesRoutingModule } from './pages-routing.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { SidebarMenuModule } from '../components/sidebar-menu/sidebar-menu.module'; import { SidebarMenuModule } from '../components/sidebar-menu/sidebar-menu.module';
import { BarMenuModule } from '../components/bar-menu/bar-menu.module'; import { BarMenuModule } from '../components/bar-menu/bar-menu.module';
@@ -14,6 +15,8 @@ import { BasicDataService } from '../services/basic-data-service';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
FormsModule,
ReactiveFormsModule,
NgZorroAntdModule, NgZorroAntdModule,
SidebarMenuModule, SidebarMenuModule,
BarMenuModule, BarMenuModule,
@@ -63,7 +63,7 @@
<span nzSpan="12" class="detail-item-text">{{parentName|null}}</span> <span nzSpan="12" class="detail-item-text">{{parentName|null}}</span>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="24"> <!-- <div nz-col nzSpan="24">
<nz-form-item> <nz-form-item>
<nz-form-label class="mr-2" [nzXs]="24" [nzSm]="24" [nzMd]="3" [nzLg]="3" [nzXl]="3" [nzXXl]="3">机构负责人</nz-form-label> <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"> <div nz-col nzSpan="17" class="user-table">
@@ -87,7 +87,7 @@
</nz-table> </nz-table>
</div> </div>
</nz-form-item> </nz-form-item>
</div> </div> -->
</form> </form>
<!-- 详情 end --> <!-- 详情 end -->
<!-- 新增、修改 begin --> <!-- 新增、修改 begin -->
@@ -115,7 +115,8 @@
<nz-form-item> <nz-form-item>
<nz-form-label nzSpan="7" nzFor="code" nzRequired>机构编码</nz-form-label> <nz-form-label nzSpan="7" nzFor="code" nzRequired>机构编码</nz-form-label>
<nz-form-control nzSpan="12"> <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?.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="validateForm.get('code').dirty && validateForm.get('code').errors?.maxlength">机构编码最长10个字符</nz-form-explain>
<nz-form-explain *ngIf="!nameOnly" class="danger">该编码已存在</nz-form-explain> <nz-form-explain *ngIf="!nameOnly" class="danger">该编码已存在</nz-form-explain>
@@ -126,7 +127,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label nzSpan="7" nzFor="contact_person">联系人</nz-form-label> <nz-form-label nzSpan="7" nzFor="contact_person">联系人</nz-form-label>
<nz-form-control nzSpan="12"> <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-explain *ngIf="validateForm.get('contact_person').dirty && validateForm.get('contact_person').errors?.maxlength">联系人名称最长10个字符</nz-form-explain>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@@ -135,8 +136,8 @@
<nz-form-item> <nz-form-item>
<nz-form-label nzSpan="7" nzFor="contact_method">联系方式</nz-form-label> <nz-form-label nzSpan="7" nzFor="contact_method">联系方式</nz-form-label>
<nz-form-control nzSpan="12"> <nz-form-control nzSpan="12">
<input nz-input id="contact_method" formControlName="contact_method" placeholder="请输入姓名"> <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> <nz-form-explain *ngIf="validateForm.get('contact_method').dirty && validateForm.get('contact_method').errors?.maxlength">联系方式最长20个字符</nz-form-explain>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
@@ -145,6 +146,7 @@
<nz-form-label nzSpan="7" nzFor="address">机构地址</nz-form-label> <nz-form-label nzSpan="7" nzFor="address">机构地址</nz-form-label>
<nz-form-control nzSpan="12"> <nz-form-control nzSpan="12">
<textarea rows="3" id="address" nz-input formControlName="address" placeholder="请输入机构地址"></textarea> <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-control>
</nz-form-item> </nz-form-item>
</div> </div>
@@ -171,7 +173,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="24"> <!-- <div nz-col nzSpan="24">
<nz-form-item> <nz-form-item>
<nz-form-label [nzXs]="7" [nzSm]="7" [nzMd]="7" [nzLg]="7" [nzXl]="3" [nzXXl]="3">机构负责人</nz-form-label> <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"> <nz-form-control [nzXs]="3" [nzSm]="3" [nzMd]="2" [nzLg]="2" [nzXl]="2" [nzXXl]="2">
@@ -203,7 +205,7 @@
</nz-table> </nz-table>
</div> </div>
</nz-form-item> </nz-form-item>
</div> </div> -->
</form> </form>
<div class="user-footer" *ngIf="modifyType!=3"> <div class="user-footer" *ngIf="modifyType!=3">
@@ -33,6 +33,7 @@ export class DepartmentManagementComponent implements OnInit {
real_name: '', real_name: '',
} }
public orgDetail: any = ''; //左侧机构目录当前选中项机构的详情信息 public orgDetail: any = ''; //左侧机构目录当前选中项机构的详情信息
public sekOrgDetail: any = '';
public orgSeleted: any = ''; //新增或者修改时,当前选中的所属机构的机构详情信息 public orgSeleted: any = ''; //新增或者修改时,当前选中的所属机构的机构详情信息
public modifyType: any = '3'; //操作状态 1新增 2修改 3详情 public modifyType: any = '3'; //操作状态 1新增 2修改 3详情
public parentName: any = ''; public parentName: any = '';
@@ -73,10 +74,9 @@ export class DepartmentManagementComponent implements OnInit {
shortName: ['', [Validators.maxLength(10)]], shortName: ['', [Validators.maxLength(10)]],
code: ['', [Validators.required, Validators.maxLength(10)]], code: ['', [Validators.required, Validators.maxLength(10)]],
contact_person: ['', [Validators.maxLength(10)]], contact_person: ['', [Validators.maxLength(10)]],
contact_method: [''], contact_method: ['', [Validators.maxLength(20)]],
organization_type: [''], organization_type: [''],
address: [''], address: ['', [Validators.maxLength(30)]],
}); });
this.initTree(); this.initTree();
this.queryTable(); this.queryTable();
@@ -85,23 +85,35 @@ export class DepartmentManagementComponent implements OnInit {
addModify(type) { addModify(type) {
//数据清空重置 //数据清空重置
this.modifyType = type; this.modifyType = type;
this.validateForm.reset(); // this.validateForm.reset();
this.userSelecteds = []; this.userSelecteds = [];
this.orgSeleted = ''; this.orgSeleted = '';
this.checkNameStatus = ''; this.checkNameStatus = '';
this.nameOnly = true; this.nameOnly = true;
this.validateForm.patchValue({ organization_type: 1, }); // this.validateForm.patchValue({ organization_type: 1, });
if (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) { } else if (type == 2) {
this.sekOrgDetail = false;
let item = this.orgDetail; let item = this.orgDetail;
this.zNodesChild = this.zNodes.concat(); this.zNodesChild = this.zNodes.concat();
for (let i = 0; i < this.zNodesChild.length; i++) { // for (let i = 0; i < this.zNodesChild.length; i++) {
if (this.zNodesChild[i].id === item.id) { // if (this.zNodesChild[i].id === item.id) {
this.zNodesChild.splice(i, 1); // this.zNodesChild.splice(i, 1);
break; // break;
} // }
} // }
$.fn.zTree.init($("#treeDemoChild"), this.settingChild, this.zNodesChild); $.fn.zTree.init($("#treeDemoChild"), this.settingChild, this.zNodesChild);
this.validateForm.patchValue({ this.validateForm.patchValue({
organization: item.organization, organization: item.organization,
@@ -190,6 +202,18 @@ export class DepartmentManagementComponent implements OnInit {
//保存选择机构 //保存选择机构
treeSave() { treeSave() {
if (this.treeSelectedChild) { 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.orgSeleted = this.treeSelectedChild;
this.close(); this.close();
// this.visible = false; // this.visible = false;
@@ -354,7 +378,7 @@ export class DepartmentManagementComponent implements OnInit {
if (node[0].children && node[0].children.length > 0) { if (node[0].children && node[0].children.length > 0) {
zTree.selectNode(node[0].children[0]) zTree.selectNode(node[0].children[0])
zTree.setting.callback.onClick(null, zTree.setting.treeId, node[0].children[0]) zTree.setting.callback.onClick(null, zTree.setting.treeId, node[0].children[0])
}else{ } else {
zTree.selectNode(node[0]) zTree.selectNode(node[0])
zTree.setting.callback.onClick(null, zTree.setting.treeId, node[0]) zTree.setting.callback.onClick(null, zTree.setting.treeId, node[0])
} }
@@ -24,7 +24,7 @@
nzPlaceHolder="请选择所属角色"> nzPlaceHolder="请选择所属角色">
<nz-option *ngFor="let option of listOfRole" [nzLabel]="option.role_name" [nzValue]="option.rid"></nz-option> <nz-option *ngFor="let option of listOfRole" [nzLabel]="option.role_name" [nzValue]="option.rid"></nz-option>
</nz-select> </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-control>
</nz-form-item> </nz-form-item>
</div> </div>
@@ -67,6 +67,7 @@
<nz-form-label nzSpan="7" nzFor="remark">描述</nz-form-label> <nz-form-label nzSpan="7" nzFor="remark">描述</nz-form-label>
<nz-form-control nzSpan="12"> <nz-form-control nzSpan="12">
<textarea rows="3" id="remark" nz-input formControlName="remark" placeholder="请输入描述信息"></textarea> <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-control>
</nz-form-item> </nz-form-item>
</div> </div>
@@ -75,6 +76,7 @@
<nz-form-label nzSpan="7" nzFor="identify_num">身份证号</nz-form-label> <nz-form-label nzSpan="7" nzFor="identify_num">身份证号</nz-form-label>
<nz-form-control nzSpan="12"> <nz-form-control nzSpan="12">
<input nz-input id="identify_num" formControlName="identify_num" placeholder="请输入身份证号"> <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-control>
</nz-form-item> </nz-form-item>
</div> </div>
@@ -83,6 +85,7 @@
<nz-form-label nzSpan="7" nzFor="email">邮箱</nz-form-label> <nz-form-label nzSpan="7" nzFor="email">邮箱</nz-form-label>
<nz-form-control nzSpan="12"> <nz-form-control nzSpan="12">
<input nz-input id="email" formControlName="email" placeholder="请输入邮箱地址"> <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-control>
</nz-form-item> </nz-form-item>
</div> </div>
@@ -91,6 +94,7 @@
<nz-form-label nzSpan="7" nzFor="mobile">电话</nz-form-label> <nz-form-label nzSpan="7" nzFor="mobile">电话</nz-form-label>
<nz-form-control nzSpan="12"> <nz-form-control nzSpan="12">
<input nz-input id="mobile" formControlName="mobile" placeholder="请输入电话号码"> <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-control>
</nz-form-item> </nz-form-item>
</div> </div>
@@ -54,16 +54,16 @@ export class UserManagementModifyComponent implements OnInit {
// $('#main-container').height('height',(document.documentElement.clientHeight-106+'px')); // $('#main-container').height('height',(document.documentElement.clientHeight-106+'px'));
this.queryRole(); this.queryRole();
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
real_name: ['', [Validators.required,Validators.maxLength(20)]], real_name: ['', [Validators.required, Validators.maxLength(20)]],
login_name: ['', [Validators.required,Validators.maxLength(20)]], login_name: ['', [Validators.required, Validators.maxLength(20)]],
password: ['', [Validators.required,Validators.maxLength(20)]], password: ['', [Validators.required, Validators.maxLength(20)]],
identify_num: [''], identify_num: ['', [Validators.maxLength(18)]],
email: [''], email: ['', [Validators.maxLength(20)]],
mobile: [''], mobile: ['', [Validators.maxLength(12)]],
sex: ['m'], sex: ['m'],
status: ['1'], status: ['1'],
roleList: ['', [Validators.required]], roleList: [[], [Validators.required]],
remark: [''] remark: ['', [Validators.maxLength(20)]]
}); });
//取路由参数 //取路由参数
this.route.queryParams.subscribe(routeParams => { this.route.queryParams.subscribe(routeParams => {
+97 -44
View File
@@ -217,76 +217,101 @@ export class FlightsDataHandle {
} }
public basicDataTransHandle(item, airports, citys, airlines, flightStatus, flightTypes) { public basicDataTransHandle(item, airports, citys, airlines, flightStatus, flightTypes) {
try { if (this.orderHandle.isArriFlight(item) || this.orderHandle.isDeptFlight(item)) {
if (this.orderHandle.isArriFlight(item) || this.orderHandle.isDeptFlight(item)) { //航线处理
//航线处理 try {
let erutCodeArray = item['renderFlight']['ERUT'].split(' - '); let erutCodeArray = item['renderFlight']['ERUT'].split(' - ');
let erutChnArray = [] let erutChnArray = []
for (let i = 0; i < erutCodeArray.length; i++) { for (let i = 0; i < erutCodeArray.length; i++) {
try { let airportIndex = airports.findIndex(val => val.airportCodeIata === erutCodeArray[i]);
let airportIndex = airports.findIndex(val => val.airportCodeIata === erutCodeArray[i]); if (airportIndex > -1) {
if (airportIndex > -1) { if (airports[airportIndex].briefNameChn) {
if (airports[airportIndex].briefNameChn) { erutChnArray.push(airports[airportIndex].briefNameChn);
erutChnArray.push(airports[airportIndex].briefNameChn);
} else {
erutChnArray.push(airports[airportIndex].airportNameChn);
}
} else { } else {
erutChnArray.push(erutCodeArray[i]); erutChnArray.push(airports[airportIndex].airportNameChn);
} }
} catch (error) { } else {
erutChnArray.push(erutCodeArray[i]); erutChnArray.push(erutCodeArray[i]);
} }
} }
item['renderFlight']['ERUT'] = erutChnArray.join(' - '); item['renderFlight']['ERUT'] = erutChnArray.join(' - ');
//航空公司处理 } catch (error) {
console.log("基础数据航线错误,处理失败,请检查数据 -- 纯到港或纯离港")
}
//航空公司处理
try {
let airlineIndex = airlines.findIndex(val => val.airlineCode === item['renderFlight']['ALCD']); let airlineIndex = airlines.findIndex(val => val.airlineCode === item['renderFlight']['ALCD']);
item['renderFlight']['ALCD'] = airlines[airlineIndex].airlineName; item['renderFlight']['ALCD'] = airlines[airlineIndex].airlineName;
//运营状态处理 } catch (error) {
console.log("基础数据航空公司错误,处理失败,请检查数据 -- 纯到港或纯离港")
}
//运营状态处理
try {
item['renderFlight']['FTSS'] = flightStatus.find(val => val.sttc === item['renderFlight']['FTSS']).stdc; 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; item['renderFlight']['FLTY'] = flightTypes.find(val => val.flightTypeCode === item['renderFlight']['FLTY']).flightTypeNameCn;
} else { } catch (error) {
//航线处理 console.log("基础数据航班类型错误,处理失败,请检查数据 -- 纯到港或纯离港")
}
} else {
//航线处理
try {
let erutLinkCodeArray = item['renderFlight']['ERUT'].split(' - '); let erutLinkCodeArray = item['renderFlight']['ERUT'].split(' - ');
let erutLinkChnArray = [] let erutLinkChnArray = []
for (let i = 0; i < erutLinkCodeArray.length; i++) { for (let i = 0; i < erutLinkCodeArray.length; i++) {
try { let airportIndex = airports.findIndex(val => val.airportCodeIata === erutLinkCodeArray[i]);
let airportIndex = airports.findIndex(val => val.airportCodeIata === erutLinkCodeArray[i]); if (airportIndex > -1) {
if (airportIndex > -1) { if (airports[airportIndex].briefNameChn) {
if (airports[airportIndex].briefNameChn) { erutLinkChnArray.push(airports[airportIndex].briefNameChn);
erutLinkChnArray.push(airports[airportIndex].briefNameChn);
} else {
erutLinkChnArray.push(airports[airportIndex].airportNameChn);
}
} else { } else {
erutLinkChnArray.push(erutLinkCodeArray[i]); erutLinkChnArray.push(airports[airportIndex].airportNameChn);
} }
} catch (error) { } else {
erutLinkChnArray.push(erutLinkCodeArray[i]); erutLinkChnArray.push(erutLinkCodeArray[i]);
} }
} }
item['renderFlight']['ERUT'] = erutLinkChnArray.join(' - '); item['renderFlight']['ERUT'] = erutLinkChnArray.join(' - ');
//航空公司处理 } catch (error) {
console.log("基础数据航线错误,处理失败,请检查数据 -- 链接航班")
}
//航空公司处理
try {
let airlineLinkIndex = airlines.findIndex(val => val.airlineCode === item['renderFlight']['ALCD']); let airlineLinkIndex = airlines.findIndex(val => val.airlineCode === item['renderFlight']['ALCD']);
item['renderFlight']['ALCD'] = airlines[airlineLinkIndex].airlineName; item['renderFlight']['ALCD'] = airlines[airlineLinkIndex].airlineName;
//运营状态处理 } catch (error) {
console.log("基础数据航空公司错误,处理失败,请检查数据 -- 链接航班")
}
//运营状态处理
try {
let ftssLinkCodeArray = item['renderFlight']['FTSS'].split(' / '); let ftssLinkCodeArray = item['renderFlight']['FTSS'].split(' / ');
let ftssLinkChnArray = []; let ftssLinkChnArray = [];
for (let i = 0; i < ftssLinkCodeArray.length; i++) { for (let i = 0; i < ftssLinkCodeArray.length; i++) {
ftssLinkChnArray.push(flightStatus.find(val => val.sttc === ftssLinkCodeArray[i]).stdc) ftssLinkChnArray.push(flightStatus.find(val => val.sttc === ftssLinkCodeArray[i]).stdc)
} }
item['renderFlight']['FTSS'] = ftssLinkChnArray.join(' / '); item['renderFlight']['FTSS'] = ftssLinkChnArray.join(' / ');
} catch (error) {
console.log("基础数据运营状态错误,处理失败,请检查数据 -- 链接航班")
}
//航班类型处理 //航班类型处理
try {
let fltyLinkCodeArray = item['renderFlight']['FLTY'].split(' / '); let fltyLinkCodeArray = item['renderFlight']['FLTY'].split(' / ');
let fltyLinkChnArray = []; let fltyLinkChnArray = [];
for (let i = 0; i < fltyLinkCodeArray.length; i++) { for (let i = 0; i < fltyLinkCodeArray.length; i++) {
fltyLinkChnArray.push(flightTypes.find(val => val.flightTypeCode === fltyLinkCodeArray[i]).flightTypeNameCn) fltyLinkChnArray.push(flightTypes.find(val => val.flightTypeCode === fltyLinkCodeArray[i]).flightTypeNameCn)
} }
item['renderFlight']['FLTY'] = fltyLinkChnArray.join(' / '); item['renderFlight']['FLTY'] = fltyLinkChnArray.join(' / ');
} catch (error) {
console.log("基础数据航班类型错误,处理失败,请检查数据 -- 链接航班")
}
//航线处理 //航线处理
try {
let erutPreCodeArray = item['renderPreFlight']['ERUT'].split(' - '); let erutPreCodeArray = item['renderPreFlight']['ERUT'].split(' - ');
let erutPreChnArray = [] let erutPreChnArray = []
for (let i = 0; i < erutPreCodeArray.length; i++) { for (let i = 0; i < erutPreCodeArray.length; i++) {
@@ -306,16 +331,32 @@ export class FlightsDataHandle {
} }
} }
item['renderPreFlight']['ERUT'] = erutPreChnArray.join(' - '); item['renderPreFlight']['ERUT'] = erutPreChnArray.join(' - ');
//航空公司处理 } catch (error) {
console.log("基础数据航线错误,处理失败,请检查数据 -- 链接航班-到港航班")
}
//航空公司处理
try {
let airlinePreIndex = airlines.findIndex(val => val.airlineCode === item['renderPreFlight']['ALCD']); let airlinePreIndex = airlines.findIndex(val => val.airlineCode === item['renderPreFlight']['ALCD']);
item['renderPreFlight']['ALCD'] = airlines[airlinePreIndex].airlineName; item['renderPreFlight']['ALCD'] = airlines[airlinePreIndex].airlineName;
//运营状态处理 } catch (error) {
console.log("基础数据航空公司错误,处理失败,请检查数据 -- 链接航班-到港航班")
}
//运营状态处理
try {
item['renderPreFlight']['FTSS'] = flightStatus.find(val => val.sttc === item['renderPreFlight']['FTSS']).stdc 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; item['renderPreFlight']['FLTY'] = flightTypes.find(val => val.flightTypeCode === item['renderPreFlight']['FLTY']).flightTypeNameCn;
} catch (error) {
console.log("基础数据航班类型错误,处理失败,请检查数据 -- 链接航班-到港航班")
}
//航线处理 //航线处理
try {
let erutReaCodeArray = item['renderReaFlight']['ERUT'].split(' - '); let erutReaCodeArray = item['renderReaFlight']['ERUT'].split(' - ');
let erutReaChnArray = [] let erutReaChnArray = []
for (let i = 0; i < erutReaCodeArray.length; i++) { for (let i = 0; i < erutReaCodeArray.length; i++) {
@@ -335,19 +376,31 @@ export class FlightsDataHandle {
} }
} }
item['renderReaFlight']['ERUT'] = erutReaChnArray.join(' - '); item['renderReaFlight']['ERUT'] = erutReaChnArray.join(' - ');
//航空公司处理 } catch (error) {
console.log("基础数据航线错误,处理失败,请检查数据 -- 链接航班-离港航班")
}
//航空公司处理
try {
let airlineReaIndex = airlines.findIndex(val => val.airlineCode === item['renderReaFlight']['ALCD']); let airlineReaIndex = airlines.findIndex(val => val.airlineCode === item['renderReaFlight']['ALCD']);
item['renderReaFlight']['ALCD'] = airlines[airlineReaIndex].airlineName; item['renderReaFlight']['ALCD'] = airlines[airlineReaIndex].airlineName;
//运营状态处理 } catch (error) {
console.log("基础数据航空公司错误,处理失败,请检查数据 -- 链接航班-离港航班")
}
//运营状态处理
try {
item['renderReaFlight']['FTSS'] = flightStatus.find(val => val.sttc === item['renderReaFlight']['FTSS']).stdc 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; item['renderReaFlight']['FLTY'] = flightTypes.find(val => val.flightTypeCode === item['renderReaFlight']['FLTY']).flightTypeNameCn;
} catch (error) {
console.log("基础数据航班类型错误,处理失败,请检查数据 -- 链接航班-离港航班")
} }
} catch (error) {
console.log('基础数据转换有误,处理失败,请检查数据');
throw error;
} finally {
return item;
} }
return item;
} }
} }