From b12e8a1065e7cc8f4ac93040ebf54a16e9ae90a3 Mon Sep 17 00:00:00 2001 From: "714943302@qq.com" Date: Thu, 22 Nov 2018 13:52:01 +0800 Subject: [PATCH 01/39] =?UTF-8?q?=E5=80=BC=E6=9C=BA=E6=9F=9C=E5=8F=B0?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkin-desk/checkin-desk.component.html | 31 +- .../checkin-desk/checkin-desk.component.ts | 126 ++----- .../checkin-group/checkin-group.component.ts | 322 +++++++++--------- 3 files changed, 207 insertions(+), 272 deletions(-) diff --git a/src/app/pages/basic-data/checkin-desk/checkin-desk.component.html b/src/app/pages/basic-data/checkin-desk/checkin-desk.component.html index a78066f..d24a132 100644 --- a/src/app/pages/basic-data/checkin-desk/checkin-desk.component.html +++ b/src/app/pages/basic-data/checkin-desk/checkin-desk.component.html @@ -19,36 +19,39 @@
- +
- - - + +
- - - + +
- - - + +
@@ -69,7 +72,7 @@ - + {{i+1}} {{checkinDesk.checkindeskCode}} {{checkinDesk.checkindeskName}} diff --git a/src/app/pages/basic-data/checkin-desk/checkin-desk.component.ts b/src/app/pages/basic-data/checkin-desk/checkin-desk.component.ts index f244420..dee02ef 100644 --- a/src/app/pages/basic-data/checkin-desk/checkin-desk.component.ts +++ b/src/app/pages/basic-data/checkin-desk/checkin-desk.component.ts @@ -20,9 +20,17 @@ SEARCH = ''; //手动输入条件 FLT_POS = 1; //过滤还是定位 SEL_COL = ''; //选择列名 +//下拉框 +public filterItems = { + terminalAreaCode:'', + checkinGroupCode:'', + chutCode:'', +} + checkinDesks : Array; public row_state: any = { renderFlight: {} }; public render_data: Array = []; //显示数据,即需要显示的数据 +public return_data: Array = []; //下拉框显示数据 ngOnInit() { this.checkinDesks = this.basicDataService.checkin_desk; this.basicDataService.checkin_desk_subject.subscribe( @@ -42,114 +50,38 @@ ngOnInit() { tableCont.addEventListener('scroll',scrollHandle); } -//刷新 -clearFiter(){ - $("#inputerInfo").val(""); //清空过滤或查找定位文本框 - $("#qy").val(""); //清空所属航站楼区域 - $("#zjd").val(""); //清空值机岛 - $("#xl").val(""); //清空行李传送带 - this.ngOnInit(); -} //输入框回车事件 inputEnter() { -if (this.FLT_POS === 1) { - this.selectChange() -} else { - this.selectChange() - this.inputPosition(this.render_data) -} + if (this.FLT_POS === 1) { + this.inputFilter(this.checkinDesks) + } else { + this.inputFilter(this.checkinDesks) + this.inputPosition(this.checkinDesks) + } } //下拉框选择筛选 selectChange() { - let filter_data = []; - let filtercheckinDesks = this.render_data; - this.render_data.forEach(item => { - filter_data.push(Object.assign({}, item)); - }) - if (this.FLT_POS === 1) { - this.inputFilter(filter_data); - } else { - this.checkinDesks = filter_data; - this.row_state = this.checkinDesks.length > 0 ? this.checkinDesks[0] : { renderFlight: {} }; - } - //下拉框筛选 - filter_data = filter_data.filter(item => { - if (item) { + this.return_data = this.checkinDesks.filter(item=>{ let is_satis = true; - for (const key in filtercheckinDesks) { - if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) { - if (item[key] === filtercheckinDesks[key]) { + for (const key in this.filterItems) { + if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { + if (item[key] === this.filterItems[key]) { is_satis = true; continue; } else { is_satis = false; break; } - } } return is_satis; - } else if (item) { - let is_satis = true; - for (const key in filtercheckinDesks) { - if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) { - if (item[key] === filtercheckinDesks[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - - } - } - return is_satis; - } else { - let pre_satis = true; - let rea_satis = true; - for (const key in filtercheckinDesks) { - if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) { - if (item[key] === filtercheckinDesks[key]) { - pre_satis = true; - continue; - } else { - pre_satis = false; - break; - } - - } - } - for (const key in filtercheckinDesks) { - if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) { - if (item[key] === filtercheckinDesks[key]) { - rea_satis = true; - continue; - } else { - rea_satis = false; - break; - } - - } - } - - if (pre_satis && !rea_satis) { - item = item; - return pre_satis; - } else if (!pre_satis && rea_satis) { - item = item; - return rea_satis; - } else if (pre_satis && rea_satis) { - return pre_satis && rea_satis; - } else { - return false; - } - } }) - } + this.render_data = this.return_data; +} - //输入框筛选 - inputFilter(filterData) { +//输入框筛选 +inputFilter(filterData) { if (this.SEARCH) { if (this.SEL_COL) { let sel_col = this.SEL_COL; @@ -197,14 +129,14 @@ selectChange() { }) } } - this.checkinDesks = filterData; - this.row_state = this.checkinDesks.length > 0 ? this.checkinDesks[0] : { renderFlight: {} }; - } + this.render_data = filterData; + this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; +} - positionArray: Array = []; - positionArrayIndex: number = 0; - //输入框定位 - inputPosition(filterData) { +positionArray: Array = []; +positionArrayIndex: number = 0; +//输入框定位 +inputPosition(filterData) { let transArray = [] if (this.SEL_COL) { let sel_col = this.SEL_COL; diff --git a/src/app/pages/basic-data/checkin-group/checkin-group.component.ts b/src/app/pages/basic-data/checkin-group/checkin-group.component.ts index 553b222..b5e5067 100644 --- a/src/app/pages/basic-data/checkin-group/checkin-group.component.ts +++ b/src/app/pages/basic-data/checkin-group/checkin-group.component.ts @@ -59,204 +59,204 @@ if (this.FLT_POS === 1) { //下拉框选择筛选 selectChange() { -let filter_data = []; -let filtercheckinGroups = this.render_data; -this.render_data.forEach(item => { - filter_data.push(Object.assign({}, item)); -}) -if (this.FLT_POS === 1) { - this.inputFilter(filter_data); -} else { - this.checkinGroups = filter_data; - this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} }; -} -//下拉框筛选 -filter_data = filter_data.filter(item => { - if (item) { - let is_satis = true; - for (const key in filtercheckinGroups) { - if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { - if (item[key] === filtercheckinGroups[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - - } - } - return is_satis; - } else if (item) { - let is_satis = true; - for (const key in filtercheckinGroups) { - if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { - if (item[key] === filtercheckinGroups[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - - } - } - return is_satis; + let filter_data = []; + let filtercheckinGroups = this.render_data; + this.render_data.forEach(item => { + filter_data.push(Object.assign({}, item)); + }) + if (this.FLT_POS === 1) { + this.inputFilter(filter_data); } else { - let pre_satis = true; - let rea_satis = true; - for (const key in filtercheckinGroups) { - if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { - if (item[key] === filtercheckinGroups[key]) { - pre_satis = true; - continue; - } else { - pre_satis = false; - break; + this.checkinGroups = filter_data; + this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} }; + } + //下拉框筛选 + filter_data = filter_data.filter(item => { + if (item) { + let is_satis = true; + for (const key in filtercheckinGroups) { + if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { + if (item[key] === filtercheckinGroups[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } - } - } - for (const key in filtercheckinGroups) { - if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { - if (item[key] === filtercheckinGroups[key]) { - rea_satis = true; - continue; - } else { - rea_satis = false; - break; + return is_satis; + } else if (item) { + let is_satis = true; + for (const key in filtercheckinGroups) { + if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { + if (item[key] === filtercheckinGroups[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + } - } - } - - if (pre_satis && !rea_satis) { - item = item; - return pre_satis; - } else if (!pre_satis && rea_satis) { - item = item; - return rea_satis; - } else if (pre_satis && rea_satis) { - return pre_satis && rea_satis; + return is_satis; } else { - return false; + let pre_satis = true; + let rea_satis = true; + for (const key in filtercheckinGroups) { + if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { + if (item[key] === filtercheckinGroups[key]) { + pre_satis = true; + continue; + } else { + pre_satis = false; + break; + } + + } + } + for (const key in filtercheckinGroups) { + if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { + if (item[key] === filtercheckinGroups[key]) { + rea_satis = true; + continue; + } else { + rea_satis = false; + break; + } + + } + } + + if (pre_satis && !rea_satis) { + item = item; + return pre_satis; + } else if (!pre_satis && rea_satis) { + item = item; + return rea_satis; + } else if (pre_satis && rea_satis) { + return pre_satis && rea_satis; + } else { + return false; + } + } + }) + } + + //输入框筛选 + inputFilter(filterData) { + if (this.SEARCH) { + if (this.SEL_COL) { + let sel_col = this.SEL_COL; + filterData = filterData.filter(item => { + if (item[sel_col]) { + if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { + return true; + } + } else { + if (this.SEARCH) { + return false; + } else { + return true; + } + } + }) + + } else { + filterData = filterData.filter(item => { + let is_satis = false; + for (const key in item) { + if (item.hasOwnProperty(key)) { + if (item[key]) { + if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) { + is_satis = true; + break; + } else { + is_satis = false; + continue; + } + } else { + if (this.SEARCH) { + is_satis = false; + continue; + } else { + is_satis = true; + break; + } + } + } else { + continue; + } + } + return is_satis; + }) } } -}) -} + this.checkinGroups = filterData; + this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} }; + } -//输入框筛选 -inputFilter(filterData) { -if (this.SEARCH) { + positionArray: Array = []; + positionArrayIndex: number = 0; + //输入框定位 + inputPosition(filterData) { + let transArray = [] if (this.SEL_COL) { let sel_col = this.SEL_COL; - filterData = filterData.filter(item => { - if (item[sel_col]) { - if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { - return true; + filterData.forEach(element => { + if (element[sel_col]) { + if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { + transArray.push(element) } } else { - if (this.SEARCH) { - return false; - } else { - return true; + if (!this.SEARCH) { + transArray.push(element) } } - }) - + }); } else { - filterData = filterData.filter(item => { - let is_satis = false; - for (const key in item) { - if (item.hasOwnProperty(key)) { - if (item[key]) { - if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) { - is_satis = true; + filterData.forEach(element => { + for (const key in element) { + if (element.hasOwnProperty(key)) { + if (element[key]) { + if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) { + transArray.push(element) break; } else { - is_satis = false; continue; } } else { if (this.SEARCH) { - is_satis = false; continue; } else { - is_satis = true; + transArray.push(element) break; } } + } else { continue; } } - return is_satis; - }) + }); } -} -this.checkinGroups = filterData; -this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} }; -} -positionArray: Array = []; -positionArrayIndex: number = 0; -//输入框定位 -inputPosition(filterData) { -let transArray = [] -if (this.SEL_COL) { - let sel_col = this.SEL_COL; - filterData.forEach(element => { - if (element[sel_col]) { - if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { - transArray.push(element) + if (transArray.length > 0) { + if (transArray.toString() == this.positionArray.toString()) { + this.positionArrayIndex++; + if (this.positionArrayIndex === this.positionArray.length) { + this.positionArrayIndex = 0; } + this.row_state = this.positionArray[this.positionArrayIndex]; } else { - if (!this.SEARCH) { - transArray.push(element) - } - } - }); -} else { - filterData.forEach(element => { - for (const key in element) { - if (element.hasOwnProperty(key)) { - if (element[key]) { - if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) { - transArray.push(element) - break; - } else { - continue; - } - } else { - if (this.SEARCH) { - continue; - } else { - transArray.push(element) - break; - } - } - - } else { - continue; - } - } - }); -} - -if (transArray.length > 0) { - if (transArray.toString() == this.positionArray.toString()) { - this.positionArrayIndex++; - if (this.positionArrayIndex === this.positionArray.length) { + this.positionArray = transArray; this.positionArrayIndex = 0; + this.row_state = this.positionArray[this.positionArrayIndex]; } - this.row_state = this.positionArray[this.positionArrayIndex]; } else { - this.positionArray = transArray; - this.positionArrayIndex = 0; - this.row_state = this.positionArray[this.positionArrayIndex]; + alert('没有搜索到相关数据'); + } } -} else { - alert('没有搜索到相关数据'); -} -} } From 636ec4ed02aa281487e058f8961b6e82a2a4174d Mon Sep 17 00:00:00 2001 From: "714943302@qq.com" Date: Thu, 22 Nov 2018 13:54:30 +0800 Subject: [PATCH 02/39] =?UTF-8?q?=E6=9C=BA=E4=BD=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/basic-data/city/city.component.html | 13 +- .../pages/basic-data/city/city.component.ts | 122 ++++-------------- .../pages/basic-data/stand/stand.component.ts | 5 +- 3 files changed, 37 insertions(+), 103 deletions(-) diff --git a/src/app/pages/basic-data/city/city.component.html b/src/app/pages/basic-data/city/city.component.html index fa31878..8471a11 100644 --- a/src/app/pages/basic-data/city/city.component.html +++ b/src/app/pages/basic-data/city/city.component.html @@ -22,7 +22,7 @@ --> - + @@ -36,12 +36,13 @@
- - - + +
@@ -72,7 +73,7 @@ - + {{i+1}} {{city.cityCode}} {{city.cityNameChn}} diff --git a/src/app/pages/basic-data/city/city.component.ts b/src/app/pages/basic-data/city/city.component.ts index 35c9aaa..415d25b 100644 --- a/src/app/pages/basic-data/city/city.component.ts +++ b/src/app/pages/basic-data/city/city.component.ts @@ -20,9 +20,15 @@ SEARCH = ''; //手动输入条件 FLT_POS = 1; //过滤还是定位 SEL_COL = ''; //选择列名 +//下拉框 +public filterItems = { + countryId:'', +} + citys : Array; public row_state: any = { renderFlight: {} }; public render_data: Array = []; //显示数据,即需要显示的数据 +public return_data: Array = []; //下拉框显示数据 ngOnInit() { this.citys = this.basicDataService.city; this.basicDataService.city_subject.subscribe( @@ -42,112 +48,38 @@ ngOnInit() { tableCont.addEventListener('scroll',scrollHandle); } -//刷新 -clearFiter(){ - $("#inputerInfo").val(""); //清空过滤或查找定位文本框 - $("#citry").val(""); //清空所国家 - this.ngOnInit(); -} //输入框回车事件 inputEnter() { -if (this.FLT_POS === 1) { - this.selectChange() -} else { - this.selectChange() - this.inputPosition(this.render_data) -} + if (this.FLT_POS === 1) { + this.inputFilter(this.citys) + } else { + this.inputFilter(this.citys) + this.inputPosition(this.citys) + } } //下拉框选择筛选 selectChange() { - let filter_data = []; - let filtercitys = this.render_data; - this.render_data.forEach(item => { - filter_data.push(Object.assign({}, item)); - }) - if (this.FLT_POS === 1) { - this.inputFilter(filter_data); - } else { - this.citys = filter_data; - this.row_state = this.citys.length > 0 ? this.citys[0] : { renderFlight: {} }; - } - //下拉框筛选 - filter_data = filter_data.filter(item => { - if (item) { + this.return_data = this.citys.filter(item=>{ let is_satis = true; - for (const key in filtercitys) { - if (filtercitys.hasOwnProperty(key) && filtercitys[key]) { - if (item[key] === filtercitys[key]) { + for (const key in this.filterItems) { + if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { + if (item[key] === this.filterItems[key]) { is_satis = true; continue; } else { is_satis = false; break; } - } } return is_satis; - } else if (item) { - let is_satis = true; - for (const key in filtercitys) { - if (filtercitys.hasOwnProperty(key) && filtercitys[key]) { - if (item[key] === filtercitys[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - - } - } - return is_satis; - } else { - let pre_satis = true; - let rea_satis = true; - for (const key in filtercitys) { - if (filtercitys.hasOwnProperty(key) && filtercitys[key]) { - if (item[key] === filtercitys[key]) { - pre_satis = true; - continue; - } else { - pre_satis = false; - break; - } - - } - } - for (const key in filtercitys) { - if (filtercitys.hasOwnProperty(key) && filtercitys[key]) { - if (item[key] === filtercitys[key]) { - rea_satis = true; - continue; - } else { - rea_satis = false; - break; - } - - } - } - - if (pre_satis && !rea_satis) { - item = item; - return pre_satis; - } else if (!pre_satis && rea_satis) { - item = item; - return rea_satis; - } else if (pre_satis && rea_satis) { - return pre_satis && rea_satis; - } else { - return false; - } - } }) - } + this.render_data = this.return_data; +} - //输入框筛选 - inputFilter(filterData) { +//输入框筛选 +inputFilter(filterData) { if (this.SEARCH) { if (this.SEL_COL) { let sel_col = this.SEL_COL; @@ -195,14 +127,14 @@ selectChange() { }) } } - this.citys = filterData; - this.row_state = this.citys.length > 0 ? this.citys[0] : { renderFlight: {} }; - } + this.render_data = filterData; + this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; +} - positionArray: Array = []; - positionArrayIndex: number = 0; - //输入框定位 - inputPosition(filterData) { +positionArray: Array = []; +positionArrayIndex: number = 0; +//输入框定位 +inputPosition(filterData) { let transArray = [] if (this.SEL_COL) { let sel_col = this.SEL_COL; diff --git a/src/app/pages/basic-data/stand/stand.component.ts b/src/app/pages/basic-data/stand/stand.component.ts index 1a79f12..c94a0a0 100644 --- a/src/app/pages/basic-data/stand/stand.component.ts +++ b/src/app/pages/basic-data/stand/stand.component.ts @@ -23,7 +23,8 @@ SEL_COL = ''; //选择列名 //下拉框 public filterItems = { terminalAreaCode:'', - gateStatus:'', + standType:'', + standStatus:'', } stands : Array; @@ -55,7 +56,7 @@ inputEnter() { this.inputFilter(this.stands) } else { this.inputFilter(this.stands) - // this.inputPosition(this.render_data) + this.inputPosition(this.stands) } } From 62db2ab1ac58c0b0bb702afc7800738ce416357d Mon Sep 17 00:00:00 2001 From: "714943302@qq.com" Date: Thu, 22 Nov 2018 13:55:44 +0800 Subject: [PATCH 03/39] =?UTF-8?q?=E7=99=BB=E6=9C=BA=E9=97=A8=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/basic-data/carousel/carousel.component.ts | 2 +- src/app/pages/basic-data/gate/gate.component.html | 2 ++ src/app/pages/basic-data/gate/gate.component.ts | 10 +++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/pages/basic-data/carousel/carousel.component.ts b/src/app/pages/basic-data/carousel/carousel.component.ts index 48a2196..a55f10e 100644 --- a/src/app/pages/basic-data/carousel/carousel.component.ts +++ b/src/app/pages/basic-data/carousel/carousel.component.ts @@ -54,7 +54,7 @@ inputEnter() { this.inputFilter(this.carousels) } else { this.inputFilter(this.carousels) - // this.inputPosition(this.render_data) + this.inputPosition(this.carousels) } } diff --git a/src/app/pages/basic-data/gate/gate.component.html b/src/app/pages/basic-data/gate/gate.component.html index 3db51de..873b6ab 100644 --- a/src/app/pages/basic-data/gate/gate.component.html +++ b/src/app/pages/basic-data/gate/gate.component.html @@ -56,6 +56,8 @@ + {{i+1}} {{gate.gateCode}} {{gate.gateName}} diff --git a/src/app/pages/basic-data/gate/gate.component.ts b/src/app/pages/basic-data/gate/gate.component.ts index db59526..effb96c 100644 --- a/src/app/pages/basic-data/gate/gate.component.ts +++ b/src/app/pages/basic-data/gate/gate.component.ts @@ -49,13 +49,21 @@ ngOnInit() { tableCont.addEventListener('scroll',scrollHandle); } +/** + * 选中某行 + * @param i + */ +/* selectRow(i) { + this.row_state = i; +} */ + //输入框回车事件 inputEnter() { if (this.FLT_POS === 1) { this.inputFilter(this.gates) } else { this.inputFilter(this.gates) - // this.inputPosition(this.render_data) + this.inputPosition(this.gates) } } From 4b1baa98765a06f502763ac6538525e0dbf37e61 Mon Sep 17 00:00:00 2001 From: "714943302@qq.com" Date: Thu, 22 Nov 2018 13:57:25 +0800 Subject: [PATCH 04/39] =?UTF-8?q?=E6=9C=BA=E5=9E=8B=E3=80=81=E9=A3=9E?= =?UTF-8?q?=E6=9C=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aircraft-type/aircraft-type.component.ts | 2 +- .../aircraft/aircraft.component.html | 22 +-- .../basic-data/aircraft/aircraft.component.ts | 125 ++++-------------- 3 files changed, 42 insertions(+), 107 deletions(-) diff --git a/src/app/pages/basic-data/aircraft-type/aircraft-type.component.ts b/src/app/pages/basic-data/aircraft-type/aircraft-type.component.ts index 26adbb0..48e0df2 100644 --- a/src/app/pages/basic-data/aircraft-type/aircraft-type.component.ts +++ b/src/app/pages/basic-data/aircraft-type/aircraft-type.component.ts @@ -54,7 +54,7 @@ inputEnter() { this.inputFilter(this.aircraftTypes) } else { this.inputFilter(this.aircraftTypes) - // this.inputPosition(this.render_data) + this.inputPosition(this.aircraftTypes) } } diff --git a/src/app/pages/basic-data/aircraft/aircraft.component.html b/src/app/pages/basic-data/aircraft/aircraft.component.html index 50fd68f..8d9c182 100644 --- a/src/app/pages/basic-data/aircraft/aircraft.component.html +++ b/src/app/pages/basic-data/aircraft/aircraft.component.html @@ -20,26 +20,28 @@ - +
- - - - + +
- - - + +
@@ -63,7 +65,7 @@ - + {{i+1}} {{aircraft.aircraftNumber}} {{aircraft.maxPassengers}} diff --git a/src/app/pages/basic-data/aircraft/aircraft.component.ts b/src/app/pages/basic-data/aircraft/aircraft.component.ts index 889e4cf..866846b 100644 --- a/src/app/pages/basic-data/aircraft/aircraft.component.ts +++ b/src/app/pages/basic-data/aircraft/aircraft.component.ts @@ -20,9 +20,17 @@ SEARCH = ''; //手动输入条件 FLT_POS = 1; //过滤还是定位 SEL_COL = ''; //选择列名 +//下拉框 +public filterItems = { + airlineCode:'', + aircraftTypeCode:'', +} + aircrafts : Array; public row_state: any = { renderFlight: {} }; public render_data: Array = []; //显示数据,即需要显示的数据 +public return_data: Array = []; //下拉框显示数据 + ngOnInit() { this.aircrafts = this.basicDataService.aircraft; this.basicDataService.aircraft_subject.subscribe( @@ -42,113 +50,38 @@ ngOnInit() { tableCont.addEventListener('scroll',scrollHandle); } -//刷新 -clearFiter(){ - $("#inputerInfo").val(""); //清空过滤或查找定位文本框 - $("#airlineCompany").val(""); //清空航空公司 - $("#jx").val(""); //清空机型 - this.ngOnInit(); -} //输入框回车事件 inputEnter() { -if (this.FLT_POS === 1) { - this.selectChange() -} else { - this.selectChange() - this.inputPosition(this.render_data) -} + if (this.FLT_POS === 1) { + this.inputFilter(this.aircrafts) + } else { + this.inputFilter(this.aircrafts) + this.inputPosition(this.aircrafts) + } } //下拉框选择筛选 selectChange() { - let filter_data = []; - let filteraircrafts = this.render_data; - this.render_data.forEach(item => { - filter_data.push(Object.assign({}, item)); - }) - if (this.FLT_POS === 1) { - this.inputFilter(filter_data); - } else { - this.aircrafts = filter_data; - this.row_state = this.aircrafts.length > 0 ? this.aircrafts[0] : { renderFlight: {} }; - } - //下拉框筛选 - filter_data = filter_data.filter(item => { - if (item) { + this.return_data = this.aircrafts.filter(item=>{ let is_satis = true; - for (const key in filteraircrafts) { - if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) { - if (item[key] === filteraircrafts[key]) { + for (const key in this.filterItems) { + if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { + if (item[key] === this.filterItems[key]) { is_satis = true; continue; } else { is_satis = false; break; } - } } return is_satis; - } else if (item) { - let is_satis = true; - for (const key in filteraircrafts) { - if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) { - if (item[key] === filteraircrafts[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - - } - } - return is_satis; - } else { - let pre_satis = true; - let rea_satis = true; - for (const key in filteraircrafts) { - if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) { - if (item[key] === filteraircrafts[key]) { - pre_satis = true; - continue; - } else { - pre_satis = false; - break; - } - - } - } - for (const key in filteraircrafts) { - if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) { - if (item[key] === filteraircrafts[key]) { - rea_satis = true; - continue; - } else { - rea_satis = false; - break; - } - - } - } - - if (pre_satis && !rea_satis) { - item = item; - return pre_satis; - } else if (!pre_satis && rea_satis) { - item = item; - return rea_satis; - } else if (pre_satis && rea_satis) { - return pre_satis && rea_satis; - } else { - return false; - } - } }) - } + this.render_data = this.return_data; +} - //输入框筛选 - inputFilter(filterData) { +//输入框筛选 +inputFilter(filterData) { if (this.SEARCH) { if (this.SEL_COL) { let sel_col = this.SEL_COL; @@ -196,14 +129,14 @@ selectChange() { }) } } - this.aircrafts = filterData; - this.row_state = this.aircrafts.length > 0 ? this.aircrafts[0] : { renderFlight: {} }; - } + this.render_data = filterData; + this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; +} - positionArray: Array = []; - positionArrayIndex: number = 0; - //输入框定位 - inputPosition(filterData) { +positionArray: Array = []; +positionArrayIndex: number = 0; +//输入框定位 +inputPosition(filterData) { let transArray = [] if (this.SEL_COL) { let sel_col = this.SEL_COL; From 72c1fb16e91d201a25b5feb1c37bff7ae3b803df Mon Sep 17 00:00:00 2001 From: "714943302@qq.com" Date: Thu, 22 Nov 2018 14:17:48 +0800 Subject: [PATCH 05/39] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=A3=E5=BA=A6?= =?UTF-8?q?=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seasonal-plan.component.html | 109 ++++- .../seasonal-plan.component.scss | 68 ++++ .../seasonal-plan/seasonal-plan.component.ts | 384 +++++++++++++++++- .../seasonal-plan/seasonal-plan.module.ts | 5 +- src/assets/mock-data/seasonal-code.json | 87 ++++ src/assets/mock-data/seasonal-data.json | 139 +++++++ 6 files changed, 783 insertions(+), 9 deletions(-) create mode 100644 src/assets/mock-data/seasonal-code.json create mode 100644 src/assets/mock-data/seasonal-data.json diff --git a/src/app/pages/seasonal-plan/seasonal-plan.component.html b/src/app/pages/seasonal-plan/seasonal-plan.component.html index 3223c9e..e5f75e3 100644 --- a/src/app/pages/seasonal-plan/seasonal-plan.component.html +++ b/src/app/pages/seasonal-plan/seasonal-plan.component.html @@ -1,3 +1,106 @@ -

