Commit f61bff97 authored by 周远喜's avatar 周远喜

ok

parent 13b0f861
......@@ -2,7 +2,7 @@
<span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown transfer trigger="hover" @on-click="handleClickUserDropdown">
<span @click="openModelBugAdd">
<Badge :count="bugCount === 0 ? null : bugCount" :overflow-count="99" :offset="[20, 0]">
<Badge :count="bugCount === 0 ? null : bugCount" :overflow-count="99" :offset="[10, 0]">
<Icon type="ios-bug" size="18" />
</Badge>
</span>
......
<template>
<Tooltip :content="tooltipContent" transfer>
<span class="i-layout-header-trigger i-layout-header-trigger-min" @click="handleOpenLog">
<Badge :count="lengthError === 0 ? null : lengthError" :overflow-count="99" :dot="showDot" :offset="showDot ? [26, 2] : [20, 0]">
<Badge :count="lengthError === 0 ? null : lengthError" :overflow-count="99" :dot="showDot" :offset="showDot ? [10, 2] : [10, 2]">
<Icon custom="i-icon i-icon-record" />
</Badge>
</span>
......
<template>
<span
class="i-layout-header-trigger i-layout-header-trigger-min i-layout-header-trigger-in i-con"
class="i-layout-header-trigger i-layout-header-trigger-min i-layout-header-trigger-in i-con readmsg"
>
<Notification auto-count @on-load-more="handleLoadMore" @on-clear="handleClear">
<NotificationTab title="通知" name="message" :count="unreadMessage" :loading="messageLoading">
<Notification auto-count @on-clear="handleClear">
<NotificationTab title="通知" name="message" :count="unreadMessage">
<NotificationItem
v-for="(item, index) in messages"
v-for="(item, index) in messageList"
:key="index"
:class="item.msg?'con_bord':''"
:class="{read:item.status==1}"
:title="item.title"
:icon="item.icon||'md-mail'"
:icon-color="item.iconColor||'#2680eb'"
:icon-color="item.color||'#2680eb'"
:time="item.creationTime"
@click.native="clickItem(item,index)"
/>
<!-- :read="item.content" -->
<div slot="clear">历史消息</div>
</NotificationTab>
</Notification>
<Modal v-model="modal1" :title="msg.title" width="1200">
<p class="content-in">发送时间:{{msg.creationTime}}</p>
<p class="content-in">{{msg.content}}</p>
<Modal v-model="modal1" :title="title" width="1200">
<component :is="detail" :eid="eid" />
<div slot="footer">
<Button type="primary" @click="modal1=false">取消</Button>
</div>
......@@ -39,8 +37,10 @@ export default {
badgeProps: {
offset: [20, 0],
},
detail: null,
modal1: false,
msg: {},
title: "消息",
eid: -1,
};
},
computed: {
......@@ -48,8 +48,8 @@ export default {
...mapState({ messages: "messages" }),
unreadMessage() {
let unread = 0;
this.messages.forEach((item) => {
if (!item.read) unread++;
this.messageList.forEach((item) => {
if (item.status != 1) unread++;
});
return unread;
},
......@@ -60,37 +60,33 @@ export default {
mounted() {
// this.messageList = [...this.messages];
// console.log(this.messages);
this.load();
setInterval(this.load, 60 * 1000);
},
methods: {
handleLoadMore(tab) {
this.loadMore(tab.name);
},
loadMore(type) {
if (this[`${type}Loading`]) return;
this[`${type}Loading`] = true;
setTimeout(() => {
this[`${type}List`] = this[`${type}List`].concat([
...this[`${type}BaseList`],
]);
this[`${type}Loading`] = false;
}, 1000);
load() {
this.$store.dispatch("loadMessages");
this.messageList = this.messages.filter((u) => {
return true;
});
console.log("message", this.messageList);
},
handleClear(tab) {
this.$router.push("/home/msgRecord");
},
clickItem(item, i) {
this.modal1 = true;
this.msg = item;
item.iconColor = "#ccc";
item.msg = true;
let url = `${systemUrl}/usermessage/read`;
this.$api.post(url, item).then((r) => {
//消息转为已读
// this.msg = r.result;
setInterval(() => {
this.$store.dispatch("loadMessages");
}, 30 * 1000);
});
item.color = "#ccc";
item.status = 1;
this.$set(this.messageList, i, item);
this.title = item.title || " ";
this.eid = item.id;
this.detail = () => import("./message");
},
},
};
......@@ -99,15 +95,17 @@ export default {
.i-con .ivu-badge-count {
top: 0 !important;
}
.content-in {
height: 30px;
}
.con_bord {
.ivu-time {
.readmsg {
min-height: 200px;
.readv {
.ivu-time,
h4 {
color: #ccc;
}
color: #ccc;
}
h4 {
color: #ccc;
.ivu-notifications-tab-loading {
display: none;
}
}
</style>
<template>
<div class="msg-main">
<p class="title">发送时间:{{msg.creationTime}} <span class="fr">发送人:<User :value="msg.senderId"/></span>
</p>
<div class="content" v-html="msg.content"></div>
<div v-if="msg.attachment" class="file">
附件:
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
msg:{}
}
},
mounted(){
this.load();
},
methods:{
load(){
this.$api.get(`${systemUrl}/usermessage/read`,{id:this.eid}).then(r=>{
this.msg=r.result;
})
}
},
props:["eid"],
watch:{
eid(v,o){
if(v){
this.load();
}
}
}
}
</script>
<style lang="less">
.msg-main{
.title{
font-size:14px;
line-height: 45px;
}
.content{
padding: 10px 20px;
}
.file{
padding: 10px 20px;
}
}
</style>
\ No newline at end of file
......@@ -72,8 +72,8 @@
<i-menu-head v-if="headerMenu && isMobile" />
<i-header-log v-if="isDesktop && showLog" />
<i-header-bug />
<i-header-fullscreen v-if="isDesktop && showFullscreen" />
<i-header-notice v-if="showNotice" />
<i-header-fullscreen v-if="isDesktop && showFullscreen" />
<i-header-user />
<!-- <i-header-i18n v-if="showI18n" />
<i-header-setting v-if="enableSetting && !isMobile" />-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment