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

Merge branch 'feat/zl' into 'develop'

Feat/zl

See merge request !46
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<v-footer></v-footer> <v-footer></v-footer>
</div> </div>
</el-container> </el-container>
<chat :showChat="showChat" :currentUser="{}"></chat> <chat :showChat="showChat" :currentChat="currentChat"></chat>
</div> </div>
</template> </template>
<script> <script>
...@@ -30,7 +30,7 @@ import { ...@@ -30,7 +30,7 @@ import {
ssoLogin, ssoLogin,
bindDragHeader bindDragHeader
} from "./utils/utils.js"; } from "./utils/utils.js";
import { mapActions, mapGetters } from "vuex"; import { mapActions, mapGetters, mapState } from "vuex";
import { getInnerLoginUrl } from "./utils/index"; import { getInnerLoginUrl } from "./utils/index";
let vm = null; let vm = null;
export default { export default {
...@@ -46,10 +46,13 @@ export default { ...@@ -46,10 +46,13 @@ export default {
userName: "", userName: "",
authList: [], authList: [],
systemType: 0, systemType: 0,
showChat:false
}; };
}, },
computed: { computed: {
...mapState({
showChat: 'showChat',
currentChat: 'currentChat',
}),
...mapGetters(["_token"]) ...mapGetters(["_token"])
}, },
created() { created() {
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
} }
} }
.msg-content { .msg-content {
height: 400px;
background: #F0F2F5; background: #F0F2F5;
word-break: break-all; word-break: break-all;
overflow: scroll; overflow: scroll;
...@@ -118,7 +119,7 @@ ...@@ -118,7 +119,7 @@
} }
} }
.link { .link {
color: #2f86f6; color: #ffffff;
} }
& > .mid-pdf { & > .mid-pdf {
width: 260px; width: 260px;
...@@ -303,7 +304,7 @@ ...@@ -303,7 +304,7 @@
} }
.cr{ .cr{
color: #ffffff; color: #ffffff;
.mid-text, .live-notice, .time-box, .diagnosis-box{ .mid-text, .live-notice, .time-box, .diagnosis-box, .suggession-box{
background: #449284; background: #449284;
.time{ .time{
color: #ffffff; color: #ffffff;
...@@ -364,12 +365,10 @@ ...@@ -364,12 +365,10 @@
top: -8px; top: -8px;
left: 0; left: 0;
display: flex; display: flex;
align-items: center;
flex-direction: row; flex-direction: row;
margin: 16px 12px 16px 25px; margin: 16px 12px 16px 25px;
.cb-icon-wrapper { .cb-icon-wrapper {
position: absolute;
top: 0;
right: 70px;
display: flex; display: flex;
align-items: center; align-items: center;
height: 44px; height: 44px;
...@@ -381,22 +380,19 @@ ...@@ -381,22 +380,19 @@
} }
} }
.send-btn { .send-btn {
display: flex; width: 86px;
flex-direction: row; height: 33px;
justify-content: center; background: #449284;
align-items: center; border-radius: 23px;
width: 60px; color: #ffffff;
height: 44px; border: none;
background: #f3f6f7; font-size: 14px;
margin-left: 12px; font-weight: bold;
border-radius: 8px; }
cursor: pointer; /deep/.el-textarea{
& > img { width: 75%;
width: 24px; .el-textarea__inner{
height: 24px; border: none;
}
&.active {
background: #0d9078;
} }
} }
} }
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
<span class="dep">&nbsp;内科</span> <span class="dep">&nbsp;内科</span>
</div> </div>
<div class="c-header-edit"> <div class="c-header-edit">
<span class="edit-img"> <span class="edit-img" @click="overFn">
<img src="../../assets/image/IM/im_close.png" alt /> <img src="../../assets/image/IM/im_close.png" alt />
</span> </span>
<span class="edit-img"> <span class="edit-img" @click="closeChat">
<img src="../../assets/image/IM/im_close2.png" alt /> <img src="../../assets/image/IM/im_close2.png" alt />
</span> </span>
<span class="edit-img"> <span class="edit-img">
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
</article> </article>
</section> </section>
<section class="c-bottom"> <section class="c-bottom">
<el-input type="textarea" placeholder="请输入内容" v-model="sendText" maxlength="499"></el-input> <el-input type="textarea" class="c-bottom-input" placeholder="请输入内容" v-model="sendText" maxlength="499"></el-input>
<div class="cb-icon-wrapper"> <div class="cb-icon-wrapper">
<el-upload <el-upload
class="bg-uploader" class="bg-uploader"
...@@ -139,14 +139,14 @@ ...@@ -139,14 +139,14 @@
:show-file-list="false" :show-file-list="false"
:before-upload="beforeUploadFile" :before-upload="beforeUploadFile"
> >
<img src="../../assets/image/IM/icon-folder-open.png" alt /> <img src="../../assets/image/IM/im_sendfile.png" alt />
</el-upload> </el-upload>
<img src="../../assets/image/IM/icon-link.png" @click="preSendLinkMsg" alt /> <img src="../../assets/image/IM/im_sendvedio.png" @click="preSendLinkMsg" alt />
</div>
<div class="send-btn" :class="{'active': canSend}" @click="sendTextMsg">
<img v-show="canSend" src="../../assets/image/IM/send-yes.png" alt />
<img v-show="!canSend" src="../../assets/image/IM/send-no.png" alt />
</div> </div>
<el-button size="small" class="send-btn" :class="{'active': canSend}" @click="sendTextMsg">
发送
</el-button>
</section> </section>
</article> </article>
</section> </section>
...@@ -154,6 +154,7 @@ ...@@ -154,6 +154,7 @@
<!-- 选择链接弹窗 --> <!-- 选择链接弹窗 -->
<el-dialog <el-dialog
title="选择链接" title="选择链接"
:modal="false"
:show-close="true" :show-close="true"
:visible.sync="showSelectDialog" :visible.sync="showSelectDialog"
:close-on-click-modal="false" :close-on-click-modal="false"
...@@ -196,14 +197,17 @@ ...@@ -196,14 +197,17 @@
<el-button size="small" type="primary" @click="sendLinkMsg">确 定</el-button> <el-button size="small" type="primary" @click="sendLinkMsg">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<alert ref="alert"></alert>
</div> </div>
</template> </template>
<script> <script>
import BreadCrumb from "@/components/breadcrumb.vue"; import BreadCrumb from "@/components/breadcrumb.vue";
import alert from "@/components/common/alert.vue";
import diagnosisLive from "./diagnosis-live"; import diagnosisLive from "./diagnosis-live";
import { doUpload, getFilePath } from "@/utils/qiniu-util"; import { doUpload, getFilePath } from "@/utils/qiniu-util";
import { openLoading, closeLoading, betaHandle } from "@/utils/utils"; import { openLoading, closeLoading, betaHandle } from "@/utils/utils";
import { getPicaKFAccid, getPhomeDemain } from "@/utils"; import { getPicaKFAccid, getPhomeDemain } from "@/utils";
import {mapState} from "vuex";
const CONTAINER_HEIGHT = 700; const CONTAINER_HEIGHT = 700;
let forwardMsgIntervalId = null, let forwardMsgIntervalId = null,
continueIntervalId = null, continueIntervalId = null,
...@@ -214,18 +218,14 @@ let _this = null; ...@@ -214,18 +218,14 @@ let _this = null;
export default { export default {
components: { components: {
BreadCrumb, BreadCrumb,
diagnosisLive diagnosisLive,
alert
}, },
props: { props: {
showChat: { showChat: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
currentUser: {
type: Object,
default: {},
}
}, },
data() { data() {
return { return {
...@@ -272,6 +272,9 @@ export default { ...@@ -272,6 +272,9 @@ export default {
}, },
computed: { computed: {
...mapState({
currentChat: 'currentChat',
}),
canSend() { canSend() {
return !!this.sendText; return !!this.sendText;
} }
...@@ -295,28 +298,16 @@ export default { ...@@ -295,28 +298,16 @@ export default {
// 监听到有变化,就缓存一下 // 监听到有变化,就缓存一下
sendText(newText) { sendText(newText) {
cacheMap[this.currentSession.id] = newText || ""; cacheMap[this.currentSession.id] = newText || "";
},
currentChat (newVal, oldVal) {
if(newVal !== oldVal && newVal.imTeamId){
this.chatInit();
}
} }
}, },
created() { created() {
_this = this;
this.picakfAccId = getPicaKFAccid();
this.tid = this.$route.query.tid || '3868439091';
this.getFiveContentList();
autoCompletionIntervalId && clearInterval(autoCompletionIntervalId);
autoCompletionIntervalId = setInterval(() => {
this.autoCompletionInterval();
}, 2000);
// 监听键盘的回车按键(回车时发送消息,并阻止其在textarea中的回车换行行为)
document.onkeydown = function(ev) {
var event = ev || event;
if (event.keyCode == 13) {
_this.sendTextMsg();
event.preventDefault();
}
};
this.getMembersList(); // 获取群聊成员信息
}, },
mounted() { mounted() {
...@@ -329,6 +320,28 @@ export default { ...@@ -329,6 +320,28 @@ export default {
}, },
methods: { methods: {
chatInit () {
_this = this;
this.picakfAccId = getPicaKFAccid();
const {imTeamId} = this.currentChat;
this.tid = imTeamId || '3853944746';
console.log('--this.currentChat', this.currentChat);
this.getFiveContentList();
autoCompletionIntervalId && clearInterval(autoCompletionIntervalId);
autoCompletionIntervalId = setInterval(() => {
this.autoCompletionInterval();
}, 2000);
// 监听键盘的回车按键(回车时发送消息,并阻止其在textarea中的回车换行行为)
document.onkeydown = function(ev) {
var event = ev || event;
if (event.keyCode == 13) {
_this.sendTextMsg();
event.preventDefault();
}
};
this.getMembersList(); // 获取群聊成员信息
},
// 含有敏感信息的消息,自行补全提示文案 // 含有敏感信息的消息,自行补全提示文案
// 每30秒监测敏感信息 // 每30秒监测敏感信息
autoCompletionInterval() { autoCompletionInterval() {
...@@ -889,6 +902,62 @@ export default { ...@@ -889,6 +902,62 @@ export default {
return betaHandle(val); return betaHandle(val);
}, },
closeChat () {
window.rtc.leave();
this.clearSession();
this.$store.commit('updateShowChat', false);
this.$store.commit('updateCurrentChat', {});
},
clearSession() {
sessionStorage.removeItem("TIME_askTime");
sessionStorage.removeItem("TIME_answerTime");
sessionStorage.removeItem("TIME_useTime");
sessionStorage.removeItem("TIME_loseTime");
},
// 结束会话
overFn() {
this.$refs.alert
.init({
cancleTxt: "取消",
confirmTxt: "我知道了",
title: `确定要结束会话么?`,
})
.then(() => {
this.out();
})
.catch((err) => {});
},
out() {
const {diagnoseLogId} = this.currentChat;
let url = `/diagnose/admin/diagnose/endCall/${diagnoseLogId}`;
let params = {};
this.POST(url, params)
.then((res) => {
if (res.code == "000000") {
this.closeChat();
} else {
this.$refs.alert
.init({
confirmTxt: "我知道了",
title: `操作失败,请稍后重试`,
})
.then(() => {})
.catch((err) => {});
}
})
.catch(() => {
this.$refs.alert
.init({
confirmTxt: "我知道了",
title: `操作失败,请稍后重试`,
})
.then(() => {})
.catch((err) => {});
});
},
}, },
beforeDestroy() { beforeDestroy() {
......
...@@ -39,11 +39,11 @@ ...@@ -39,11 +39,11 @@
</div> </div>
</div> </div>
<div class="vedio-man"> <div class="vedio-man">
<p class="man-img"> <p class="man-img" @click="toggleVol">
<img :src="im_man1" alt /> <img :src="isMuted ? im_man2: im_man1" alt />
</p> </p>
<p class="man-txt"> <p class="man-txt">
已接入 {{isMuted ? '已静音' : '已接入'}}
</p> </p>
</div> </div>
</div> </div>
...@@ -109,11 +109,12 @@ export default { ...@@ -109,11 +109,12 @@ export default {
memberList: [], memberList: [],
tid: "", // 群id tid: "", // 群id
diagnoseLogId: "", //问诊id diagnoseLogId: "", //问诊id
isMuted: false
}; };
}, },
created() { created() {
this.tid = this.$route.query.tid || "3868439091"; this.tid = this.$route.query.tid || "3853944746";
this.diagnoseLogId = this.$route.query.diagnoseLogId || "38"; this.diagnoseLogId = this.$route.query.diagnoseLogId || "35";
// openLoading(this); // openLoading(this);
this.init(); this.init();
}, },
...@@ -145,9 +146,14 @@ export default { ...@@ -145,9 +146,14 @@ export default {
}); });
} }
}, },
// 设置item toggleVol () {
setItem(data, item) { if(this.isMuted){
item.timeleft = 0; this.rtc.unmuteLocalAudio();
}else{
this.rtc.muteLocalAudio();
}
this.isMuted = !this.isMuted;
}, },
// 主动呼叫 // 主动呼叫
drivingCall(data) { drivingCall(data) {
...@@ -288,6 +294,7 @@ export default { ...@@ -288,6 +294,7 @@ export default {
vueInstance: this, vueInstance: this,
}; };
this.rtc = new RtcClient(obj); this.rtc = new RtcClient(obj);
window.rtc = this.rtc;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.alert this.$refs.alert
.init({ .init({
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</div> </div>
</div> </div>
<div class="inquiryroom"> <div class="inquiryroom">
<div class="goroom"><span v-if="nomor">进入诊室</span><span v-else>正在呼叫医助,进入诊室</span> </div> <div class="goroom"><span v-if="nomor" @click="openChat">进入诊室</span><span v-else>正在呼叫医助,进入诊室</span> </div>
<div class="suggest" @click="showAdvice()">诊断建议 <div class="writesuggest" v-if="inquiry.write">未写</div></div> <div class="suggest" @click="showAdvice()">诊断建议 <div class="writesuggest" v-if="inquiry.write">未写</div></div>
</div> </div>
</el-card> </el-card>
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<script> <script>
import DiagnoseAdvice from '@/components/common/diagnoseAdvice.vue' import DiagnoseAdvice from '@/components/common/diagnoseAdvice.vue'
import { mapState } from "vuex";
export default { export default {
components:{ components:{
DiagnoseAdvice DiagnoseAdvice
...@@ -86,6 +87,9 @@ export default { ...@@ -86,6 +87,9 @@ export default {
created() { created() {
}, },
computed:{ computed:{
...mapState({
showChat: 'showChat',
}),
diagnoseType() { diagnoseType() {
switch(this.item.diagnoseType) { switch(this.item.diagnoseType) {
case 1: case 1:
...@@ -148,6 +152,21 @@ export default { ...@@ -148,6 +152,21 @@ export default {
}, },
showAdvice() { showAdvice() {
this.showAdvices = true this.showAdvices = true
},
openChat () {
if(this.showChat){
this.$message({
message: '不可同时进入多个诊室,请先退出已进入的诊室,再试。',
type: "warning",
duration:1000
});
return false;
}
const i = this.item;
if(i.imTeamId){
this.$store.commit('updateShowChat', true);
this.$store.commit('updateCurrentChat', i);
}
} }
} }
} }
......
// ES6 import // ES6 import
import store from '../';
import io from 'socket.io-client'; import io from 'socket.io-client';
export default { export default {
...@@ -14,7 +15,6 @@ export default { ...@@ -14,7 +15,6 @@ export default {
loginUserNum: `diagnose_list_socket_888` loginUserNum: `diagnose_list_socket_888`
} }
}); });
console.log('-=-=-=-=',socket)
commit('SET_SOCKET', socket); commit('SET_SOCKET', socket);
commit('SET_IOLISTION'); commit('SET_IOLISTION');
}, },
...@@ -40,6 +40,16 @@ export default { ...@@ -40,6 +40,16 @@ export default {
}); });
state.socketClient.on("diagnose_push_event", (socket) => { state.socketClient.on("diagnose_push_event", (socket) => {
console.log('diagnose_push_event---', socket); console.log('diagnose_push_event---', socket);
const {list, countRespList} = socket;
store.commit('updateCurrentDiagList', list);
store.commit('updateCurrentCalList', countRespList);
});
state.socketClient.on("diagnose_call_push_event", (socket) => {
console.log('diagnose_call_push_event---', socket);
const l = store.noticeList;
l.push(socket);
store.commit('updateNoticeList', l);
}); });
state.socketClient.on('ping', function () { state.socketClient.on('ping', function () {
console.log('[E] 心跳请求已发出 →', true); console.log('[E] 心跳请求已发出 →', true);
......
export default {
updateCurrentDiagList(state, obj) {
state.currentDiagList = obj;
},
updateCurrentCalList(state, obj) {
state.currentCalList = obj;
},
updateCurrentChat(state, obj) {
state.currentChat = obj;
},
updateShowChat(state, obj) {
state.showChat = obj;
},
updateNoticeList(state, obj) {
state.noticeList = obj;
},
};
/* 内存数据状态 */ /* 内存数据状态 */
export default { export default {
currentDiagList:[],
currentCalList:{},
currentChat: {},
noticeList: [],
showChat:false
}; };
...@@ -20,15 +20,15 @@ ...@@ -20,15 +20,15 @@
<!-- tab栏 --> <!-- tab栏 -->
<div id="radio"> <div id="radio">
<el-radio-group v-model="tabPosition" style="margin-bottom: 30px;" > <el-radio-group v-model="tabPosition" style="margin-bottom: 30px;" >
<el-radio-button label="all">全部(0)</el-radio-button> <el-radio-button label="all">全部({{currentCalList}})</el-radio-button>
<el-radio-button label="abnormal">异常(0)</el-radio-button> <el-radio-button label="abnormal">异常({{currentCalList}})</el-radio-button>
<el-radio-button label="consultation">问诊中(0)</el-radio-button> <el-radio-button label="consultation">问诊中({{currentCalList}})</el-radio-button>
<el-radio-button label="Notstarted">未开始(0)</el-radio-button> <el-radio-button label="Notstarted">未开始({{currentCalList}})</el-radio-button>
<el-radio-button label="Hasended">已结束(0)</el-radio-button> <el-radio-button label="Hasended">已结束({{currentCalList}})</el-radio-button>
<el-radio-button label="Cancelled">已取消(0)</el-radio-button> <el-radio-button label="Cancelled">已取消({{currentCalList}})</el-radio-button>
</el-radio-group> </el-radio-group>
<div class="forbox"> <div class="forbox">
<div class="for" v-for="item,index in list" :key="'for'+index"> <div class="for" v-for="(item, index) in currentDiagList" :key="'for'+index">
<inquiryList-component :item="item"></inquiryList-component> <inquiryList-component :item="item"></inquiryList-component>
</div> </div>
</div> </div>
...@@ -51,11 +51,17 @@ ...@@ -51,11 +51,17 @@
</template> </template>
<script> <script>
import { mapState } from "vuex";
import InquiryListComponent from '../../../components/common/inquirylist.vue'; import InquiryListComponent from '../../../components/common/inquirylist.vue';
console.log('---InquiryList', InquiryListComponent);
export default { export default {
components: { components: {
InquiryListComponent InquiryListComponent
},
computed:{
...mapState({
currentDiagList: 'currentDiagList',
currentCalList: 'currentCalList'
}),
}, },
data(){ data(){
return { return {
...@@ -78,7 +84,7 @@ export default { ...@@ -78,7 +84,7 @@ export default {
"doctorName": "孙思邈", "doctorName": "孙思邈",
"doctorTrtcEntryStatus": 1, "doctorTrtcEntryStatus": 1,
"imStatus": 0, "imStatus": 0,
"imTeamId": "string", "imTeamId": "3853944746",
"returnStatus": 1, "returnStatus": 1,
"roomId": "string", "roomId": "string",
"sort": 0, "sort": 0,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册