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