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

code done

上级 82aa474a
...@@ -62,6 +62,7 @@ export default { ...@@ -62,6 +62,7 @@ export default {
created() { created() {
vm = this; vm = this;
vm.getToken(); vm.getToken();
window._VM = vm;
}, },
mounted() { mounted() {
setTimeout( function () { setTimeout( function () {
...@@ -129,7 +130,8 @@ export default { ...@@ -129,7 +130,8 @@ export default {
vm.authList = authList; vm.authList = authList;
} }
}); });
} },
closeGlobalMsgNotice () {}
} }
}; };
</script> </script>
......
...@@ -155,24 +155,25 @@ export default { ...@@ -155,24 +155,25 @@ export default {
return false; return false;
} }
const i = this.item; const i = this.item;
if(i.imTeamId){ // if(i.imTeamId){
const params = { // const params = {
teamIdList: [i.imTeamId] // teamIdList: [i.imTeamId]
} // }
this.POST(`/im/team/call/op/ack/`,params).then(res=>{ // this.POST(`/im/team/call/op/ack/`,params).then(res=>{
if(res.code == '000000'){ // if(res.code == '000000'){
this.$store.commit('updateShowChat', true); // this.$store.commit('updateShowChat', true);
this.$store.commit('updateCurrentChat', i); // this.$store.commit('updateCurrentChat', i);
} // }
}).catch(err=>{ // }).catch(err=>{
this.$message({ // this.$message({
message: err.message, // message: err.message,
type: "warning", // type: "warning",
duration:1000 // duration:1000
}); // });
}) // })
//
} // }
this.$store.dispatch('gotoInquiry', i);
}, },
openAdvice() { openAdvice() {
if(this.showAdvice){ 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 { ...@@ -47,9 +47,13 @@ export default {
state.socketClient.on("diagnose_call_push_event", (socket) => { state.socketClient.on("diagnose_call_push_event", (socket) => {
console.log('diagnose_call_push_event---', socket); console.log('diagnose_call_push_event---', socket);
const l = store.noticeList; const l = store.noticeList;
if(l.length >=5){
l.shift();
}
l.push(socket); l.push(socket);
const n = {notifyIndex: l.length, ...socket}
store.commit('updateNoticeList', l); store.commit('updateNoticeList', l);
store.commit('SET_NOTIFY', n);
}); });
state.socketClient.on('ping', function () { state.socketClient.on('ping', function () {
console.log('[E] 心跳请求已发出 →', true); console.log('[E] 心跳请求已发出 →', true);
...@@ -59,5 +63,37 @@ export default { ...@@ -59,5 +63,37 @@ export default {
console.log('[E] 心跳响应已收到 ←', true); 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{ ...@@ -174,7 +174,7 @@ html,body{
// 消息推送 // 消息推送
.el-notification.right { .el-notification.right {
top: 130px !important; //top: 130px !important;
} }
// 弹框按钮样式 // 弹框按钮样式
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
</el-row> </el-row>
<!-- tab栏 --> <!-- 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="99">全部({{currentCalList}})</el-radio-button>
<el-radio-button label="1">待处理({{currentCalList}})</el-radio-button> <el-radio-button label="1">待处理({{currentCalList}})</el-radio-button>
<el-radio-button label="2">问诊中({{currentCalList}})</el-radio-button> <el-radio-button label="2">问诊中({{currentCalList}})</el-radio-button>
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
import { mapState } from "vuex"; import { mapState } from "vuex";
import storejs from 'storejs'; import storejs from 'storejs';
import InquiryListComponent from '../../../components/common/inquirylist.vue'; import InquiryListComponent from '../../../components/common/inquirylist.vue';
import store from "../../../store";
export default { export default {
components: { components: {
...@@ -165,31 +166,8 @@ export default { ...@@ -165,31 +166,8 @@ export default {
const l = this.currentDiagList; const l = this.currentDiagList;
l.push(...this.testlistdata); l.push(...this.testlistdata);
this.$store.commit('updateCurrentDiagList', l); 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> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册