|
@@ -377,7 +377,7 @@
|
|
|
:style="draggableStyle"
|
|
|
>
|
|
|
<div
|
|
|
- v-drag-height
|
|
|
+ ref="dragBox"
|
|
|
class="drag-box"
|
|
|
:class="{ active: dragActive }"
|
|
|
>
|
|
@@ -521,43 +521,7 @@ import { throttledExportToExcel } from '@/utils/table'
|
|
|
|
|
|
export default {
|
|
|
name: 'FlightView',
|
|
|
- directives: {
|
|
|
- dragHeight: {
|
|
|
- inserted(el, binding, vnode) {
|
|
|
- const that = vnode.context
|
|
|
- let mousedownY
|
|
|
- let dragY
|
|
|
- let dragHeight
|
|
|
- const offsetTop = el.offsetParent.offsetTop
|
|
|
- function mousemoveHandler(e) {
|
|
|
- e.stopPropagation()
|
|
|
- e.preventDefault()
|
|
|
- dragY = dragHeight + mousedownY - e.screenY
|
|
|
- dragY = dragY < 0 ? 0 : dragY > offsetTop ? offsetTop : dragY
|
|
|
- that.dragY = dragY
|
|
|
- }
|
|
|
- function mouseupHandler(e) {
|
|
|
- e.stopPropagation()
|
|
|
- e.preventDefault()
|
|
|
- that.dragHeight = that.dragY
|
|
|
- that.dragY = 0
|
|
|
- that.dragActive = false
|
|
|
- document.removeEventListener('mousemove', mousemoveHandler)
|
|
|
- document.removeEventListener('mouseup', mouseupHandler)
|
|
|
- }
|
|
|
- el.addEventListener('mousedown', e => {
|
|
|
- that.dragActive = true
|
|
|
- mousedownY = e.screenY
|
|
|
- dragHeight = that.dragHeight
|
|
|
- that.dragY = dragHeight
|
|
|
- document.addEventListener('mousemove', mousemoveHandler)
|
|
|
- document.addEventListener('mouseup', mouseupHandler)
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
components: {
|
|
|
- // BackButton,
|
|
|
Dialog,
|
|
|
TimeZoneSelector,
|
|
|
TableHeaderCell
|
|
@@ -595,7 +559,6 @@ export default {
|
|
|
// { label: '中转数', prop: 'transferNumber' }
|
|
|
// ],
|
|
|
tableCols: [
|
|
|
- // { label: '序号', prop: 'index' },
|
|
|
{
|
|
|
label: '旅客姓名',
|
|
|
prop: 'PassengerNameUpcase',
|
|
@@ -878,46 +841,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- $route: {
|
|
|
- handler({ path, query }) {
|
|
|
- if (path.includes('flightView')) {
|
|
|
- const { flightNO, flightDate, departureAirport, landingAirport, fastFilter } = query
|
|
|
- if (flightNO && flightDate) {
|
|
|
- if (Object.keys(this.queryData).some(key => this.queryData[key] !== query[key])) {
|
|
|
- this.resetSettings()
|
|
|
- }
|
|
|
- const {
|
|
|
- flightNO: oldFlightNO,
|
|
|
- flightDate: oldFlightDate,
|
|
|
- departureAirport: oldDepartureAirport,
|
|
|
- landingAirport: oldLandingAirport
|
|
|
- } = this.queryData
|
|
|
- if (flightNO !== oldFlightNO || flightDate !== oldFlightDate) {
|
|
|
- this.queryAirline([flightNO, flightDate])
|
|
|
- } else if (departureAirport !== oldDepartureAirport || landingAirport !== oldLandingAirport) {
|
|
|
- if (this.airlineList.length) {
|
|
|
- let currentIndex = this.airlineList.findIndex(
|
|
|
- ({ value }) => value === `${departureAirport}-${landingAirport}`
|
|
|
- )
|
|
|
- currentIndex = currentIndex > -1 ? currentIndex : 0
|
|
|
- this.selectedAirline = this.airlineList[currentIndex].value
|
|
|
- }
|
|
|
- }
|
|
|
- this.selectedFilter = fastFilter ? fastFilter.split(',') : []
|
|
|
- this.queryData = {
|
|
|
- flightNO,
|
|
|
- flightDate,
|
|
|
- departureAirport,
|
|
|
- landingAirport
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$router.push('/')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- deep: true,
|
|
|
- immediate: true
|
|
|
- },
|
|
|
loading(val) {
|
|
|
if (val) {
|
|
|
this.fullscreenLoading = this.$loading({
|
|
@@ -937,9 +860,33 @@ export default {
|
|
|
const { flightNO, flightDate } = this.queryData
|
|
|
const [departureAirport, landingAirport] = val.split('-')
|
|
|
this.queryAll([flightNO, flightDate, departureAirport, landingAirport])
|
|
|
+ },
|
|
|
+ selectedFilter(val) {
|
|
|
+ const { path, query } = this.$route
|
|
|
+ const newQuery = { ...query }
|
|
|
+ delete newQuery.fastFilter
|
|
|
+ if (val.length) {
|
|
|
+ newQuery.fastFilter = val.join(',')
|
|
|
+ }
|
|
|
+ this.$router.replace({
|
|
|
+ path,
|
|
|
+ query: newQuery
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ const { flightNO, flightDate, departureAirport, landingAirport } = this.$route.query
|
|
|
+ if (flightNO && flightDate) {
|
|
|
+ this.queryAirline([flightNO, flightDate])
|
|
|
+ this.queryData = {
|
|
|
+ flightNO,
|
|
|
+ flightDate,
|
|
|
+ departureAirport,
|
|
|
+ landingAirport
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$router.push('/')
|
|
|
+ }
|
|
|
Object.values(this.tableCols).forEach(({ prop, filterable, sortable }) => {
|
|
|
if (filterable) {
|
|
|
this.$set(this.flightBaggageTableFilters, prop, [])
|
|
@@ -950,40 +897,63 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.setDragBox()
|
|
|
+ },
|
|
|
updated() {
|
|
|
this.resizeHandler()
|
|
|
},
|
|
|
activated() {
|
|
|
+ const { fastFilter } = this.$route.query
|
|
|
+ this.selectedFilter = fastFilter ? fastFilter.split(',') : []
|
|
|
this.getWarningData()
|
|
|
this.resizeHandler()
|
|
|
this.debouncedResizeHandler = this._.debounce(this.resizeHandler, this.debounceTime)
|
|
|
window.addEventListener('resize', this.debouncedResizeHandler)
|
|
|
},
|
|
|
deactivated() {
|
|
|
- this.dragHeight = 0
|
|
|
- this.dragY = 0
|
|
|
this.fullscreenLoading?.close()
|
|
|
window.removeEventListener('resize', this.debouncedResizeHandler)
|
|
|
},
|
|
|
- beforeDestroy() {
|
|
|
- this.fullscreenLoading?.close()
|
|
|
- },
|
|
|
methods: {
|
|
|
+ setDragBox() {
|
|
|
+ const dragBox = this.$refs['dragBox']
|
|
|
+ const offsetTop = dragBox.offsetParent.offsetTop
|
|
|
+ const that = this
|
|
|
+ let mousedownY
|
|
|
+ let dragY
|
|
|
+ let dragHeight
|
|
|
+ function mousemoveHandler(e) {
|
|
|
+ e.stopPropagation()
|
|
|
+ e.preventDefault()
|
|
|
+ dragY = dragHeight + mousedownY - e.screenY
|
|
|
+ dragY = dragY < 0 ? 0 : dragY > offsetTop ? offsetTop : dragY
|
|
|
+ that.dragY = dragY
|
|
|
+ }
|
|
|
+ function mouseupHandler(e) {
|
|
|
+ e.stopPropagation()
|
|
|
+ e.preventDefault()
|
|
|
+ that.dragHeight = that.dragY
|
|
|
+ that.dragY = 0
|
|
|
+ that.dragActive = false
|
|
|
+ document.removeEventListener('mousemove', mousemoveHandler)
|
|
|
+ document.removeEventListener('mouseup', mouseupHandler)
|
|
|
+ }
|
|
|
+ dragBox.addEventListener('mousedown', e => {
|
|
|
+ that.dragActive = true
|
|
|
+ mousedownY = e.screenY
|
|
|
+ dragHeight = that.dragHeight
|
|
|
+ that.dragY = dragHeight
|
|
|
+ document.addEventListener('mousemove', mousemoveHandler)
|
|
|
+ document.addEventListener('mouseup', mouseupHandler)
|
|
|
+ })
|
|
|
+ },
|
|
|
resizeHandler() {
|
|
|
this.$refs['containerTable']?.doLayout()
|
|
|
// this.$refs['transferInBaggageTable']?.doLayout()
|
|
|
// this.$refs['transferOutBaggageTable']?.doLayout()
|
|
|
this.$refs['flightBaggageTable']?.doLayout()
|
|
|
},
|
|
|
- resetSettings() {
|
|
|
- this.initTableCols()
|
|
|
- Object.keys(this.filterValues).forEach(key => {
|
|
|
- this.filterValues[key] = []
|
|
|
- })
|
|
|
- Object.keys(this.tableDataSortRules).forEach(key => {
|
|
|
- this.tableDataSortRules[key] = ''
|
|
|
- })
|
|
|
- },
|
|
|
setfastFilterValues() {
|
|
|
const inFlightNOList = new Set()
|
|
|
const transferFlightNOList = new Set()
|