提交 2786e5cd 编写于 作者: 张磊's avatar 张磊

code done

上级 82aa474a
......@@ -62,6 +62,7 @@ export default {
created() {
vm = this;
vm.getToken();
window._VM = vm;
},
mounted() {
setTimeout( function () {
......@@ -129,7 +130,8 @@ export default {
vm.authList = authList;
}
});
}
},
closeGlobalMsgNotice () {}
}
};
</script>
......
......@@ -155,24 +155,25 @@ export default {
return false;
}
const i = this.item;
if(i.imTeamId){
const params = {
teamIdList: [i.imTeamId]
}
this.POST(`/im/team/call/op/ack/`,params).then(res=>{
if(res.code == '000000'){
this.$store.commit('updateShowChat', true);
this.$store.commit('updateCurrentChat', i);
}
}).catch(err=>{
this.$message({
message: err.message,
type: "warning",
duration:1000
});
})
}
// if(i.imTeamId){
// const params = {
// teamIdList: [i.imTeamId]
// }
// this.POST(`/im/team/call/op/ack/`,params).then(res=>{
// if(res.code == '000000'){
// this.$store.commit('updateShowChat', true);
// this.$store.commit('updateCurrentChat', i);
// }
// }).catch(err=>{
// this.$message({
// message: err.message,
// type: "warning",
// duration:1000
// });
// })
//
// }
this.$store.dispatch('gotoInquiry', i);
},
openAdvice() {
if(this.showAdvice){
......
export default {
gotoInquiry ({ commit }, current) {
if(current.imTeamId){
const params = {
teamIdList: [current.imTeamId]
}
_VM.POST(`/im/team/call/op/ack/`,params).then(res=>{
if(res.code == '000000'){
commit('updateShowChat', true);
commit('updateCurrentChat', current);
}
}).catch(err=>{
_VM.$message({
message: err.message,
type: "warning",
duration:1000
});
})
}
},
}
......@@ -47,9 +47,13 @@ export default {
state.socketClient.on("diagnose_call_push_event", (socket) => {
console.log('diagnose_call_push_event---', socket);
const l = store.noticeList;
if(l.length >=5){
l.shift();
}
l.push(socket);
const n = {notifyIndex: l.length, ...socket}
store.commit('updateNoticeList', l);
store.commit('SET_NOTIFY', n);
});
state.socketClient.on('ping', function () {
console.log('[E] 心跳请求已发出 →', true);
......@@ -59,5 +63,37 @@ export default {
console.log('[E] 心跳响应已收到 ←', true);
});
},
SET_NOTIFY: (state, payload) => {
console.log('--payload', payload)
let doms = document.getElementsByClassName('el-notification')
if (doms.length >= 5) return
const h = _VM.$createElement;
const cn = _VM.$notify({
title: `问诊单195(${payload.department})`,
message: h("p", [
h("i", {style: `color: teal;`}, `${payload.doctorName}正在呼叫你`),
h(
"el-button",
{
style: `float:right;margin-top:${30}px;`,
on: {
click: function () {
console.log('--click', payload)
store.dispatch('gotoInquiry', payload);
cn.close();
},
},
},
"进入诊室"
),
]),
onClose: function () {
console.log('--onClose',payload )
},
duration: 0,
position: 'top-right',
})
}
},
};
......@@ -174,7 +174,7 @@ html,body{
// 消息推送
.el-notification.right {
top: 130px !important;
//top: 130px !important;
}
// 弹框按钮样式
......
......@@ -19,7 +19,7 @@
</div>
</el-row>
<!-- tab栏 -->
<el-radio-group @change="globalMsgNotice" v-model="tabPosition" style="margin-bottom: 30px;">
<el-radio-group @change="tabChange" v-model="tabPosition" style="margin-bottom: 30px;">
<el-radio-button label="99">全部({{currentCalList}})</el-radio-button>
<el-radio-button label="1">待处理({{currentCalList}})</el-radio-button>
<el-radio-button label="2">问诊中({{currentCalList}})</el-radio-button>
......@@ -52,6 +52,7 @@
import { mapState } from "vuex";
import storejs from 'storejs';
import InquiryListComponent from '../../../components/common/inquirylist.vue';
import store from "../../../store";
export default {
components: {
......@@ -165,31 +166,8 @@ export default {
const l = this.currentDiagList;
l.push(...this.testlistdata);
this.$store.commit('updateCurrentDiagList', l);
this.$store.commit('socket/SET_NOTIFY', ...this.testlistdata);
},
globalMsgNotice() {
let doms = document.getElementsByClassName('el-notification')
if(doms.length > 2) return
const h = this.$createElement;
this.$notify({
title: "问诊单195(内科)",
message: h("p", [
h("i", { style: "color: teal" }, "王医生,孙医生正在呼叫你"),
h(
"el-button",
{
style: "float: right;margin-top:20px;",
on: {
click: this.closeGlobalMsgNotice,
},
},
"进入诊室"
),
]),
duration: 5000,
position:'top-right',
})
},
closeGlobalMsgNotice () {}
},
}
</script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册