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

ok

parent 13b0f861
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<span class="i-layout-header-trigger i-layout-header-trigger-min"> <span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown transfer trigger="hover" @on-click="handleClickUserDropdown"> <Dropdown transfer trigger="hover" @on-click="handleClickUserDropdown">
<span @click="openModelBugAdd"> <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" /> <Icon type="ios-bug" size="18" />
</Badge> </Badge>
</span> </span>
......
<template> <template>
<Tooltip :content="tooltipContent" transfer> <Tooltip :content="tooltipContent" transfer>
<span class="i-layout-header-trigger i-layout-header-trigger-min" @click="handleOpenLog"> <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" /> <Icon custom="i-icon i-icon-record" />
</Badge> </Badge>
</span> </span>
......
<template> <template>
<span <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"> <Notification auto-count @on-clear="handleClear">
<NotificationTab title="通知" name="message" :count="unreadMessage" :loading="messageLoading"> <NotificationTab title="通知" name="message" :count="unreadMessage">
<NotificationItem <NotificationItem
v-for="(item, index) in messages" v-for="(item, index) in messageList"
:key="index" :key="index"
:class="item.msg?'con_bord':''" :class="{read:item.status==1}"
:title="item.title" :title="item.title"
:icon="item.icon||'md-mail'" :icon="item.icon||'md-mail'"
:icon-color="item.iconColor||'#2680eb'" :icon-color="item.color||'#2680eb'"
:time="item.creationTime" :time="item.creationTime"
@click.native="clickItem(item,index)" @click.native="clickItem(item,index)"
/> />
<!-- :read="item.content" -->
<div slot="clear">历史消息</div> <div slot="clear">历史消息</div>
</NotificationTab> </NotificationTab>
</Notification> </Notification>
<Modal v-model="modal1" :title="msg.title" width="1200"> <Modal v-model="modal1" :title="title" width="1200">
<p class="content-in">发送时间:{{msg.creationTime}}</p> <component :is="detail" :eid="eid" />
<p class="content-in">{{msg.content}}</p>
<div slot="footer"> <div slot="footer">
<Button type="primary" @click="modal1=false">取消</Button> <Button type="primary" @click="modal1=false">取消</Button>
</div> </div>
...@@ -39,8 +37,10 @@ export default { ...@@ -39,8 +37,10 @@ export default {
badgeProps: { badgeProps: {
offset: [20, 0], offset: [20, 0],
}, },
detail: null,
modal1: false, modal1: false,
msg: {}, title: "消息",
eid: -1,
}; };
}, },
computed: { computed: {
...@@ -48,8 +48,8 @@ export default { ...@@ -48,8 +48,8 @@ export default {
...mapState({ messages: "messages" }), ...mapState({ messages: "messages" }),
unreadMessage() { unreadMessage() {
let unread = 0; let unread = 0;
this.messages.forEach((item) => { this.messageList.forEach((item) => {
if (!item.read) unread++; if (item.status != 1) unread++;
}); });
return unread; return unread;
}, },
...@@ -60,37 +60,33 @@ export default { ...@@ -60,37 +60,33 @@ export default {
mounted() { mounted() {
// this.messageList = [...this.messages]; // this.messageList = [...this.messages];
// console.log(this.messages); // console.log(this.messages);
this.load();
setInterval(this.load, 60 * 1000);
}, },
methods: { methods: {
handleLoadMore(tab) { handleLoadMore(tab) {
this.loadMore(tab.name); this.loadMore(tab.name);
}, },
loadMore(type) { load() {
if (this[`${type}Loading`]) return; this.$store.dispatch("loadMessages");
this[`${type}Loading`] = true; this.messageList = this.messages.filter((u) => {
setTimeout(() => { return true;
this[`${type}List`] = this[`${type}List`].concat([ });
...this[`${type}BaseList`], console.log("message", this.messageList);
]);
this[`${type}Loading`] = false;
}, 1000);
}, },
handleClear(tab) { handleClear(tab) {
this.$router.push("/home/msgRecord"); this.$router.push("/home/msgRecord");
}, },
clickItem(item, i) { clickItem(item, i) {
this.modal1 = true; this.modal1 = true;
this.msg = item; this.msg = item;
item.iconColor = "#ccc"; item.color = "#ccc";
item.msg = true; item.status = 1;
let url = `${systemUrl}/usermessage/read`; this.$set(this.messageList, i, item);
this.$api.post(url, item).then((r) => { this.title = item.title || " ";
//消息转为已读 this.eid = item.id;
// this.msg = r.result; this.detail = () => import("./message");
setInterval(() => {
this.$store.dispatch("loadMessages");
}, 30 * 1000);
});
}, },
}, },
}; };
...@@ -99,15 +95,17 @@ export default { ...@@ -99,15 +95,17 @@ export default {
.i-con .ivu-badge-count { .i-con .ivu-badge-count {
top: 0 !important; top: 0 !important;
} }
.content-in { .readmsg {
height: 30px; min-height: 200px;
} .readv {
.con_bord { .ivu-time,
.ivu-time { h4 {
color: #ccc;
}
color: #ccc; color: #ccc;
} }
h4 { .ivu-notifications-tab-loading {
color: #ccc; display: none;
} }
} }
</style> </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 @@ ...@@ -72,8 +72,8 @@
<i-menu-head v-if="headerMenu && isMobile" /> <i-menu-head v-if="headerMenu && isMobile" />
<i-header-log v-if="isDesktop && showLog" /> <i-header-log v-if="isDesktop && showLog" />
<i-header-bug /> <i-header-bug />
<i-header-fullscreen v-if="isDesktop && showFullscreen" />
<i-header-notice v-if="showNotice" /> <i-header-notice v-if="showNotice" />
<i-header-fullscreen v-if="isDesktop && showFullscreen" />
<i-header-user /> <i-header-user />
<!-- <i-header-i18n v-if="showI18n" /> <!-- <i-header-i18n v-if="showI18n" />
<i-header-setting v-if="enableSetting && !isMobile" />--> <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