市局: 消息处理 跳转到前台以及门户的各自审批页面
This commit is contained in:
parent
251c3d33d6
commit
1ae5dda1a7
|
@ -20,20 +20,6 @@
|
|||
<div>{{ nav.title + '(' + nav.num + ')' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="right">
|
||||
<div style="margin-right: 0.1rem">搜索</div>
|
||||
<a-input
|
||||
v-model:value="userName"
|
||||
placeholder="请输入关键字"
|
||||
style="margin-right: 0.1rem"
|
||||
>
|
||||
<template #suffix>
|
||||
<search-outlined style="color: rgba(0, 0, 0, 0.45)" />
|
||||
</template>
|
||||
</a-input>
|
||||
<a-button type="primary" style="margin-right: 0.1rem">搜索</a-button>
|
||||
<div class="reset">重置</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="btn">
|
||||
<div class="left">
|
||||
|
@ -75,7 +61,6 @@
|
|||
<a-avatar :src="item.src" />
|
||||
</a-badge>
|
||||
<a-avatar :src="item.src" v-show="item.readStatus == 1" />
|
||||
<!-- <a-avatar :src="item.src" /> -->
|
||||
</template>
|
||||
</a-list-item-meta>
|
||||
</a-list-item>
|
||||
|
@ -87,7 +72,6 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
// import { SearchOutlined } from '@ant-design/icons-vue'
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
import { message } from 'ant-design-vue'
|
||||
|
@ -186,8 +170,83 @@ const goBack = (url) => {
|
|||
path: url,
|
||||
})
|
||||
}
|
||||
|
||||
// 申请状态
|
||||
let applyStateObj = {
|
||||
0: '待办',
|
||||
1: '已办',
|
||||
}
|
||||
let typeObj = {
|
||||
0: '申请前台',
|
||||
1: '申请后台',
|
||||
2: '上架前台',
|
||||
3: '上架后台',
|
||||
4: '下架前台',
|
||||
5: '下架后台',
|
||||
6: '需求前台',
|
||||
7: '需求后台',
|
||||
8: '评论前台',
|
||||
9: '评论后台',
|
||||
10: '评价前台',
|
||||
11: '评价后台',
|
||||
}
|
||||
|
||||
// 对应的后台管理的页面
|
||||
let pageObj = {
|
||||
'申请后台': {
|
||||
0: 'myAgent-CompetencyApplication',
|
||||
1: 'hasToDoTasks-CompetencyApplication',
|
||||
},
|
||||
'上架后台': {
|
||||
0: 'myAgent-AbilityResourceShelf',
|
||||
1: 'hasToDoTasks-AbilityResourceShelf',
|
||||
},
|
||||
'下架后台': {
|
||||
0: 'myAgent-AbilityResourcesRemoved',
|
||||
1: 'hasToDoTasks-AbilityResourcesRemoved',
|
||||
},
|
||||
'需求后台': {
|
||||
0: 'myAgent-ApplicationforCompetencyRequirements',
|
||||
1: 'hasToDoTasks-ApplicationForCompetencyRequirements',
|
||||
},
|
||||
'评论后台': {
|
||||
0: 'myAgent-CommentModeration',
|
||||
1: 'hasToDoTasks-CommentModeration',
|
||||
},
|
||||
}
|
||||
|
||||
// 前台tab名称
|
||||
const tabTypeObj = {
|
||||
'申请前台': '能力申请',
|
||||
'上架前台': '能力上架',
|
||||
'下架前台': '能力下架',
|
||||
'需求前台': '需求评论',
|
||||
'评论前台': '需求评论',
|
||||
}
|
||||
|
||||
const goPage = (item) => {
|
||||
console.log('item----更改消息状态-------->', item);
|
||||
let typeText = typeObj[item.type];
|
||||
if (typeText) {
|
||||
console.log('typeText类型------------>', typeText);
|
||||
// 是后台,跳转到后台相关页面
|
||||
if (typeText.indexOf('后台') !== -1) {
|
||||
let _applyState = item.applyState
|
||||
let _page = pageObj[typeText][_applyState]
|
||||
window.open(window.SITE_CONFIG.backUrl + `/#/${_page}`)
|
||||
} else if (typeText.indexOf('前台') !== -1) {
|
||||
window.sessionStorage.setItem('type', JSON.stringify('apply'))
|
||||
router.push({
|
||||
path: '/personalCenter',
|
||||
query: {
|
||||
tabTypeName: tabTypeObj[typeText] || '能力申请',
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
// 更改消息状态
|
||||
const read = (item) => {
|
||||
// console.log(item)
|
||||
if (selectData.value.length === 0 && !item) {
|
||||
message.error('未选择消息!')
|
||||
return
|
||||
|
@ -196,17 +255,24 @@ const read = (item) => {
|
|||
if (item) {
|
||||
// 已读状态
|
||||
if (item.readStatus === 1) {
|
||||
goPage(item)
|
||||
// 跳转页面
|
||||
return
|
||||
}
|
||||
|
||||
mynoticeRead(item.id).then((res) => {
|
||||
if (res.data.code == 0) {
|
||||
message.success('通知已读!')
|
||||
mybus.emit('getMynotice')
|
||||
init()
|
||||
// 页面跳转
|
||||
setTimeout(() => {
|
||||
goPage(item)
|
||||
}, 1000)
|
||||
} else {
|
||||
message.error('操作失败!')
|
||||
}
|
||||
}).catch(err => {
|
||||
message.error(err)
|
||||
})
|
||||
} else {
|
||||
console.log('提交')
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,7 +10,7 @@
|
|||
<!-- <on-the-right-side-of-the-list
|
||||
v-if="showFlag === 'collect'"
|
||||
></on-the-right-side-of-the-list> -->
|
||||
<my-apply v-if="showFlag === 'apply'"></my-apply>
|
||||
<my-apply v-if="showFlag === 'apply'" :tabTypeName="tabTypeName"></my-apply>
|
||||
<my-publish v-if="showFlag === 'push'"></my-publish>
|
||||
<purchase-vehicle
|
||||
v-if="showFlag === 'PurchaseVehicle'"
|
||||
|
@ -38,7 +38,9 @@
|
|||
import Collection from '@/views/personalCenter/components/Collection'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
import { onBeforeUnmount, ref } from 'vue'
|
||||
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
let tabTypeName = ref(router.currentRoute.value.query.tabTypeName || '')
|
||||
const type = JSON.parse(window.sessionStorage.getItem('type'))
|
||||
const showFlag = ref('PurchaseVehicle')
|
||||
if (type) {
|
||||
|
|
Loading…
Reference in New Issue