提交 cb39b7d2 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-phase1-0111' of...

Merge branch 'dev-phase1-0111' of 192.168.110.53:com.pica.cloud.education.frontend/pica-admin-IM into dev-phase1-0111

* 'dev-phase1-0111' of 192.168.110.53:com.pica.cloud.education.frontend/pica-admin-IM:
  去掉时间查询消息
  页面优化处理
  页面优化
  群发内容限制个数
<template>
<div class="chain-history-detail">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :jumPathThird="jumPathThird"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="title">群发标题:<span>{{detailData.title}}</span></div>
<div class="user-list">目标用户:<span @click="downFile">{{detailData.fileName}}</span></div>
......@@ -40,6 +40,7 @@ export default {
},
data() {
return {
jumPathThird: '/chain-history-list',
curmbFirst: "历史群发",
curmbSecond: "任务详情",
detailData: {
......
......@@ -9,7 +9,7 @@
<el-input clearable v-model="searchParam.title" size="mini" maxlength="20" placeholder="请输入群发标题" style="width: 300px;"></el-input>
</el-form-item>
<el-form-item label="目标用户">
<el-input clearable v-model="excelfileName" size="mini" placeholder="请上传目标用户" style="width: 300px;"></el-input>
<el-input clearable v-model="excelfileName" readonly size="mini" placeholder="请上传目标用户" style="width: 300px;"></el-input>
<el-upload
class="upload-demo"
accept=".xlsx"
......@@ -38,11 +38,11 @@
maxlength="499"
show-word-limit
placeholder="请输入文本信息"
style="width: 300px;"></el-input>
style="width: 600px;"></el-input>
</div>
<div class="file-content" v-if="item.type == 1 || item.type == 2">
<p>文件信息<i class="el-icon-error" @click="deleteFile(item,index)"></i></p>
<el-input v-model="item.info" size="mini" placeholder="请上传文件信息" style="width: 300px;"></el-input>
<el-input v-model="item.info" readonly size="mini" placeholder="请上传文件信息" style="width: 300px;"></el-input>
<el-upload
class="upload-demo"
action="#"
......@@ -89,6 +89,7 @@
import BreadCrumb from "@/components/breadcrumb.vue";
import { doUpload, getFilePath } from "@/utils/qiniu-util";
import { openLoading, closeLoading, isEmptyUtils } from "@/utils/utils";
import { getPicaKFAccid, getPhomeDemain } from "@/utils";
import * as commonUtil from "@/utils/utils";
export default {
components: {
......@@ -149,7 +150,7 @@ export default {
},
// 添加文本
addText() {
if(this.searchParam.contentModelList.length < 6) {
if(this.searchParam.contentModelList.length < 5) {
this.searchParam.contentModelList.push({
type: 0, // 0 文本 1图片 2PDF 3链接
info: ''
......@@ -167,8 +168,7 @@ export default {
},
// 添加文件
addFile() {
if(this.searchParam.contentModelList.length < 6) {
if(this.searchParam.contentModelList.length < 5) {
this.searchParam.contentModelList.push({
type: 1,
info: '',
......@@ -225,7 +225,7 @@ export default {
},
// 添加链接
addLink() {
if(this.searchParam.contentModelList.length < 6) {
if(this.searchParam.contentModelList.length < 5) {
this.searchParam.contentModelList.push({
type: 3,
info: '',
......@@ -265,7 +265,7 @@ export default {
if(req.contentModelList[i].type == 3) {
this.linkList.forEach((element, index) => {
if(element.title == req.contentModelList[i].info) {
req.contentModelList[i].url = element.linkUrl;
req.contentModelList[i].url = getPhomeDemain() + `/template_v2/?id=${element.id}`;
}
});
}
......@@ -277,7 +277,7 @@ export default {
});
return
}
if(isEmptyUtils(req.fileModel)) {
if(isEmptyUtils(req.fileModel.base64)) {
this.$message({
message: '请上传人员名单',
type: 'warning'
......@@ -302,25 +302,30 @@ export default {
}
}
}
this.POST("/im/group/messages", req).then(res => {
this.loading = false;
if(res.code == '000000') {
if (res.data.status == 1) {
this.searchParam.title = "";
this.searchParam.fileModel = {};
this.searchParam.contentModelList = [];
this.excelfileName = '';
}else {
this.$message({
message: res.data.message,
type: 'error'
});
this.$confirm('点击“确定”,将开始执行群发任务,请务必确认内容无误', '群发确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.POST("/im/group/messages", req).then(res => {
this.loading = false;
if(res.code == '000000') {
if (res.data.status == 1) {
this.searchParam.title = "";
this.searchParam.fileModel = {};
this.searchParam.contentModelList = [];
this.excelfileName = '';
}else {
this.$message({
message: res.data.message,
type: 'error'
});
}
}
}
});
});
})
}
}
}
};
</script>
<style lang="scss">
......@@ -329,6 +334,7 @@ export default {
margin: 20px 20px 0;
padding: 10px;
background: #fff;
overflow: auto;
.search-title {
display: flex;
flex-direction: row;
......
<template>
<!-- v-infinite-scroll="getDeatailData(0)" getHistoryData(0)-->
<div class="search-msg-detail">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :jumPathThird="jumPathThird"></bread-crumb>
<div class="detail-content">
<div id="scroll-set">
<div v-for="(item, index) in detailData" :key="index">
<div class="item-content" v-for="(item, index) in detailData" :key="index">
<div class="split-line" v-if="item.sessionFlag">本次会话结束</div>
<div v-if="item.content.bizType != -1" class="msg-container" :class="{'has-line': !item.sessionFlag}">
<div class="msg-item-img">
......@@ -37,7 +36,7 @@
</div>
</div>
<div v-if="item.content.bizType == 19" class="link-content">
<div class="link-text">{{item.content.content}}</div>
<div>{{item.content.content}}<span class="link-text">{{item.content.suffix}}</span></div>
</div>
<div v-if="item.content.bizType != -1 && item.content.bizType != 19 && item.content.bizType != 18" class="text-content pc-no-support">
<img src="../../../assets/image/IM/icon-warning-circle.png" alt />
......@@ -62,7 +61,7 @@ export default {
},
data() {
return {
hasSearchDate: false,
// hasSearchDate: false,
jumPathThird: '/search-message-list',
curmbFirst:'消息查询',
curmbSecond:'消息详情',
......@@ -81,26 +80,28 @@ export default {
};
},
created() {
this.hasSearchDate = this.$route.query.hasSearchDate;
this.lastMsgTime = this.$route.query.msgTimestamp;
// this.hasSearchDate = this.$route.query.hasSearchDate;
this.historyTime = this.$route.query.msgTimestamp;
this.doctorAccId = this.$route.query.doctorAccId;
this.userAvatar = this.$route.query.avatarImageUrl;
this.userName = this.$route.query.userName;
this.picakfAccId = getPicaKFAccid();
},
mounted() {
this.getDeatailData(1);
// this.getDeatailData(1);
this.getHistoryData(1);
let _this = this;
setTimeout(() => {
let el = _this.getElmByID('scroll-set');
// _this.containerHeight = _this.getElmByID('slidebar-container').getBoundingClientRect().height - 15;
_this.containerHeight = document.body.clientHeight - 80;
_this.getElmByID('scroll-set').style.height = _this.containerHeight - 152 + "px";
if(_this.hasSearchDate) { // 有查询日期 滚动条最顶部
el.scrollTop = 10;
}else { // 没有查询日期 滚动条最底部
el.scrollTop = el.scrollHeight;
}
// if(_this.hasSearchDate) { // 有查询日期 滚动条最顶部
// el.scrollTop = 10;
// }else { // 没有查询日期 滚动条最底部
// el.scrollTop = el.scrollHeight;
// }
el.scrollTop = el.scrollHeight;
let flag = true, timeoutId = null, downflag = true, downtimeoutId = null;
el.addEventListener('scroll', function() {
let allH, sh;
......@@ -116,66 +117,17 @@ export default {
}, 150)
}
}
if((sh - allH < 1) && _this.hasForwardData && _this.hasSearchDate) {
if(downflag) {
downflag = false;
downtimeoutId && clearTimeout(downtimeoutId);
downtimeoutId = setTimeout( () => {
_this.getDeatailData(0);
downflag = true;
}, 150)
}
}
// if((sh - allH < 1) && _this.hasForwardData) {
// if(downflag) {
// downflag = false;
// downtimeoutId && clearTimeout(downtimeoutId);
// downtimeoutId = setTimeout( () => {
// _this.getDeatailData(0);
// downflag = true;
// }, 150)
// }
// }
})
// if(_this.hasSearchDate) { // 有查询日期 滚动条最顶部
// el.scrollTop = 10;
// let flag = true, timeoutId = null;
// el.addEventListener('scroll', function() {
// let allH, sh;
// allH = el.scrollTop + el.clientHeight;
// sh = el.scrollHeight;
// if(el.scrollTop < 1 && _this.hasHistoryData) {
// if(flag) {
// flag = false;
// timeoutId && clearTimeout(timeoutId);
// timeoutId = setTimeout( () => {
// _this.getHistoryData(0);
// flag = true;
// }, 150)
// }
// }
// if((sh - allH < 1) && _this.hasForwardData) {
// if(flag) {
// flag = false;
// timeoutId && clearTimeout(timeoutId);
// timeoutId = setTimeout( () => {
// _this.getDeatailData(0);
// flag = true;
// }, 150)
// }
// }
// })
// }else { // 没有查询日期 滚动条最底部
// el.scrollTop = el.scrollHeight;
// let flag = true, timeoutId = null;
// el.addEventListener('scroll', function() {
// if(el.scrollTop < 1 && _this.hasHistoryData) {
// if(flag) {
// flag = false;
// timeoutId && clearTimeout(timeoutId);
// timeoutId = setTimeout( () => {
// _this.getHistoryData(0);
// flag = true;
// }, 150)
// }
// }
// })
// }
},100);
},
methods: {
......@@ -184,37 +136,31 @@ export default {
return document.getElementById(elmId);
},
// 获取详情数据以及下拉加载历史数据
getDeatailData(param) { // 最新的时间在最后面
let url = '/im/msg/forward';
let req = {
doctorAccId: this.doctorAccId,
includeFlag: param, // 第一次加载是1 上翻历史是0
lastMsgTimestamp: this.lastMsgTime,
limit: 20,
patientAccId: this.picakfAccId,
unionId: ""
}
this.POST(url, req).then((res) => {
if(res.code == '000000') {
let arr = [];
if(res.data.length > 0) {
this.hasForwardData = true;
this.historyTime = res.data[0].timestamp;
this.lastMsgTime = res.data[res.data.length - 1].timestamp;
arr = this.dataconcatHandle(res.data);
this.detailData.push(...arr);
}else {
this.hasForwardData = false;
}
// if(this.hasSearchDate) { // 查询条件不包含日期
// this.$nextTick(() => {
// var element = document.querySelector(".scroll-box");
// element.scrollTop = element.scrollHeight;
// });
// }
}
})
},
// getDeatailData(param) { // 最新的时间在最后面
// let url = '/im/msg/forward';
// let req = {
// doctorAccId: this.doctorAccId,
// includeFlag: param, // 第一次加载是1 上翻历史是0
// lastMsgTimestamp: this.lastMsgTime,
// limit: 20,
// patientAccId: this.picakfAccId,
// unionId: ""
// }
// this.POST(url, req).then((res) => {
// if(res.code == '000000') {
// let arr = [];
// if(res.data.length > 0) {
// this.hasForwardData = true;
// this.historyTime = res.data[0].timestamp;
// this.lastMsgTime = res.data[res.data.length - 1].timestamp;
// arr = this.dataconcatHandle(res.data);
// this.detailData.push(...arr);
// }else {
// this.hasForwardData = false;
// }
// }
// })
// },
// 上翻查看最新消息
getHistoryData(param) { // 最新的时间在最前面
let url = '/im/msg/history';
......@@ -399,7 +345,9 @@ export default {
}
.link-content {
padding: 16px 0;
color: #2f86f6;
.link-text {
color: #2f86f6;
}
}
}
}
......@@ -415,5 +363,8 @@ export default {
#scroll-set::-webkit-scrollbar-thumb {
background-color: #F0F1F2 !important;
}
#scroll-set:last-child .msg-container {
border-bottom: 1px solid #F0F1F2;
}
}
</style>
\ No newline at end of file
......@@ -88,7 +88,7 @@ export default {
totalRows: 0,
tableData: [],
loading: false,
hasSearchDate: false // 查询条件不包含日期
// hasSearchDate: false // 查询条件不包含日期
};
},
computed: {},
......@@ -131,7 +131,7 @@ export default {
// 查看消息详情
edit(row) {
if(this.searchParam.chooseDate) this.hasSearchDate = true;
// if(this.searchParam.chooseDate) this.hasSearchDate = true;
this.$router.push({
path: `/search-message-detail`,
query: {
......@@ -139,7 +139,7 @@ export default {
doctorAccId: row.accId,
userName: row.userName,
avatarImageUrl: row.avatarImageUrl,
hasSearchDate: this.hasSearchDate
// hasSearchDate: this.hasSearchDate
}
});
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册