|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2022-01-17 10:39:22
|
|
|
- * @LastEditTime: 2022-05-07 15:56:23
|
|
|
+ * @LastEditTime: 2022-05-10 09:33:09
|
|
|
* @LastEditors: your name
|
|
|
* @Description: 行李视图
|
|
|
-->
|
|
@@ -155,7 +155,6 @@
|
|
|
:span="6"
|
|
|
>
|
|
|
<div class="card">
|
|
|
- <!-- <div class="message-date">{{ message.date }}</div> -->
|
|
|
<div class="message-content">
|
|
|
{{ message.replace(/\s+/g, "").split(".").join("\n.") }}
|
|
|
<!-- BSM <br>
|
|
@@ -399,7 +398,8 @@ export default {
|
|
|
baggageTableData: [],
|
|
|
spanArr: [],
|
|
|
pos: 0,
|
|
|
- loopEvent:null
|
|
|
+ loopEvent: null,
|
|
|
+ msgEvent:null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -414,19 +414,37 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
infoBtn(val) {
|
|
|
+ let that = this;
|
|
|
if (val === '跟踪报文') {
|
|
|
+ clearInterval(this.loopEvent);
|
|
|
this.baggageMessageQuery()
|
|
|
+ this.msgEvent = setInterval(function(){
|
|
|
+ that.baggageMessageQuery()
|
|
|
+ },5000)
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ clearInterval(this.loopEvent);
|
|
|
+ this.queryBaggageAll()
|
|
|
+ this.loopEvent = setInterval(function () {
|
|
|
+ that.queryBaggageAll()
|
|
|
+ }, 3000)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.queryData = this._.cloneDeep(this.$route.query)
|
|
|
// console.log(this.queryData)
|
|
|
- let that = this
|
|
|
- this.loopEvent = setInterval(function(){
|
|
|
+ const that = this
|
|
|
+ this.queryBaggageAll()
|
|
|
+ this.loopEvent = setInterval(function () {
|
|
|
that.queryBaggageAll()
|
|
|
-
|
|
|
- },3000)
|
|
|
+ }, 3000)
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ clearInterval(this.loopEvent)
|
|
|
+ this.loopEvent = null
|
|
|
+ clearInterval(this.queryMessageLoop)
|
|
|
+ this.queryMessageLoop = null
|
|
|
},
|
|
|
methods: {
|
|
|
// objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
@@ -448,8 +466,8 @@ export default {
|
|
|
} else {
|
|
|
if (
|
|
|
tableData[i]['flightNo'] === tableData[i - 1]['flightNo'] &&
|
|
|
- tableData[i]['flightDate'] === tableData[i - 1]['flightDate']&&
|
|
|
- tableData[i]['departureAirport'] === tableData[i - 1]['departureAirport']&&
|
|
|
+ tableData[i]['flightDate'] === tableData[i - 1]['flightDate'] &&
|
|
|
+ tableData[i]['departureAirport'] === tableData[i - 1]['departureAirport'] &&
|
|
|
tableData[i]['landingAirport'] === tableData[i - 1]['landingAirport']
|
|
|
) {
|
|
|
spanArr[pos] += 1
|
|
@@ -464,7 +482,7 @@ export default {
|
|
|
this.pos = pos
|
|
|
},
|
|
|
tableSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
- if (['flightNo', 'flightDate','departureAirport','landingAirport'].includes(column['property'])) {
|
|
|
+ if (['flightNo', 'flightDate', 'departureAirport', 'landingAirport'].includes(column['property'])) {
|
|
|
const _row = this.spanArr[rowIndex]
|
|
|
const _col = _row > 0 ? 1 : 0
|
|
|
return {
|
|
@@ -485,6 +503,10 @@ export default {
|
|
|
queryBaggageDetails(dataContent) {
|
|
|
return myQuery(queryMap.baggageDetailsByID, ...dataContent)
|
|
|
},
|
|
|
+ // 原始报文
|
|
|
+ queryMessage(dataContent) {
|
|
|
+ return myQuery(queryMap.message, ...dataContent)
|
|
|
+ },
|
|
|
async queryBaggageAll(queryData = this.queryData) {
|
|
|
const { FlightNO, FlightDate, BagSN } = queryData
|
|
|
const dataContent = [FlightNO, FlightDate, BagSN]
|
|
@@ -498,20 +520,20 @@ export default {
|
|
|
// this.queryBaggageTrack(new Array(2).fill(dataContent).flat()),
|
|
|
this.queryBaggageDetails(new Array(6).fill(dataContent).flat())
|
|
|
])
|
|
|
- baggageBasicInfo[0].FlightNO = FlightNO;
|
|
|
+ baggageBasicInfo[0].FlightNO = FlightNO
|
|
|
baggageBasicInfo.length && (this.baggageBasicInfo = baggageBasicInfo[0])
|
|
|
// this._.sortBy(baggageTrack, item => item.DealTime).forEach((item, index) => {
|
|
|
// item['DealTime'] = item['DealTime'].replace('T', '\n')
|
|
|
// item.NodeNameEN && this.stepData.splice(index, 1, item)
|
|
|
// })
|
|
|
- let baggageDetailsData = this._.sortBy(baggageDetails, ['flightDate','dealTime'])
|
|
|
+ const baggageDetailsData = this._.sortBy(baggageDetails, ['flightDate', 'dealTime'])
|
|
|
|
|
|
this.baggageTableData = baggageDetailsData.map((item, index) => {
|
|
|
this.stepData.splice(index, 1, {
|
|
|
NodeNameEN: item.nodeCode,
|
|
|
DealTime: item.dealTime.replace('T', '\n')
|
|
|
})
|
|
|
- if(item['dealTime'].split('T').length>1){
|
|
|
+ if (item['dealTime'].split('T').length > 1) {
|
|
|
item['dealTime'] = item['dealTime'].split('T')[1]
|
|
|
}
|
|
|
item['departureAirport'] = `${item['departureAirport']}\n${item['departureTime'].split('T')[1]}`
|
|
@@ -526,11 +548,6 @@ export default {
|
|
|
async baggageMessageQuery() {
|
|
|
const { FlightNO, FlightDate, BagSN } = this.queryData
|
|
|
let dataContent = [FlightNO,FlightDate,BagSN]
|
|
|
- try {
|
|
|
- // const result = await BaggageMessageQuery(params)
|
|
|
- // console.log(result.returnData)
|
|
|
- // return myQuery(queryMap.baggageDetailsByID, ...dataContent)
|
|
|
-
|
|
|
try {
|
|
|
const res = await getQuery({
|
|
|
id:75,
|
|
@@ -545,14 +562,8 @@ export default {
|
|
|
} catch (error) {
|
|
|
console.log('出错了', error)
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- console.log(error)
|
|
|
- }
|
|
|
}
|
|
|
- },
|
|
|
- beforeDestroy() {
|
|
|
- clearInterval(this.loopEvent);
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
@@ -750,8 +761,8 @@ export default {
|
|
|
flex-wrap: wrap;
|
|
|
.card {
|
|
|
width: 100%;
|
|
|
- min-height: 330px;
|
|
|
- padding: 24px 0 0 32px;
|
|
|
+ min-height: 440px;
|
|
|
+ padding: 24px 0 24px 32px;
|
|
|
background: #ffffff;
|
|
|
box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, 0.29);
|
|
|
margin-bottom: 24px;
|