- seasonal-plan works! -

+
+
+
+
+
+ + + + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ +
+
+ + + + + + + + + + + + + + + +
序号{{airline_col.COL_CN}}
{{i+1}}{{airline_row['renderFlight'][airline_col.COL_CODE]}}
+
+
+
+
\ No newline at end of file diff --git a/src/app/pages/seasonal-plan/seasonal-plan.component.scss b/src/app/pages/seasonal-plan/seasonal-plan.component.scss index e69de29..dba3c39 100644 --- a/src/app/pages/seasonal-plan/seasonal-plan.component.scss +++ b/src/app/pages/seasonal-plan/seasonal-plan.component.scss @@ -0,0 +1,68 @@ +.main-page { + width: 100%; + height: 100%; + overflow-y: scroll; + padding: 15px 10px; + background-color: #fff; + .page-content { + border: 1px solid #ccc; + padding: 10px 20px; + .search-filter { + padding: 0 15px; + .first-condition { + .line-operator-right { + text-align: right; + padding: 0; + .btn-info { + background-color: rgb(122, 156, 204); + border-color: rgb(122, 156, 204); + } + } + } + .input-container { + padding: 0; + > .form-control { + width: 180px; + display: inline-block; + } + } + } + .airline-table{ + .table-container{ + // border: 1px solid #ccc; + width: 100%; + height: 700px; + overflow: auto; + box-shadow: 0 0 1px .5px #ddd; + table{ + width: max-content; + tr{ + cursor: pointer; + &.selected{ + background: rgb(181, 215, 255); + } + } + th{ + background-color: #ddd; + } + th,td{ + // border: none; + text-align: center; + } + } + } + } + } +} + +@media screen and (max-width: 991px) { + .line-operator-right { + text-align: left !important; + } +} + +// @media screen and (min-width: 1200px){ +// .line-operator-right{ +// text-align: left; +// } +// } diff --git a/src/app/pages/seasonal-plan/seasonal-plan.component.ts b/src/app/pages/seasonal-plan/seasonal-plan.component.ts index c0ab4ec..66a37db 100644 --- a/src/app/pages/seasonal-plan/seasonal-plan.component.ts +++ b/src/app/pages/seasonal-plan/seasonal-plan.component.ts @@ -1,5 +1,9 @@ import { Component, OnInit } from '@angular/core'; - +import { ChangeDetectorRef } from '@angular/core'; +import { HttpClientService } from '../../services/http-client.service'; +import dateFormatter from '../../utils/data-formatter'; +import { HttpParams } from '@angular/common/http'; +import * as $ from 'jquery'; @Component({ selector: 'app-seasonal-plan', templateUrl: './seasonal-plan.component.html', @@ -7,9 +11,381 @@ import { Component, OnInit } from '@angular/core'; }) export class SeasonalPlanComponent implements OnInit { - constructor() { } + constructor( + private httpCilent: HttpClientService, + private changeDetectorRef: ChangeDetectorRef +) { } - ngOnInit() { - } +public raw_data: Array = []; //原始数据,即航班计划 + +public combined_data: Array = []; //组合数据,即链接航班,显示信息等组合好之后的数据 + +public render_data: Array = []; //显示数据,即需要显示的数据 + +public seasonal_lists: Array; //列数据 + +public row_state: any = { renderFlight: {} }; + +// 搜索条件 +SEARCH = ''; //手动输入条件 +FLT_POS = 1; //过滤还是定位 +SEL_COL = ''; //选择列名 + +public filterItems = { + HZ: '', //所属航站楼区域 + ZY: '', //资源状态 +} + +public formatter = { + 'HZ': { + 'GH': '国内区域', + 'CH': '国际区域', + "QT": '其他区域' + }, + 'ZY': { + 'K': '可用', + 'R': '不可用', + "T": '其他' + }, + 'SODT': dateFormatter, + 'ESTT': dateFormatter, + 'ACTT': dateFormatter +} + +selectRow(i) { + this.row_state = i; + this.changeDetectorRef.detectChanges(); +} + +getColor(col_CODE) { + if (col_CODE === 'SODT') { + return 'skyblue' + } else { + return null + } +} + +ngOnInit() { + this.changeDetectorRef.detach(); + /* 获取显示列 */ + this.httpCilent.get('/assets/mock-data/seasonal-code.json').subscribe( + data => { + data.sort(function (a, b) { + return (a['COL_ORDER'] - b['COL_ORDER']); + }) + this.seasonal_lists = data; + } + ) + /* 获取登机门信息 */ + this.httpCilent.get('/assets/mock-data/seasonal-data.json').subscribe( + data => { + //解析数据 + data.forEach(element => { + this.raw_data.push(JSON.parse(element.value)); + }); + + let combined_linked_data = this.raw_data + + combined_linked_data.forEach(element => { + let row_flights = {}; + let render_flight = {}; + let render_pre_flight = {}; + let render_rea_flight = {}; + row_flights['preFlight'] = element; + + for (let i = 0; i < this.seasonal_lists.length; i++) { + let key = this.seasonal_lists[i]['COL_CODE'] + render_flight[key] = typeof (this.formatter[key]) === 'function' ? this.formatter[key](row_flights['preFlight'][key], 1) : this.formatter[key] ? this.formatter[key][row_flights['preFlight'][key]] : row_flights['preFlight'][key]; + } + row_flights['renderFlight'] = render_flight; + if (element['isLinked']) { + row_flights['preFlight'] = element['linkFlight']; + delete element['linkFlight']; + delete element['isLinked']; + row_flights['reaFlight'] = element; + + for (let i = 0; i < this.seasonal_lists.length; i++) { + let key = this.seasonal_lists[i]['COL_CODE'] + if (this.formatter.hasOwnProperty(key)) { + if (typeof (this.formatter[key]) === 'function') { + render_flight[key] = (row_flights['preFlight'][key] === row_flights['reaFlight'][key]) ? (this.formatter[key](row_flights['preFlight'][key], 1)) : (this.formatter[key](row_flights['preFlight'][key], 1) + '/' + this.formatter[key](row_flights['reaFlight'][key], 1)); + render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1); + render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1); + } else { + render_flight[key] = (row_flights['preFlight'][key] === row_flights['reaFlight'][key]) ? (this.formatter[key][row_flights['preFlight'][key]]) : (this.formatter[key][row_flights['preFlight'][key]] + '/' + this.formatter[key][row_flights['reaFlight'][key]]); + render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]]; + render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]]; + } + } else { + render_flight[key] = (row_flights['preFlight'][key] === row_flights['reaFlight'][key]) ? (row_flights['preFlight'][key]) : (row_flights['preFlight'][key] + '/' + row_flights['reaFlight'][key]); + render_pre_flight[key] = row_flights['preFlight'][key]; + render_rea_flight[key] = row_flights['reaFlight'][key]; + } + } + row_flights['renderFlight'] = render_flight; + row_flights['renderPreFlight'] = render_pre_flight; + row_flights['renderReaFlight'] = render_rea_flight; + } + this.combined_data.push(row_flights); + }) + // this.doSequence(this.combined_data); + this.render_data = this.combined_data + this.changeDetectorRef.detectChanges(); + } + ) + /** + * 固定表头 + */ + var tableCont = document.querySelector('#table-container'); + function scrollHandle (){ + var scrollTop = this.scrollTop; + this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)'; + } + tableCont.addEventListener('scroll',scrollHandle); +} + +/** + * 执行排序并渲染 + */ +/* doSequence(sequenceData) { + sequenceData.forEach(element => { + element['ORDER'] = this.sequence(element); + }) + + sequenceData.sort(function (a, b) { + return (a['ORDER'] - b['ORDER']); + }) + + this.render_data = sequenceData; + this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; + this.changeDetectorRef.detectChanges(); +} */ + +/** + * 过滤及定位 + * @param filterItems + * @return + */ +//输入框回车事件 +inputEnter() { + if (this.FLT_POS === 1) { + this.selectChange() + } else { + this.selectChange() + this.inputPosition(this.render_data) + } +} + +//下拉框选择筛选 +selectChange() { + let filter_data = []; + let filterItems = this.filterItems; + this.combined_data.forEach(item => { + filter_data.push(Object.assign({}, item)); + }) + //下拉框筛选 + filter_data = filter_data.filter(item => { + if (item) { + let is_satis = true; + for (const key in filterItems) { + if (filterItems.hasOwnProperty(key) && filterItems[key]) { + if (item['preFlight'][key] === filterItems[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + + } + } + return is_satis; + } else if (item) { + let is_satis = true; + for (const key in filterItems) { + if (filterItems.hasOwnProperty(key) && filterItems[key]) { + if (item['reaFlight'][key] === filterItems[key]) { + is_satis = true; + continue; + } else { + is_satis = false; + break; + } + + } + } + return is_satis; + } else { + let pre_satis = true; + let rea_satis = true; + for (const key in filterItems) { + if (filterItems.hasOwnProperty(key) && filterItems[key]) { + if (item['preFlight'][key] === filterItems[key]) { + pre_satis = true; + continue; + } else { + pre_satis = false; + break; + } + + } + } + for (const key in filterItems) { + if (filterItems.hasOwnProperty(key) && filterItems[key]) { + if (item['reaFlight'][key] === filterItems[key]) { + rea_satis = true; + continue; + } else { + rea_satis = false; + break; + } + + } + } + + if (pre_satis && !rea_satis) { + item['renderFlight'] = item['renderPreFlight']; + return pre_satis; + } else if (!pre_satis && rea_satis) { + item['renderFlight'] = item['renderReaFlight']; + return rea_satis; + } else if (pre_satis && rea_satis) { + return pre_satis && rea_satis; + } else { + return false; + } + } + }) + if (this.FLT_POS === 1) { + this.inputFilter(filter_data); + } else { + this.render_data = filter_data; + this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; + // this.inputPosition(this.render_data); + this.changeDetectorRef.detectChanges(); + } +} + +//输入框筛选 +inputFilter(filterData) { + if (this.SEARCH) { + if (this.SEL_COL) { + let sel_col = this.SEL_COL; + filterData = filterData.filter(item => { + if (item['renderFlight'][sel_col]) { + if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { + return true; + } + } else { + if (this.SEARCH) { + return false; + } else { + return true; + } + } + }) + + } else { + filterData = filterData.filter(item => { + let is_satis = false; + for (const key in item['renderFlight']) { + if (item['renderFlight'].hasOwnProperty(key)) { + if (item['renderFlight'][key]) { + if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) { + is_satis = true; + break; + } else { + is_satis = false; + continue; + } + } else { + if (this.SEARCH) { + is_satis = false; + continue; + } else { + is_satis = true; + break; + } + } + } else { + continue; + } + } + return is_satis; + }) + } + } + this.render_data = filterData; + this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; + this.changeDetectorRef.detectChanges(); +} + +positionArray: Array = []; +positionArrayIndex: number = 0; +//输入框定位 +inputPosition(filterData) { + let transArray = [] + if (this.SEL_COL) { + let sel_col = this.SEL_COL; + filterData.forEach(element => { + if (element['renderFlight'][sel_col]) { + if (element['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) { + transArray.push(element) + } + } else { + if (!this.SEARCH) { + transArray.push(element) + } + } + }); + } else { + filterData.forEach(element => { + for (const key in element['renderFlight']) { + if (element['renderFlight'].hasOwnProperty(key)) { + if (element['renderFlight'][key]) { + if (element['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) { + transArray.push(element) + break; + } else { + continue; + } + } else { + if (this.SEARCH) { + continue; + } else { + transArray.push(element) + break; + } + } + + } else { + continue; + } + } + }); + } + + if (transArray.length > 0) { + if (transArray.toString() == this.positionArray.toString()) { + this.positionArrayIndex++; + if (this.positionArrayIndex === this.positionArray.length) { + this.positionArrayIndex = 0; + } + this.row_state = this.positionArray[this.positionArrayIndex]; + } else { + this.positionArray = transArray; + this.positionArrayIndex = 0; + this.row_state = this.positionArray[this.positionArrayIndex]; + } + } else { + alert('没有搜索到相关数据'); + } + + this.changeDetectorRef.detectChanges(); + + let tr = $(".selected"); + let objTr = tr[0]; + $("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow"); +} } diff --git a/src/app/pages/seasonal-plan/seasonal-plan.module.ts b/src/app/pages/seasonal-plan/seasonal-plan.module.ts index 697b18b..f5108a9 100644 --- a/src/app/pages/seasonal-plan/seasonal-plan.module.ts +++ b/src/app/pages/seasonal-plan/seasonal-plan.module.ts @@ -2,11 +2,12 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { SeasonalPlanComponent } from './seasonal-plan.component'; import { SeasonalPlanRouting } from './seasonal-plan-routing.module' - +import { FormsModule } from '@angular/forms'; @NgModule({ imports: [ CommonModule, - SeasonalPlanRouting + SeasonalPlanRouting, + FormsModule ], declarations: [SeasonalPlanComponent] }) diff --git a/src/assets/mock-data/seasonal-code.json b/src/assets/mock-data/seasonal-code.json new file mode 100644 index 0000000..82bc92c --- /dev/null +++ b/src/assets/mock-data/seasonal-code.json @@ -0,0 +1,87 @@ +[ + { + "COL_CODE":"FLNO", + "COL_CN":"航班号", + "COL_ORDER":"1" + }, + { + "COL_CODE":"ALCD", + "COL_CN":"航班季度", + "COL_ORDER":"2" + }, + { + "COL_CODE":"HZ", + "COL_CN":"国际代码", + "COL_ORDER":"3" + }, + { + "COL_CODE":"ZY", + "COL_CN":"航空公司", + "COL_ORDER":"4" + }, + { + "COL_CODE":"HXLB", + "COL_CN":"航线类别", + "COL_ORDER":"5" + }, + { + "COL_CODE":"HBLB", + "COL_CN":"航班类别", + "COL_ORDER":"6" + }, + { + "COL_CODE":"HBRW", + "COL_CN":"航班任务", + "COL_ORDER":"7" + }, + { + "COL_CODE":"YYR", + "COL_CN":"运营日", + "COL_ORDER":"8" + }, + { + "COL_CODE":"START", + "COL_CN":"开始日期", + "COL_ORDER":"9" + }, + { + "COL_CODE":"END", + "COL_CN":"结束日期", + "COL_ORDER":"10" + }, + { + "COL_CODE":"HX", + "COL_CN":"航线", + "COL_ORDER":"11" + }, + { + "COL_CODE":"JCG", + "COL_CN":"进/出港", + "COL_ORDER":"12" + }, + { + "COL_CODE":"DATIME", + "COL_CN":"到达时间", + "COL_ORDER":"13" + }, + { + "COL_CODE":"CHUFA", + "COL_CN":"出发时间", + "COL_ORDER":"14" + }, + { + "COL_CODE":"JIXING", + "COL_CN":"机型", + "COL_ORDER":"15" + }, + { + "COL_CODE":"FX", + "COL_CN":"飞行距离(千米)", + "COL_ORDER":"16" + }, + { + "COL_CODE":"FXTIME", + "COL_CN":"飞行时间(分钟)", + "COL_ORDER":"17" + } +] \ No newline at end of file diff --git a/src/assets/mock-data/seasonal-data.json b/src/assets/mock-data/seasonal-data.json new file mode 100644 index 0000000..7439171 --- /dev/null +++ b/src/assets/mock-data/seasonal-data.json @@ -0,0 +1,139 @@ +[ + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"QT\", \"ZY\": \"K\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"GH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"QT\", \"ZY\": \"K\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"GH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + }, + { + "topic": "schd", + "value": "{\"ALCD\": \"春\", \"FLNO\": \"CA00001\", \"HZ\": \"CH\", \"ZY\": \"R\", \"HXLB\": \"国内\", \"HBLB\": \"客机\", \"HBRW\": \"正班\", \"YYR\": \"123456\", \"START\": \"2018\", \"END\": \"2019\", \"HX\": \"北京-上海\", \"JCG\": \"出发\", \"DATIME\": \"20:00\", \"CHUFA\": \"9:00\", \"JIXING\": \"B8526\", \"FX\": \"120\", \"FXTIME\": \"180\"}", + "offset": 1988, + "partition": 0, + "highWaterOffset": 3975, + "key": "11083618" + } + +] \ No newline at end of file From e291163951028d6e5974e9746b516ca9271f7851 Mon Sep 17 00:00:00 2001 From: "714943302@qq.com" Date: Thu, 22 Nov 2018 15:49:58 +0800 Subject: [PATCH 06/39] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=88=AA=E7=8F=AD?= =?UTF-8?q?=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic-data/airline/airline.component.ts | 4 +- .../basic-data/airport/airport.component.ts | 2 +- .../seasonal-plan.component.html | 57 ++++++++++++++----- 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/src/app/pages/basic-data/airline/airline.component.ts b/src/app/pages/basic-data/airline/airline.component.ts index 114b9a2..03ecee3 100644 --- a/src/app/pages/basic-data/airline/airline.component.ts +++ b/src/app/pages/basic-data/airline/airline.component.ts @@ -54,7 +54,7 @@ inputEnter() { this.inputFilter(this.airlines) } else { this.inputFilter(this.airlines) - // this.inputPosition(this.render_data) + this.inputPosition(this.airlines) } } @@ -62,7 +62,7 @@ inputEnter() { selectChange() { this.return_data = this.airlines.filter(item=>{ let is_satis = true; - for (const key in this.filterItems) {debugger + for (const key in this.filterItems) { if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { if (item[key] === this.filterItems[key]) { is_satis = true; diff --git a/src/app/pages/basic-data/airport/airport.component.ts b/src/app/pages/basic-data/airport/airport.component.ts index d2530d8..daae285 100644 --- a/src/app/pages/basic-data/airport/airport.component.ts +++ b/src/app/pages/basic-data/airport/airport.component.ts @@ -55,7 +55,7 @@ inputEnter() { this.inputFilter(this.airports) } else { this.inputFilter(this.airports) - // this.inputPosition(this.render_data) + this.inputPosition(this.airports) } } diff --git a/src/app/pages/seasonal-plan/seasonal-plan.component.html b/src/app/pages/seasonal-plan/seasonal-plan.component.html index e5f75e3..c2ff158 100644 --- a/src/app/pages/seasonal-plan/seasonal-plan.component.html +++ b/src/app/pages/seasonal-plan/seasonal-plan.component.html @@ -34,6 +34,7 @@ +
@@ -42,24 +43,28 @@ +
- +
- +
- +
@@ -81,22 +86,48 @@ 序号 - - {{airline_col.COL_CN}} + + {{seasonal.COL_CN}} {{i+1}} - - {{airline_row['renderFlight'][airline_col.COL_CODE]}} + + {{airline_row['renderFlight'][seasonal.COL_CODE]}} From b9a432a11ef1b664fb557a9c514bbbfc61802bb0 Mon Sep 17 00:00:00 2001 From: "714943302@qq.com" Date: Fri, 23 Nov 2018 11:55:58 +0800 Subject: [PATCH 07/39] =?UTF-8?q?=E5=80=BC=E6=9C=BA=E5=B2=9B=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=88=97=E5=90=8D=E6=95=B0=E6=8D=AE=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=8F=8A=E6=9F=A5=E6=89=BE=E5=AE=9A=E4=BD=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkin-group.component.html | 7 +- .../checkin-group/checkin-group.component.ts | 127 +++++------------- 2 files changed, 39 insertions(+), 95 deletions(-) diff --git a/src/app/pages/basic-data/checkin-group/checkin-group.component.html b/src/app/pages/basic-data/checkin-group/checkin-group.component.html index 9eb8af7..391876e 100644 --- a/src/app/pages/basic-data/checkin-group/checkin-group.component.html +++ b/src/app/pages/basic-data/checkin-group/checkin-group.component.html @@ -5,6 +5,8 @@
@@ -36,7 +38,8 @@ - + {{i+1}} {{checkinGroup.checkinGroupCode}} {{checkinGroup.checkinGroupName}} diff --git a/src/app/pages/basic-data/checkin-group/checkin-group.component.ts b/src/app/pages/basic-data/checkin-group/checkin-group.component.ts index b5e5067..2bc869d 100644 --- a/src/app/pages/basic-data/checkin-group/checkin-group.component.ts +++ b/src/app/pages/basic-data/checkin-group/checkin-group.component.ts @@ -20,9 +20,15 @@ SEARCH = ''; //手动输入条件 FLT_POS = 1; //过滤还是定位 SEL_COL = ''; //选择列名 +//下拉框 +public filterItems = { + +} + checkinGroups : Array; public row_state: any = { renderFlight: {} }; public render_data: Array = []; //显示数据,即需要显示的数据 +public return_data: Array = []; //下拉框显示数据 ngOnInit() { this.checkinGroups = this.basicDataService.checkin_group; this.basicDataService.checkin_group_subject.subscribe( @@ -42,111 +48,46 @@ ngOnInit() { tableCont.addEventListener('scroll',scrollHandle); } -//刷新 -clearFiter(){ - $("#inputerInfo").val(""); //清空过滤或查找定位文本框 - this.ngOnInit(); +/** + * 选中某行 + * @param i + */ +selectRow(i) { + this.row_state = i; } + //输入框回车事件 inputEnter() { -if (this.FLT_POS === 1) { - this.selectChange() -} else { - this.selectChange() - this.inputPosition(this.render_data) -} + if (this.FLT_POS === 1) { + this.inputFilter(this.checkinGroups) + } else { + this.inputFilter(this.checkinGroups) + this.inputPosition(this.checkinGroups) + } } //下拉框选择筛选 selectChange() { - let filter_data = []; - let filtercheckinGroups = this.render_data; - this.render_data.forEach(item => { - filter_data.push(Object.assign({}, item)); - }) - if (this.FLT_POS === 1) { - this.inputFilter(filter_data); - } else { - this.checkinGroups = filter_data; - this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} }; - } - //下拉框筛选 - filter_data = filter_data.filter(item => { - if (item) { + this.return_data = this.checkinGroups.filter(item=>{ let is_satis = true; - for (const key in filtercheckinGroups) { - if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { - if (item[key] === filtercheckinGroups[key]) { + for (const key in this.filterItems) { + if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { + if (item[key] === this.filterItems[key]) { is_satis = true; continue; } else { is_satis = false; break; } - } } return is_satis; - } else if (item) { - let is_satis = true; - for (const key in filtercheckinGroups) { - if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { - if (item[key] === filtercheckinGroups[key]) { - is_satis = true; - continue; - } else { - is_satis = false; - break; - } - - } - } - return is_satis; - } else { - let pre_satis = true; - let rea_satis = true; - for (const key in filtercheckinGroups) { - if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { - if (item[key] === filtercheckinGroups[key]) { - pre_satis = true; - continue; - } else { - pre_satis = false; - break; - } - - } - } - for (const key in filtercheckinGroups) { - if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) { - if (item[key] === filtercheckinGroups[key]) { - rea_satis = true; - continue; - } else { - rea_satis = false; - break; - } - - } - } - - if (pre_satis && !rea_satis) { - item = item; - return pre_satis; - } else if (!pre_satis && rea_satis) { - item = item; - return rea_satis; - } else if (pre_satis && rea_satis) { - return pre_satis && rea_satis; - } else { - return false; - } - } }) - } + this.render_data = this.return_data; +} - //输入框筛选 - inputFilter(filterData) { +//输入框筛选 +inputFilter(filterData) { if (this.SEARCH) { if (this.SEL_COL) { let sel_col = this.SEL_COL; @@ -194,14 +135,14 @@ selectChange() { }) } } - this.checkinGroups = filterData; - this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} }; - } + this.render_data = filterData; + this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} }; +} - positionArray: Array = []; - positionArrayIndex: number = 0; - //输入框定位 - inputPosition(filterData) { +positionArray: Array = []; +positionArrayIndex: number = 0; +//输入框定位 +inputPosition(filterData) { let transArray = [] if (this.SEL_COL) { let sel_col = this.SEL_COL; From 08df98693fe11dbdfb69395dbe4d89a2d975e564 Mon Sep 17 00:00:00 2001 From: "714943302@qq.com" Date: Fri, 23 Nov 2018 11:58:10 +0800 Subject: [PATCH 08/39] =?UTF-8?q?=E7=99=BB=E6=9C=BA=E9=97=A8=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=88=97=E5=90=8D=E6=95=B0=E6=8D=AE=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=8F=8A=E6=9F=A5=E6=89=BE=E5=AE=9A=E4=BD=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/pages/basic-data/gate/gate.component.html | 14 +++++++++----- src/app/pages/basic-data/gate/gate.component.ts | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/app/pages/basic-data/gate/gate.component.html b/src/app/pages/basic-data/gate/gate.component.html index 873b6ab..f56ef3d 100644 --- a/src/app/pages/basic-data/gate/gate.component.html +++ b/src/app/pages/basic-data/gate/gate.component.html @@ -3,8 +3,13 @@
- + + + + +