提交 bae4b941 编写于 作者: huangwensu's avatar huangwensu

添加默认修改时间

上级 405ed6ca
......@@ -390,35 +390,35 @@ export default {
this.teamMemberList.forEach(item => {
if(this.picakfAccId = item.accId) {
msg.avatarImg = item.avatarImageUrl; // 运营头像
msg.avatarImg = item.avatarImageUrl // 运营头像
}
})
if(msg.type == 1) {
this.imgSizeHandleNew(msg, msg.width, msg.height);
this.imgSizeHandleNew(msg, msg.width, msg.height)
}
this.messageList.push(msg);
this.messageList.push(msg)
this.$nextTick(() => {
var element = document.querySelector(".scroll-box");
element.scrollTop = element.scrollHeight;
var element = document.querySelector(".scroll-box")
element.scrollTop = element.scrollHeight
});
},
// 查询医生和居民的消息历史(下拉刷新时调用)
getOldMSGHistory() {
if(this.hasNoHistoryData) return;
if(this.hasNoHistoryData) return
let params = {
includeFlag: 0, // 不带本条消息
lastMsgTimestamp: this.historyTimestamp,
limit: 20,
tid: this.tid
};
}
this.POST("/im/team/message/history", params).then(res => {
if (res.code === "000000") {
// 将新消息合并到之前的消息中, 并且重置最后一条消息
if(res.data && res.data.length > 0) {
this.convertMessageList(res.data, 3);
this.convertMessageList(res.data, 3)
} else {
this.hasNoHistoryData = true;
this.hasNoHistoryData = true
}
} else {
this.$message({
......@@ -438,7 +438,7 @@ export default {
};
this.POST("/im/team/message/history", params).then(res => {
if (res.code === "000000") {
this.convertMessageList(res.data, 1);
this.convertMessageList(res.data, 1)
} else {
this.$message({
message: res.message,
......@@ -459,7 +459,7 @@ export default {
};
this.POST("/im/team/message/forward", params).then(res => {
if (res.code === "000000") {
this.convertMessageList(res.data, 2);
this.convertMessageList(res.data, 2)
} else {
this.$message({
message: res.message,
......@@ -479,7 +479,7 @@ export default {
convertMessageList(messageList, directFlag = 1) {
messageList.sort((a, b) => {
return a.timestamp - b.timestamp;
});
})
let msg = null,
content = null,
text = "",
......@@ -567,51 +567,51 @@ export default {
});
if (directFlag === 1) {
this.messageList = [];
this.$forceUpdate();
forwardMsgIntervalId && clearInterval(forwardMsgIntervalId);
this.messageList = cMessageList;
this.$forceUpdate();
this.messageList = []
this.$forceUpdate()
forwardMsgIntervalId && clearInterval(forwardMsgIntervalId)
this.messageList = cMessageList
this.$forceUpdate()
setTimeout(() => {
this.$nextTick(() => {
const scrollBoxDom = document.querySelector(".scroll-box");
scrollBoxDom.scrollTop = scrollBoxDom.scrollHeight;
const scrollBoxDom = document.querySelector(".scroll-box")
scrollBoxDom.scrollTop = scrollBoxDom.scrollHeight
});
}, 100);
this.currentContinueTimes = this.sessionListData.currentTimestamp - this.currentSession.handleStartTime;
continueIntervalId && clearInterval(continueIntervalId);
this.currentContinueTimes = this.sessionListData.currentTimestamp - this.currentSession.handleStartTime
continueIntervalId && clearInterval(continueIntervalId)
continueIntervalId = setInterval(() => {
this.currentContinueTimes += 1000;
this.currentContinueTimes += 1000
}, 1000);
// 最新消息,要合并CUSTOM类型中,bizType是-1的数据(系统消息)
} else if (directFlag === 2) {
this.contactForwardMessage(cMessageList);
this.contactForwardMessage(cMessageList)
} else {
if (cMessageList.length) {
this.messageList.unshift(...cMessageList);
this.messageList.unshift(...cMessageList)
this.$nextTick(() => {
const scrollBoxDom = document.querySelector(".scroll-box");
scrollBoxDom.scrollTop = 1000;
const scrollBoxDom = document.querySelector(".scroll-box")
scrollBoxDom.scrollTop = 1000
});
}
}
// 重新设置历史与实时的时间戳
if (this.messageList.length) {
this.historyTimestamp = this.messageList[0].timestamp;
let timestamp = this.messageList[this.messageList.length - 1].timestamp;
this.historyTimestamp = this.messageList[0].timestamp
let timestamp = this.messageList[this.messageList.length - 1].timestamp
if (timestamp) {
this.realTimestamp = timestamp;
this.realTimestamp = timestamp
}
}
// 自己发送消息时,暂时不刷新消息
if (directFlag == 1) {
forwardMsgIntervalId = setInterval(() => {
this.getMSGForward();
}, 3000);
this.getMSGForward()
}, 3000)
}
this.$forceUpdate();
this.$forceUpdate()
},
// 接接数据
......@@ -787,12 +787,12 @@ export default {
remark: "", // 其他信息(链接中的前缀文案)
type: 0, // 类型 0文本 1图片 2pdf 3链接
url: "" // url地址(图片、pdf,链接)
};
params = Object.assign(sendMsgParams, params);
}
params = Object.assign(sendMsgParams, params)
// 将获取新数据的定时器关闭
forwardMsgIntervalId && clearInterval(forwardMsgIntervalId);
let sendId = new Date().getTime();
this.handleSendMsg(params, sendId);
forwardMsgIntervalId && clearInterval(forwardMsgIntervalId)
let sendId = new Date().getTime()
this.handleSendMsg(params, sendId)
await this.POST("/im/team/op/message/send", params)
.then(res => {
if (res.code === "000000") {
......@@ -802,15 +802,20 @@ export default {
msg = this.getMsgBySendId(sendId);
}
if (res.data.checkFlag == 1) {
this.realTimestamp = res.data.timetag;
msg.isShowLoadingIcon = false;
msg.isShowErrorIcon = false;
msg.isShowErrorMsg = false; // 只有在下次拉取新数据时才有可能是为ture
this.realTimestamp = res.data.timetag
this.teamMemberList.forEach((item, index) => {
if(params.fromAccount == item.accId) {
msg.name = item.name
}
})
msg.isShowLoadingIcon = false
msg.isShowErrorIcon = false
msg.isShowErrorMsg = false // 只有在下次拉取新数据时才有可能是为ture
} else {
msg.signature = res.data.signature;
msg.isShowLoadingIcon = false;
msg.isShowErrorIcon = true;
msg.isShowErrorMsg = false; // 只有在下次拉取新数据时才有可能是为ture
msg.signature = res.data.signature
msg.isShowLoadingIcon = false
msg.isShowErrorIcon = true
msg.isShowErrorMsg = false // 只有在下次拉取新数据时才有可能是为ture
}
} else {
this.$message({
......@@ -820,20 +825,20 @@ export default {
}
})
.catch(error => {
let msg = this.messageList[this.messageList.length - 1];
let msg = this.messageList[this.messageList.length - 1]
if (msg.sendId !== sendId) {
msg = this.getMsgBySendId(sendId);
msg = this.getMsgBySendId(sendId)
}
msg.isShowLoadingIcon = false;
msg.isShowErrorIcon = true;
msg.isShowErrorMsg = false; // 只有在下次拉取新数据时才有可能是为ture
msg.canRepeatSend = true;
msg.isShowLoadingIcon = false
msg.isShowErrorIcon = true
msg.isShowErrorMsg = false // 只有在下次拉取新数据时才有可能是为ture
msg.canRepeatSend = true
});
this.$forceUpdate();
this.$forceUpdate()
// 重新开启定时器
forwardMsgIntervalId = setInterval(() => {
this.getMSGForward();
}, 3000);
this.getMSGForward()
}, 3000)
},
// 根据sendId,查找到对应的消息
......
......@@ -285,6 +285,8 @@ export default {
timeHandle(row) {
this.timeVisible = true
this.timeForm.diagnoseLogId = row.diagnoseLogId
this.timeForm.beginTime = row.appointBeginTime
this.timeForm.endTime = row.appointEndTime
},
confirmTime() {
this.$refs.timeForm.validate((valid) => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册