Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mocp-uniapp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pangchong
mocp-uniapp
Commits
e960efb7
Commit
e960efb7
authored
Jul 26, 2024
by
liujinbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
信息通报隐藏状态修改
parent
ab7e061d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
243 additions
and
88 deletions
+243
-88
src/mocp/api/inforDisclosure.js
+8
-0
src/mocp/store/inforDisclosure.js
+12
-1
src/mocp/utils/getFlightList.js
+1
-1
src/mocp/utils/http.js
+5
-3
src/pages/modules/mocp/panel/flight-support/utils/currentAllRelatedFlights.js
+2
-2
src/pages/modules/mocp/panel/inforDisclosure/components/status-popup.vue
+74
-0
src/pages/modules/mocp/panel/inforDisclosure/constants/inforDisclosure.scss
+39
-2
src/pages/modules/mocp/panel/inforDisclosure/details.vue
+59
-52
src/pages/modules/mocp/panel/inforDisclosure/list.vue
+43
-27
No files found.
src/mocp/api/inforDisclosure.js
View file @
e960efb7
...
...
@@ -8,3 +8,11 @@ export const getMocinfoListApi = (data, config) => {
config
})
}
export
const
updateOpenAndCloseApi
=
(
data
,
config
)
=>
{
return
http
({
method
:
'POST'
,
url
:
'/moc/updateOpenAndClose'
,
data
,
config
})
}
src/mocp/store/inforDisclosure.js
View file @
e960efb7
...
...
@@ -41,6 +41,17 @@ const useInforDisclosureStore = defineStore('inforDisclosure', {
}
},
// 配置持久化
persist
:
false
// persist: false
persist
:
{
// 调整为兼容多端的API
storage
:
{
setItem
(
key
,
value
)
{
uni
.
setStorageSync
(
key
,
value
)
},
getItem
(
key
)
{
return
uni
.
getStorageSync
(
key
)
}
}
}
})
export
default
useInforDisclosureStore
src/mocp/utils/getFlightList.
t
s
→
src/mocp/utils/getFlightList.
j
s
View file @
e960efb7
...
...
@@ -2,7 +2,7 @@ import { ref, computed } from 'vue'
const
dayForMilliseconds
=
24
*
3600
*
1000
export
function
decideTimeRange
(
inputNum
:
number
)
{
export
function
decideTimeRange
(
inputNum
)
{
const
d
=
new
Date
(
inputNum
)
d
.
setHours
(
5
,
0
,
0
,
0
)
return
{
...
...
src/mocp/utils/http.js
View file @
e960efb7
import
useUserStore
from
'mocp/store/user'
// const baseURL = 'https://hna-platform.anyremote.cn'
const
baseURL
=
'https://moc.hnatechnic.com/api'
// const baseURL = 'https://hna-platform.anyremote.cn'
//测试
const
baseURL
=
'https://moc.hnatechnic.com/api'
//生产
class
ServiceLoading
{
open
(
loading
)
{
...
...
@@ -16,12 +16,14 @@ class ServiceLoading {
})
}
}
close
(
loading
)
{
if
(
loading
||
loading
===
''
)
{
uni
.
hideLoading
()
}
}
}
const
serviceLoading
=
new
ServiceLoading
()
//请求拦截器
export
const
httpInterceptor
=
(
options
)
=>
{
...
...
@@ -82,7 +84,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
...
...
src/pages/modules/mocp/panel/flight-support/utils/currentAllRelatedFlights.js
View file @
e960efb7
...
...
@@ -40,7 +40,7 @@ export function beforeJumpSingleFlightHandleFunc(ac, identifier, inBoundMode, ai
currentAirlineCode
.
value
=
airlineCode
}
export
function
currentSelectedIndexInAllRelatedFlightsChanged
(
v
)
{
/*
export function currentSelectedIndexInAllRelatedFlightsChanged(v) {
disableUpdateInTimeForTasks()
currentSelectedIndexInAllRelatedFlights.value = v
currentFlightDataPassAlong.value = currentAllRelatedFlights.value[v]
...
...
@@ -49,6 +49,6 @@ export function currentSelectedIndexInAllRelatedFlightsChanged(v) {
} else if (v === initialIndexConfig + 1) {
currentInBoundModeForFlightSinglePage.value = initialType === allInBoundMode.In ? allInBoundMode.Out : allInBoundMode.In
}
}
}
*/
src/pages/modules/mocp/panel/inforDisclosure/components/status-popup.vue
0 → 100644
View file @
e960efb7
<
template
>
<global-popup
v-model=
"showPopup"
mode=
"bottom"
:width=
"580"
background=
"#F7F8FA"
:round=
"32"
>
<view
class=
"list"
>
<view
class=
"item"
@
tap=
"handleClick"
>
{{
details
.
failureState
==
0
?
'作废'
:
'open'
}}
</view>
<view
class=
"item"
@
tap=
"close"
>
取消
</view>
</view>
</global-popup>
</
template
>
<
script
setup
>
import
{
ref
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
updateOpenAndCloseApi
}
from
'mocp/api/inforDisclosure'
import
useInforDisclosureStore
from
'mocp/store/inforDisclosure'
import
useUserStore
from
'mocp/store/user'
const
inforDisclosure
=
useInforDisclosureStore
()
const
{
details
}
=
storeToRefs
(
inforDisclosure
)
const
userStore
=
useUserStore
()
const
showPopup
=
ref
(
false
)
const
open
=
()
=>
{
showPopup
.
value
=
true
}
const
close
=
()
=>
{
showPopup
.
value
=
false
}
const
handleClick
=
async
()
=>
{
console
.
log
(
details
.
value
)
const
params
=
{
id
:
details
.
value
.
id
,
state
:
details
.
value
.
failureState
==
0
?
1
:
0
,
//0开户 1作废
userId
:
userStore
.
userInfo
.
id
,
username
:
userStore
.
userInfo
.
nickname
}
console
.
log
(
params
)
const
res
=
await
updateOpenAndCloseApi
(
params
,
{
loading
:
true
})
console
.
log
(
res
)
if
(
res
.
code
==
'200'
)
{
const
toast
=
details
.
value
.
failureState
==
0
?
'已作废'
:
'已开启'
uni
.
$mocpMessage
.
success
(
toast
)
details
.
value
.
failureState
=
details
.
value
.
failureState
==
0
?
1
:
0
showPopup
.
value
=
false
uni
.
$emit
(
'inforDisclosureReload'
)
}
else
{
uni
.
$mocpMessage
.
error
(
'变更失败!'
)
}
}
defineExpose
({
open
,
close
})
</
script
>
<
style
lang=
"scss"
scoped
>
.list
{
padding
:
18
rpx
32
rpx
;
.item
{
color
:
$
mocp-text-4
;
font-size
:
30
rpx
;
background
:
#fff
;
margin-bottom
:
24
rpx
;
padding
:
16
rpx
24
rpx
;
text-align
:
center
;
}
}
</
style
>
src/pages/modules/mocp/panel/inforDisclosure/constants/inforDisclosure.scss
View file @
e960efb7
...
...
@@ -2,5 +2,43 @@
.txt
{
font-size
:
10px
;
}
}
}
\ No newline at end of file
.inforDis
{
display
:
flex
;
justify-content
:
space-between
;
font-size
:
28rpx
;
color
:
$mocp-text-4
;
margin-bottom
:
20rpx
;
}
.inforDisFooter
{
color
:
$mocp-text-4
;
}
.mocp-cell
{
background-color
:
#fff
;
margin-bottom
:
100rpx
;
.detailFaultDes
{
font-size
:
15px
;
padding
:
24rpx
26rpx
;
border-bottom
:
1px
solid
rgb
(
214
,
215
,
217
,
0
.5
);
.content
{
margin-top
:
10rpx
;
color
:
$mocp-text-3
;
}
}
}
.footer-btn
{
padding
:
24rpx
32rpx
;
background-color
:
#fff
;
.detailsFooterBtn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
}
src/pages/modules/mocp/panel/inforDisclosure/details.vue
View file @
e960efb7
<
template
>
<global-page
:padding=
"24"
title=
"机队状态网详情"
>
<template
v-if=
"details"
>
<view
class=
"details fleetDetails"
>
<view
class=
"details-header"
>
<view
class=
"details-header-top"
>
<view
class=
"left"
>
<custom-state
:value=
"useGetDictByValue('wa_state', details.state)"
:size=
"32"
/>
</view>
<view
class=
"right"
>
<global-tag
:type=
"useGetDictByValue('wa_isSuccessType', details.isSuccess)"
>
{{
useGetDictByValue
(
'wa_isSuccess'
,
details
.
isSuccess
)
}}
</global-tag>
</view>
</view>
<view
class=
"details-header-bottom"
>
<view
class=
"left"
>
<global-icon
class=
"left-icon"
icon=
"Vector"
size=
"24"
color=
"#DD4012"
></global-icon>
<view
class=
"txt"
>
{{
details
.
aviation
}}
{{
details
.
machineNumber
}}
{{
details
.
model
}}
</view>
</view>
</view>
<global-page
:padding=
"24"
title=
"信息通报详情"
>
<view
class=
"mocp-cell"
>
<up-cell-group
v-if=
"details"
>
<up-cell
title=
"机号"
:value=
"details.machineNumber || '-'"
/>
<up-cell
title=
"航站"
:value=
"details.termin || '-'"
/>
<up-cell
title=
"机型"
:value=
"details.planeModel || '-'"
/>
<up-cell
title=
"航司"
:value=
"details.aviation || '-'"
/>
<up-cell
title=
"保障阶段"
:value=
"details.tags[1]?.text || '-'"
/>
<up-cell
title=
"运行阶段"
:value=
"details.tags[2]?.text || '-'"
/>
<up-cell
title=
"故障报告人"
:value=
"details.reporterValue || '-'"
/>
<view
class=
"detailFaultDes"
>
<view
class=
"title"
>
故障描述
</view>
<view
class=
"content"
>
{{
details
.
faultDescription
}}
</view>
</view>
<view
class=
"details-body fleetATA"
>
<view
class=
"details-body-content ataCont"
>
<text>
ATA章节:
{{
details
.
ata
}}
</text>
<view
class=
"fleetDescribe"
>
故障描述:
</view>
<view
class=
"describeCont"
>
{{
details
.
faultDescribe
||
'无'
}}
</view>
<up-cell
title=
"专业类别"
:value=
"details.professionalValue || '-'"
/>
<up-cell
title=
"放行状态"
:value=
"details.tags[3]?.text || '-'"
/>
</up-cell-group>
</view>
</view>
</view>
<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
>
<template
#
bottom
v-if=
"false"
>
<view
class=
"footer-btn"
>
<up-row
gutter=
"10"
>
<up-col
span=
"6"
>
<global-button
type=
"primary"
plain
size=
"large"
:radius=
"5"
@
tap=
"handleRightClick"
>
<view
class=
"detailsFooterBtn"
>
<text>
状态 (
{{
details
.
status
.
toUpperCase
()
}}
)
</text>
<up-icon
name=
"arrow-up"
size=
"16"
:color=
"$mocp-primary-7"
/>
</view>
</global-button>
</up-col>
<up-col
span=
"6"
>
<global-button
type=
"primary"
size=
"large"
:radius=
"5"
>
追加
</global-button>
</up-col>
</up-row>
</view>
</
template
>
</global-page>
<!--作废-->
<StatusPopup
ref=
"statusPopupRef"
/>
</template>
<
script
setup
>
import
use
FleetStore
from
'mocp/store/fleet
'
import
use
InforDisclosureStore
from
'mocp/store/inforDisclosure
'
import
{
storeToRefs
}
from
'pinia'
import
useUserStore
from
'mocp/store/user'
import
{
timeStampFormat
}
from
'mocp/utils/tool'
import
{
useGetDictByValue
}
from
'mocp/hooks/use-dict/useDict'
import
{
formData
}
from
'../support-application/constants/add.compositions'
import
StatusPopup
from
'./components/status-popup.vue'
import
{
ref
}
from
'vue'
import
{
getFleetListApi
}
from
'mocp/api/fleet'
import
{
WorkTaskIsSuccessApi
}
from
'mocp/api/work-assignment'
import
Day
from
'mocp/utils/dayjs'
const
inforDisclosure
=
useInforDisclosureStore
()
const
{
details
}
=
storeToRefs
(
inforDisclosure
)
const
statusPopupRef
=
ref
()
const
handleRightClick
=
()
=>
{
statusPopupRef
.
value
?.
open
()
}
const
fleetStore
=
useFleetStore
()
const
{
details
}
=
storeToRefs
(
fleetStore
)
console
.
log
(
details
.
value
)
console
.
log
(
details
,
details
.
value
.
creationTime
,
timeStampFormat
(
'1721810489517'
,
{
format
:
'YYYY-MM-DD'
}
))
</
script
>
<
style
lang=
"scss"
scoped
>
@import
'../work-assignment/constants/details.scss'
;
@import
'./constants/inforDisclosure.scss'
;
</
style
>
src/pages/modules/mocp/panel/inforDisclosure/list.vue
View file @
e960efb7
...
...
@@ -7,14 +7,16 @@
auto
ref=
"paging"
:params=
"searchData"
@
handleRightClick=
"handleRightClick"
:api=
"getMocinfoListApi"
:padding=
"24"
localPaging
:localPagingCB=
"localPagingCB"
:transformData=
"transformData"
:tabList=
"tabList"
tabValueField=
"state"
tabsWidth=
"50%"
showNavRight
navRightType=
"icon"
navRightIcon=
"saixuan-01"
@
handleRightClick=
"handleRightClick"
>
<template
#="
{ dataList }">
<view
...
...
@@ -25,7 +27,7 @@
>
<view
class=
"item-title"
>
<view
class=
"left"
>
<custom-state
:value=
"item.status.toUpperCase()"
/>
<custom-state
:value=
"item.status
?
.toUpperCase()"
/>
</view>
<view
class=
"right inforDisTags"
>
<global-tag
...
...
@@ -34,16 +36,28 @@
:type=
"tagItem.type"
class=
"txt"
>
{{
tagItem
.
text
}}
</global-tag>
<!--
<global-tag
type=
"success"
class=
"txt"
>
{{
getParamNameByValue
(
'MajorCategory'
,
item
.
majorCategory
)
}}
</global-tag>
<global-tag
type=
"info"
class=
"txt"
>
{{
getParamNameByValue
(
'McoCurrentState'
,
item
.
state
)
}}
</global-tag>
-->
</view>
</view>
<view
class=
"item-content u-line-3 fleetItemCont"
>
<global-icon
icon=
"calendar"
></global-icon>
<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
>
...
...
@@ -53,18 +67,16 @@
<
script
setup
>
import
{
ref
}
from
'vue'
import
{
timeStampFormat
}
from
'mocp/utils/tool'
import
{
useGetDictByValue
}
from
'mocp/hooks/use-dict/useDict'
import
useInforDisclosureStore
from
'mocp/store/inforDisclosure'
import
{
storeToRefs
}
from
'pinia'
import
{
onUnload
}
from
'@dcloudio/uni-app'
import
{
getMocinfoListApi
}
from
'mocp/api/inforDisclosure'
import
{
getParam
NameByValue
,
getParam
sByType
}
from
'mocp/hooks/use-params/useParams'
import
{
getParamsByType
}
from
'mocp/hooks/use-params/useParams'
//跳转
const
inforDisclosure
=
useInforDisclosureStore
()
const
{
searchData
}
=
storeToRefs
(
inforDisclosure
)
const
inforDisclosure
Store
=
useInforDisclosureStore
()
const
{
searchData
}
=
storeToRefs
(
inforDisclosure
Store
)
const
tabList
=
[
{
...
...
@@ -78,16 +90,20 @@ const tabList = [
]
const
goDetails
=
(
data
)
=>
{
console
.
log
(
data
)
uni
.
$mocpJump
.
navigateTo
(
'/panel/inforDisclosure/details'
,
{
id
:
data
.
id
}).
then
(()
=>
{
inforDisclosure
.
setState
(
'details'
,
data
)
inforDisclosure
Store
.
setState
(
'details'
,
data
)
})
}
const
localPagingCB
=
(
data
)
=>
{
const
RetentionBasisList
=
getParamsByType
(
'RetentionBasis
'
)
const
transformData
=
(
data
)
=>
{
const
GuaranteeStageList
=
getParamsByType
(
'GuaranteeStage
'
)
const
OperationPhaseList
=
getParamsByType
(
'OperationPhase'
)
const
ReleaseStatuList
=
getParamsByType
(
'ReleaseStatu'
)
data
.
list
=
data
.
list
.
reduce
((
q
,
w
)
=>
{
const
FaultReportingList
=
getParamsByType
(
'FaultReporting'
)
const
MajorCategoryList
=
getParamsByType
(
'MajorCategory'
)
data
=
data
.
reduce
((
q
,
w
)
=>
{
q
.
push
(
w
)
if
(
Array
.
isArray
(
w
.
cascade
)
&&
w
.
cascade
.
length
>
0
)
{
q
.
push
(...
w
.
cascade
)
...
...
@@ -95,11 +111,10 @@ const localPagingCB = (data) => {
return
q
},
[])
const
mappedData
=
data
.
list
.
map
(
item
=>
{
const
mappedData
=
data
.
map
(
item
=>
{
return
{
...
item
,
time
:
item
.
creationTime
.
replace
(
/-/g
,
'/'
).
replace
(
/:
\d
+
?
$/
,
''
),
operator
:
item
.
filledBy
,
info
:
item
.
faultDescription
,
status
:
item
.
failureState
.
toString
()
===
'0'
?
'open'
:
item
.
failureState
.
toString
()
===
'1'
?
'close'
:
'作废'
,
...
...
@@ -109,7 +124,7 @@ const localPagingCB = (data) => {
type
:
item
.
pid
===
'0'
?
'primary'
:
'warning'
},
{
text
:
RetentionBasis
List
[
item
.
guarantee
*
1
]?.
label
,
text
:
GuaranteeStage
List
[
item
.
guarantee
*
1
]?.
label
,
type
:
'primary'
},
{
...
...
@@ -121,7 +136,8 @@ const localPagingCB = (data) => {
type
:
'info'
}
],
id
:
item
.
id
reporterValue
:
FaultReportingList
[
Number
(
item
.
reporter
)]?.
label
,
professionalValue
:
MajorCategoryList
[
Number
(
item
.
professional
)]?.
label
}
})
console
.
log
(
'@@mappedData'
,
mappedData
[
0
])
...
...
@@ -130,7 +146,7 @@ const localPagingCB = (data) => {
//筛选
const
handleRightClick
=
()
=>
{
uni
.
$mocpJump
.
redirect
To
(
'/panel/inforDisclosure/search'
)
uni
.
$mocpJump
.
navigate
To
(
'/panel/inforDisclosure/search'
)
}
//刷新
const
paging
=
ref
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment