Commit 58d844b6 by liujinbo

信息通报-兼容其他模板展示

parent 8ad2b684
...@@ -16,3 +16,45 @@ export const getAircraftTerminalsApi = (data, config) => { ...@@ -16,3 +16,45 @@ export const getAircraftTerminalsApi = (data, config) => {
config config
}) })
} }
export const getFListApi = (data, config) => {
return http({
method: 'POST',
url: '/flighting/getFList',
data,
config
})
}
export const getReleaseListApi = (data, config) => {
return http({
method: 'POST',
url: '/flighting/getReleaseList',
data,
config
})
}
export const findWeatherSynopsesMessagesApi = (data, config) => {
return http({
method: 'POST',
url: '/basicinfo/findWeatherSynopsesMessages',
data,
config
})
}
/*
* 获取天气信息
* /basicinfo/findWeatherSynopsesMessages
* {airportCode: "WUH"}
* [取最后一条数据] weatherInfoTxt-天气明朗 temperature-温度
*
*
* 获取航班任务-定时执行
* /flighting/getFlightTask
* {catchId: 9435439}
*
* 获取飞往目的地列表
* /flighting/getFlyToApplets
*
*
* */
<template> <template>
<!-- 航班号+航空图标 --> <!-- 航班号+航空图标 -->
<image <image
:style="{visibility: airlinePic ? 'visible' : 'hidden'}" :style="{
class="flight-no-image" visibility: airlinePic ? 'visible' : 'hidden',
:src="airlinePic || HnaPic" ...ps.style
}"
:src="airlinePic"
mode="widthFix" /> mode="widthFix" />
<text>{{ ps.flightNo }}</text> <text v-if="ps.flightNo">{{ ps.flightNo }}</text>
</template> </template>
<script setup> <script setup>
...@@ -13,15 +15,27 @@ import { computed } from 'vue' ...@@ -13,15 +15,27 @@ import { computed } from 'vue'
import HnaPic from 'mocpStatic/image/monitor/hna.png' import HnaPic from 'mocpStatic/image/monitor/hna.png'
import { airlinePicMapping } from './components/airlinePicMapping' import { airlinePicMapping } from './components/airlinePicMapping'
const ps = defineProps(['flightNo', 'airline']) const ps = defineProps({
const airlinePic = computed(function() { airline: {
return airlinePicMapping[ps.airline] type: String,
default: HnaPic
},
flightNo: {
type: [String, Number],
default: ''
},
style: {
type: Object,
default: () => {
return {
'width': '22rpx',
'height': '22rpx',
'marginRight': '6rpx'
}
}
}
}) })
const airlinePic = computed(() => airlinePicMapping[ps.airline])
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
.flight-no-image {
width: 22rpx;
height: 22rpx;
margin-right: 6rpx;
}
</style>
...@@ -15,7 +15,7 @@ const useFlightSupportStore = defineStore('flightSupport', { ...@@ -15,7 +15,7 @@ const useFlightSupportStore = defineStore('flightSupport', {
isInbound: 1, isInbound: 1,
ac: '',//机号 ac: '',//机号
flightNo: '',//航班号 flightNo: 'GS7857',//航班号 临时测试用,ljb
acOwns2: '', acOwns2: '',
acTerminals1: '', acTerminals1: '',
...@@ -23,31 +23,36 @@ const useFlightSupportStore = defineStore('flightSupport', { ...@@ -23,31 +23,36 @@ const useFlightSupportStore = defineStore('flightSupport', {
acs1: '' acs1: ''
}, },
screenData: { screenData: {
terminal: '',//航站 terminal: 'WUH',//航站
acType: '',//机型 acType: '',//机型
acOwn: ''//航司 acOwn: ''//航司
}, },
details: undefined,
listTab, listTab,
listScreen, listScreen,
listScreenCurrent: 1 listScreenCurrent: 1,
details: undefined,
filterDetailsList: [],
filterDetailsCurrentIndex: 0
} }
}, },
getters: { getters: {
getSearchData(state) { getSearchData (state) {
const userStore = useUserStore() const userStore = useUserStore()
return {...state.searchData, ...state.screenData, terminal: userStore.userInfo?.terminal || 'WUH'} return {...state.searchData, ...state.screenData, terminal: userStore.userInfo?.terminal || 'WUH'}
}, },
getSelectedList(state) { getSelectedList (state) {
return state.listTab.filter(item => item.selected) return state.listTab.filter(item => item.selected)
}, },
getTerminal() { getTerminal () {
const userStore = useUserStore() const userStore = useUserStore()
return userStore.userInfo?.terminal || 'WUH' return userStore.userInfo?.terminal || 'WUH'
},
getDetailsCurrentMsg (state) {
return state.filterDetailsList[state.filterDetailsCurrentIndex]
} }
}, },
actions: { actions: {
resetScreenForm() { resetScreenForm () {
const userStore = useUserStore() const userStore = useUserStore()
this.screenData = { this.screenData = {
terminal: userStore.userInfo?.terminal || 'WUH', terminal: userStore.userInfo?.terminal || 'WUH',
...@@ -55,7 +60,7 @@ const useFlightSupportStore = defineStore('flightSupport', { ...@@ -55,7 +60,7 @@ const useFlightSupportStore = defineStore('flightSupport', {
acOwn: '' acOwn: ''
} }
}, },
setStateScreen(state) { setStateScreen (state) {
const userStore = useUserStore() const userStore = useUserStore()
this.screenData = { this.screenData = {
terminal: state.terminal || userStore.userInfo?.terminal || 'WUH', terminal: state.terminal || userStore.userInfo?.terminal || 'WUH',
...@@ -64,7 +69,7 @@ const useFlightSupportStore = defineStore('flightSupport', { ...@@ -64,7 +69,7 @@ const useFlightSupportStore = defineStore('flightSupport', {
} }
}, },
// 设置列表tab筛选数据 // 设置列表tab筛选数据
setListTabSelected(args) { setListTabSelected (args) {
this.listTab = this.listTab.map(item => { this.listTab = this.listTab.map(item => {
const that = args.find(args => args == item.label) const that = args.find(args => args == item.label)
return { return {
...@@ -75,18 +80,18 @@ const useFlightSupportStore = defineStore('flightSupport', { ...@@ -75,18 +80,18 @@ const useFlightSupportStore = defineStore('flightSupport', {
} }
}, },
// 配置持久化 // 配置持久化
persist: false // persist: false
/*persist: { persist: {
// 调整为兼容多端的API // 调整为兼容多端的API
storage: { storage: {
setItem(key, value) { setItem (key, value) {
uni.setStorageSync(key, value) uni.setStorageSync(key, value)
}, },
getItem(key) { getItem (key) {
return uni.getStorageSync(key) return uni.getStorageSync(key)
} }
} }
}*/ }
}) })
export default useFlightSupportStore export default useFlightSupportStore
...@@ -2,7 +2,7 @@ import { ref, computed } from 'vue' ...@@ -2,7 +2,7 @@ import { ref, computed } from 'vue'
const dayForMilliseconds = 24 * 3600 * 1000 const dayForMilliseconds = 24 * 3600 * 1000
export function decideTimeRange(inputNum) { export function decideTimeRange (inputNum) {
const d = new Date(inputNum) const d = new Date(inputNum)
d.setHours(5, 0, 0, 0) d.setHours(5, 0, 0, 0)
return { return {
...@@ -29,6 +29,10 @@ export const listScreen = [ ...@@ -29,6 +29,10 @@ export const listScreen = [
{name: '无航班', value: 2} {name: '无航班', value: 2}
] ]
export const followAcTagAll = [
'未接收', '已接收', '已出发', '已到位', '已登机'
]
export const fightListTime = ['etdChn', 'atdChn', 'etaChn', 'ataChn'] export const fightListTime = ['etdChn', 'atdChn', 'etaChn', 'ataChn']
export const fightListPlanTime = ['staChn', 'schTime'] export const fightListPlanTime = ['staChn', 'schTime']
export const finishedStatus = ['ARR', 'NDR', 'ATA'] export const finishedStatus = ['ARR', 'NDR', 'ATA']
......
<template> <template>
<view class="globalDetailsModel detailsBasicInfo"> <view class="globalDetailsModel detailsBasicInfo">
<view class="title">BH9999</view> <view class="title">{{ getDetailsCurrentMsg.flightNo }}</view>
<view class="basicInfoDep flex flex-between"> <view class="basicInfoDep flex flex-between">
<view> <view>
<text>CKG</text> <text>{{ baseStore.getTerminalObject[getDetailsCurrentMsg.depStn] }}</text>
<text class="m-x-6">重庆江北</text> <!--<text class="m-x-6">重庆江北</text>-->
<text>T3</text> <!--<text>T3</text>-->
</view> </view>
<view> <view>
<text>WUh</text> <!--<text>{{ getDetailsCurrentMsg.arrStn }}</text>-->
<text>武汉天河</text> <text>{{ baseStore.getTerminalObject[getDetailsCurrentMsg.arrStn] }}</text>
<text>T2</text> <!--<text>T2</text>-->
</view> </view>
</view> </view>
<view class="basicInfoTime flex flex-between"> <view class="basicInfoTime flex flex-between">
<text>19:59</text> <text>{{ atdChnValue }}</text>
<image class="timeFlightIcon" :src="FlightImage" /> <image class="timeFlightIcon" :src="FlightImage" />
<text>20:59</text> <text>{{ ataChnValue }}</text>
</view> </view>
<view class="basicInfoTimePlan flex flex-between"> <view class="basicInfoTimePlan flex flex-between">
<view> <view>
<text>计划</text> <text>计划</text>
<text>5/9</text> <text class="MM">{{ timeStampFormat(getDetailsCurrentMsg.stdChn, {format: 'MM/DD'}) }}</text>
<text>16:59</text> <text>{{ timeStampFormat(getDetailsCurrentMsg.stdChn, {format: 'HH:mm'}) }}</text>
</view> </view>
<view> <view>
<text>5/9</text> <text>{{ timeStampFormat(getDetailsCurrentMsg.staChn, {format: 'MM/DD'}) }}</text>
<text>17:59</text> <text class="MM">{{ timeStampFormat(getDetailsCurrentMsg.staChn, {format: 'HH:mm'}) }}</text>
<text>计划</text> <text>计划</text>
</view> </view>
</view> </view>
</view> </view>
<DetailsFollowCrewItem title="跟机人员" :list="followCrewList" /> <DetailsFollowCrewItem title="跟机人员" :list="getDetailsCurrentMsg.mfollowAcLists" />
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { computed, ref } from 'vue'
import { timeStampFormat } from 'mocp/utils/tool'
import FlightImage from 'mocpStatic/image/monitor/flight-pane.png' import FlightImage from 'mocpStatic/image/monitor/flight-pane.png'
import DetailsFollowCrewItem from './DetailsFollowCrewItem.vue' import DetailsFollowCrewItem from './DetailsFollowCrewItem.vue'
import useFlightSupportStore from 'mocp/store/flight-support'
import { storeToRefs } from 'pinia'
import useBaseStore from 'mocp/store/base'
const followCrewList = ref([ const baseStore = useBaseStore()
{name: '斯柯达'}, const flightSupportStore = useFlightSupportStore()
{name: '花飘万家雪'}, const {getDetailsCurrentMsg} = storeToRefs(flightSupportStore)
{name: '花样百出'}
]) const atdChnValue = computed(() => {
const time = getDetailsCurrentMsg.value?.atdChn || getDetailsCurrentMsg.value.etdChn
return time ? timeStampFormat(time, {format: 'HH:mm'}) : '--:--'
})
const ataChnValue = computed(() => {
const time = getDetailsCurrentMsg.value?.ataChn || getDetailsCurrentMsg.value.etaChn
return time ? timeStampFormat(time, {format: 'HH:mm'}) : '--:--'
})
</script> </script>
......
...@@ -8,15 +8,16 @@ ...@@ -8,15 +8,16 @@
class="followCrewItem flex flex-between" class="followCrewItem flex flex-between"
> >
<view class="flex"> <view class="flex">
<image class="img" :src="FlightImage" /> <!--<image class="img" :src="FlightImage" />-->
<view> <view>
<view>{{ item.name }}</view> <view>{{ item.uname }}</view>
<view class="status">维修员</view> <!--<view class="status">维修员</view>-->
</view> </view>
</view> </view>
<view class="flex"> <view class="flex">
<up-icon class="rtIcon" name="checkmark-circle-fill" size="20" :color="$mocp-success-6" /> <up-icon v-if="item.followStatus > 0" class="rtIcon" name="checkmark-circle-fill" size="20"
<text>已登机</text> :color="$mocp-success-6" />
<text>{{ item.followStatusValue }}</text>
</view> </view>
</view> </view>
</view> </view>
......
<template> <template>
<view class="globalDetailsModel detailsFollowingCrew detailsOtherInfo"> <DetailsWeather v-if="ps.weatherMsg?.depStnList" title="起飞当日" :msg="ps.weatherMsg.depStnList" />
<view class="font-700 flex">
<image class="timeFlightIcon" :src="FlightImage" />
<view>
<text class="m-x-6">重庆江北</text>
<text>CKG</text>
</view>
</view>
<view class="flex waterCont">
<image class="weatherIcon" :src="FlightImage" />
<view>
<view class="waterTp"></view>
<view>
<text class="waterTemp font-700">16°/30°</text>
<text class="waterText">(起飞当日)</text>
</view>
</view>
</view>
<view class="flex flex-between waterInfo">
<view>
<view class="flex waterInfoItem">
<image class="weatherSubIcon" :src="FlightImage" />
<text>能见度</text>
</view>
<view>5000m</view>
</view>
<view>
<view class="flex waterInfoItem">
<image class="weatherSubIcon" :src="FlightImage" />
<text>风速</text>
</view>
<view>5公里/小时</view>
</view>
<view>
<view class="flex waterInfoItem">
<image class="weatherSubIcon" :src="FlightImage" />
<text>PM2.5</text>
</view>
<view>18优</view>
</view>
</view>
<DetailsWeather v-if="ps.weatherMsg?.arrStnList" title="落地当日" :msg="ps.weatherMsg.arrStnList" />
</view>
<DetailsFollowCrewItem title="跟机机务" :list="followCrewList" /> <DetailsFollowCrewItem title="跟机机务" :list="followCrewList" />
<DetailsFollowCrewItem title="机组人员" :list="followCrewList" /> <DetailsFollowCrewItem title="机组人员" :list="followCrewList" />
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { ref, onMounted } from 'vue'
import FlightImage from 'mocpStatic/image/monitor/flight-pane.png'
import DetailsFollowCrewItem from './DetailsFollowCrewItem.vue' import DetailsFollowCrewItem from './DetailsFollowCrewItem.vue'
import DetailsWeather from './DetailsWeather.vue'
const ps = defineProps({
weatherMsg: {
type: Object,
default: () => {}
}
})
const followCrewList = ref([ const followCrewList = ref([
{name: '斯柯达'}, {name: '斯柯达'},
......
<template> <template>
<swiper <swiper
class="swiperCont" class="swiperCont"
:current="1" :current="filterDetailsCurrentIndex || 0"
active-class="swiper-active" active-class="swiper-active"
previous-margin="20rpx" previous-margin="20rpx"
next-margin="380rpx" next-margin="380rpx"
@change="swiperChange" @change="swiperChange"
> >
<swiper-item v-for="(item, index) in currentAllRelatedFlights" :key="item.flightNo"> <swiper-item v-for="item in filterDetailsList" :key="item.id">
<view class="swiperItem"> <view class="swiperItem">
<view class="title">{{ item.flightNo }}</view> <view class="title">{{ item.flightNo }}</view>
<view class="flex swiperInfo"> <view class="flex swiperInfo">
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<text>{{ item.arrStn }}</text> <text>{{ item.arrStn }}</text>
</view> </view>
<view class="flex swiperInfo"> <view class="flex swiperInfo">
<text>{{ item.stdChn }}</text> <text>{{ timeStampFormat(item.stdChn, {format: 'HH:mm'}) }}</text>
<text>{{ item.staChn }}</text> <text>{{ timeStampFormat(item.staChn, {format: 'HH:mm'}) }}</text>
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
...@@ -28,20 +28,22 @@ ...@@ -28,20 +28,22 @@
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import { timeStampFormat } from 'mocp/utils/tool'
import useFlightSupportStore from 'mocp/store/flight-support' import useFlightSupportStore from 'mocp/store/flight-support'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { cloneDeep } from 'lodash'
import FlightImage from 'mocpStatic/image/monitor/flight-pane.png' import FlightImage from 'mocpStatic/image/monitor/flight-pane.png'
const flightSupportStore = useFlightSupportStore()
const {filterDetailsList, filterDetailsCurrentIndex} = storeToRefs(flightSupportStore)
const ps = defineProps({ const ps = defineProps({
currentAllRelatedFlights: { filterDetailsList: {
type: Array, type: Array,
default: [] default: []
} }
}) })
const swiperChange = (e) => { const swiperChange = (e) => {
console.log(e, e.detail.current) filterDetailsCurrentIndex.value = e.detail.current
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<template>
<view class="globalDetailsModel detailsFollowingCrew detailsOtherInfo">
<view class="font-700 flex">
<image class="timeFlightIcon" :src="FlightImage" />
<view>
<text class="m-x-6">重庆江北</text>
<text>CKG</text>
</view>
</view>
<view class="flex waterCont">
<image class="weatherIcon" :src="FlightImage" />
<view>
<view class="waterTp"></view>
<view>
<text class="waterTemp font-700">16°/30°</text>
<text class="waterText">({{ title }})</text>
</view>
</view>
</view>
<view class="flex flex-between waterInfo">
<view>
<view class="flex waterInfoItem">
<image class="weatherSubIcon" :src="FlightImage" />
<text>能见度</text>
</view>
<view>5000m</view>
</view>
<view>
<view class="flex waterInfoItem">
<image class="weatherSubIcon" :src="FlightImage" />
<text>风速</text>
</view>
<view>5公里/小时</view>
</view>
<view>
<view class="flex waterInfoItem">
<image class="weatherSubIcon" :src="FlightImage" />
<text>PM2.5</text>
</view>
<view>18优</view>
</view>
</view>
</view>
</template>
<script setup>
import { computed, ref } from 'vue'
import FlightImage from 'mocpStatic/image/monitor/flight-pane.png'
import DetailsFollowCrewItem from './DetailsFollowCrewItem.vue'
import { onLoad } from '@dcloudio/uni-app'
import { findWeatherSynopsesMessagesApi } from 'mocp/api/flight-support'
const ps = defineProps({
title: {
type: String,
default: '起飞当日'
},
msg: {
type: Object,
default: () => ({})
}
})
console.log('ps.msg', ps.msg)
const followCrewList = ref([
{name: '斯柯达'},
{name: '花飘万家雪'},
{name: '花样百出'}
])
</script>
<style lang="scss" scoped>
@import '../constants/details';
</style>
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
</template> </template>
<script setup> <script setup>
import { computed } from 'vue' import { computed } from 'vue'
import Day from 'mocp/utils/dayjs' import Day from 'mocp/utils/dayjs'
import useFlightSupportStore from 'mocp/store/flight-support' import useFlightSupportStore from 'mocp/store/flight-support'
...@@ -42,9 +41,10 @@ import { allInBoundMode, currentInBoundModeForFlightTablePage, decideReleaseStat ...@@ -42,9 +41,10 @@ import { allInBoundMode, currentInBoundModeForFlightTablePage, decideReleaseStat
import GlobalFlightNo from 'mocp/components/global-flight-no/global-flight-no.vue' import GlobalFlightNo from 'mocp/components/global-flight-no/global-flight-no.vue'
import RenderTime from '../components/RenderTime.vue' import RenderTime from '../components/RenderTime.vue'
import { fightListPlanTime } from 'mocp/utils/getFlightList' import { fightListPlanTime } from 'mocp/utils/getFlightList'
import { rowClicked } from '../utils/jumpSlingleFlight' import { storeToRefs } from 'pinia'
const flightSupportStore = useFlightSupportStore() const flightSupportStore = useFlightSupportStore()
const {details} = storeToRefs(flightSupportStore)
const listTab = flightSupportStore.listTab const listTab = flightSupportStore.listTab
const ps = defineProps({ const ps = defineProps({
...@@ -57,7 +57,7 @@ const ps = defineProps({ ...@@ -57,7 +57,7 @@ const ps = defineProps({
const msg = computed(() => { const msg = computed(() => {
if (!ps.itemMsg) return {} if (!ps.itemMsg) return {}
const isCurrentIn = currentInBoundModeForFlightTablePage.value + 1 == allInBoundMode.In const isCurrentIn = currentInBoundModeForFlightTablePage.value == allInBoundMode.In
const filterListTab = listTab.filter(item => !!item.selected) const filterListTab = listTab.filter(item => !!item.selected)
return filterListTab.map(item => { return filterListTab.map(item => {
...@@ -74,7 +74,7 @@ const msg = computed(() => { ...@@ -74,7 +74,7 @@ const msg = computed(() => {
} }
} }
// 出发地 // 出发地
if (item.keyValue == 'depStn') { if (item.keyValue == 'place') {
return { return {
...defaultObj, ...defaultObj,
data: isCurrentIn ? data: isCurrentIn ?
...@@ -111,7 +111,13 @@ const msg = computed(() => { ...@@ -111,7 +111,13 @@ const msg = computed(() => {
}) })
}) })
const rowClicked = (currentMsg) => {
console.log('****', currentMsg)
if (!currentMsg.ac) return uni.$mocpMessage.error('航班已取消')
details.value = currentMsg
console.log('@@@@details', details.value)
uni.$mocpJump.navigateTo('/panel/flight-support/flight-support-details/index')
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../constants/flightSupportList'; @import '../constants/flightSupportList';
......
...@@ -177,6 +177,10 @@ ...@@ -177,6 +177,10 @@
.basicInfoTimePlan { .basicInfoTimePlan {
font-size: 12px; font-size: 12px;
color: $mocp-text-4; color: $mocp-text-4;
.MM {
margin: 0 12rpx;
}
} }
} }
......
...@@ -3,18 +3,21 @@ ...@@ -3,18 +3,21 @@
<view class="flightSupportDetails"> <view class="flightSupportDetails">
<view class="details_header"> <view class="details_header">
<view class="header_no flex"> <view class="header_no flex">
<image class="flight-no-image" :src="HnaPic" mode="widthFix" /> <global-flight-no
<text>B9999</text> :airline="details.airlineCode"
:style="flightNoStyle"
/>
<text>{{ details.ac }}</text>
</view> </view>
<view class="header_info flex"> <view class="header_info flex">
<text class="margin-r-32">机型:A999</text> <text class="margin-r-32">机型:{{ details.acTypeGc }}</text>
<text>机位:HG99</text> <text>机位:{{ details.airlineCode }}</text>
</view> </view>
</view> </view>
<view class="details_swiper"> <view class="details_swiper">
<detailsSwiper :currentAllRelatedFlights="currentAllRelatedFlights" /> <detailsSwiper :filterDetailsList="filterDetailsList" />
</view> </view>
<view class="details_tab"> <view class="details_tab">
...@@ -26,12 +29,13 @@ ...@@ -26,12 +29,13 @@
class="f-flex-1 tabItem" class="f-flex-1 tabItem"
:class="index == tabCurrent ? 'active' : ''" :class="index == tabCurrent ? 'active' : ''"
> >
{{ item }}--{{ tabCurrent }} {{ item }}-{{ tabCurrent }}
</view> </view>
</view> </view>
<detailsFlightInfo v-if="tabCurrent === 0" /> <detailsFlightInfo v-if="tabCurrent === 0" />
<detailsOtherInfo v-else />
<detailsOtherInfo v-else :weatherMsg="weatherMsg" />
</view> </view>
</view> </view>
</global-page> </global-page>
...@@ -40,40 +44,92 @@ ...@@ -40,40 +44,92 @@
<script setup> <script setup>
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { cloneDeep } from 'lodash'
import useBaseStore from 'mocp/store/base'
import useFlightSupportStore from 'mocp/store/flight-support' import useFlightSupportStore from 'mocp/store/flight-support'
import { onUnload } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import HnaPic from 'mocpStatic/image/air-company/hnhk.png' import { getFListApi, getReleaseListApi, findWeatherSynopsesMessagesApi } from 'mocp/api/flight-support'
import detailsSwiper from '../components/DetailsSwiper.vue' import detailsSwiper from '../components/DetailsSwiper.vue'
import detailsFlightInfo from '../components/DetailsFlightInfo.vue' import detailsFlightInfo from '../components/DetailsFlightInfo.vue'
import detailsOtherInfo from '../components/DetailsOtherInfo.vue' import detailsOtherInfo from '../components/DetailsOtherInfo.vue'
import GlobalFlightNo from 'mocp/components/global-flight-no/global-flight-no.vue'
import { followAcTagAll } from 'mocp/utils/getFlightList'
const currentAllRelatedFlights = reactive([ const flightSupportStore = useFlightSupportStore()
{ const {
flightNo: 'B7777', searchData,
depStn: 'AKG', details,
arrStn: 'WUH', filterDetailsList,
stdChn: '16:16', filterDetailsCurrentIndex,
staChn: '17:17' getDetailsCurrentMsg
}, } = storeToRefs(flightSupportStore)
{
flightNo: 'B8888',
depStn: 'VGF',
arrStn: 'JHY',
stdChn: '18:18',
staChn: '19:19'
},
{
flightNo: 'B9999',
depStn: 'ERG',
arrStn: 'MHG',
stdChn: '20:20',
staChn: '21:21'
}
])
const tabList = ['航班信息', '其他信息'] const tabList = ['航班信息', '其他信息']
const tabCurrent = ref(0) const tabCurrent = ref(0)
const flightNoStyle = {
'width': '64rpx',
'height': '64rpx',
'marginRight': '16rpx'
}
const weatherMsg = ref()
onLoad(() => {
getAllFlightsByAc()
getWeatherMsg()
})
const getAllFlightsByAc = async () => {
const params = {
acs2: details.value.ac,
// pageSize: 100,
startT: searchData.value.startT,
stopT: searchData.value.stopT
}
console.log('92@@details.value', details.value)
let {list} = await getFListApi(params, {loading: true})
if (list && list.length) {
const allReleases = await Promise.all(list.map(a => getReleaseListApi({catchId: a.catchId}, {loading: true})))
if (allReleases.every(a => Array.isArray(a.data))) {
allReleases.forEach((q, w) => {
list[w].releases = q.data
})
} else {
uni.$mocpMessage.error('请求异常')
}
list = list.map(item => {
if (!item.mfollowAcLists || !item.mfollowAcLists.length) {
return {...item}
} else {
const mfollowAcLists = []
for (let followAcItem of item.mfollowAcLists) {
mfollowAcLists.push({
...followAcItem,
followStatusValue: followAcTagAll[followAcItem.followStatus]
})
}
return {
...item,
mfollowAcLists
}
}
})
console.log('87@@', list)
filterDetailsCurrentIndex.value = list.findIndex(a => a.depStn === details.value.depStn && a.stdChn === details.value.stdChn)
filterDetailsList.value = list
console.log('90@@', filterDetailsCurrentIndex.value)
}
}
const getWeatherMsg = async () => {
const msg = {
depStnList: [],
arrStnList: []
}
const depStnRes = await findWeatherSynopsesMessagesApi({airportCode: getDetailsCurrentMsg.value.depStn}, {loading: true})
if (depStnRes.code == '200') msg.depStnList = depStnRes.data[depStnRes.data.length - 1]
const arrStnRes = await findWeatherSynopsesMessagesApi({airportCode: getDetailsCurrentMsg.value.arrStn}, {loading: true})
if (arrStnRes.code == '200') msg.arrStnList = arrStnRes.data[arrStnRes.data.length - 1]
weatherMsg.value = msg
console.log(weatherMsg.value)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../constants/details'; @import '../constants/details';
......
...@@ -91,6 +91,7 @@ const transformData = (data) => { ...@@ -91,6 +91,7 @@ const transformData = (data) => {
} }
return q return q
}).flat() }).flat()
console.log('@@listMsg', listMsg)
return listMsg return listMsg
} }
...@@ -103,9 +104,8 @@ const subsectionChange = (e) => { ...@@ -103,9 +104,8 @@ const subsectionChange = (e) => {
searchData.value.isOut = e searchData.value.isOut = e
currentInBoundModeForFlightTablePage.value = e currentInBoundModeForFlightTablePage.value = e
const ind = listTab.value.findIndex((item) => item.label == '出发地' || item.label == '目的地') const ind = listTab.value.findIndex((item) => item.label == '出发地' || item.label == '目的地')
const isCurrentIn = currentInBoundModeForFlightTablePage.value + 1 == allInBoundMode.In const isCurrentIn = currentInBoundModeForFlightTablePage.value == allInBoundMode.In
if (ind > -1) { if (ind > -1) {
console.log(currentInBoundModeForFlightTablePage.value, allInBoundMode.In, ind)
listTab.value[ind].label = isCurrentIn ? '出发地' : '目的地' listTab.value[ind].label = isCurrentIn ? '出发地' : '目的地'
} }
paging.value.reload() paging.value.reload()
......
import { ref } from 'vue'
import { allInBoundMode, currentInBoundModeForFlightSinglePage } from './currentInBoundMode'
import { disableUpdateInTimeForTasks } from './scheduledReload'
export const fromTablePartIdentifierProps = ref({
depStn: '',
stdChn: ''
})
export const timeRangeSpecifier = ref(0)
export const currentAllRelatedFlights = ref([])
export const currentFlightDataPassAlong = ref({})
export const isFetchingDataInFlightSingle = ref(false)
export const currentFlightSingleHandlingAc = ref('')
export const currentSelectedIndexInAllRelatedFlights = ref(0)
export const currentFlightSingleHandlingAcType = ref('')
export const currentAirlineCode = ref('')
let initialIndexConfig = 0
let initialType = allInBoundMode.In
/*export function setUpInitialSwitchConfig() {
initialIndexConfig = currentSelectedIndexInAllRelatedFlights.value
initialType = currentInBoundModeForFlightSinglePage.value
}*/
export function beforeJumpSingleFlightHandleFunc(ac, identifier, inBoundMode, airlineCode) {
currentAllRelatedFlights.value = []
currentFlightDataPassAlong.value = {}
currentFlightSingleHandlingAc.value = ac
fromTablePartIdentifierProps.value = identifier
currentInBoundModeForFlightSinglePage.value = inBoundMode
currentAirlineCode.value = airlineCode
}
/*export function currentSelectedIndexInAllRelatedFlightsChanged(v) {
disableUpdateInTimeForTasks()
currentSelectedIndexInAllRelatedFlights.value = v
currentFlightDataPassAlong.value = currentAllRelatedFlights.value[v]
if (v === initialIndexConfig) {
currentInBoundModeForFlightSinglePage.value = initialType
} else if (v === initialIndexConfig + 1) {
currentInBoundModeForFlightSinglePage.value = initialType === allInBoundMode.In ? allInBoundMode.Out : allInBoundMode.In
}
}*/
import { ref } from 'vue' import { ref } from 'vue'
export const allInBoundMode = { export const allInBoundMode = {
In: 1, In: 0,
Out: 2 Out: 1
} }
export const currentInBoundModeForFlightTablePage = ref(allInBoundMode.In) export const currentInBoundModeForFlightTablePage = ref(allInBoundMode.In)
...@@ -12,7 +12,7 @@ export const currentInBoundModeForFlightSinglePage = ref(allInBoundMode.In) ...@@ -12,7 +12,7 @@ export const currentInBoundModeForFlightSinglePage = ref(allInBoundMode.In)
export function decideReleaseStatus(v) { export function decideReleaseStatus(v) {
let allReleases = v.releases let allReleases = v.releases
let manualReleases = allReleases.filter(a => a.isUserAdd) let manualReleases = allReleases.filter(a => a.isUserAdd)
if (currentInBoundModeForFlightTablePage.value + 1 === allInBoundMode.Out) { if (currentInBoundModeForFlightTablePage.value === allInBoundMode.Out) {
manualReleases = manualReleases.filter(a => a.isOut) manualReleases = manualReleases.filter(a => a.isOut)
allReleases = allReleases.filter(a => a.isOut) allReleases = allReleases.filter(a => a.isOut)
} else { } else {
......
import { timeRangeSpecifier, beforeJumpSingleFlightHandleFunc } from './currentAllRelatedFlights'
import { currentInBoundModeForFlightTablePage, allInBoundMode } from './currentInBoundMode'
export const rowClicked = (currentMsg) => {
console.log('****', currentMsg)
if (!currentMsg.ac) return uni.$mocpMessage.error('航班已取消')
timeRangeSpecifier.value = 0
beforeJumpSingleFlightHandleFunc(currentMsg.ac, {
depStn: currentMsg.depStn,
stdChn: currentMsg.stdChn
},
currentInBoundModeForFlightTablePage.value,
currentMsg.airlineCode
)
uni.$mocpJump.navigateTo('/panel/flight-support/flight-support-details/index')
}
\ No newline at end of file
let shouldTimelyUpdate = false
let clearlyTimeout = 0
const TimeIntervalJob = 5000
export function disableUpdateInTimeForTasks() {
clearTimeout(clearlyTimeout)
shouldTimelyUpdate = false
clearlyTimeout = setTimeout(function() {
shouldTimelyUpdate = true
}, TimeIntervalJob)
}
\ No newline at end of file
<template>
<view
@tap="goDetails(item)"
class="item"
>
<view class="item-title">
<view class="left">
<custom-state :value="item.status?.toUpperCase()" />
</view>
<view class="right inforDisTags">
<global-tag
v-for="tagItem of item.tags"
:key="tagItem.text"
:type="tagItem.type" class="txt">
{{ tagItem.text }}
</global-tag>
</view>
</view>
<view class="item-content u-line-3">
<view class="inforDis">
<text v-if="item.machineNumber">机号:{{ item.machineNumber }}</text>
<text v-if="item.ATA">ATA:{{ item.ata }}</text>
</view>
<text>{{ item.faultDescription || '无' }}</text>
</view>
<view class="item-footer inforDisFooter">
<view class="label">
<global-icon icon="calendar" />
<text class="txt">
{{ item.time }}
</text>
</view>
<view class="label right">
<global-icon icon="idcard" />
<text class="txt">
值班人员:{{ item.filledBy }}
</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import useInforDisclosureStore from 'mocp/store/inforDisclosure'
import { storeToRefs } from 'pinia'
import { onUnload } from '@dcloudio/uni-app'
import { getMocinfoListApi } from 'mocp/api/inforDisclosure'
import { getParamsByType } from 'mocp/hooks/use-params/useParams'
const ps = defineProps({
item: {
type: Object,
default: () => ({})
}
})
const {item} = ps
//跳转
const inforDisclosureStore = useInforDisclosureStore()
const goDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/inforDisclosure/details', {id: data.id}).then(() => {
inforDisclosureStore.setState('details', data)
})
}
//刷新
const paging = ref()
uni.$on('inforDisclosureReload', () => {
paging.value?.reload()
})
onUnload(() => {
uni.$off('inforDisclosureReload')
})
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
@import '../constants/inforDisclosure.scss';
</style>
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
@handleRightClick="handleRightClick" @handleRightClick="handleRightClick"
> >
<template #="{ item }"> <template #="{ item }">
<view <inforDisclosureItem :item="item" />
<!--<view
@tap="goDetails(item)" @tap="goDetails(item)"
class="item" class="item"
> >
...@@ -57,7 +58,7 @@ ...@@ -57,7 +58,7 @@
</text> </text>
</view> </view>
</view> </view>
</view> </view>-->
</template> </template>
</global-page-swiper> </global-page-swiper>
...@@ -70,12 +71,11 @@ import { storeToRefs } from 'pinia' ...@@ -70,12 +71,11 @@ import { storeToRefs } from 'pinia'
import { onUnload } from '@dcloudio/uni-app' import { onUnload } from '@dcloudio/uni-app'
import { getMocinfoListApi } from 'mocp/api/inforDisclosure' import { getMocinfoListApi } from 'mocp/api/inforDisclosure'
import { getParamsByType } from 'mocp/hooks/use-params/useParams' import { getParamsByType } from 'mocp/hooks/use-params/useParams'
import inforDisclosureItem from './components/inforDisClosureItem.vue'
//跳转 //跳转
const inforDisclosureStore = useInforDisclosureStore() const inforDisclosureStore = useInforDisclosureStore()
const {searchData} = storeToRefs(inforDisclosureStore) const {searchData} = storeToRefs(inforDisclosureStore)
const tabList = [ const tabList = [
{ {
name: '当前通报', name: '当前通报',
...@@ -87,12 +87,6 @@ const tabList = [ ...@@ -87,12 +87,6 @@ const tabList = [
} }
] ]
const goDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/inforDisclosure/details', {id: data.id}).then(() => {
inforDisclosureStore.setState('details', data)
})
}
const transformData = (data) => { const transformData = (data) => {
const GuaranteeStageList = getParamsByType('GuaranteeStage') const GuaranteeStageList = getParamsByType('GuaranteeStage')
const OperationPhaseList = getParamsByType('OperationPhase') const OperationPhaseList = getParamsByType('OperationPhase')
...@@ -154,7 +148,4 @@ onUnload(() => { ...@@ -154,7 +148,4 @@ onUnload(() => {
uni.$off('inforDisclosureReload') uni.$off('inforDisclosureReload')
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
@import 'mocpStatic/css/list.scss';
@import './constants/inforDisclosure.scss';
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment