|
@@ -1,22 +1,12 @@
|
|
|
/*
|
|
|
* @Author: Badguy
|
|
|
* @Date: 2022-03-04 11:41:55
|
|
|
- * @LastEditTime: 2022-05-27 09:49:24
|
|
|
+ * @LastEditTime: 2022-05-27 15:48:17
|
|
|
* @LastEditors: your name
|
|
|
* @Description: 航站视图通用部分
|
|
|
* have a nice day!
|
|
|
*/
|
|
|
|
|
|
-import { queryMap, myQuery } from '@/api/dataIntegration'
|
|
|
-// import {
|
|
|
-// CurrentAirportQuery,
|
|
|
-// RelatedAirportQuery,
|
|
|
-// AirCompanyQuery,
|
|
|
-// CraftTypeQuery,
|
|
|
-// FlightAttrQuery,
|
|
|
-// IntegratedQuery,
|
|
|
-// IntegratedQueryTransfer
|
|
|
-// } from '@/api/flight'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import { commonTableCellClass } from '@/utils/table'
|
|
|
|
|
@@ -27,51 +17,20 @@ export default {
|
|
|
tableData: [],
|
|
|
spanArr: [],
|
|
|
pos: 0,
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ computedTableHeight: 0
|
|
|
}
|
|
|
},
|
|
|
- // created() {
|
|
|
- // this.currentAirportQuery()
|
|
|
- // },
|
|
|
- mounted() {
|
|
|
- // this.queryDepartureAirport()
|
|
|
+ updated() {
|
|
|
+ const headerHeight = 80
|
|
|
+ const bottomBlankHeight = 41
|
|
|
+ const formWrapHeight = this.$refs['formWrap'].offsetHeight
|
|
|
+ this.computedTableHeight = `calc(100vh - ${headerHeight + bottomBlankHeight + formWrapHeight}px)`
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['clickedCells']),
|
|
|
- dates() {
|
|
|
- return [this.startDate, this.endDate]
|
|
|
- },
|
|
|
- flightQueryParams() {
|
|
|
- return [
|
|
|
- this.startDate,
|
|
|
- this.endDate,
|
|
|
- this.departureAirPort,
|
|
|
- this.departureAirPort,
|
|
|
- this.landingAirport,
|
|
|
- this.landingAirport,
|
|
|
- this.carrier,
|
|
|
- this.carrier,
|
|
|
- this.craftType,
|
|
|
- this.craftType,
|
|
|
- this.flightAttr,
|
|
|
- this.flightAttr,
|
|
|
- this.search,
|
|
|
- this.search
|
|
|
- ]
|
|
|
- }
|
|
|
+ ...mapGetters(['clickedCells'])
|
|
|
},
|
|
|
methods: {
|
|
|
- // 数据处理
|
|
|
- formatData(arr) {
|
|
|
- arr.forEach(item => {
|
|
|
- item['name'] = item['name'] + item['code3']
|
|
|
- item.builds &&
|
|
|
- item.builds.forEach(p => {
|
|
|
- p['code3'] = p.name
|
|
|
- })
|
|
|
- })
|
|
|
- return arr
|
|
|
- },
|
|
|
// 合计行
|
|
|
summaryMethod({ columns, data }) {
|
|
|
const sums = []
|
|
@@ -348,188 +307,6 @@ export default {
|
|
|
default:
|
|
|
break
|
|
|
}
|
|
|
- },
|
|
|
- // // 全部机场查询
|
|
|
- // async currentAirportQuery() {
|
|
|
- // const params = {
|
|
|
- // startDate: this.startDate,
|
|
|
- // endDate: this.endDate
|
|
|
- // }
|
|
|
- // try {
|
|
|
- // const res = await CurrentAirportQuery(params)
|
|
|
- // if (res.code === 0) {
|
|
|
- // if (res.returnData.length) {
|
|
|
- // const datas = this.formatData(res.returnData)
|
|
|
- // const datasCopy = this._.cloneDeep(datas)
|
|
|
- // this.currentAirportList = datas
|
|
|
- // const defaultData = datasCopy[0]
|
|
|
- // // this.formData.currentAirport = [[defaultData.code3, defaultData.builds[0].code3]]
|
|
|
- // // this.formData.currentAirport = [[defaultData.code3]]
|
|
|
- // this.formData.currentAirport = [defaultData.code3]
|
|
|
- // params.currentAirport = this.currentAirport
|
|
|
- // this.getFormData(params)
|
|
|
- // this.getTableData({
|
|
|
- // ...params,
|
|
|
- // world: this.formData.search
|
|
|
- // })
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.$message.error(res.message)
|
|
|
- // }
|
|
|
- // } catch (error) {
|
|
|
- // console.log('出错了', error)
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 目的站/始飞站查询
|
|
|
- // async relatedAirportQuery(params = {}) {
|
|
|
- // try {
|
|
|
- // const res = await RelatedAirportQuery(params)
|
|
|
- // if (res.code === 0) {
|
|
|
- // const datas = this.formatData(res.returnData)
|
|
|
- // this.relatedAirportList = datas
|
|
|
- // } else {
|
|
|
- // this.$message.error(res.message)
|
|
|
- // }
|
|
|
- // } catch (error) {
|
|
|
- // console.log('出错了', error)
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 航司查询
|
|
|
- // async inboundCarrierQuery(params = {}) {
|
|
|
- // try {
|
|
|
- // const res = await AirCompanyQuery({
|
|
|
- // ...params,
|
|
|
- // type: 'IN'
|
|
|
- // })
|
|
|
- // if (res.code === 0) {
|
|
|
- // this.carrierList = res.returnData
|
|
|
- // } else {
|
|
|
- // this.$message.error(res.message)
|
|
|
- // }
|
|
|
- // } catch (error) {
|
|
|
- // console.log('出错了', error)
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 航司查询
|
|
|
- // async outgoingAirlineQuery(params = {}) {
|
|
|
- // try {
|
|
|
- // const res = await AirCompanyQuery({
|
|
|
- // ...params,
|
|
|
- // type: 'OUT'
|
|
|
- // })
|
|
|
- // if (res.code === 0) {
|
|
|
- // this.carrierList = res.returnData
|
|
|
- // } else {
|
|
|
- // this.$message.error(res.message)
|
|
|
- // }
|
|
|
- // } catch (error) {
|
|
|
- // console.log('出错了', error)
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 机型查询
|
|
|
- // async craftTypeQuery(params = {}) {
|
|
|
- // try {
|
|
|
- // const res = await CraftTypeQuery(params)
|
|
|
- // if (res.code === 0) {
|
|
|
- // this.craftTypeList = res.returnData.map(item => ({
|
|
|
- // code3: item,
|
|
|
- // name: item
|
|
|
- // }))
|
|
|
- // } else {
|
|
|
- // this.$message.error(res.message)
|
|
|
- // }
|
|
|
- // } catch (error) {
|
|
|
- // console.log('出错了', error)
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 航线查询
|
|
|
- // async flightAttrQuery(params = {}) {
|
|
|
- // try {
|
|
|
- // const res = await FlightAttrQuery(params)
|
|
|
- // if (res.code === 0) {
|
|
|
- // this.flightAttrList = res.returnData
|
|
|
- // } else {
|
|
|
- // this.$message.error(res.message)
|
|
|
- // }
|
|
|
- // } catch (error) {
|
|
|
- // console.log('出错了', error)
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 综合查询
|
|
|
- // async integratedQuery(params = {}) {
|
|
|
- // try {
|
|
|
- // this.loading = true
|
|
|
- // const res = await IntegratedQuery(params)
|
|
|
- // if (res.code === 0) {
|
|
|
- // const tableData = res.returnData
|
|
|
- // this.initTableData(tableData)
|
|
|
- // this.loading = false
|
|
|
- // } else {
|
|
|
- // this.$message.error(res.message)
|
|
|
- // this.loading = false
|
|
|
- // }
|
|
|
- // } catch (error) {
|
|
|
- // console.log('出错了', error)
|
|
|
- // this.loading = false
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 中转综合查询
|
|
|
- // async integratedQueryTransfer(params = {}) {
|
|
|
- // try {
|
|
|
- // this.loading = true
|
|
|
- // const res = await IntegratedQueryTransfer(params)
|
|
|
- // if (res.code === 0) {
|
|
|
- // const tableData = res.returnData
|
|
|
- // this.initTableData(tableData)
|
|
|
- // this.loading = false
|
|
|
- // } else {
|
|
|
- // this.$message.error(res.message)
|
|
|
- // this.loading = false
|
|
|
- // }
|
|
|
- // } catch (error) {
|
|
|
- // console.log('出错了', error)
|
|
|
- // this.loading = false
|
|
|
- // }
|
|
|
- // },
|
|
|
- // 查询起飞机场 id: 31
|
|
|
- queryDepartureAirport() {
|
|
|
- return myQuery(queryMap.departureAirPort, ...this.dates)
|
|
|
- },
|
|
|
- // 查询降落机场 id: 32
|
|
|
- queryLandingAirport() {
|
|
|
- return myQuery(queryMap.landingAirport, ...this.dates)
|
|
|
- },
|
|
|
- // 按照降落机场查询起飞机场 id: 33
|
|
|
- queryDepartureAirportByLandingAirport() {
|
|
|
- return myQuery(queryMap.departureAirPortBylandingAirport, this.currentAirport, ...this.dates)
|
|
|
- },
|
|
|
- // 按照起飞机场查询降落机场 id: 34
|
|
|
- queryLandingAirportByDepartureAirport() {
|
|
|
- return myQuery(queryMap.landingAirportBydepartureAirPort, this.currentAirport, ...this.dates)
|
|
|
- },
|
|
|
- // 查询航司 id: 35
|
|
|
- queryCarrier() {
|
|
|
- return myQuery(queryMap.carrier, ...this.dates)
|
|
|
- },
|
|
|
- // 查询机型 id: 36
|
|
|
- queryCraftType() {
|
|
|
- return myQuery(queryMap.craftType, ...this.dates)
|
|
|
- },
|
|
|
- // 查询航线 id: 37
|
|
|
- queryAirline() {
|
|
|
- return myQuery(queryMap.flightAttr, ...this.dates)
|
|
|
- },
|
|
|
- // 查询进港航班 id: 38
|
|
|
- queryLandingFlight() {
|
|
|
- return myQuery(queryMap.landingFlight, ...this.flightQueryParams)
|
|
|
- },
|
|
|
- // 查询离港航班 id: 39
|
|
|
- queryDepartureFlight() {
|
|
|
- return myQuery(queryMap.departureFlight, ...this.flightQueryParams)
|
|
|
- },
|
|
|
- // 查询中转航班 id: 40
|
|
|
- queryTrasferFlight() {
|
|
|
- return myQuery(queryMap.transferFlight, ...this.flightQueryParams)
|
|
|
}
|
|
|
}
|
|
|
}
|