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
342da887
Commit
342da887
authored
Dec 26, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增操作权限
parent
89d9ae7c
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
69 additions
and
47 deletions
+69
-47
src/mocp/api/system.js
+10
-0
src/mocp/directive/vHasPermi.js
+0
-8
src/mocp/store/user.js
+16
-10
src/pages/modules/mocp/login/index.vue
+21
-11
src/pages/modules/mocp/panel/abnormalEventManage/details.vue
+3
-3
src/pages/modules/mocp/panel/electronicBill/list.vue
+9
-1
src/pages/modules/mocp/panel/inforDisclosure/addDetails.vue
+0
-7
src/pages/modules/mocp/panel/support-application/list.vue
+2
-2
src/pages/modules/mocp/panel/supported-task/list.vue
+3
-2
src/pages/modules/mocp/panel/unplanApply/list.vue
+2
-1
src/pages/modules/mocp/panel/unplanWarning/list.vue
+3
-2
No files found.
src/mocp/api/system.js
View file @
342da887
...
...
@@ -40,6 +40,16 @@ export const getSysSeatListApi = (data, config) => {
})
}
//获取某用户拥有的席位列表(不分页)
export
const
getUserSeatListApi
=
(
data
,
config
)
=>
{
return
http
({
method
:
'POST'
,
url
:
'/system/getUserSeatList'
,
data
,
config
})
}
//获取操作权限
export
const
getSeatPermissionApi
=
(
data
,
config
)
=>
{
return
http
({
...
...
src/mocp/directive/vHasPermi.js
deleted
100644 → 0
View file @
89d9ae7c
import
{
checkPermi
}
from
'mocp/utils/permission'
// 操作权限指令
export
const
vHasPermi
=
(
el
,
binding
)
=>
{
const
{
value
}
=
binding
if
(
!
checkPermi
(
value
))
{
el
.
parentNode
&&
el
.
parentNode
.
removeChild
(
el
)
}
}
src/mocp/store/user.js
View file @
342da887
...
...
@@ -8,7 +8,9 @@ const useUserStore = defineStore('mocpUser', {
userInfo
:
undefined
,
//用户信息
allMenuItem
:
{
id
:
999
,
name
:
'全部菜单'
,
icon
:
'all'
,
group
:
''
,
count
:
0
},
allUserList
:
[],
//所有登录用户存储的信息
seatPermission
:
[],
//操作权限
//席位权限
seatId
:
''
,
//当前席位id
seatPermission
:
[
'all'
],
//操作权限
configData
:
[]
//数据权限
}
},
...
...
@@ -23,7 +25,9 @@ const useUserStore = defineStore('mocpUser', {
},
//获取全部菜单
getMenuList
(
state
)
{
if
(
state
.
seatPermission
.
includes
(
'all'
))
{
return
menuList
.
value
}
return
menuList
.
value
.
filter
((
item
)
=>
state
.
getApiPaths
.
includes
(
item
.
apiPath
)
||
!
item
.
apiPath
)
},
//获取分组菜单
...
...
@@ -40,7 +44,8 @@ const useUserStore = defineStore('mocpUser', {
},
//获取当前登录用户的首页菜单
getHomeMenuList
(
state
)
{
const
homeMenuList
=
state
.
allUserList
.
find
((
item
)
=>
item
.
userId
==
state
.
userInfo
?.
id
)?.
homeMenuList
if
(
!
state
.
userInfo
)
return
[]
const
homeMenuList
=
state
.
allUserList
.
find
((
item
)
=>
item
.
userId
==
state
.
userInfo
.
id
)?.
homeMenuList
||
[]
const
ids
=
[]
homeMenuList
.
forEach
((
item
)
=>
{
ids
.
push
(
item
.
id
)
...
...
@@ -66,14 +71,6 @@ const useUserStore = defineStore('mocpUser', {
})
}
},
//设置操作权限
setSeatPermission
(
data
)
{
this
.
seatPermission
=
data
||
[]
},
//设置数据权限
setConfigData
(
data
)
{
this
.
configData
=
data
||
[]
},
//退出登录
handleLogOut
()
{
this
.
token
=
''
...
...
@@ -81,12 +78,21 @@ const useUserStore = defineStore('mocpUser', {
//返回登录页面
uni
.
$mocpJump
.
redirectTo
(
'/login/index'
)
},
//重置席位权限
resetSeat
()
{
this
.
seatId
=
''
this
.
seatPermission
=
[
'all'
]
this
.
configData
=
[]
},
//修改用户首页菜单
changeHomeMenuList
(
menuList
)
{
const
index
=
this
.
allUserList
.
findIndex
((
item
)
=>
item
.
userId
==
this
.
userInfo
.
id
)
this
.
allUserList
[
index
].
homeMenuList
=
menuList
.
map
((
item
)
=>
{
return
{
id
:
item
.
id
}
})
},
setState
(...
args
)
{
this
.
$patch
({
[
args
[
0
]]:
args
[
1
]
})
}
},
// 配置持久化
...
...
src/pages/modules/mocp/login/index.vue
View file @
342da887
...
...
@@ -46,7 +46,7 @@ import { onLoad } from '@dcloudio/uni-app'
import
{
ref
,
toRaw
,
watch
}
from
'vue'
import
useUserStore
from
'mocp/store/user'
import
{
loginApi
}
from
'mocp/api/user'
import
{
getConfigDataApi
,
getSeatPermissionApi
}
from
'mocp/api/system'
import
{
getConfigDataApi
,
getSeatPermissionApi
,
getUserSeatListApi
}
from
'mocp/api/system'
watch
(
()
=>
loginForm
.
username
,
...
...
@@ -56,8 +56,9 @@ watch(
}
},
500
)
)
const
userStore
=
useUserStore
()
onLoad
(()
=>
{
userStore
.
resetSeat
()
loginForm
.
verifyCode
=
''
getGifCaptcha
()
loginAmms
()
...
...
@@ -65,7 +66,6 @@ onLoad(() => {
//登录
const
loading
=
ref
(
false
)
const
userStore
=
useUserStore
()
const
handleLogin
=
async
()
=>
{
await
loginFormRef
.
value
?.
validate
()
try
{
...
...
@@ -75,7 +75,12 @@ const handleLogin = async () => {
})
loading
.
value
=
true
await
login
()
await
getUserSeatList
()
if
(
userStore
.
seatId
)
{
await
Promise
.
all
([
getSeatPermission
(),
getConfigData
()])
}
else
{
userStore
.
setState
(
'seatPermission'
,
[])
}
//跳转工作台
uni
.
$mocpJump
.
redirectTo
(
'/tab/index'
)
}
catch
(
error
)
{
...
...
@@ -94,22 +99,27 @@ const login = async () => {
uni
.
$mocpMessage
.
error
(
res
.
message
)
}
}
//获取席位信息
const
getUserSeatList
=
async
()
=>
{
const
res
=
await
getUserSeatListApi
({
seatScene
:
'2'
})
if
(
res
.
code
==
200
)
{
if
(
res
.
data
?.
list
?.
length
>
0
)
{
userStore
.
setState
(
'seatId'
,
res
.
data
.
list
[
0
].
id
)
}
}
}
//获取操作权限
const
getSeatPermission
=
async
()
=>
{
const
res
=
await
getSeatPermissionApi
({
seatId
:
'1871742912739872770'
})
const
res
=
await
getSeatPermissionApi
({
seatId
:
userStore
.
seatId
})
if
(
res
.
code
==
200
)
{
userStore
.
setSeatPermission
(
res
.
data
)
}
else
{
uni
.
$mocpMessage
.
error
(
res
.
message
)
userStore
.
setState
(
'seatPermission'
,
res
.
data
)
}
}
//获取数据权限
const
getConfigData
=
async
()
=>
{
const
res
=
await
getConfigDataApi
({
seatId
:
'1871742912739872770'
})
const
res
=
await
getConfigDataApi
({
seatId
:
userStore
.
seatId
})
if
(
res
.
code
==
200
)
{
userStore
.
setConfigData
(
res
.
data
)
}
else
{
uni
.
$mocpMessage
.
error
(
res
.
message
)
userStore
.
setState
(
'configData'
,
res
.
data
)
}
}
//接入amms
...
...
src/pages/modules/mocp/panel/abnormalEventManage/details.vue
View file @
342da887
...
...
@@ -2,10 +2,10 @@
<global-page
:padding=
"24"
title=
"航站不正常事件详情"
:showFooterBtn=
"details.state == 0"
:showFooterBtn=
"details.state == 0
&& checkPermi('/terminalQualityManagement/audit')
"
:footerBtnText=
"getFooterTxt"
@
handleFooterClick=
"handleFooterClick"
:showNavRight=
"auditLabel != '审核通过'"
:showNavRight=
"auditLabel != '审核通过'
&& checkPermi('/terminalQualityManagement/edit')
"
@
handleRightClick=
"navigateTo('/panel/abnormalEventManage/edit')"
>
<view
class=
"mocp-cell"
v-if=
"details"
>
...
...
@@ -93,7 +93,7 @@ import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import
{
computed
,
ref
}
from
'vue'
import
{
navigateTo
}
from
'mocp/utils/jump'
import
{
reviewedAdverseEventsApi
}
from
'mocp/api/abnormalEventManage'
import
{
getAirlineSelect
}
from
'mocp/utils/permission'
import
{
checkPermi
,
getAirlineSelect
}
from
'mocp/utils/permission'
const
abnormalEventManageStore
=
useAbnormalEventManageStore
()
const
{
details
}
=
storeToRefs
(
abnormalEventManageStore
)
...
...
src/pages/modules/mocp/panel/electronicBill/list.vue
View file @
342da887
<
template
>
<global-page
padding=
"0 24rpx"
title=
"收费单"
auto
:localData=
"list"
>
<template
#
default=
"
{ item }">
<global-card
:title=
"item.title"
titleSuffix=
"查看详情"
:rightWidth=
"180"
@
handleTitleClick=
"
navigate
To(item.url)"
>
<global-card
:title=
"item.title"
titleSuffix=
"查看详情"
:rightWidth=
"180"
@
handleTitleClick=
"
go
To(item.url)"
>
描述:
{{
item
.
desc
}}
</global-card>
</
template
>
...
...
@@ -13,7 +13,15 @@ import { navigateTo } from 'mocp/utils/jump'
import
{
list
}
from
'./constants/list.compositions'
import
useElectronicBillStore
from
'mocp/store/electronicBill'
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
{
checkPermi
}
from
'mocp/utils/permission'
const
goTo
=
(
url
)
=>
{
if
(
checkPermi
(
'/ElectronBill/edit'
))
{
navigateTo
(
url
)
}
else
{
uni
.
$mocpMessage
.
warning
(
'暂无权限'
)
}
}
const
electronicBillStore
=
useElectronicBillStore
()
onLoad
(()
=>
{
electronicBillStore
.
init
()
...
...
src/pages/modules/mocp/panel/inforDisclosure/addDetails.vue
View file @
342da887
...
...
@@ -42,18 +42,11 @@
<
script
setup
>
import
useFleetStore
from
'mocp/store/fleet'
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
{
ref
}
from
'vue'
import
{
getFleetListApi
}
from
'mocp/api/fleet'
import
{
WorkTaskIsSuccessApi
}
from
'mocp/api/work-assignment'
import
Day
from
'mocp/utils/dayjs'
const
fleetStore
=
useFleetStore
()
const
{
details
}
=
storeToRefs
(
fleetStore
)
console
.
log
(
details
,
details
.
value
.
creationTime
,
timeStampFormat
(
'1721810489517'
,
{
format
:
'YYYY-MM-DD'
}
))
<
/script
>
<
style
lang
=
"scss"
scoped
>
@
import
'../work-assignment/constants/details.scss'
;
...
...
src/pages/modules/mocp/panel/support-application/list.vue
View file @
342da887
...
...
@@ -13,7 +13,7 @@
@
handleRightClick=
"handleRightClick"
:api=
"getSupportRequestListApi"
:padding=
"24"
showFooterBtn
:showFooterBtn=
"checkPermi('/supportApplication/start')"
footerBtnText=
"新建"
@
handleFooterClick=
"handleFooterClick"
>
...
...
@@ -52,7 +52,7 @@ import { storeToRefs } from 'pinia'
import
{
onUnload
}
from
'@dcloudio/uni-app'
import
{
getSupportRequestListApi
}
from
'mocp/api/support-application'
import
useSupportApplicationStore
from
'mocp/store/support-application'
import
{
getAirlineSelect
}
from
'mocp/utils/permission'
import
{
checkPermi
,
getAirlineSelect
}
from
'mocp/utils/permission'
//跳转
const
supportApplicationStore
=
useSupportApplicationStore
()
...
...
src/pages/modules/mocp/panel/supported-task/list.vue
View file @
342da887
...
...
@@ -11,7 +11,7 @@
:tabList=
"tabList"
tabValueField=
"state"
tabsWidth=
"50%"
chooseDataType=
"checkbox
"
:chooseDataType=
"checkPermi('/workbench/edit') ? 'checkbox' : ''
"
@
handleChooseData=
"handleChooseData"
localPaging
alone
...
...
@@ -20,7 +20,7 @@
<supportedTaskItem
:item=
"item"
/>
</
template
>
<
template
#
bottom
>
<
template
#
bottom
v-if=
"checkPermi('/workbench/edit')"
>
<view
class=
"footer-btn"
>
<up-row
gutter=
"10"
>
<up-col
span=
"6"
>
...
...
@@ -44,6 +44,7 @@ import supportedTaskItem from './components/supportedTaskItem.vue'
import
{
followAcTagAll
}
from
'mocp/utils/getFlightList'
import
{
orderBy
}
from
'lodash'
import
Day
from
'mocp/utils/dayjs'
import
{
checkPermi
}
from
'mocp/utils/permission'
const
paging
=
ref
(
null
)
const
showAction
=
ref
(
false
)
...
...
src/pages/modules/mocp/panel/unplanApply/list.vue
View file @
342da887
...
...
@@ -13,7 +13,7 @@
@
handleRightClick=
"handleRightClick"
:api=
"unplanApplyListApi"
:padding=
"24"
showFooterBtn
:showFooterBtn=
"checkPermi('/noplan/edit')"
footerBtnText=
"新增申请"
@
handleFooterClick=
"handleFooterClick"
>
...
...
@@ -57,6 +57,7 @@ import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
import
{
timeStampFormat
}
from
'mocp/utils/tool'
import
{
unplanApplyListApi
}
from
'mocp/api/unplanApply'
import
useUnplanApplyStore
from
'mocp/store/unplanApply'
import
{
checkPermi
}
from
'mocp/utils/permission'
//跳转
const
unplanApplyStore
=
useUnplanApplyStore
()
...
...
src/pages/modules/mocp/panel/unplanWarning/list.vue
View file @
342da887
...
...
@@ -13,8 +13,8 @@
@
handleRightClick=
"handleRightClick"
:api=
"unplanWarningListApi"
:padding=
"24"
showFooterBtn
footerBtnText=
"新增
申请
"
:showFooterBtn=
"checkPermi('/noplan/edit')"
footerBtnText=
"新增
预警
"
@
handleFooterClick=
"handleFooterClick"
>
<template
#
default=
"
{ item }">
...
...
@@ -57,6 +57,7 @@ import { unplanWarningListApi } from 'mocp/api/unplanWarning'
import
useUnplanWarningStore
from
'mocp/store/unplanWarning'
import
{
getParamNameByValue
}
from
'mocp/hooks/use-params/useParams'
import
{
timeStampFormat
}
from
'mocp/utils/tool'
import
{
checkPermi
}
from
'mocp/utils/permission'
//跳转
const
unplanWarningStore
=
useUnplanWarningStore
()
...
...
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