Compare commits

..

2 Commits

Author SHA1 Message Date
a0049873 e4fc85a861 Merge branch 'hi-ucs-dev' of http://192.168.124.50:3000/wuhongjian/hi-ucs into hi-ucs-dev 2022-12-30 17:45:03 +08:00
a0049873 e5d600867f UI修改 2022-12-30 17:44:57 +08:00
2 changed files with 553 additions and 498 deletions

View File

@ -75,10 +75,12 @@
<div class="mynotice" v-show="mynoticeFlag"> <div class="mynotice" v-show="mynoticeFlag">
<a-list item-layout="horizontal" :data-source="mynoticeData"> <a-list item-layout="horizontal" :data-source="mynoticeData">
<template #renderItem="{ item }"> <template #renderItem="{ item }">
<a-tooltip placement="left"> <!-- <a-tooltip placement="left">
<template #title> <template #title>
<span>{{ item.content }}</span> <span>{{ item.content }}</span>
</template> </template>
</a-tooltip> -->
<a-list-item> <a-list-item>
<a-list-item-meta :description="item.senderDate"> <a-list-item-meta :description="item.senderDate">
<template #title> <template #title>
@ -86,10 +88,26 @@
</template> </template>
</a-list-item-meta> </a-list-item-meta>
</a-list-item> </a-list-item>
</a-tooltip>
</template> </template>
</a-list> </a-list>
<div class="bottom" @click="goToView()">查看更多</div> <div class="bottom" @click="goToView()">
查看更多
<svg
t="1672387024761"
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="2682"
width="20"
height="20"
>
<path
d="M185.884 327.55 146.3 367.133 512.021 732.779 877.7 367.133 838.117 327.55 511.997 653.676Z"
p-id="2683"
></path>
</svg>
</div>
</div> </div>
<div class="info"> <div class="info">
<i <i
@ -706,6 +724,9 @@
text-align: center; text-align: center;
color: #000; color: #000;
font-size: 0.16rem; font-size: 0.16rem;
display: flex;
justify-content: center;
align-items: center;
} }
} }
@ -734,6 +755,9 @@
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
cursor: default; cursor: default;
} }
a:hover {
color: #0058e1;
}
button { button {
width: 0.7rem; width: 0.7rem;

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-21 11:55:07 * @Date: 2022-06-21 11:55:07
* @LastEditors: hisense.liangjunhua * @LastEditors: Light
* @LastEditTime: 2022-07-27 15:57:26 * @LastEditTime: 2022-12-30 16:05:18
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
--> -->
<template> <template>
@ -15,7 +15,12 @@
</a-breadcrumb> </a-breadcrumb>
<div class="top"> <div class="top">
<div class="left"> <div class="left">
<div class="item" :class="{ select: selectNav == nav.key }" v-for="nav in navList" :key="nav.key"> <div
class="item"
:class="{ select: selectNav == nav.key }"
v-for="nav in navList"
:key="nav.key"
>
<i :class="nav.key" @click="changeNav(nav)"></i> <i :class="nav.key" @click="changeNav(nav)"></i>
<div>{{ nav.title + '(' + nav.num + ')' }}</div> <div>{{ nav.title + '(' + nav.num + ')' }}</div>
</div> </div>
@ -23,11 +28,25 @@
</div> </div>
<div class="btn"> <div class="btn">
<div class="left"> <div class="left">
<a-select ref="select" v-model:value="value" style="width: 120px" @focus="focus" @change="handleChange"> <a-select
ref="select"
v-model:value="value"
style="width: 120px"
@focus="focus"
@change="handleChange"
>
<a-select-option value="全部消息">全部消息</a-select-option> <a-select-option value="全部消息">全部消息</a-select-option>
<a-select-option value="已读消息">已读消息</a-select-option> <a-select-option value="已读消息">已读消息</a-select-option>
<a-select-option value="未读消息">未读消息</a-select-option> <a-select-option value="未读消息">未读消息</a-select-option>
</a-select> </a-select>
<a-checkbox
:checked="
selectData.length !== 0 && selectData.length === data.length
"
stlye="margin-right:0.3rem;"
@change="changeCheckAll()"
></a-checkbox>
<div style="margin-left: 10px">全选当前页</div>
<div class="check"> <div class="check">
<div> <div>
@ -37,26 +56,30 @@
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<a-checkbox :checked="
selectData.length !== 0 && selectData.length === data.length
" stlye="margin-right:0.3rem;" @change="changeCheckAll()"></a-checkbox>
<div>全选当前页</div>
<span @click="read()">标记为已读</span> <span @click="read()">标记为已读</span>
</div> </div>
</div> </div>
<div class="main-box">
<div class="main"> <div class="main">
<a-list item-layout="horizontal" :data-source="data"> <a-list item-layout="horizontal" :data-source="data">
<template #renderItem="{ item }" @click="goNoticePage(item)"> <template #renderItem="{ item }" @click="goNoticePage(item)">
<a-list-item> <a-list-item>
<a-list-item-meta description=""> <a-list-item-meta description="">
<template #title> <template #title>
<div class="left" @click="read(item)" :class="item.readStatus === 0 ? 'bold-text' : ''"> <div
class="left"
@click="read(item)"
:class="item.readStatus === 0 ? 'bold-text' : ''"
>
{{ item.content }} {{ item.content }}
</div> </div>
<div class="right">{{ '发布时间:' + item.senderDate }}</div> <div class="right">{{ '发布时间:' + item.senderDate }}</div>
</template> </template>
<template #avatar> <template #avatar>
<a-checkbox :checked="item.checked" @change="changeCheckBox(item)"></a-checkbox> <a-checkbox
:checked="item.checked"
@change="changeCheckBox(item)"
></a-checkbox>
<a-badge dot :offset="[-30, 5]" v-show="item.readStatus == 0"> <a-badge dot :offset="[-30, 5]" v-show="item.readStatus == 0">
<a-avatar :src="item.src" /> <a-avatar :src="item.src" />
</a-badge> </a-badge>
@ -67,23 +90,30 @@
</template> </template>
</a-list> </a-list>
</div> </div>
<a-pagination v-model:current="pageNum" v-model:pageSize="pageSize" :total="total" show-less-items </div>
:show-size-changer="false" @change="changePageNum" /> <a-pagination
v-model:current="pageNum"
v-model:pageSize="pageSize"
:total="total"
show-less-items
:show-size-changer="false"
@change="changePageNum"
/>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, reactive, onBeforeUnmount } from 'vue' import { ref, reactive, onBeforeUnmount } from 'vue'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { mynotice, mynoticeRead } from '@/api/home' import { mynotice, mynoticeRead } from '@/api/home'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
const router = useRouter() const router = useRouter()
const total = ref(0) const total = ref(0)
const pageSize = ref(8) const pageSize = ref(8)
const pageNum = ref(1) const pageNum = ref(1)
const value = ref('全部消息') const value = ref('全部消息')
const obj = reactive({ page: pageNum.value, limit: pageSize.value }) const obj = reactive({ page: pageNum.value, limit: pageSize.value })
const navList = reactive([ const navList = reactive([
{ {
title: '全部', title: '全部',
key: 'all', key: 'all',
@ -104,11 +134,11 @@ const navList = reactive([
key: 'other', key: 'other',
num: 0, num: 0,
}, },
]) ])
const selectNav = ref('all') const selectNav = ref('all')
const selectData = ref([]) const selectData = ref([])
const data = ref([]) const data = ref([])
const changeNav = (nav) => { const changeNav = (nav) => {
selectNav.value = nav.key selectNav.value = nav.key
if (nav.key === 'all') { if (nav.key === 'all') {
delete obj.from delete obj.from
@ -118,16 +148,16 @@ const changeNav = (nav) => {
value.value = '全部消息' value.value = '全部消息'
delete obj.readStatus delete obj.readStatus
init() init()
} }
const changeCheckBox = (item) => { const changeCheckBox = (item) => {
item.checked = !item.checked item.checked = !item.checked
if (item.checked) { if (item.checked) {
selectData.value.push(item.id) selectData.value.push(item.id)
} else { } else {
selectData.value = selectData.value.filter((val) => val !== item.id) selectData.value = selectData.value.filter((val) => val !== item.id)
} }
} }
const changeCheckAll = () => { const changeCheckAll = () => {
if (selectData.value.length == data.value.length) { if (selectData.value.length == data.value.length) {
selectData.value = [] selectData.value = []
data.value.forEach((val) => { data.value.forEach((val) => {
@ -140,13 +170,13 @@ const changeCheckAll = () => {
selectData.value.push(val.id) selectData.value.push(val.id)
}) })
} }
} }
const changePageNum = (page) => { const changePageNum = (page) => {
pageNum.value = page pageNum.value = page
obj.page = pageNum.value obj.page = pageNum.value
init() init()
} }
const handleChange = () => { const handleChange = () => {
pageNum.value = 1 pageNum.value = 1
obj.page = pageNum.value obj.page = pageNum.value
switch (value.value) { switch (value.value) {
@ -164,19 +194,19 @@ const handleChange = () => {
break break
} }
init() init()
} }
const goBack = (url) => { const goBack = (url) => {
router.push({ router.push({
path: url, path: url,
}) })
} }
// //
let applyStateObj = { let applyStateObj = {
0: '待办', 0: '待办',
1: '已办', 1: '已办',
} }
let typeObj = { let typeObj = {
0: '申请前台', 0: '申请前台',
1: '申请后台', 1: '申请后台',
2: '上架前台', 2: '上架前台',
@ -189,56 +219,56 @@ let typeObj = {
9: '评论后台', 9: '评论后台',
10: '会客厅前台', 10: '会客厅前台',
11: '会客厅后台', 11: '会客厅后台',
12: '其他' 12: '其他',
} }
// //
let pageObj = { let pageObj = {
'申请后台': { 申请后台: {
0: 'myAgent-CompetencyApplication', 0: 'myAgent-CompetencyApplication',
1: 'hasToDoTasks-CompetencyApplication', 1: 'hasToDoTasks-CompetencyApplication',
}, },
'上架后台': { 上架后台: {
0: 'myAgent-AbilityResourceShelf', 0: 'myAgent-AbilityResourceShelf',
1: 'hasToDoTasks-AbilityResourceShelf', 1: 'hasToDoTasks-AbilityResourceShelf',
}, },
'下架后台': { 下架后台: {
0: 'myAgent-AbilityResourcesRemoved', 0: 'myAgent-AbilityResourcesRemoved',
1: 'hasToDoTasks-AbilityResourcesRemoved', 1: 'hasToDoTasks-AbilityResourcesRemoved',
}, },
'需求后台': { 需求后台: {
0: 'myAgent-ApplicationforCompetencyRequirements', 0: 'myAgent-ApplicationforCompetencyRequirements',
1: 'hasToDoTasks-ApplicationForCompetencyRequirements', 1: 'hasToDoTasks-ApplicationForCompetencyRequirements',
}, },
'评论后台': { 评论后台: {
0: 'myAgent-CommentModeration', 0: 'myAgent-CommentModeration',
1: 'hasToDoTasks-CommentModeration', 1: 'hasToDoTasks-CommentModeration',
}, },
'会客厅后台': { 会客厅后台: {
0: 'activiti-RoomExamineAdmin', 0: 'activiti-RoomExamineAdmin',
1: 'activiti-RoomExamineAdmin', 1: 'activiti-RoomExamineAdmin',
}, },
} }
// tab // tab
const tabTypeObj = { const tabTypeObj = {
'申请前台': '能力申请', 申请前台: '能力申请',
'上架前台': '能力上架', 上架前台: '能力上架',
'下架前台': '能力下架', 下架前台: '能力下架',
'需求前台': '需求评论', 需求前台: '需求评论',
'评论前台': '需求评论', 评论前台: '需求评论',
'会客厅前台': '会客厅前台' 会客厅前台: '会客厅前台',
} }
// //
const goPage = (item) => { const goPage = (item) => {
if (item.jumpUrl && item.type !== 12) { if (item.jumpUrl && item.type !== 12) {
let typeText = typeObj[item.type]; let typeText = typeObj[item.type]
console.log('item------------>', item); console.log('item------------>', item)
console.log('typeText类型------------>', typeText); console.log('typeText类型------------>', typeText)
// "http://192.168.124.236:9796/#/personalCenter?tabTypeName=" // "http://192.168.124.236:9796/#/personalCenter?tabTypeName="
let _url = item.jumpUrl && item.jumpUrl.split('#') let _url = item.jumpUrl && item.jumpUrl.split('#')
let openType = '_self'; let openType = '_self'
// //
if (typeText && typeText.indexOf('后台') !== -1) { if (typeText && typeText.indexOf('后台') !== -1) {
openType = '_blank' openType = '_blank'
@ -248,9 +278,8 @@ const goPage = (item) => {
} }
} }
window.open(item.jumpUrl, openType) window.open(item.jumpUrl, openType)
} }
return; return
// if (typeText) { // if (typeText) {
// console.log('typeText------------>', typeText); // console.log('typeText------------>', typeText);
// // // //
@ -279,10 +308,10 @@ const goPage = (item) => {
// } // }
// } // }
} }
// //
const read = (item) => { const read = (item) => {
if (selectData.value.length === 0 && !item) { if (selectData.value.length === 0 && !item) {
return message.error('未选择消息!') return message.error('未选择消息!')
} }
@ -292,7 +321,8 @@ const read = (item) => {
if (item.readStatus === 1) { if (item.readStatus === 1) {
return goPage(item) return goPage(item)
} }
mynoticeRead(item.id).then((res) => { mynoticeRead(item.id)
.then((res) => {
if (res.data.code == 0) { if (res.data.code == 0) {
message.success('通知已读!') message.success('通知已读!')
mybus.emit('getMynotice') mybus.emit('getMynotice')
@ -304,7 +334,8 @@ const read = (item) => {
} else { } else {
message.error('操作失败!') message.error('操作失败!')
} }
}).catch(err => { })
.catch((err) => {
message.error(err) message.error(err)
}) })
} else { } else {
@ -321,8 +352,8 @@ const read = (item) => {
}) })
}) })
} }
} }
const init = () => { const init = () => {
// from readStatus 0 1 // from readStatus 0 1
mynotice(obj).then((res) => { mynotice(obj).then((res) => {
console.log('消息=============>', res.data.data) console.log('消息=============>', res.data.data)
@ -340,8 +371,8 @@ const init = () => {
total.value = res.data.data.total total.value = res.data.data.total
selectData.value = [] selectData.value = []
}) })
} }
navList.forEach((val) => { navList.forEach((val) => {
if (val.title === '全部') { if (val.title === '全部') {
mynotice({ page: pageNum.value, limit: pageSize.value }).then((res) => { mynotice({ page: pageNum.value, limit: pageSize.value }).then((res) => {
val.num = res.data.data.total val.num = res.data.data.total
@ -355,17 +386,17 @@ navList.forEach((val) => {
val.num = res.data.data.total val.num = res.data.data.total
}) })
} }
}) })
init()
mybus.on('noticeListInit', () => {
init() init()
}) mybus.on('noticeListInit', () => {
onBeforeUnmount(() => { init()
})
onBeforeUnmount(() => {
mybus.off('noticeListInit') mybus.off('noticeListInit')
}) })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.notice-list { .notice-list {
padding: 0.64rem 0 0; padding: 0.64rem 0 0;
background: #f4f5f8; background: #f4f5f8;
@ -380,11 +411,8 @@ onBeforeUnmount(() => {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.left { .left {
display: flex; display: flex;
.item { .item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -452,19 +480,19 @@ onBeforeUnmount(() => {
.btn { .btn {
background: #fff; background: #fff;
margin-top: 0.16rem; margin-top: 0.16rem;
padding: 0.14rem 3.1rem 0; padding: 0.14rem 3.1rem 0.1rem;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
& > div:nth-of-type(2) {
margin-right: 10px;
}
.ant-select { .ant-select {
margin-right: 0.24rem; margin-right: 0.24rem;
} }
.check { .check {
display: flex; display: flex;
align-items: center; align-items: center;
@ -507,12 +535,14 @@ onBeforeUnmount(() => {
} }
} }
.main-box {
background: #fff;
.main { .main {
background: #fff; background: #fff;
padding: 0 3.1rem; margin: 0 3.1rem;
height: 4.75rem; height: 4.75rem;
overflow-y: scroll; overflow-y: scroll;
border-top: 1px solid #dddee1;
:deep(.ant-list-item-meta) { :deep(.ant-list-item-meta) {
display: flex; display: flex;
align-items: center; align-items: center;
@ -553,11 +583,12 @@ onBeforeUnmount(() => {
} }
} }
} }
}
.ant-pagination { .ant-pagination {
background: #fff; background: #fff;
margin-top: 0; margin-top: 0;
padding: 0.2rem 0 0.2rem; padding: 0.2rem 0 0.2rem;
} }
} }
</style> </style>