Commit 752fb438 by pangchong

feat: 修复航站图标

parent c8a7ddfa
...@@ -12,6 +12,7 @@ declare module 'vue' { ...@@ -12,6 +12,7 @@ declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
// 全局组件 // 全局组件
GlobalActionSheet: typeof import('./src/mocp/components/global-action-sheet/global-action-sheet.vue')['default'] GlobalActionSheet: typeof import('./src/mocp/components/global-action-sheet/global-action-sheet.vue')['default']
GlobalAirlineImage: typeof import('./src/mocp/components/global-airline-image/global-airline-image.vue')['default']
GlobalAlbum: typeof import('./src/mocp/components/global-album/global-album.vue')['default'] GlobalAlbum: typeof import('./src/mocp/components/global-album/global-album.vue')['default']
GlobalButton: typeof import('./src/mocp/components/global-button/global-button.vue')['default'] GlobalButton: typeof import('./src/mocp/components/global-button/global-button.vue')['default']
GlobalCalendar: typeof import('./src/mocp/components/global-calendar/global-calendar.vue')['default'] GlobalCalendar: typeof import('./src/mocp/components/global-calendar/global-calendar.vue')['default']
......
export const airlineMap = {
GT: 'guilinhangkong',
'9H': 'changanhangkong', // 长安航空
HT: 'tianjinhangkong',
UQ: 'wulumuqihangkong',
DRJ: 'shouduhangkong',
JD: 'shouduhangkong',
FU: 'fuzhouhangkong',
CN: 'hainanhangkong', // 大新华航空
HNA: 'hainanhangkong',
GS: 'tianjinhangkong',
GX: 'beibuwanhangkong', // 北部湾航空
HU: 'hainanhangkong',
'8L': 'xiangpenghangkong',
PN: 'xibuhangkong',
Y8: 'jinpenghangkong',
LKA: 'xiangpenghangkong',
GCE: 'tianjinhangkong',
GCH: 'guilinhangkong',
WAC: 'xibuhangkong',
GXA: 'tianjinhangkong',
YZJ: 'jinpenghangkong',
CTJ: 'tianjinghuoyunhangkong',
CGH: 'guilinhangkong',
CGN: 'changanhangkong',
CUH: 'wulumuqihangkong',
FZA: 'fuzhouhangkong',
GCA: 'hainanhangkong'
}
<template>
<view class="airline" :style="style" :class="class">
<up-image :show-loading="true" :src="getImage" :width="width + 'rpx'" :height="height + 'rpx'" shape="circle" lazyLoad></up-image>
<text class="txt" v-if="$slots.default">
<slot></slot>
</text>
</view>
</template>
<script setup>
import { computed } from 'vue'
import { airlineMap } from './data'
const ps = defineProps({
code: {
type: String,
default: ''
},
width: {
type: [String, Number],
default: 40
},
height: {
type: [String, Number],
default: 40
},
style: {
type: Object,
default: () => {
return {}
}
},
class: {
type: [Array, String],
default: () => {
return ''
}
}
})
const getImage = computed(() => {
return '/static/mocp/image/airline/' + (airlineMap[ps.code] || 'hainanhangkong') + '.png'
})
</script>
<style lang="scss" scoped>
.airline {
display: flex;
align-items: center;
.txt {
margin-left: 8rpx;
}
}
</style>
import useUserStore from 'mocp/store/user' import useUserStore from 'mocp/store/user'
// const baseURL = 'https://hna-platform.anyremote.cn'//测试 const baseURL = 'https://hna-platform.anyremote.cn' //测试
const baseURL = 'https://moc.hnatechnic.com/api'//生产 // const baseURL = 'https://moc.hnatechnic.com/api'//生产
class ServiceLoading { class ServiceLoading {
open(loading) { open(loading) {
...@@ -84,7 +84,7 @@ export const httpInterceptor = (options) => { ...@@ -84,7 +84,7 @@ export const httpInterceptor = (options) => {
} }
// 添加 token 请求头标识 // 添加 token 请求头标识
if (userStore.token) { if (userStore.token) {
options.header.Authorization = `Bearer ${ userStore.token }` options.header.Authorization = `Bearer ${userStore.token}`
} }
console.log('接口请求信息:', options) console.log('接口请求信息:', options)
return options return options
......
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.left-icon {
margin-right: 16rpx;
}
.txt { .txt {
margin-left: 16rpx; margin-left: 16rpx;
display: flex; display: flex;
......
...@@ -28,9 +28,10 @@ ...@@ -28,9 +28,10 @@
</view> </view>
<view class="details-header-bottom"> <view class="details-header-bottom">
<view class="left"> <view class="left">
<view class="txt u-line-1" v-if="details.ac"> <view class="txt" v-if="details.ac">
<global-icon class="left-icon" icon="Vector" size="24" color="#DD4012"></global-icon> <global-airline-image :code="details.acOwn">
{{ details.ac }} {{ details.ac }}
</global-airline-image>
</view> </view>
<view class="txt u-line-1" v-if="details.acType"> <view class="txt u-line-1" v-if="details.acType">
{{ details.acType }} {{ details.acType }}
......
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
<view class="details-header"> <view class="details-header">
<view class="details-header-top"> <view class="details-header-top">
<view class="left"> <view class="left">
<custom-state <custom-state :value="useGetDictByValue('wa_state', details.state)" :size="32" />
:value="useGetDictByValue('wa_state', details.state)"
:size="32" />
</view> </view>
<view class="right"> <view class="right">
<global-tag :type="useGetDictByValue('wa_isSuccessType', details.isSuccess)"> <global-tag :type="useGetDictByValue('wa_isSuccessType', details.isSuccess)">
...@@ -17,10 +15,9 @@ ...@@ -17,10 +15,9 @@
</view> </view>
<view class="details-header-bottom"> <view class="details-header-bottom">
<view class="left"> <view class="left">
<global-icon class="left-icon" icon="Vector" size="24" color="#DD4012"></global-icon> <global-airline-image :code="details.aviation">
<view class="txt">
{{ details.aviation }} {{ details.machineNumber }} {{ details.model }} {{ details.aviation }} {{ details.machineNumber }} {{ details.model }}
</view> </global-airline-image>
</view> </view>
</view> </view>
</view> </view>
...@@ -29,18 +26,13 @@ ...@@ -29,18 +26,13 @@
<text>ATA章节:{{ details.ata }}</text> <text>ATA章节:{{ details.ata }}</text>
<view class="fleetDescribe">故障描述:</view> <view class="fleetDescribe">故障描述:</view>
<view class="describeCont">{{ details.faultDescribe || '无' }}</view> <view class="describeCont">{{ details.faultDescribe || '无' }}</view>
</view> </view>
</view> </view>
<view class="details-footer"> <view class="details-footer">
<view class="fleetDescribe">处理措施:</view> <view class="fleetDescribe">处理措施:</view>
<view class="describeCont">{{ details.handle || '无' }}</view> <view class="describeCont">{{ details.handle || '无' }}</view>
<view class="footerData occurrenceData"> <view class="footerData occurrenceData">发生日期:{{ timeStampFormat(details.sendingTime, { format: 'YYYY-MM-DD' }) }}</view>
发生日期:{{ timeStampFormat(details.sendingTime, {format: 'YYYY-MM-DD'}) }} <view class="footerData occurrenceData">填报时间:{{ timeStampFormat(details.creationTime, { format: 'YYYY-MM-DD' }) }}</view>
</view>
<view class="footerData occurrenceData">
填报时间:{{ timeStampFormat(details.creationTime, {format: 'YYYY-MM-DD'}) }}
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -54,8 +46,7 @@ import { timeStampFormat } from 'mocp/utils/tool' ...@@ -54,8 +46,7 @@ import { timeStampFormat } from 'mocp/utils/tool'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict' import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
const fleetStore = useFleetStore() const fleetStore = useFleetStore()
const {details} = storeToRefs(fleetStore) const { details } = storeToRefs(fleetStore)
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../work-assignment/constants/details.scss'; @import '../work-assignment/constants/details.scss';
......
<template> <template>
<view <view v-if="msg?.length" @tap="rowClicked(ps.itemMsg)" class="tableRow flex" :class="ps.itemMsg.isFinished ? 'mocp-bg-fill-4' : ''">
v-if="msg?.length" <view v-for="(item, index) of msg" :key="index" class="rowItem u-line-1 text-center" :style="{ flex: item.flex }">
@tap="rowClicked(ps.itemMsg)" <global-airline-image :width="20" :height="20" v-if="item.keyValue === 'flightNo'" :code="item.airlineCode">
class="tableRow flex" {{ item.data }}
:class="ps.itemMsg.isFinished ? 'mocp-bg-fill-4' : ''" </global-airline-image>
>
<view
v-for="(item, index) of msg"
:key="index"
class="rowItem u-line-1 text-center"
:style="{flex: item.flex}"
>
<global-flight-no
v-if="item.keyValue === 'flightNo'"
:flightNo="item.data"
:airline="item.airlineCode"
/>
<RenderTime <RenderTime v-else-if="item.keyValue === 'time'" :item="ps.itemMsg" />
v-else-if="item.keyValue === 'time'"
:item="ps.itemMsg"
/>
<view <view v-else-if="item.keyValue == 'status'" :class="item.color">
v-else-if="item.keyValue == 'status'"
:class="item.color">
{{ item.data }} {{ item.data }}
</view> </view>
...@@ -34,12 +17,10 @@ ...@@ -34,12 +17,10 @@
</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'
import { allInBoundMode, currentInBoundModeForFlightTablePage, decideReleaseStatus } from '../utils/currentInBoundMode' import { allInBoundMode, currentInBoundModeForFlightTablePage, decideReleaseStatus } from '../utils/currentInBoundMode'
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 { rowClicked } from '../utils/jumpSlingleFlight'
...@@ -50,17 +31,16 @@ const listTab = flightSupportStore.listTab ...@@ -50,17 +31,16 @@ const listTab = flightSupportStore.listTab
const ps = defineProps({ const ps = defineProps({
itemMsg: { itemMsg: {
type: Object, type: Object,
default: () => { default: () => {}
}
} }
}) })
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 + 1 == allInBoundMode.In
const filterListTab = listTab.filter(item => !!item.selected) const filterListTab = listTab.filter((item) => !!item.selected)
return filterListTab.map(item => { return filterListTab.map((item) => {
const defaultObj = { const defaultObj = {
keyValue: item.keyValue, keyValue: item.keyValue,
flex: item.flex, flex: item.flex,
...@@ -77,18 +57,14 @@ const msg = computed(() => { ...@@ -77,18 +57,14 @@ const msg = computed(() => {
if (item.keyValue == 'depStn') { if (item.keyValue == 'depStn') {
return { return {
...defaultObj, ...defaultObj,
data: isCurrentIn ? data: isCurrentIn ? ps.itemMsg.depStn : ps.itemMsg.arrStn
ps.itemMsg.depStn :
ps.itemMsg.arrStn
} }
} }
// 计划 // 计划
if (fightListPlanTime.includes(item.keyValue)) { if (fightListPlanTime.includes(item.keyValue)) {
return { return {
...defaultObj, ...defaultObj,
data: isCurrentIn ? data: isCurrentIn ? Day(ps.itemMsg.staChn).format('HH:mm') : Day(ps.itemMsg.stdChn).format('HH:mm')
Day(ps.itemMsg.staChn).format('HH:mm') :
Day(ps.itemMsg.stdChn).format('HH:mm')
} }
} }
// 状态 // 状态
...@@ -110,8 +86,6 @@ const msg = computed(() => { ...@@ -110,8 +86,6 @@ const msg = computed(() => {
} }
}) })
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../constants/flightSupportList'; @import '../constants/flightSupportList';
......
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
<view class="details-header"> <view class="details-header">
<view class="details-header-top"> <view class="details-header-top">
<view class="left"> <view class="left">
<custom-state <custom-state :value="useGetDictByValue('wa_state', details.state)" :size="32" />
:value="useGetDictByValue('wa_state', details.state)"
:size="32" />
</view> </view>
<view class="right"> <view class="right">
<global-tag :type="useGetDictByValue('wa_isSuccessType', details.isSuccess)"> <global-tag :type="useGetDictByValue('wa_isSuccessType', details.isSuccess)">
...@@ -17,10 +15,9 @@ ...@@ -17,10 +15,9 @@
</view> </view>
<view class="details-header-bottom"> <view class="details-header-bottom">
<view class="left"> <view class="left">
<global-icon class="left-icon" icon="Vector" size="24" color="#DD4012"></global-icon> <global-airline-image :code="details.aviation">
<view class="txt">
{{ details.aviation }} {{ details.machineNumber }} {{ details.model }} {{ details.aviation }} {{ details.machineNumber }} {{ details.model }}
</view> </global-airline-image>
</view> </view>
</view> </view>
</view> </view>
...@@ -29,18 +26,13 @@ ...@@ -29,18 +26,13 @@
<text>ATA章节:{{ details.ata }}</text> <text>ATA章节:{{ details.ata }}</text>
<view class="fleetDescribe">故障描述:</view> <view class="fleetDescribe">故障描述:</view>
<view class="describeCont">{{ details.faultDescribe || '无' }}</view> <view class="describeCont">{{ details.faultDescribe || '无' }}</view>
</view> </view>
</view> </view>
<view class="details-footer"> <view class="details-footer">
<view class="fleetDescribe">处理措施:</view> <view class="fleetDescribe">处理措施:</view>
<view class="describeCont">{{ details.handle || '无' }}</view> <view class="describeCont">{{ details.handle || '无' }}</view>
<view class="footerData occurrenceData"> <view class="footerData occurrenceData">发生日期:{{ timeStampFormat(details.sendingTime, { format: 'YYYY-MM-DD' }) }}</view>
发生日期:{{ timeStampFormat(details.sendingTime, {format: 'YYYY-MM-DD'}) }} <view class="footerData occurrenceData">填报时间:{{ timeStampFormat(details.creationTime, { format: 'YYYY-MM-DD' }) }}</view>
</view>
<view class="footerData occurrenceData">
填报时间:{{ timeStampFormat(details.creationTime, {format: 'YYYY-MM-DD'}) }}
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -58,14 +50,12 @@ import { getFleetListApi } from 'mocp/api/fleet' ...@@ -58,14 +50,12 @@ import { getFleetListApi } from 'mocp/api/fleet'
import { WorkTaskIsSuccessApi } from 'mocp/api/work-assignment' import { WorkTaskIsSuccessApi } from 'mocp/api/work-assignment'
import Day from 'mocp/utils/dayjs' import Day from 'mocp/utils/dayjs'
const fleetStore = useFleetStore() const fleetStore = useFleetStore()
const {details} = storeToRefs(fleetStore) const { details } = storeToRefs(fleetStore)
console.log(details, details.value.creationTime, timeStampFormat('1721810489517', {format: 'YYYY-MM-DD'})) console.log(details, details.value.creationTime, timeStampFormat('1721810489517', { format: 'YYYY-MM-DD' }))
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../work-assignment/constants/details.scss'; @import '../work-assignment/constants/details.scss';
@import './constants/inforDisclosure.scss'; @import './constants/inforDisclosure.scss';
</style> </style>
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
</view> </view>
<view class="details-header-bottom"> <view class="details-header-bottom">
<view class="left"> <view class="left">
<global-icon class="left-icon" icon="Vector" size="24" color="#DD4012"></global-icon> <global-airline-image :code="details.aviation">
<view class="txt">{{ details.aviation }} {{ details.machineNumber }} {{ details.model }}</view> {{ details.aviation }} {{ details.machineNumber }} {{ details.model }}
</global-airline-image>
</view> </view>
<view class="right"> <view class="right">
<view class="txt">{{ details.terminal }}</view> <view class="txt">{{ details.terminal }}</view>
......
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