Commit f7f3e704 by liujinbo

天气

parent ef59220e
import { http } from 'mocp/utils/http'
export const userTasksApi = (data, config) => {
return http({
method: 'POST',
url: '/flighting/userTasks',
data,
config
})
}
......@@ -45,6 +45,10 @@ const getImage = computed(() => {
.airline {
display: flex;
align-items: center;
:deep( .u-image__image){
display: block;
}
.txt {
margin-left: 8rpx;
}
......
......@@ -11,17 +11,20 @@
<!-- 自定义导航栏 -->
<global-navbar :title="title" v-if="showNavbar" :bgColor="navbgColor" :color="navColor">
<template #left v-if="pages.length > 1 && showNavLeft">
<up-icon v-if="navLeftType == 'icon'" :name="navLeftIcon" size="16" @tap="handleLeftClick" :color="navColor"></up-icon>
<up-icon v-if="navLeftType == 'icon'" :name="navLeftIcon" size="16" @tap="handleLeftClick"
:color="navColor"></up-icon>
<view v-if="navLeftType == 'text'" class="cancel" @tap="handleLeftClick">{{ navLeftText }}</view>
</template>
<template #right v-if="showNavRight">
<global-button type="text" size="small" v-if="navRightType == 'text'" @tap="handleRightClick">
{{ navRightText }}
</global-button>
<global-button type="primary" size="small" v-if="navRightType == 'button'" style="padding: 0 32rpx" @tap="handleRightClick">
<global-button type="primary" size="small" v-if="navRightType == 'button'" style="padding: 0 32rpx"
@tap="handleRightClick">
{{ navRightText }}
</global-button>
<global-icon v-if="navRightType == 'icon'" :icon="navRightIcon" @tap="handleRightClick"></global-icon>
<global-icon v-if="navRightType == 'icon'" :icon="navRightIcon"
@tap="handleRightClick"></global-icon>
</template>
</global-navbar>
<!-- tab切换 -->
......@@ -97,7 +100,7 @@
import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
// 获取屏幕边界到安全区域距离
const { safeAreaInsets } = uni.getSystemInfoSync()
const {safeAreaInsets} = uni.getSystemInfoSync()
const es = defineEmits(['handleLeftClick', 'handleRightClick', 'handleFooterClick', 'handleChooseData'])
const ps = defineProps({
background: {
......@@ -309,11 +312,10 @@ const getStyle = computed(() => {
//监听选择
const chooseValue = ref([])
watch(chooseValue, (value) => {
let data = value.map((index) => pagingArr.value[current.value]?.getDataList[index])
let data = value.map((index) => pagingArr.value[current.value]?.dataList[index])
if (ps.mapFieldName) {
data = data.map((v) => v[ps.mapFieldName]).join(ps.mapFieldSplit)
}
console.log(data)
es('handleChooseData', data)
})
const current = ref(ps.current)
......
......@@ -5,10 +5,10 @@ const useInforDisclosureStore = defineStore('inforDisclosure', {
return {
searchData: {
state: 1,
machineNumber: '',
machine_number: '',
planeModel: '',
aviation: '',
terminal: '',
termin: '',
startTime: '',
guarantee: '',
rlease_state: '',
......@@ -21,13 +21,13 @@ const useInforDisclosureStore = defineStore('inforDisclosure', {
},
getters: {},
actions: {
resetForm() {
resetForm () {
this.searchData = {
state: 1,
machineNumber: '',
machine_number: '',
planeModel: '',
aviation: '',
terminal: '',
termin: '',
startTime: '',
guarantee: '',
rlease_state: '',
......@@ -36,7 +36,7 @@ const useInforDisclosureStore = defineStore('inforDisclosure', {
professional: ''
}
},
setState(...args) {
setState (...args) {
this.$patch({[args[0]]: args[1]})
}
},
......@@ -45,10 +45,10 @@ const useInforDisclosureStore = defineStore('inforDisclosure', {
persist: {
// 调整为兼容多端的API
storage: {
setItem(key, value) {
setItem (key, value) {
uni.setStorageSync(key, value)
},
getItem(key) {
getItem (key) {
return uni.getStorageSync(key)
}
}
......
import { defineStore } from 'pinia'
import useUserStore from 'mocp/store/user'
const useInforDisclosureStore = defineStore('supportedTask', {
state: () => {
return {
searchData: {},
details: undefined
}
},
getters: {},
actions: {
resetForm () {
const userStore = useUserStore()
this.searchData.realUserId = userStore.userInfo.id
},
setState (...args) {
this.$patch({[args[0]]: args[1]})
}
},
// 配置持久化
persist: false
})
export default useInforDisclosureStore
......@@ -2,6 +2,7 @@ import { defineStore } from 'pinia'
import { ref } from 'vue'
const menuList = ref([
{id: 15, name: '我的跟机', icon: 'khjl', group: '运行品质', count: 0, url: '/panel/supported-task/list'},
{id: 1, name: '信息通报', icon: 'xxtb', group: '技术支援', count: 12, url: '/panel/inforDisclosure/search'},
{id: 2, name: '机队状态', icon: 'jdzt', group: '技术支援', count: 0, url: '/panel/fleet/search'},
{id: 3, name: '支援申请', icon: 'zysq', group: '技术支援', count: 0, url: '/panel/support-application/search'},
......@@ -29,11 +30,11 @@ const useUserStore = defineStore('user', {
},
getters: {
//获取全部菜单
getMenuList() {
getMenuList () {
return menuList.value
},
//获取分组菜单
getGroupMenuList(state) {
getGroupMenuList (state) {
return state.getMenuList.reduce((groups, item) => {
// 如果该组不存在,则创建一个新组
if (!groups[item.group]) {
......@@ -45,7 +46,7 @@ const useUserStore = defineStore('user', {
}, {})
},
//获取当前登录用户的首页菜单
getHomeMenuList(state) {
getHomeMenuList (state) {
const homeMenuList = state.allHomeMenuList.find((item) => item.userId == state.userInfo?.id)?.homeMenuList
const ids = []
homeMenuList.forEach((item) => {
......@@ -56,7 +57,7 @@ const useUserStore = defineStore('user', {
},
actions: {
//用户登录
setUserInfo(data) {
setUserInfo (data) {
this.token = data.token
this.userInfo = data
//加入用户首页菜单信息
......@@ -65,7 +66,7 @@ const useUserStore = defineStore('user', {
this.allHomeMenuList.push({
userId: this.userInfo.id,
homeMenuList: this.getMenuList.map((item) => {
return { id: item.id }
return {id: item.id}
})
})
}
......@@ -73,14 +74,14 @@ const useUserStore = defineStore('user', {
uni.$mocpJump.redirectTo('/tab/index')
},
//退出登录
handleLogOut() {
handleLogOut () {
this.token = ''
this.userInfo = undefined
//返回登录页面
uni.$mocpJump.redirectTo('/login/index')
},
//修改用户首页菜单
changeHomeMenuList(menuList) {
changeHomeMenuList (menuList) {
const index = this.allHomeMenuList.findIndex((item) => item.userId == this.userInfo.id)
this.allHomeMenuList[index].homeMenuList = menuList
}
......@@ -89,10 +90,10 @@ const useUserStore = defineStore('user', {
persist: {
// 调整为兼容多端的API
storage: {
setItem(key, value) {
setItem (key, value) {
uni.setStorageSync(key, value)
},
getItem(key) {
getItem (key) {
return uni.getStorageSync(key)
}
}
......
......@@ -47,6 +47,7 @@ export const httpInterceptor = (options) => {
apiPwd: 'Ifar$2_0160_525_Mocp',
requestFrom: '6',
realUserId: userStore.userInfo?.id
// 1806609951173058561 1806609983825715202 1806609992679890946
}
}
}
......@@ -84,7 +85,7 @@ export const httpInterceptor = (options) => {
}
// 添加 token 请求头标识
if (userStore.token) {
options.header.Authorization = `Bearer ${userStore.token}`
options.header.Authorization = `Bearer ${ userStore.token }`
}
console.log('接口请求信息:', options)
return options
......
......@@ -178,6 +178,12 @@
}
},
{
"path": "pages/modules/mocp/panel/supported-task/list",
"style": {
"navigationBarTitleText": "我的跟机"
}
},
{
"path": "pages/modules/mocp/panel/inforDisclosure/search",
"style": {
"navigationBarTitleText": "信息通报查询"
......
......@@ -31,9 +31,15 @@
<view class="details-footer">
<view class="fleetDescribe">处理措施:</view>
<view class="describeCont">{{ details.handle || '无' }}</view>
<view class="footerData occurrenceData">发生日期:{{ timeStampFormat(details.sendingTime, { format: 'YYYY-MM-DD' }) }}</view>
<view class="footerData occurrenceData">填报时间:{{ timeStampFormat(details.creationTime, { format: 'YYYY-MM-DD' }) }}</view>
<view class="footerData occurrenceData">
发生日期:{{ timeStampFormat(details.sendingTime, {format: 'YYYY-MM-DD'}) }}
</view>
<view class="footerData occurrenceData">
填报时间:{{ timeStampFormat(details.creationTime, {format: 'YYYY-MM-DD'}) }}
</view>
</view>
</view>
</template>
</global-page>
......@@ -46,7 +52,7 @@ import { timeStampFormat } from 'mocp/utils/tool'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
const fleetStore = useFleetStore()
const { details } = storeToRefs(fleetStore)
const {details} = storeToRefs(fleetStore)
</script>
<style lang="scss" scoped>
@import '../work-assignment/constants/details.scss';
......
......@@ -32,13 +32,6 @@ const ps = defineProps({
}
})
const followCrewList = ref([
{name: '斯柯达'},
{name: '花飘万家雪'},
{name: '花样百出'}
])
</script>
<style lang="scss" scoped>
@import '../constants/details';
......
......@@ -12,7 +12,7 @@
<view class="title">{{ item.flightNo }}</view>
<view class="flex swiperInfo">
<text>{{ item.depStn }}</text>
<image class="renderTime" :src="FlightImage" />
<image class="renderTime" :src="fly01" />
<text>{{ item.arrStn }}</text>
</view>
<view class="flex swiperInfo">
......@@ -32,6 +32,7 @@ import { timeStampFormat } from 'mocp/utils/tool'
import useFlightSupportStore from 'mocp/store/flight-support'
import { storeToRefs } from 'pinia'
import FlightImage from 'mocpStatic/image/monitor/flight-pane.png'
import fly01 from 'mocpStatic/image/flight-support/fly01.png'
const flightSupportStore = useFlightSupportStore()
const {filterDetailsList, filterDetailsCurrentIndex} = storeToRefs(flightSupportStore)
......
<template>
<view class="globalDetailsModel detailsFollowingCrew detailsOtherInfo">
<view class="font-700 flex">
<image class="timeFlightIcon" :src="FlightImage" />
<image class="timeFlightIcon" :src="title == '起飞当日' ? fly02 : fly03" />
<view>
<text class="m-x-6">{{ baseStore.getTerminalObject[msg.airportCode] }}</text>
<text class="m-x-6">
{{ baseStore.getTerminalObject[title == '起飞当日' ? getDetailsCurrentMsg.depStn : getDetailsCurrentMsg.arrStn]
}}
</text>
</view>
</view>
<view class="flex waterCont">
<image class="weatherIcon" :src="FlightImage" />
<image class="weatherIcon" :src="weatherIconFn(msg.weatherInfoTxt)" />
<view>
<view class="waterTp">{{ msg.weatherInfoTxt }}</view>
<view class="waterTp" v-html="msg.weatherInfoTxt"></view>
<view>
<text class="waterTemp font-700">{{ msg.temperature }}°</text>
<text class="waterText">({{ title }})</text>
......@@ -19,41 +22,40 @@
<view class="flex flex-between waterInfo">
<view>
<view class="flex waterInfoItem">
<image class="weatherSubIcon" :src="FlightImage" />
<image class="weatherSubIcon" :src="visibility" />
<text>能见度</text>
</view>
<view>{{ msg.visibility }}m</view>
</view>
<view>
<view class="flex waterInfoItem">
<image class="weatherSubIcon" :src="FlightImage" />
<image class="weatherSubIcon" :src="windFs" />
<text>风速</text>
</view>
<view>{{ parseInt(msg.windFs) }} 米/秒</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 { ref } from 'vue'
import FlightImage from 'mocpStatic/image/monitor/flight-pane.png'
import useBaseStore from 'mocp/store/base'
import { parseInt } from 'lodash'
import fly02 from 'mocpStatic/image/flight-support/fly02.png'
import fly03 from 'mocpStatic/image/flight-support/fly03.png'
import PM from 'mocpStatic/image/flight-support/PM.png'
import visibility from 'mocpStatic/image/flight-support/visibility.png'
import windFs from 'mocpStatic/image/flight-support/windFs.png'
import useFlightSupportStore from 'mocp/store/flight-support'
import { storeToRefs } from 'pinia'
import { weatherIconFn } from '../utils/weatherIcon'
const baseStore = useBaseStore()
const flightSupportStore = useFlightSupportStore()
const {getDetailsCurrentMsg} = storeToRefs(flightSupportStore)
const baseStore = useBaseStore()
const {title, msg} = defineProps({
title: {
type: String,
......@@ -65,13 +67,6 @@ const {title, msg} = defineProps({
}
})
console.log('msg', msg)
const followCrewList = ref([
{name: '斯柯达'},
{name: '花飘万家雪'},
{name: '花样百出'}
])
</script>
<style lang="scss" scoped>
......
......@@ -11,11 +11,10 @@
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"
/>
<global-airline-image :width="20" :height="20" class="text-center" v-if="item.keyValue === 'flightNo'"
:code="item.airlineCode">
{{ item.data }}
</global-airline-image>
<RenderTime
v-else-if="item.keyValue === 'time'"
......@@ -38,7 +37,6 @@ import { computed } from 'vue'
import Day from 'mocp/utils/dayjs'
import useFlightSupportStore from 'mocp/store/flight-support'
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 { fightListPlanTime } from 'mocp/utils/getFlightList'
import { storeToRefs } from 'pinia'
......
......@@ -61,6 +61,9 @@
.header_no {
font-size: 66rpx;
.airlineImg {
margin-left: 16rpx;
}
}
.header_info {
......@@ -101,8 +104,8 @@
}
.renderTime {
width: 30rpx;
height: 30rpx;
width: 47rpx;
height: 26rpx;
}
}
......@@ -194,8 +197,8 @@
padding-bottom: 24rpx;
.timeFlightIcon {
width: 40rpx;
height: 40rpx;
width: 48rpx;
height: 48rpx;
}
.waterCont {
......@@ -222,8 +225,8 @@
}
.weatherSubIcon {
width: 24rpx;
height: 24rpx;
width: 26rpx;
height: 26rpx;
margin-right: 16rpx;
}
......
......@@ -49,6 +49,10 @@
&.flex-3 {
flex: 3;
}
.text-center {
justify-content: center;
}
}
}
}
......
......@@ -3,10 +3,11 @@
<view class="flightSupportDetails">
<view class="details_header">
<view class="header_no flex">
<global-flight-no
:airline="details.airlineCode"
:style="flightNoStyle"
/>
<global-airline-image
:width="64" :height="64"
:code="details.airlineCode">
<text class="airlineImg"></text>
</global-airline-image>
<text>{{ details.ac }}</text>
</view>
......@@ -60,7 +61,6 @@ import {
import detailsSwiper from '../components/DetailsSwiper.vue'
import detailsFlightInfo from '../components/DetailsFlightInfo.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 {safeAreaInsets} = uni.getSystemInfoSync()
......@@ -74,11 +74,6 @@ const {
} = storeToRefs(flightSupportStore)
const tabList = ['航班信息', '其他信息']
const tabCurrent = ref(0)
const flightNoStyle = {
'width': '64rpx',
'height': '64rpx',
'marginRight': '16rpx'
}
onLoad(() => {
getAllFlightsByAc()
......
import SunCloud from 'mocpStatic/image/flight-support/Sun.png'
import rain from 'mocpStatic/image/flight-support/rain.png'
import Cloud from 'mocpStatic/image/flight-support/Cloud.png'
import snow from 'mocpStatic/image/flight-support/snow.png'
const weatherMsg = {
'晴': SunCloud,
'雨': rain,
'阴': Cloud,
'雪': snow
}
export const weatherIconFn = (txt) => {
const text = txt.replace(/<[^>]*>?/gm, '')
let weather
for (let item in weatherMsg) {
if (text.indexOf(item) > -1) {
weather = weatherMsg[item]
}
}
return weather || SunCloud
}
......@@ -6,11 +6,11 @@
labelWidth="auto">
<up-form-item
label="机号"
prop="machineNumber"
prop="machine_number"
:borderBottom="true">
<global-picker
pickAlign="right"
v-model="formData.machineNumber"
v-model="formData.machine_number"
:options="deviceNumList"
clearable
filter
......@@ -43,10 +43,10 @@
/>
</up-form-item>
<up-form-item label="航站" prop="terminal" :borderBottom="true">
<up-form-item label="航站" prop="termin" :borderBottom="true">
<global-picker
pickAlign="right"
v-model="formData.terminal"
v-model="formData.termin"
clearable
:options="baseStore.getTerminalSelect"
filter
......
<template>
<view
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'
const ps = defineProps({
item: {
type: Object,
default: () => ({})
}
})
const {item} = ps
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
</style>
<template>
<global-page-swiper
title="我的跟机"
isDataList
refresherEnabled
loadingMoreEnabled
auto
ref="paging"
:params="searchData"
:api="userTasksApi"
:padding="24"
:transformData="transformData"
:tabList="tabList"
tabValueField="state"
tabsWidth="50%"
chooseDataType="checkbox"
@handleChooseData="handleChooseData"
>
<template #="{ item }">
<supportedTaskItem :item="itemMsg" />
</template>
</global-page-swiper>
</template>
<script setup>
import { ref } from 'vue'
import useSupportedTaskStore from 'mocp/store/supportedTask'
import { storeToRefs } from 'pinia'
import { userTasksApi } from 'mocp/api/supportedTask'
import supportedTaskItem from './components/supportedTaskItem.vue'
//跳转
const supportedTaskStore = useSupportedTaskStore()
const {searchData} = storeToRefs(supportedTaskStore)
const tabList = [
{
name: '今日及次日后跟机任务',
value: 1
},
{
name: '历史跟机任务',
value: 2
}
]
const transformData = (data) => {
console.log('@@mappedData', data)
return [
{
followStatus: 1,//跟机状态
aaa: 1,//跟机航班日期
bbb: 1,//起飞时间
ccc: 1,//跟机航站
ddd: 1,//航司
eee: 1,//航班号
fff: 1,//飞机号
ggg: 1//机型
}
]
}
const handleChooseData = (data) => {
console.log('@@', data)
}
</script>
<style lang="scss" scoped></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