2024-08-05 16:16:08 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="account_systemMessage">
|
2024-08-19 10:36:46 +08:00
|
|
|
<div class="account_generalMessage_title modal_title_text">
|
2024-08-23 10:19:02 +08:00
|
|
|
<!-- <span>系统消息</span> -->
|
2024-09-03 16:39:06 +08:00
|
|
|
<div class="account_generalMessage_title_setting" @click="allRead">{{$t('account.AllRead')}}</div>
|
2024-08-05 16:16:08 +08:00
|
|
|
</div>
|
2024-08-19 10:36:46 +08:00
|
|
|
<div class="account_generalMessage_item modal_title_text" v-for="item in dataList" :key="item.id" @click="setRead(item)">
|
2024-08-23 10:19:02 +08:00
|
|
|
<a-badge :dot="item.isRead == 0"></a-badge>
|
2024-08-19 10:36:46 +08:00
|
|
|
<div class="account_generalMessage_item_title">
|
|
|
|
|
<div class="account_generalMessage_item_title_text" :title="item.content">{{ item.content.title }}</div>
|
|
|
|
|
<div class="modal_title_text_intro">{{ item.createTime }}</div>
|
2024-08-05 16:16:08 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="modal_title_text_intro">
|
2024-08-19 10:36:46 +08:00
|
|
|
{{ item.content.content }}
|
|
|
|
|
<span v-if="item.content.link" class="account_generalMessage_item_link">{{ item.content.link }}</span>
|
2024-08-05 16:16:08 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-08-23 10:19:02 +08:00
|
|
|
<div class="account_generalMessage_item modal_title_text" style="display:flex;justify-content: center;" v-if="dataList.length == 0 && isNoData">
|
2024-09-03 16:39:06 +08:00
|
|
|
{{$t('account.dataNull')}}
|
2024-08-23 10:19:02 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="page_loading_box" v-show="!isNoData">
|
|
|
|
|
<span class="page_loading" ref="loadingDom" v-show="!isShowMark"></span>
|
|
|
|
|
<span v-show="isShowMark">
|
|
|
|
|
<a-spin size="large" />
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2024-08-05 16:16:08 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { defineComponent,computed,ref,reactive,nextTick,toRefs,createVNode, onMounted} from 'vue'
|
|
|
|
|
import { Https } from "@/tool/https";
|
|
|
|
|
import { useRouter,useRoute } from 'vue-router'
|
|
|
|
|
import { useStore } from "vuex";
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
components:{
|
|
|
|
|
},
|
2024-08-23 10:19:02 +08:00
|
|
|
// emits:['putListData'],
|
|
|
|
|
props:['setReadStatus','setAllmessage','getHistory'],
|
2024-08-19 10:36:46 +08:00
|
|
|
setup(prop,{emit}) {
|
2024-08-05 16:16:08 +08:00
|
|
|
const router = useRouter()
|
|
|
|
|
const store = useStore();
|
|
|
|
|
let accountMessage = reactive({
|
2024-08-19 10:36:46 +08:00
|
|
|
dataList: [],
|
2024-08-23 10:19:02 +08:00
|
|
|
page:1,
|
|
|
|
|
size:10,
|
|
|
|
|
isNoData: false,
|
|
|
|
|
isShowMark: false,
|
2024-08-05 16:16:08 +08:00
|
|
|
})
|
2024-08-23 10:19:02 +08:00
|
|
|
let loadingDom:any = ref(null)
|
|
|
|
|
let setmessageList = ()=>{
|
|
|
|
|
accountMessage.isShowMark = true
|
|
|
|
|
let data = {
|
|
|
|
|
page: accountMessage.page,
|
|
|
|
|
size: accountMessage.size,
|
|
|
|
|
}
|
|
|
|
|
prop.getHistory(data).then((rv:any)=>{
|
|
|
|
|
accountMessage.isShowMark = false
|
|
|
|
|
if(rv.content.length == 0) {
|
|
|
|
|
accountMessage.isNoData = true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
rv.content.forEach((item:any) => {
|
|
|
|
|
item.content = JSON.parse(item.content)
|
|
|
|
|
});
|
|
|
|
|
accountMessage.dataList = rv.content
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
accountMessage.isShowMark = false
|
|
|
|
|
accountMessage.isNoData = true
|
|
|
|
|
})
|
2024-08-19 10:36:46 +08:00
|
|
|
}
|
|
|
|
|
let setRead = (item:any)=>{
|
2024-08-23 10:19:02 +08:00
|
|
|
prop.setReadStatus(item).then((rv:any)=>{
|
|
|
|
|
item.isRead = 1
|
|
|
|
|
}).catch((err:any)=>{
|
|
|
|
|
})
|
2024-08-19 10:36:46 +08:00
|
|
|
}
|
|
|
|
|
let allRead = ()=>{
|
2024-08-23 10:19:02 +08:00
|
|
|
// emit('setAllmessage')
|
|
|
|
|
prop.setAllmessage().then(()=>{
|
2024-09-30 17:59:24 +08:00
|
|
|
accountMessage.dataList.forEach((item:any)=>{
|
|
|
|
|
item.isRead = 1
|
|
|
|
|
})
|
2024-08-23 10:19:02 +08:00
|
|
|
}).catch((err:any)=>{
|
|
|
|
|
})
|
2024-08-19 10:36:46 +08:00
|
|
|
}
|
2024-08-05 16:16:08 +08:00
|
|
|
// provide('exhibitionList',exhibitionList)
|
|
|
|
|
onMounted (()=>{
|
2024-08-23 10:19:02 +08:00
|
|
|
accountMessage.isNoData = false
|
|
|
|
|
accountMessage.page = 0
|
|
|
|
|
let imgParent:any = document.querySelector('.account_systemMessage .page_loading')
|
|
|
|
|
new IntersectionObserver(
|
|
|
|
|
(entries, observer) => {
|
|
|
|
|
// 如果不是相交,则直接返回
|
|
|
|
|
// console.log(entries[0]);
|
|
|
|
|
if (!entries[0].intersectionRatio) return;
|
|
|
|
|
accountMessage.page+=1
|
|
|
|
|
setmessageList()
|
|
|
|
|
},
|
|
|
|
|
// { root:worksPage }
|
|
|
|
|
).observe(loadingDom.value);
|
2024-08-05 16:16:08 +08:00
|
|
|
})
|
|
|
|
|
return{
|
|
|
|
|
...toRefs(accountMessage),
|
2024-08-19 10:36:46 +08:00
|
|
|
setmessageList,
|
|
|
|
|
setRead,
|
2024-08-23 10:19:02 +08:00
|
|
|
allRead,
|
|
|
|
|
loadingDom,
|
2024-08-05 16:16:08 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data(){
|
|
|
|
|
return{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.account_systemMessage{
|
|
|
|
|
width: 100%;
|
2024-08-19 10:36:46 +08:00
|
|
|
.account_generalMessage_item{
|
|
|
|
|
.account_generalMessage_item_title{
|
2024-08-05 16:16:08 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 2rem;
|
2024-08-19 10:36:46 +08:00
|
|
|
.account_generalMessage_item_title_text{
|
|
|
|
|
max-width: 80%;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
2024-08-05 16:16:08 +08:00
|
|
|
.modal_title_text_intro{
|
|
|
|
|
margin-left: 4rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|