新增视频管理员角色

This commit is contained in:
a0049873 2022-11-23 10:40:25 +08:00
parent 6cfde21605
commit 7b843847a7
2 changed files with 37 additions and 7 deletions

View File

@ -2,11 +2,11 @@
* @Author: Light * @Author: Light
* @Date: 2022-11-18 11:53:43 * @Date: 2022-11-18 11:53:43
* @LastEditors: Light * @LastEditors: Light
* @LastEditTime: 2022-11-22 19:28:55 * @LastEditTime: 2022-11-23 10:32:10
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
--> -->
<template> <template>
<div class="infrastructureApplication"> <div class="infrastructureApplication" v-if="showFlag">
<div class="top"> <div class="top">
<a-list size="small" bordered :data-source="dataList.toBeApplied"> <a-list size="small" bordered :data-source="dataList.toBeApplied">
<template #renderItem="{ item }"> <template #renderItem="{ item }">
@ -137,6 +137,7 @@
getApplyCameraListXha, getApplyCameraListXha,
delApplyCamera, delApplyCamera,
} from '@/api/home' } from '@/api/home'
import { getUserInfo, getRole } from '@/api/user'
import { endProcess } from '@/api/personalCenter.js' import { endProcess } from '@/api/personalCenter.js'
import { onBeforeUnmount, reactive, ref } from 'vue' import { onBeforeUnmount, reactive, ref } from 'vue'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
@ -172,6 +173,20 @@
}, },
] ]
const router = useRouter() const router = useRouter()
const showFlag = ref(false)
getUserInfo().then((res) => {
if (res.data.data.superAdmin == '1') {
showFlag.value = true
} else {
res.data.data.roleIdList.map((val) => {
getRole(val).then((role) => {
if (role.data.data.name === '视频管理员') {
showFlag.value = true
}
})
})
}
})
const delWillApplyCamera = (id) => { const delWillApplyCamera = (id) => {
console.log('撤销===>', id) console.log('撤销===>', id)
if (delWacFlag.value) { if (delWacFlag.value) {

View File

@ -30,10 +30,10 @@
<div class="text-label"> <div class="text-label">
<span>{{defaultIndex+1}}</span>/<span>{{cameraDataList.length}}</span> <span>{{defaultIndex+1}}</span>/<span>{{cameraDataList.length}}</span>
</div> </div>
<div class="footer-button"> <div class="footer-button" v-if="showFlag">
<a-button type="primary" @click="applyNow(cameraDataList[defaultIndex])">立即申请</a-button> <a-button type="primary" @click="applyNow(cameraDataList[defaultIndex])">立即申请</a-button>
<a-button type="primary" style="margin-left:20px" @click="addIntoCart(cameraDataList[defaultIndex])">加入申购车</a-button> <a-button type="primary" style="margin-left:20px" @click="addIntoCart(cameraDataList[defaultIndex])">加入申购车</a-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -46,6 +46,7 @@
LeftCircleOutlined, LeftCircleOutlined,
RightCircleOutlined, RightCircleOutlined,
} from '@ant-design/icons-vue' } from '@ant-design/icons-vue'
import { getUserInfo, getRole } from '@/api/user'
// import { useRouter } from 'vue-router' // import { useRouter } from 'vue-router'
import H5Player from '@/views/home/components/H5Player.vue' import H5Player from '@/views/home/components/H5Player.vue'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
@ -77,6 +78,19 @@
}, },
mounted() { mounted() {
this.getVideoUrl(this.cameraDataList[this.defaultIndex]); this.getVideoUrl(this.cameraDataList[this.defaultIndex]);
getUserInfo().then((res) => {
if (res.data.data.superAdmin == '1') {
this.showFlag = true
} else {
res.data.data.roleIdList.map((val) => {
getRole(val).then((role) => {
if (role.data.data.name === '视频管理员') {
this.showFlag = true
}
})
})
}
})
}, },
// directives: { // directives: {
// viewer: viewer({ // viewer: viewer({
@ -101,7 +115,8 @@
videoStream: '', videoStream: '',
videoUrl:'', //url videoUrl:'', //url
defaultIndex:0,// defaultIndex:0,//
selectedFlag:true selectedFlag:true,
showFlag:false
// router:useRouter() // router:useRouter()
} }
}, },