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

Merge branch 'feat/zl' into 'develop'

Feat/zl

See merge request !46
......@@ -15,7 +15,7 @@
<v-footer></v-footer>
</div>
</el-container>
<chat :showChat="showChat" :currentUser="{}"></chat>
<chat :showChat="showChat" :currentChat="currentChat"></chat>
</div>
</template>
<script>
......@@ -30,7 +30,7 @@ import {
ssoLogin,
bindDragHeader
} from "./utils/utils.js";
import { mapActions, mapGetters } from "vuex";
import { mapActions, mapGetters, mapState } from "vuex";
import { getInnerLoginUrl } from "./utils/index";
let vm = null;
export default {
......@@ -46,10 +46,13 @@ export default {
userName: "",
authList: [],
systemType: 0,
showChat:false
};
},
computed: {
...mapState({
showChat: 'showChat',
currentChat: 'currentChat',
}),
...mapGetters(["_token"])
},
created() {
......
......@@ -49,6 +49,7 @@
}
}
.msg-content {
height: 400px;
background: #F0F2F5;
word-break: break-all;
overflow: scroll;
......@@ -118,7 +119,7 @@
}
}
.link {
color: #2f86f6;
color: #ffffff;
}
& > .mid-pdf {
width: 260px;
......@@ -303,7 +304,7 @@
}
.cr{
color: #ffffff;
.mid-text, .live-notice, .time-box, .diagnosis-box{
.mid-text, .live-notice, .time-box, .diagnosis-box, .suggession-box{
background: #449284;
.time{
color: #ffffff;
......@@ -364,12 +365,10 @@
top: -8px;
left: 0;
display: flex;
align-items: center;
flex-direction: row;
margin: 16px 12px 16px 25px;
.cb-icon-wrapper {
position: absolute;
top: 0;
right: 70px;
display: flex;
align-items: center;
height: 44px;
......@@ -381,22 +380,19 @@
}
}
.send-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 60px;
height: 44px;
background: #f3f6f7;
margin-left: 12px;
border-radius: 8px;
cursor: pointer;
& > img {
width: 24px;
height: 24px;
width: 86px;
height: 33px;
background: #449284;
border-radius: 23px;
color: #ffffff;
border: none;
font-size: 14px;
font-weight: bold;
}
&.active {
background: #0d9078;
/deep/.el-textarea{
width: 75%;
.el-textarea__inner{
border: none;
}
}
}
......
......@@ -12,10 +12,10 @@
<span class="dep">&nbsp;内科</span>
</div>
<div class="c-header-edit">
<span class="edit-img">
<span class="edit-img" @click="overFn">
<img src="../../assets/image/IM/im_close.png" alt />
</span>
<span class="edit-img">
<span class="edit-img" @click="closeChat">
<img src="../../assets/image/IM/im_close2.png" alt />
</span>
<span class="edit-img">
......@@ -130,7 +130,7 @@
</article>
</section>
<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">
<el-upload
class="bg-uploader"
......@@ -139,14 +139,14 @@
:show-file-list="false"
:before-upload="beforeUploadFile"
>
<img src="../../assets/image/IM/icon-folder-open.png" alt />
<img src="../../assets/image/IM/im_sendfile.png" alt />
</el-upload>
<img src="../../assets/image/IM/icon-link.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 />
<img src="../../assets/image/IM/im_sendvedio.png" @click="preSendLinkMsg" alt />
</div>
<el-button size="small" class="send-btn" :class="{'active': canSend}" @click="sendTextMsg">
发送
</el-button>
</section>
</article>
</section>
......@@ -154,6 +154,7 @@
<!-- 选择链接弹窗 -->
<el-dialog
title="选择链接"
:modal="false"
:show-close="true"
:visible.sync="showSelectDialog"
:close-on-click-modal="false"
......@@ -196,14 +197,17 @@
<el-button size="small" type="primary" @click="sendLinkMsg">确 定</el-button>
</div>
</el-dialog>
<alert ref="alert"></alert>
</div>
</template>
<script>
import BreadCrumb from "@/components/breadcrumb.vue";
import alert from "@/components/common/alert.vue";
import diagnosisLive from "./diagnosis-live";
import { doUpload, getFilePath } from "@/utils/qiniu-util";
import { openLoading, closeLoading, betaHandle } from "@/utils/utils";
import { getPicaKFAccid, getPhomeDemain } from "@/utils";
import {mapState} from "vuex";
const CONTAINER_HEIGHT = 700;
let forwardMsgIntervalId = null,
continueIntervalId = null,
......@@ -214,18 +218,14 @@ let _this = null;
export default {
components: {
BreadCrumb,
diagnosisLive
diagnosisLive,
alert
},
props: {
showChat: {
type: Boolean,
default: false,
},
currentUser: {
type: Object,
default: {},
}
},
data() {
return {
......@@ -272,6 +272,9 @@ export default {
},
computed: {
...mapState({
currentChat: 'currentChat',
}),
canSend() {
return !!this.sendText;
}
......@@ -295,13 +298,34 @@ export default {
// 监听到有变化,就缓存一下
sendText(newText) {
cacheMap[this.currentSession.id] = newText || "";
},
currentChat (newVal, oldVal) {
if(newVal !== oldVal && newVal.imTeamId){
this.chatInit();
}
}
},
created() {
},
mounted() {
cacheMap = {};
this.$nextTick(() => {
_this.containerHeight = document.body.clientHeight - 80;
// _this.getElmByID("screenSet").style.height = _this.containerHeight - 76 + "px";
_this.getElmByID("msgContentId").style.height = "400px";
});
},
methods: {
chatInit () {
_this = this;
this.picakfAccId = getPicaKFAccid();
this.tid = this.$route.query.tid || '3868439091';
const {imTeamId} = this.currentChat;
this.tid = imTeamId || '3853944746';
console.log('--this.currentChat', this.currentChat);
this.getFiveContentList();
autoCompletionIntervalId && clearInterval(autoCompletionIntervalId);
autoCompletionIntervalId = setInterval(() => {
......@@ -318,17 +342,6 @@ export default {
};
this.getMembersList(); // 获取群聊成员信息
},
mounted() {
cacheMap = {};
this.$nextTick(() => {
_this.containerHeight = document.body.clientHeight - 80;
// _this.getElmByID("screenSet").style.height = _this.containerHeight - 76 + "px";
_this.getElmByID("msgContentId").style.height = "400px";
});
},
methods: {
// 含有敏感信息的消息,自行补全提示文案
// 每30秒监测敏感信息
autoCompletionInterval() {
......@@ -889,6 +902,62 @@ export default {
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() {
......
......@@ -39,11 +39,11 @@
</div>
</div>
<div class="vedio-man">
<p class="man-img">
<img :src="im_man1" alt />
<p class="man-img" @click="toggleVol">
<img :src="isMuted ? im_man2: im_man1" alt />
</p>
<p class="man-txt">
已接入
{{isMuted ? '已静音' : '已接入'}}
</p>
</div>
</div>
......@@ -109,11 +109,12 @@ export default {
memberList: [],
tid: "", // 群id
diagnoseLogId: "", //问诊id
isMuted: false
};
},
created() {
this.tid = this.$route.query.tid || "3868439091";
this.diagnoseLogId = this.$route.query.diagnoseLogId || "38";
this.tid = this.$route.query.tid || "3853944746";
this.diagnoseLogId = this.$route.query.diagnoseLogId || "35";
// openLoading(this);
this.init();
},
......@@ -145,9 +146,14 @@ export default {
});
}
},
// 设置item
setItem(data, item) {
item.timeleft = 0;
toggleVol () {
if(this.isMuted){
this.rtc.unmuteLocalAudio();
}else{
this.rtc.muteLocalAudio();
}
this.isMuted = !this.isMuted;
},
// 主动呼叫
drivingCall(data) {
......@@ -288,6 +294,7 @@ export default {
vueInstance: this,
};
this.rtc = new RtcClient(obj);
window.rtc = this.rtc;
this.$nextTick(() => {
this.$refs.alert
.init({
......
......@@ -42,7 +42,7 @@
</div>
</div>
<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>
</el-card>
......@@ -54,6 +54,7 @@
<script>
import DiagnoseAdvice from '@/components/common/diagnoseAdvice.vue'
import { mapState } from "vuex";
export default {
components:{
DiagnoseAdvice
......@@ -86,6 +87,9 @@ export default {
created() {
},
computed:{
...mapState({
showChat: 'showChat',
}),
diagnoseType() {
switch(this.item.diagnoseType) {
case 1:
......@@ -148,6 +152,21 @@ export default {
},
showAdvice() {
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
import store from '../';
import io from 'socket.io-client';
export default {
......@@ -14,7 +15,6 @@ export default {
loginUserNum: `diagnose_list_socket_888`
}
});
console.log('-=-=-=-=',socket)
commit('SET_SOCKET', socket);
commit('SET_IOLISTION');
},
......@@ -40,6 +40,16 @@ export default {
});
state.socketClient.on("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 () {
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 {
currentDiagList:[],
currentCalList:{},
currentChat: {},
noticeList: [],
showChat:false
};
......@@ -20,15 +20,15 @@
<!-- tab栏 -->
<div id="radio">
<el-radio-group v-model="tabPosition" style="margin-bottom: 30px;" >
<el-radio-button label="all">全部(0)</el-radio-button>
<el-radio-button label="abnormal">异常(0)</el-radio-button>
<el-radio-button label="consultation">问诊中(0)</el-radio-button>
<el-radio-button label="Notstarted">未开始(0)</el-radio-button>
<el-radio-button label="Hasended">已结束(0)</el-radio-button>
<el-radio-button label="Cancelled">已取消(0)</el-radio-button>
<el-radio-button label="all">全部({{currentCalList}})</el-radio-button>
<el-radio-button label="abnormal">异常({{currentCalList}})</el-radio-button>
<el-radio-button label="consultation">问诊中({{currentCalList}})</el-radio-button>
<el-radio-button label="Notstarted">未开始({{currentCalList}})</el-radio-button>
<el-radio-button label="Hasended">已结束({{currentCalList}})</el-radio-button>
<el-radio-button label="Cancelled">已取消({{currentCalList}})</el-radio-button>
</el-radio-group>
<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>
</div>
</div>
......@@ -51,11 +51,17 @@
</template>
<script>
import { mapState } from "vuex";
import InquiryListComponent from '../../../components/common/inquirylist.vue';
console.log('---InquiryList', InquiryListComponent);
export default {
components: {
InquiryListComponent
},
computed:{
...mapState({
currentDiagList: 'currentDiagList',
currentCalList: 'currentCalList'
}),
},
data(){
return {
......@@ -78,7 +84,7 @@ export default {
"doctorName": "孙思邈",
"doctorTrtcEntryStatus": 1,
"imStatus": 0,
"imTeamId": "string",
"imTeamId": "3853944746",
"returnStatus": 1,
"roomId": "string",
"sort": 0,
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册