1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
<div class="box-drawer">
<div>
<div style="display: inline-block">
<h4>{{ messageDetailInfo.title }}</h4>
</div>
<div style="float: right; margin-top: 20px; padding-right: 30px">
<el-button
type="primary"
plain
size="mini"
icon="el-icon-arrow-left"
@click="goBack"
>返回</el-button
>
<el-button
type="primary"
plain
size="mini"
v-if="ispaas==1"
@click="redeposit"
>转存为系统公告</el-button
>
<el-button
type="primary"
plain
size="mini"
icon="el-icon-delete"
@click="delRead"
>删除</el-button
>
</div>
</div>
<div class="button-text">
<i class="el-icon-message-solid" style="color: #fbaf2d"></i>
<span class="left-text"
>消息类型:{{
messageDetailInfo.type == 1 ? "系统公告" : "活动公告"
}}</span
>
<span class="right-text"
>发布时间:{{ formatter(messageDetailInfo.add_time) }}</span
>
</div>
<div class="Info-text" v-html="messageDetailInfo.content"></div>
</div>
</template>
<script>
import { delIsRead, GetMessageDetail, Forward,GetIsPaas } from "@/api/msgtemplate";
import { dateFormat } from '@/utils'
export default {
name: "messageDetail",
props: ["messageDetailIds"],
data() {
return {
messageDetailInfo: {},
ispaas: 0,
};
},
created() {
this.getMessageInfos();
// this.getIsPaas();
},
methods: {
//获取详情信息
getMessageInfos() {
let data = {
id: this.messageDetailIds,
};
GetMessageDetail(data).then((res) => {
if (res.code == 1) {
this.messageDetailInfo = res.data;
}
});
},
//删除单个
delRead() {
let data = {
id: this.messageDetailIds,
};
delIsRead(data).then((res) => {
if (res.code == 1) {
this.$message({ message: "删除成功", type: "success" });
this.$emit("closeOrderDetailDialog");
}
});
},
//返回
goBack() {
this.$emit("closeOrderDetailDialog");
},
redeposit() {
let data = {
id: this.messageDetailIds,
};
Forward(data).then((res) => {
if (res.code == 1) {
this.$message({ message: "转存成功", type: "success" });
this.$emit("closeOrderDetailDialog");
}
});
},
getIsPaas() {
GetIsPaas().then((res) => {
if (res.code == 1) {
this.ispaas = res.data.ispaas;
}
});
},
//日期转换
/** 时间格式化 */
formatter(time) {
return dateFormat(time * 1000, 'Y-m-d H:i:s')
},
},
};
</script>
<style scoped>
.Info-text {
width: 100%;
height: 470px;
/* border: 1px solid black; */
overflow: auto;
}
.box-drawer {
/* border: 1px solid black; */
width: 96%;
margin: 0 auto;
}
.button-text {
line-height: 48px;
width: 100%;
height: 48px;
background: #f8f8f8;
padding-left: 15px;
}
.left-text {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
}
.right-text {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #999999;
float: right;
padding-right: 20px;
}
</style>