提交 60e497c0 编写于 作者: haochangdi's avatar haochangdi

Merge branch 'dev-diagnosis-20210323' of...

Merge branch 'dev-diagnosis-20210323' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-admin-consultation into dev-diagnosis-20210323

# Conflicts:
#	src/views/layout/slidebar.vue
...@@ -25,7 +25,7 @@ export default [{ ...@@ -25,7 +25,7 @@ export default [{
children: [ children: [
{ {
path: '', path: '',
redirect: '/diagnosisList' redirect: '/diagnosis-list'
},{ },{
path: '/diagnosis-list', path: '/diagnosis-list',
component: diagnosisList component: diagnosisList
......
...@@ -18,7 +18,7 @@ export const envConfig = { ...@@ -18,7 +18,7 @@ export const envConfig = {
innerLoginUrl: 'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html', innerLoginUrl: 'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html', yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html',
phomeDemain: 'https://dev-phome.yunqueyi.com', phomeDemain: 'https://dev-phome.yunqueyi.com',
picakfAccId: 'picakf_dev', picakfAccId: 'picaop_dev',
}, },
dev: { dev: {
baseUrl: 'https://dev-sc.yunqueyi.com', baseUrl: 'https://dev-sc.yunqueyi.com',
...@@ -29,7 +29,7 @@ export const envConfig = { ...@@ -29,7 +29,7 @@ export const envConfig = {
innerLoginUrl: 'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html', innerLoginUrl: 'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html', yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html',
phomeDemain: 'https://dev-phome.yunqueyi.com', phomeDemain: 'https://dev-phome.yunqueyi.com',
picakfAccId: 'picakf_dev', picakfAccId: 'picaop_dev',
}, },
test: { test: {
baseUrl: 'https://test1-sc.yunqueyi.com', baseUrl: 'https://test1-sc.yunqueyi.com',
...@@ -40,7 +40,7 @@ export const envConfig = { ...@@ -40,7 +40,7 @@ export const envConfig = {
innerLoginUrl: 'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html', innerLoginUrl: 'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html', yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html',
phomeDemain: 'https://test1-phome.yunqueyi.com', phomeDemain: 'https://test1-phome.yunqueyi.com',
picakfAccId: 'picakf_test', picakfAccId: 'picaop_test',
}, },
uat: { uat: {
baseUrl: 'https://uat-sc.yunqueyi.com', baseUrl: 'https://uat-sc.yunqueyi.com',
...@@ -53,7 +53,7 @@ export const envConfig = { ...@@ -53,7 +53,7 @@ export const envConfig = {
innerLoginUrl: 'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html', innerLoginUrl: 'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html', yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html',
phomeDemain: 'https://uat-phome.yunqueyi.com', phomeDemain: 'https://uat-phome.yunqueyi.com',
picakfAccId: 'picakf_uat', picakfAccId: 'picaop_uat',
}, },
pro: { pro: {
baseUrl: 'https://sc.yunqueyi.com', baseUrl: 'https://sc.yunqueyi.com',
...@@ -64,6 +64,6 @@ export const envConfig = { ...@@ -64,6 +64,6 @@ export const envConfig = {
innerLoginUrl: 'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html', innerLoginUrl: 'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://www.yunqueyi.com/pica_index.html', yuequeyiIndexUrl: 'https://www.yunqueyi.com/pica_index.html',
phomeDemain: 'https://phome.yunqueyi.com', phomeDemain: 'https://phome.yunqueyi.com',
picakfAccId: 'picakf', picakfAccId: 'picaop',
} }
} }
...@@ -3,6 +3,7 @@ import store from '../store' ...@@ -3,6 +3,7 @@ import store from '../store'
// import { getHostnameAndPort } from '../utils' // import { getHostnameAndPort } from '../utils'
// axios.defaults.withCredentials = true // axios.defaults.withCredentials = true
// 创建axios实例对象
const service = axios.create({ const service = axios.create({
// baseURL: process.env.BASE_API // baseURL: process.env.BASE_API
timeout: 600000, timeout: 600000,
......
...@@ -2,15 +2,11 @@ ...@@ -2,15 +2,11 @@
<div class="current-session-wrap"> <div class="current-session-wrap">
<section class="component-content screenSet" id="screenSet"> <section class="component-content screenSet" id="screenSet">
<article <article
v-show="sessionListData.sessionList.length"
class="center" class="center"
v-loadmore="getOldMSGHistory" v-loadmore="getOldMSGHistory"
> >
<section class="c-header"> <section class="c-header">
<div class="c-header-l"> <div class="c-header-l">
<!-- <img :src="currentSession.avatarImageUrl" alt />
<span class="name">{{doctorInfo.name}}</span>
<span class="time-tip">当前会话时长:{{currentContinueTimes | continueTimesFilter}}</span> -->
<span class="time-tip">问诊医生XX医生的问诊群聊</span> <span class="time-tip">问诊医生XX医生的问诊群聊</span>
</div> </div>
</section> </section>
...@@ -18,16 +14,15 @@ ...@@ -18,16 +14,15 @@
<section id="msgContentId" class="msg-content scroll-box"> <section id="msgContentId" class="msg-content scroll-box">
<article <article
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index">
:style="{'text-align': item.sendOrReceive ? 'right' : 'left'}" <!-- <div class="split-line" v-if="item.sessionFlag">本次会话结束</div> -->
> <!-- sendOrReceive 为true在右边 -->
<div class="split-line" v-if="item.sessionFlag">本次会话结束</div>
<div class="msg-item" :class="{'cr': item.sendOrReceive}"> <div class="msg-item" :class="{'cr': item.sendOrReceive}">
<div class="msg-item-img"> <div class="msg-item-img">
<img :src="item.avatarImg" alt /> <img :src="item.avatarImg" alt />
</div> </div>
<div class="msg-item-detail"> <div class="msg-item-detail" :class="{'line': item.showType == 10}">
<span class="mid-time">{{item.timestampStr}}</span> <span class="mid-time">{{item.name}} {{item.timestampStr}}</span>
<div class="send-warpper"> <div class="send-warpper">
<img <img
v-if="item.sendOrReceive && item.isShowErrorIcon" v-if="item.sendOrReceive && item.isShowErrorIcon"
...@@ -53,7 +48,6 @@ ...@@ -53,7 +48,6 @@
alt alt
/> />
</div> </div>
</div> </div>
<div v-if="item.showType == 3" class="mid-pdf" @click="openPDF(item)"> <div v-if="item.showType == 3" class="mid-pdf" @click="openPDF(item)">
<div class="midp-left"> <div class="midp-left">
...@@ -64,22 +58,6 @@ ...@@ -64,22 +58,6 @@
<img src="../../../assets/image/IM/icon-pdf.png" alt /> <img src="../../../assets/image/IM/icon-pdf.png" alt />
</div> </div>
</div> </div>
<!-- <div v-if="item.showType == 3" class="diagnosis-box">
<div class="title">朱德承医生向朱家医生发起的问诊</div>
<div class="dia-text">
<span class="label">患者:</span>
<span>王大锤 男 40岁</span>
</div>
<div class="dia-text">
<span class="label">病情描述:</span>
<span>因PCR反应模板仅为DNA,因此在进行PCR反应钱,应将新型冠状病毒核酸逆转录为DNA。</span>
</div>
</div> -->
<!-- <div v-if="item.showType == 3" class="time-box">
<div class="title">电话/视频问诊时间已确定</div>
<div class="time">已预约 2021-03-20 下午 3:00-3:30</div>
<div class="time-text">因PCR反应模板仅为DNA,因此在进行PCR反应钱,应将新型冠状病毒核酸逆转录为DNA。</div>
</div> -->
<div v-if="item.showType == 4" class="mid-text"> <div v-if="item.showType == 4" class="mid-text">
{{item.text}} {{item.text}}
<span class="link">{{item.suffix}}</span> <span class="link">{{item.suffix}}</span>
...@@ -88,6 +66,43 @@ ...@@ -88,6 +66,43 @@
<img src="../../../assets/image/IM/icon-warning-circle.png" alt /> <img src="../../../assets/image/IM/icon-warning-circle.png" alt />
<span>该消息类型PC端暂不支持</span> <span>该消息类型PC端暂不支持</span>
</div> </div>
<!-- 语音消息 -->
<div v-if="item.showType == 6" class="audio-box">
<audio controls>
<source :src="item.url" type="audio/mpeg">
</audio>
</div>
<!-- 问诊开始与病例模块 -->
<div v-if="item.showType == 7" class="diagnosis-box">
<div class="title">{{item.title}}</div>
<div class="dia-text">
<span class="label">患者:</span>
<span>{{item.text.patientName}} {{item.text.sex == 1 ? '男' : '女'}} {{item.text.age}}</span>
</div>
<div class="dia-text">
<span class="label">病情描述:</span>
<span>{{item.text.illnessDetail}}</span>
</div>
</div>
<!-- 预约时间模块 -->
<div v-if="item.showType == 8" class="time-box">
<div class="title">{{item.title}}</div>
<div class="time">{{item.text.timeStr}}</div>
<div class="time-text">{{item.text.tips}}</div>
</div>
<!-- 音视频与IM的交互 -->
<div v-if="item.showType == 9" class="live-box">
<div class="live-notice">{{item.text}}</div>
</div>
<!-- 问诊结束 -->
<div v-if="item.showType == 10" class="diagnosis-end">
<div class="split-line">{{item.text}}</div>
</div>
<!-- 医生建议模块 -->
<div v-if="item.showType == 11" class="suggession-box">
<div class="title">医生建议</div>
<div class="suggession-text">{{item.content}}</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -168,14 +183,12 @@ ...@@ -168,14 +183,12 @@
</div> </div>
</template> </template>
<script> <script>
import { mapGetters, mapMutations } from "vuex";
import BreadCrumb from "@/components/breadcrumb.vue"; import BreadCrumb from "@/components/breadcrumb.vue";
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";
const CONTAINER_HEIGHT = 700; const CONTAINER_HEIGHT = 700;
let forwardMsgIntervalId = null, let forwardMsgIntervalId = null,
sessionIntervalId = null,
continueIntervalId = null, continueIntervalId = null,
autoCompletionIntervalId = null, autoCompletionIntervalId = null,
cacheMap = {}; cacheMap = {};
...@@ -200,15 +213,9 @@ export default { ...@@ -200,15 +213,9 @@ export default {
currentSessionIndex: 0, // 当前会话序号 currentSessionIndex: 0, // 当前会话序号
currentSession: {}, currentSession: {},
currentTaskLogId: "", // 当前会话ID currentTaskLogId: "", // 当前会话ID
currentToAccId: "",
picakfAccId: "", picakfAccId: "",
historyTimestamp: 0, historyTimestamp: 0,
realTimestamp: 0, realTimestamp: 0,
doctorInfo: {
name: "",
mobilePhone: "",
isShowCopyBtn: true
},
containerHeight: CONTAINER_HEIGHT, containerHeight: CONTAINER_HEIGHT,
showSelectDialog: false, showSelectDialog: false,
linkForm: { linkForm: {
...@@ -216,8 +223,7 @@ export default { ...@@ -216,8 +223,7 @@ export default {
info: "", info: "",
url: "" url: ""
}, },
linkList: [], linkList: [], // 消息列表 showType 1: 文本; 2: 图片; 3: PDF; 4: 链接; 5: 不支持类型; 6: 语音;7: 病例;
// 消息列表 showType 1: 文本; 2: 图片; 3: PDF; 4: 链接; 5: 不支持类型;
messageList: [], messageList: [],
rules: { rules: {
info: [ info: [
...@@ -229,11 +235,12 @@ export default { ...@@ -229,11 +235,12 @@ export default {
imgHeight: 0, imgHeight: 0,
imgProportion: 0, imgProportion: 0,
hasNoHistoryData: false, hasNoHistoryData: false,
tid: '',
teamMemberList: []
}; };
}, },
computed: { computed: {
// ...mapGetters(["isFromAssignTask"]),
canSend() { canSend() {
return !!this.sendText; return !!this.sendText;
} }
...@@ -263,14 +270,8 @@ export default { ...@@ -263,14 +270,8 @@ export default {
created() { created() {
_this = this; _this = this;
this.picakfAccId = getPicaKFAccid(); this.picakfAccId = getPicaKFAccid();
this.kfAvatar = require("../../../assets/image/IM/kf-avatar.png"); this.tid = this.$route.query.tid || '';
this.getSessionList();
sessionIntervalId && clearInterval(sessionIntervalId);
sessionIntervalId = setInterval(() => {
this.getSessionList();
}, 3000);
this.getFiveContentList(); this.getFiveContentList();
autoCompletionIntervalId && clearInterval(autoCompletionIntervalId); autoCompletionIntervalId && clearInterval(autoCompletionIntervalId);
autoCompletionIntervalId = setInterval(() => { autoCompletionIntervalId = setInterval(() => {
this.autoCompletionInterval(); this.autoCompletionInterval();
...@@ -284,33 +285,23 @@ export default { ...@@ -284,33 +285,23 @@ export default {
event.preventDefault(); event.preventDefault();
} }
}; };
this.getMembersList(); // 获取群聊成员信息
}, },
mounted() { mounted() {
cacheMap = {}; cacheMap = {};
this.$nextTick(() => { this.$nextTick(() => {
_this.containerHeight = document.body.clientHeight - 80; _this.containerHeight = document.body.clientHeight - 80;
_this.getElmByID("screenSet").style.height = _this.getElmByID("screenSet").style.height = _this.containerHeight - 76 + "px";
_this.containerHeight - 76 + "px"; _this.getElmByID("msgContentId").style.height = _this.containerHeight - 211 + "px";
// console.log('_this.containerHeight', _this.containerHeight);
// _this.getElmByID("sessionListId").style.height =
// _this.containerHeight - 176 + "px";
// _this.getElmByID("userInfoId").style.height =
// _this.containerHeight - 76 + "px";
_this.getElmByID("msgContentId").style.height =
_this.containerHeight - 211 + "px";
}); });
}, },
methods: { methods: {
//
// ...mapMutations(["SET_IS_FROM_ASSIGN_TASK"]),
// 含有敏感信息的消息,自行补全提示文案 // 含有敏感信息的消息,自行补全提示文案
// 每30秒监测敏感信息 // 每30秒监测敏感信息
autoCompletionInterval() { autoCompletionInterval() {
if (!this.messageList.length) return; if (!this.messageList.length) return;
// console.log('in autoCompletionInterval');
// 将带有loading的消息转成失败的 // 将带有loading的消息转成失败的
this.messageList.forEach(item => { this.messageList.forEach(item => {
if (item.isShowLoadingIcon) { if (item.isShowLoadingIcon) {
...@@ -318,8 +309,7 @@ export default { ...@@ -318,8 +309,7 @@ export default {
item.isShowErrorIcon = true; item.isShowErrorIcon = true;
} }
}); });
let flag = false, let flag = false, msg;
msg;
for (let i = 0; i < this.messageList.length; i++) { for (let i = 0; i < this.messageList.length; i++) {
msg = this.messageList[i]; msg = this.messageList[i];
if (msg.isShowErrorIcon && !msg.isShowErrorMsg) { if (msg.isShowErrorIcon && !msg.isShowErrorMsg) {
...@@ -332,20 +322,25 @@ export default { ...@@ -332,20 +322,25 @@ export default {
} }
}, },
// 查询群组成员列表
getMembersList() {
this.GET("/im/team/member/list", {tid: this.tid}).then(res => {
if (res.code === "000000") {
this.teamMemberList = res.data;
this.getMSGHistory(); // 查询群聊历史消息
}
});
},
// 查询医生和居民的消息 - 向前查找 // 查询医生和居民的消息 - 向前查找
getMSGForwardForAC(msg) { getMSGForwardForAC(msg) {
let session = this.currentSession;
let params = { let params = {
doctorAccId: this.currentToAccId,
includeFlag: 0, includeFlag: 0,
lastClientIdServer: session.lastMsgIdClient,
lastMsgIdServer: session.lastMsgIdServer,
lastMsgTimestamp: msg.realTimestamp, lastMsgTimestamp: msg.realTimestamp,
limit: 50, limit: 50,
patientAccId: this.picakfAccId, tid: this.tid
unionId: ""
}; };
this.POST("/im/msg/forward", params).then(res => { this.POST("/im/team/message/forward", params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.contactForwardMessage(res.data, false); this.contactForwardMessage(res.data, false);
} }
...@@ -357,15 +352,16 @@ export default { ...@@ -357,15 +352,16 @@ export default {
return document.getElementById(elmId); return document.getElementById(elmId);
}, },
// 处理发送消息 /* 处理发送消息
// 1: 先将消息体直接显示在对话框中 1: 先将消息体直接显示在对话框中
// 2: 设置一个时间戳,以便再次找回 2: 设置一个时间戳,以便再次找回
// 3: 保存再次发送的数据 3: 保存再次发送的数据
// 4: 设置各种状态(1:isShowErrorIcon; 2:isShowLoadingIcon; 3:isShowErrorMsg) 4: 设置各种状态(1:isShowErrorIcon; 2:isShowLoadingIcon; 3:isShowErrorMsg)
*/
handleSendMsg(params, sendId) { handleSendMsg(params, sendId) {
let text = ""; let text = "";
let msg = Object.assign({}, params); let msg = Object.assign({}, params);
msg.fromAccount = this.currentToAccId; msg.fromAccount = this.tid;
msg.toAccount = this.picakfAccId; msg.toAccount = this.picakfAccId;
// type: 0, // 类型 0文本 1图片 2pdf 3链接 // type: 0, // 类型 0文本 1图片 2pdf 3链接
msg.text = params.info || ""; msg.text = params.info || "";
...@@ -382,14 +378,17 @@ export default { ...@@ -382,14 +378,17 @@ export default {
msg.isShowErrorIcon = false; msg.isShowErrorIcon = false;
msg.isShowErrorMsg = false; // 只有在下次拉取新数据时才有可能是为ture msg.isShowErrorMsg = false; // 只有在下次拉取新数据时才有可能是为ture
msg.extData = Object.assign({}, params); // 再将发送时的数据 msg.extData = Object.assign({}, params); // 再将发送时的数据
msg.sendId = sendId; // msg.sendId = sendId;
msg.sendOrReceive = true; msg.sendOrReceive = true;
msg.avatarImg = this.kfAvatar;
msg.timestampStr = new Date().format("hh:mm"); msg.timestampStr = new Date().format("hh:mm");
msg.realTimestamp = this.realTimestamp; msg.realTimestamp = this.realTimestamp;
msg.taskLogId = this.currentTaskLogId; msg.taskLogId = this.currentTaskLogId;
console.log("####msg####", msg);
// this.teamMemberList.forEach(item => {
if(this.picakfAccId = item.accId) {
msg.avatarImg = item.avatarImageUrl; // 运营头像
}
})
if(msg.type == 1) { if(msg.type == 1) {
this.imgSizeHandleNew(msg, msg.width, msg.height); this.imgSizeHandleNew(msg, msg.width, msg.height);
} }
...@@ -402,20 +401,14 @@ export default { ...@@ -402,20 +401,14 @@ export default {
// 查询医生和居民的消息历史(下拉刷新时调用) // 查询医生和居民的消息历史(下拉刷新时调用)
getOldMSGHistory() { getOldMSGHistory() {
console.log('this.hasNoHistoryData', this.hasNoHistoryData);
if(this.hasNoHistoryData) return; if(this.hasNoHistoryData) return;
let session = this.currentSession;
let params = { let params = {
doctorAccId: this.currentToAccId,
includeFlag: 0, // 不带本条消息 includeFlag: 0, // 不带本条消息
lastClientIdServer: session.lastMsgIdClient,
lastMsgIdServer: session.lastMsgIdServer,
lastMsgTimestamp: this.historyTimestamp, lastMsgTimestamp: this.historyTimestamp,
limit: 20, limit: 20,
patientAccId: this.picakfAccId, tid: this.tid
unionId: ""
}; };
this.POST("/im/msg/history", params).then(res => { this.POST("/im/team/message/history", params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
// 将新消息合并到之前的消息中, 并且重置最后一条消息 // 将新消息合并到之前的消息中, 并且重置最后一条消息
if(res.data && res.data.length > 0) { if(res.data && res.data.length > 0) {
...@@ -435,16 +428,11 @@ export default { ...@@ -435,16 +428,11 @@ export default {
// 查询医生和居民的消息历史(第一次进来时就调用) // 查询医生和居民的消息历史(第一次进来时就调用)
getMSGHistory(session) { getMSGHistory(session) {
let params = { let params = {
doctorAccId: this.currentToAccId,
includeFlag: 1, // 带本条消息 includeFlag: 1, // 带本条消息
lastClientIdServer: session.lastMsgIdClient,
lastMsgIdServer: session.lastMsgIdServer,
lastMsgTimestamp: session.lastMsgTime,
limit: 20, limit: 20,
patientAccId: this.picakfAccId, tid: this.tid
unionId: ""
}; };
this.POST("/im/msg/history", params).then(res => { this.POST("/im/team/message/history", params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.convertMessageList(res.data, 1); this.convertMessageList(res.data, 1);
} else { } else {
...@@ -459,23 +447,15 @@ export default { ...@@ -459,23 +447,15 @@ export default {
// 查询医生和居民的消息 - 向前查找 // 查询医生和居民的消息 - 向前查找
// 将获取消息列表插入到当前消息列表的最后 // 将获取消息列表插入到当前消息列表的最后
getMSGForward() { getMSGForward() {
let session = this.currentSession;
let params = { let params = {
doctorAccId: this.currentToAccId,
includeFlag: 0, includeFlag: 0,
lastClientIdServer: session.lastMsgIdClient,
lastMsgIdServer: session.lastMsgIdServer,
lastMsgTimestamp: this.realTimestamp, lastMsgTimestamp: this.realTimestamp,
limit: 20, limit: 20,
patientAccId: this.picakfAccId, tid: this.tid
unionId: ""
}; };
this.POST("/im/msg/forward", params).then(res => { this.POST("/im/team/message/forward", params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.convertMessageList(res.data, 2); this.convertMessageList(res.data, 2);
if (res.data.length) {
this.readAllMsg();
}
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
...@@ -485,12 +465,13 @@ export default { ...@@ -485,12 +465,13 @@ export default {
}); });
}, },
// 转换消息格式 /* 转换消息格式
// 处理的消息类型只有5种: 处理的消息类型只有5种:
// type == TEXT(showType:1) type == TEXT(showType:1)
// type == image 或 picture(showType:2) type == image 或 picture(showType:2)
// type == custom时,18: PDF文件(showType:3); 19: 链接信息(showType:4); 1 ~ 17: 不支持的消息类型(showType:5); type == custom时,18: PDF文件(showType:3); 19: 链接信息(showType:4); 1 ~ 17: 不支持的消息类型(showType:5);
// directFlag 1: 第一次取数据; 2: 拼接实时消息(push); 3: 拼接历史消息(unshift); directFlag 1: 第一次取数据; 2: 拼接实时消息(push); 3: 拼接历史消息(unshift);
*/
convertMessageList(messageList, directFlag = 1) { convertMessageList(messageList, directFlag = 1) {
messageList.sort((a, b) => { messageList.sort((a, b) => {
return a.timestamp - b.timestamp; return a.timestamp - b.timestamp;
...@@ -502,6 +483,7 @@ export default { ...@@ -502,6 +483,7 @@ export default {
showType = 1, showType = 1,
size = 0, size = 0,
url = "", url = "",
title = "",
cMessageList = []; cMessageList = [];
messageList.forEach((rawMsg, index) => { messageList.forEach((rawMsg, index) => {
text = ""; text = "";
...@@ -509,43 +491,64 @@ export default { ...@@ -509,43 +491,64 @@ export default {
showType = 1; showType = 1;
size = 0; size = 0;
url = ""; url = "";
title = "";
msg = Object.assign({}, rawMsg); msg = Object.assign({}, rawMsg);
msg.sendOrReceive = rawMsg.fromAccId !== this.currentToAccId; msg.sendOrReceive = rawMsg.fromAccId === this.picakfAccId; // 判断消息是显示在左边还是右边, true 右
msg.avatarImg = msg.sendOrReceive //msg.avatarImg = msg.sendOrReceive ? this.kfAvatar : this.currentSession.avatarImageUrl;
? this.kfAvatar for(let i = 0; i < this.teamMemberList.length; i++) {
: this.currentSession.avatarImageUrl; if(rawMsg.fromAccId == this.teamMemberList[i].accId) {
msg.avatarImg = this.teamMemberList[i].avatarImageUrl;
msg.name = this.teamMemberList[i].name;
break
}
}
if (msg.type.toLowerCase() == "custom") { if (msg.type.toLowerCase() == "custom") {
content = JSON.parse(msg.content); content = JSON.parse(msg.content);
text = content.content; text = content.content;
// 系统消息:消息由于违规未发送成功(可以不处理) if (content.bizType == -1) { // 系统消息:消息由于违规未发送成功(可以不处理)
if (content.bizType == -1) {
showType = -1; showType = -1;
text = content.content; text = content.content;
} else if (content.bizType == 18) { } else if (content.bizType == 18) { // PDF
showType = 3; showType = 3;
text = content.name; text = content.name;
size = content.size; size = content.size;
url = content.url; url = content.url;
} else if (content.bizType == 19) { } else if (content.bizType == 19) { // 链接
showType = 4; showType = 4;
text = content.content; text = content.content;
suffix = content.suffix; suffix = content.suffix;
} else { } else if(content.bizType == 22){ // 病例
showType = 7;
title = content.title;
text = JSON.parse(content.content);
} else if(content.bizType == 23) { // 预约时间
showType = 8;
title = content.title;
text = JSON.parse(content.content);
} else if(content.bizType == 24){ // 音视频与IM交互
showType = 9;
text = content.content;
} else if(content.bizType == 25){ // 本次问诊结束
showType = 10;
text = content.content;
}else {
showType = 5; showType = 5;
} }
} else if ( } else if( msg.type.toLowerCase() == "image" || msg.type.toLowerCase() == "picture") { // 图片
msg.type.toLowerCase() == "image" ||
msg.type.toLowerCase() == "picture"
) {
content = JSON.parse(msg.content); content = JSON.parse(msg.content);
url = content.url; url = content.url;
text = content.name; text = content.name;
showType = 2; showType = 2;
this.imgSizeHandleNew(msg, content.w, content.h); this.imgSizeHandleNew(msg, content.w, content.h);
}else if(msg.type.toLowerCase() == "audio") { // 语音
content = JSON.parse(msg.content);
url = content.url;
showType = 6
} else { } else {
showType = 1; showType = 1; // 文本
text = msg.content; text = msg.content;
} }
msg.title = title;
msg.text = text; msg.text = text;
msg.showType = showType; msg.showType = showType;
msg.suffix = suffix; msg.suffix = suffix;
...@@ -567,9 +570,7 @@ export default { ...@@ -567,9 +570,7 @@ export default {
scrollBoxDom.scrollTop = scrollBoxDom.scrollHeight; scrollBoxDom.scrollTop = scrollBoxDom.scrollHeight;
}); });
}, 100); }, 100);
this.currentContinueTimes = this.currentContinueTimes = this.sessionListData.currentTimestamp - this.currentSession.handleStartTime;
this.sessionListData.currentTimestamp -
this.currentSession.handleStartTime;
continueIntervalId && clearInterval(continueIntervalId); continueIntervalId && clearInterval(continueIntervalId);
continueIntervalId = setInterval(() => { continueIntervalId = setInterval(() => {
this.currentContinueTimes += 1000; this.currentContinueTimes += 1000;
...@@ -658,115 +659,6 @@ export default { ...@@ -658,115 +659,6 @@ export default {
window.open(item.url, "__blank"); window.open(item.url, "__blank");
}, },
// 获取会话列表
getSessionList() {
this.GET("/im/session/kf/list").then(res => {
if (res.code === "000000") {
this.sessionListData = res.data || {
currentTimestamp: 0,
myTaskCount: 0,
sessionList: [],
waitingTaskCount: 0
};
let sLength = this.sessionListData.sessionList.length;
let cIndex = sLength - 1;
// if (!this.isFromAssignTask) {
// this.SET_IS_FROM_ASSIGN_TASK(false);
// cIndex = 0;
// }
// 第一次进入页面
if (sLength && !this.currentTaskLogId) {
// this.currentSession = this.sessionListData.sessionList[0];
// this.currentSessionIndex = 0;
this.currentSession = this.sessionListData.sessionList[cIndex];
this.currentSessionIndex = cIndex;
this.sendText = cacheMap[this.currentSession.id];
this.currentTaskLogId = this.currentSession.taskLogId;
this.currentToAccId = this.currentSession.toAccId;
this.getDoctorInfo(this.currentToAccId);
this.getMSGHistory(this.currentSession);
this.readAllMsg();
// 如果是点击“再来一个”或“给我一个任务吧”按钮分配的任务,则要滚动到最后
// if (this.isFromAssignTask) {
// this.$nextTick(() => {
// let element = this.getElmByID("sessionListId");
// if (element) {
// element.scrollTop = element.scrollHeight;
// }
// });
// }
}
if (sLength) {
//this.convertSessions(this.sessionListData.sessionList);
this.$forceUpdate();
}
} else {
this.$message({
message: res.message,
type: "error"
});
}
});
},
// 将会话列表的数据进行处理,主要是显示文本(text)字段
// convertSessions(sessions) {
// let convertSessionList = [];
// let text = "",
// cc;
// sessions.forEach((session, index) => {
// if (session.lastMsgType.toLowerCase() == "custom") {
// cc = JSON.parse(session.lastMsgContent);
// text = cc.suffix || cc.content || cc.title || cc.name;
// } else if (
// session.lastMsgType.toLowerCase() == "image" ||
// session.lastMsgType.toLowerCase() == "picture"
// ) {
// text = "[图片]";
// } else {
// text = session.lastMsgContent;
// }
// session.text = text;
// convertSessionList.push(session);
// });
// this.sessionListData.sessionList = convertSessionList;
// },
// 根据云信id获取医生信息
getDoctorInfo(accId) {
this.GET(`/im/account/accid/doctorinfo?accId=${accId}`).then(res => {
if (res.code === "000000") {
this.doctorInfo = res.data || {};
} else {
this.$message({
message: res.message,
type: "error"
});
}
});
},
// 设置全部消息已读
readAllMsg() {
let fromAccount = this.currentToAccId,
toAccount = this.picakfAccId;
let params = {
fromAccount,
toAccount
};
this.POST(`/im/msg/read/all`, params).then(res => {
if (res.code === "000000") {
this.currentSession.unreadCount = 0;
} else {
this.$message({
message: res.message,
type: "error"
});
}
});
},
// 根据字段名及其值,从数组中查找对象 // 根据字段名及其值,从数组中查找对象
findItemByKeyAndVal(arr, key, value, flag = 0) { findItemByKeyAndVal(arr, key, value, flag = 0) {
if (flag == 0) { if (flag == 0) {
...@@ -879,7 +771,7 @@ export default { ...@@ -879,7 +771,7 @@ export default {
async sendCommonMsg(params) { async sendCommonMsg(params) {
let sendMsgParams = { let sendMsgParams = {
fromAccount: this.picakfAccId, fromAccount: this.picakfAccId,
toAccount: this.currentToAccId, toAccount: this.tid,
fileExt: "", // 文件扩展名称图片或PDF文件) fileExt: "", // 文件扩展名称图片或PDF文件)
fileSize: 0, // 文件大小(图片或PDF文件) fileSize: 0, // 文件大小(图片或PDF文件)
height: 0, // 图片高度(仅图片) height: 0, // 图片高度(仅图片)
...@@ -895,12 +787,10 @@ export default { ...@@ -895,12 +787,10 @@ export default {
forwardMsgIntervalId && clearInterval(forwardMsgIntervalId); forwardMsgIntervalId && clearInterval(forwardMsgIntervalId);
let sendId = new Date().getTime(); let sendId = new Date().getTime();
this.handleSendMsg(params, sendId); this.handleSendMsg(params, sendId);
// console.log("sendMsgParams", params); await this.POST("/im/team/op/message/send", params)
await this.POST("/im/msg/sendMessage", params)
.then(res => { .then(res => {
if (res.code === "000000") { if (res.code === "000000") {
// 校验结果:1校验通过 2校验不通过 // 校验结果:1校验通过 2校验不通过
// console.log(res.data.checkFlag);
let msg = this.messageList[this.messageList.length - 1]; let msg = this.messageList[this.messageList.length - 1];
if (msg.sendId !== sendId) { if (msg.sendId !== sendId) {
msg = this.getMsgBySendId(sendId); msg = this.getMsgBySendId(sendId);
...@@ -961,7 +851,6 @@ export default { ...@@ -961,7 +851,6 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
sessionIntervalId && clearInterval(sessionIntervalId);
forwardMsgIntervalId && clearInterval(forwardMsgIntervalId); forwardMsgIntervalId && clearInterval(forwardMsgIntervalId);
autoCompletionIntervalId && clearInterval(autoCompletionIntervalId); autoCompletionIntervalId && clearInterval(autoCompletionIntervalId);
} }
......
...@@ -73,12 +73,14 @@ ...@@ -73,12 +73,14 @@
<el-table-column prop="statusStr" label="问诊状态" min-width="80" align="left"></el-table-column> <el-table-column prop="statusStr" label="问诊状态" min-width="80" align="left"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="150"> <el-table-column label="操作" fixed="right" align="center" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 1 初始状态 2待咨询 3 咨询中 4已结束 -->
<div> <div>
<el-button type="primary" size="small" @click="timeHandle(scope.row)">预约时间</el-button> <el-button v-if="scope.row.status != 4" type="primary" size="small" @click="timeHandle(scope.row)">修改时间</el-button>
<el-button type="primary" size="small" @click="endDiagnosis(scope.row)">结束问诊</el-button> <el-button v-if="scope.row.status == 3" type="primary" size="small" @click="endDiagnosis(scope.row)">结束</el-button>
</div> </div>
<div style="margin-top: 10px;"> <div style="margin-top: 10px;">
<el-button type="primary" size="small" @click="callAll(scope.row)">呼叫双方</el-button> <el-button v-if="scope.row.status == 3 && scope.row.imStatus == 1" type="primary" size="small" @click="callAll(scope.row)">呼叫双方</el-button>
<el-button v-if="scope.row.status == 3 && scope.row.imStatus == 2" type="primary" size="small" @click="callAll(scope.row)">加入问诊</el-button>
<el-button type="primary" size="small" @click="sendMessage(scope.row)">发送消息</el-button> <el-button type="primary" size="small" @click="sendMessage(scope.row)">发送消息</el-button>
</div> </div>
</template> </template>
...@@ -281,12 +283,17 @@ export default { ...@@ -281,12 +283,17 @@ export default {
this.loading = false; this.loading = false;
if (res.code == "000000") { if (res.code == "000000") {
this.$message({ this.$message({
message: '预约成功', message: '修改预约时间成功',
type: "success" type: "success"
}); });
this.searchParam.tab = 1; this.searchParam.tab = 1;
this.timeVisible = false; this.timeVisible = false;
this.search(); this.search();
}else {
this.$message({
message: res.message,
type: "error"
})
} }
}); });
} }
...@@ -294,6 +301,11 @@ export default { ...@@ -294,6 +301,11 @@ export default {
}, },
// 结束问诊 // 结束问诊
endDiagnosis(row) { endDiagnosis(row) {
this.$confirm('确定结束问诊吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.POST(`/diagnose/admin/diagnose/end/${row.diagnoseLogId}`, '').then(res => { this.POST(`/diagnose/admin/diagnose/end/${row.diagnoseLogId}`, '').then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.$message({ this.$message({
...@@ -302,8 +314,14 @@ export default { ...@@ -302,8 +314,14 @@ export default {
}); });
this.searchParam.tab = 1; this.searchParam.tab = 1;
this.search(); this.search();
}else {
this.$message({
message: res.message,
type: "error"
})
} }
}); });
})
}, },
// 呼叫双方 // 呼叫双方
callAll() { callAll() {
...@@ -311,7 +329,7 @@ export default { ...@@ -311,7 +329,7 @@ export default {
}, },
// 发送消息 // 发送消息
sendMessage(row) { sendMessage(row) {
this.$router.push('/diagnosis-im') this.$router.push({path: '/diagnosis-im', query: {tid: row.imTeamId}})
}, },
// 选择 // 选择
selectBtn(row) { selectBtn(row) {
...@@ -323,6 +341,11 @@ export default { ...@@ -323,6 +341,11 @@ export default {
}); });
this.searchParam.tab = 1; this.searchParam.tab = 1;
this.search(); this.search();
}else {
this.$message({
message: res.message,
type: "error"
})
} }
}); });
this.activeName = 'first'; this.activeName = 'first';
......
...@@ -300,7 +300,6 @@ ...@@ -300,7 +300,6 @@
color: #B4B4B4; color: #B4B4B4;
} }
} }
} }
& > .time-box { & > .time-box {
width: 260px; width: 260px;
...@@ -324,8 +323,71 @@ ...@@ -324,8 +323,71 @@
color: #7C7C7C; color: #7C7C7C;
} }
} }
& > .suggession-box {
width: 260px;
text-align: left;
padding: 10px 15px;
background: #f0f1f2;
border-radius: 8px;
min-height: 80px;
.title {
padding-bottom: 10px;
font-size: 14px;
font-weight: 700;
}
.suggession-text {
font-size: 12px;
color: #7C7C7C;
.label {
color: #B4B4B4;
}
}
} }
& > .audio-box audio {
width: 242px;
height: 44px;
background: #EBF5FC;
border-radius: 20px;
}
& > .live-box {
width: 202px;
height: 44px;
line-height: 44px;
background: #f0f1f2;
border-radius: 8px;
text-align: center;
}
& > .diagnosis-end {
width: 100%;
.split-line {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
margin: 15px 0;
font-size: 14px;
color: #999999;
&::before {
flex: 1;
content: '';
height: 1px;
margin-right: 18px;
background: #f0f1f2;
}
&::after {
flex: 1;
content: '';
height: 1px;
margin-left: 18px;
background: #f0f1f2;
}
}
}
}
}
.msg-item-detail.line {
width: 100%;
} }
&.cr { &.cr {
flex-direction: row-reverse; flex-direction: row-reverse;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册