|
|
@@ -0,0 +1,206 @@
|
|
|
+<template>
|
|
|
+<div class="message">
|
|
|
+ <!-- 消息详情 -->
|
|
|
+ <div class="message-detail">
|
|
|
+ <van-nav-bar
|
|
|
+ title="消息详情"
|
|
|
+ left-arrow
|
|
|
+ @click-left="onClickLeft"
|
|
|
+ />
|
|
|
+ <div class="detail-box" v-if="selected">
|
|
|
+ <div class="msg-title">
|
|
|
+ <p>{{selected.title}}</p>
|
|
|
+ <p class="cell-time">{{selected.publishTime}}</p>
|
|
|
+ </div>
|
|
|
+ <div class="message-content">
|
|
|
+ <div class="text-content">
|
|
|
+ <p>{{selected.content}}</p>
|
|
|
+ <div v-if="selected.fileList" class="file-box" >
|
|
|
+ 附件:
|
|
|
+ <div v-for="(v,i) in selected.fileList">
|
|
|
+ <van-icon color="#1989fa" name="guide-o" />
|
|
|
+ <span style="color: #1989fa;" @click="preview(v)" :key="v.name">{{v.name}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+</div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {msgList, dataList, setRead, msgRead} from './api'
|
|
|
+import {mapGetters} from "vuex"
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'msgDetail',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ show:false,
|
|
|
+ selected:null,
|
|
|
+ dataList: [],
|
|
|
+ query:{
|
|
|
+ type:1,
|
|
|
+ pageNum:1,
|
|
|
+ pageSize:20,
|
|
|
+ },
|
|
|
+ pullup:true,
|
|
|
+ message:null,
|
|
|
+ total:0,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ ...mapGetters(['orgId','id','roleList'])
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ console.log(this.$route,'this.$route')
|
|
|
+ this.selected = this.$route.params;
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ preview(file){
|
|
|
+ this.openFilePreview(file);
|
|
|
+ },
|
|
|
+ onClickLeft(){
|
|
|
+ //this.show = false;
|
|
|
+ this.$store.dispatch('redDot');
|
|
|
+ this.$router.go(-1);
|
|
|
+ },
|
|
|
+ clickItem(v,i){
|
|
|
+ let queryMethod,data;
|
|
|
+ if(this.query.type == 1){
|
|
|
+ queryMethod = setRead;
|
|
|
+ data = {
|
|
|
+ announcementNotificationId:v.id,
|
|
|
+ orgId:this.orgId,
|
|
|
+ userId:this.id,
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ queryMethod = msgRead;
|
|
|
+ data = v.id
|
|
|
+ }
|
|
|
+ queryMethod(data).then(res=>{
|
|
|
+ this.dataList.forEach(item=>{
|
|
|
+ if(item.id === v.id){
|
|
|
+ item.isRead = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.selected = v;
|
|
|
+ this.show = true;
|
|
|
+ },
|
|
|
+ refreshData(){
|
|
|
+ this.pullup = true;
|
|
|
+ this.query.pageNum = 1;
|
|
|
+ this.total = 0;
|
|
|
+ this.dataList = [];
|
|
|
+ this.getDataList();
|
|
|
+ },
|
|
|
+ getDataList(){
|
|
|
+ if( this.dataList.length !== 0 && this.dataList.length >= this.total) {
|
|
|
+ this.pullup = false;
|
|
|
+ this.$toast('已加载完毕');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let data = {};
|
|
|
+ if(this.query.type == 1){
|
|
|
+ data = {
|
|
|
+ ...this.query,
|
|
|
+ userId:this.id,
|
|
|
+ orgId:this.orgId,
|
|
|
+ tagRoleIds:this.roleList.map(v=>{return v.roleId}),
|
|
|
+ }
|
|
|
+ msgList(data).then(res=>{
|
|
|
+ if(res.total === '0'){
|
|
|
+ this.pullup = false;
|
|
|
+ this.$toast('已加载完毕');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.total = res.total;
|
|
|
+ if(this.dataList.length < res.total) {
|
|
|
+ this.dataList = [...this.dataList,...res.rows] ;
|
|
|
+ this.pullup = true;
|
|
|
+ this.query.pageNum++;
|
|
|
+ this.$refs.Scroll.refresh();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ data = {
|
|
|
+ ...this.query,
|
|
|
+ userId:this.id,
|
|
|
+ }
|
|
|
+ dataList(data).then(res=>{
|
|
|
+ if(res.total === '0'){
|
|
|
+ this.pullup = false;
|
|
|
+ this.$toast('已加载完毕');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.total = res.total;
|
|
|
+ if(this.dataList.length < res.total) {
|
|
|
+ this.dataList = [...this.dataList,...res.rows] ;
|
|
|
+ this.pullup = true;
|
|
|
+ this.query.pageNum++;
|
|
|
+ this.$refs.Scroll.refresh();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.message{
|
|
|
+
|
|
|
+}
|
|
|
+.message-detail{
|
|
|
+ height: calc(100vh - 102px);
|
|
|
+}
|
|
|
+.detail-box{
|
|
|
+ height: calc(100% - 90px);
|
|
|
+ overflow: auto;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+.msg-title{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 100%;
|
|
|
+ padding: 2.666667vw 4.266667vw;
|
|
|
+ overflow: hidden;
|
|
|
+ color: #323233;
|
|
|
+ font-size: 3.733333vw;
|
|
|
+ line-height: 6.4vw;
|
|
|
+ border-bottom: 1px solid #f5f5f5;
|
|
|
+}
|
|
|
+.message-content{
|
|
|
+ width: 100%;
|
|
|
+ padding:20px 30px 20px 30px;
|
|
|
+ height: 100%;
|
|
|
+ overflow: auto;
|
|
|
+ .text-content{
|
|
|
+ width: 100%;
|
|
|
+ min-height: 40px;
|
|
|
+ overflow: auto;
|
|
|
+ >p{
|
|
|
+ text-indent: 2em;
|
|
|
+ word-break: break-word;
|
|
|
+ white-space: pre-wrap;
|
|
|
+ text-align: justify;
|
|
|
+ width: 100%;
|
|
|
+ color: #777;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .file-box{
|
|
|
+ width: 100%;
|
|
|
+ min-height: 40px;
|
|
|
+ padding: 20px 0;
|
|
|
+ >div{
|
|
|
+ line-height: 32px;
|
|
|
+ padding-left: 20px;
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|