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

样式及bug修改

上级 8969437d
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<div class="icon"> <div class="icon">
<img src="../../assets/image/IM/icon-org.png" alt /> <img src="../../assets/image/IM/icon-org.png" alt />
</div> </div>
<span class="desc">{{userInfo.hospitalName}}</span> <span class="desc">{{userInfo.hospitalName ? userInfo.hospitalName : '无机构'}}</span>
</article> </article>
</section> </section>
<section class="qt-wrapper"> <section class="qt-wrapper">
......
...@@ -234,16 +234,30 @@ html,body{ ...@@ -234,16 +234,30 @@ html,body{
} }
.current-session-wrap { .current-session-wrap {
.c-bottom .el-input__inner { // .c-bottom .el-input__inner {
height: 44px; // height: 44px;
line-height: 44px; // line-height: 44px;
padding-right: 100px; // padding-right: 100px;
} // }
.el-input.is-active .el-input__inner, // .el-input.is-active .el-input__inner,
.el-input__inner:focus { // .el-input__inner:focus {
border-color: #eff5f7; // border-color: #eff5f7;
} // }
.link-form .el-form-item { // .link-form .el-form-item {
margin-bottom: 15px; // margin-bottom: 15px;
} // }
.c-bottom .el-textarea__inner {
height: 44px;
line-height: 22px;
padding-right: 100px;
resize: none;
}
.el-input.is-active .el-textarea__inner,
.el-textarea__inner:focus {
border-color: #eff5f7;
}
.link-form .el-form-item {
margin-bottom: 15px;
}
} }
\ No newline at end of file
...@@ -255,10 +255,16 @@ ...@@ -255,10 +255,16 @@
} }
} }
.c-bottom { .c-bottom {
position: relative;
top: 0;
left: 0;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin: 16px 12px 16px 25px; margin: 16px 12px 16px 25px;
.cb-icon-wrapper { .cb-icon-wrapper {
position: absolute;
top: 0;
right: 70px;
display: flex; display: flex;
align-items: center; align-items: center;
height: 44px; height: 44px;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<ul class="session-list" :style="{'height': containerHeight + 'px'}"> <ul class="session-list" :style="{'height': containerHeight + 'px'}">
<li <li
class="item" class="item"
:class="{'current': currentTaskLogId == session.id}" :class="{'current': currentTaskLogId == session.taskLogId}"
v-for="(session, index) in sessionListData.sessionList" v-for="(session, index) in sessionListData.sessionList"
:key="index" :key="index"
@click="selectSession(session, index)" @click="selectSession(session, index)"
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<span>{{session.text}}</span> <span>{{session.text}}</span>
<!-- <span>{{session.lastMsgContent}}</span> --> <!-- <span>{{session.lastMsgContent}}</span> -->
<span <span
v-show="session.status !=3 && currentTaskLogId != session.id && session.unreadCount" v-show="session.status !=3 && currentTaskLogId != session.taskLogId && session.unreadCount"
class="num" class="num"
>{{session.unreadCount}}</span> >{{session.unreadCount}}</span>
<img <img
...@@ -93,20 +93,19 @@ ...@@ -93,20 +93,19 @@
</article> </article>
</section> </section>
<section class="c-bottom"> <section class="c-bottom">
<el-input placeholder="请输入内容" v-model="sendText"> <el-input type="textarea" placeholder="请输入内容" v-model="sendText"></el-input>
<div slot="suffix" class="cb-icon-wrapper"> <div class="cb-icon-wrapper">
<el-upload <el-upload
class="bg-uploader" class="bg-uploader"
action="#" action="#"
accept=".jpg, .png, .pdf" accept=".jpg, .png, .pdf"
:show-file-list="false" :show-file-list="false"
:before-upload="beforeUploadFile" :before-upload="beforeUploadFile"
> >
<img src="../../../assets/image/IM/icon-folder-open.png" alt /> <img src="../../../assets/image/IM/icon-folder-open.png" alt />
</el-upload> </el-upload>
<img src="../../../assets/image/IM/icon-link.png" @click="preSendLinkMsg" alt /> <img src="../../../assets/image/IM/icon-link.png" @click="preSendLinkMsg" alt />
</div> </div>
</el-input>
<div class="send-btn" :class="{'active': canSend}" @click="sendTextMsg"> <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-yes.png" alt />
<img v-show="!canSend" src="../../../assets/image/IM/send-no.png" alt /> <img v-show="!canSend" src="../../../assets/image/IM/send-no.png" alt />
...@@ -166,6 +165,7 @@ ...@@ -166,6 +165,7 @@
</div> </div>
</template> </template>
<script> <script>
// import { mapGetters } 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 { validateWord } from "@/utils/validate.js"; import { validateWord } from "@/utils/validate.js";
...@@ -176,8 +176,11 @@ import UserInfo from "@/components/IM/user-info.vue"; ...@@ -176,8 +176,11 @@ import UserInfo from "@/components/IM/user-info.vue";
const CONTAINER_HEIGHT = 700; const CONTAINER_HEIGHT = 700;
let forwardMsgIntervalId = null; let forwardMsgIntervalId = null;
let sessionIntervalId = null; let sessionIntervalId = null;
let currentTimestamp = 0;
let currentContinueTimes = 0;
let continueIntervalId = null;
let vm = null; let _this = null;
export default { export default {
components: { components: {
BreadCrumb, BreadCrumb,
...@@ -187,6 +190,7 @@ export default { ...@@ -187,6 +190,7 @@ export default {
return { return {
curmbFirst: "云鹊客服", curmbFirst: "云鹊客服",
curmbSecond: "当前会话", curmbSecond: "当前会话",
// currentTimestamp: 0,
sendText: "", sendText: "",
sessionListData: { sessionListData: {
myTaskCount: 0, myTaskCount: 0,
...@@ -223,36 +227,47 @@ export default { ...@@ -223,36 +227,47 @@ export default {
}, },
computed: { computed: {
// ...mapGetters(['stickerCacheMap']),
canSend() { canSend() {
return !!this.sendText; return !!this.sendText;
} }
}, },
created() { created() {
_this = this;
this.picakfAccId = getPicaKFAccid(); this.picakfAccId = getPicaKFAccid();
this.kfAvatar = require("../../../assets/image/IM/kf-avatar.png"); this.kfAvatar = require("../../../assets/image/IM/kf-avatar.png");
this.getSessionList(); this.getSessionList();
sessionIntervalId && clearInterval(sessionIntervalId); sessionIntervalId && clearInterval(sessionIntervalId);
sessionIntervalId = setInterval( () => { sessionIntervalId = setInterval(() => {
this.getSessionList(); this.getSessionList();
}, 10000) }, 10000);
this.getFiveContentList(); this.getFiveContentList();
document.onkeydown = function(ev) {
var event = ev || event;
if (event.keyCode == 13) {
_this.sendTextMsg();
event.preventDefault();
}
};
}, },
mounted: function() { mounted: function() {
let _this = this;
(function(window) { (function(window) {
var _element = document.querySelector(".scroll-box"), var _element = document.querySelector(".scroll-box"),
_refreshText = document.querySelector(".refreshText"), _refreshText = document.querySelector(".refreshText"),
_startPos = 0, _startPos = 0,
_transitionHeight = 0, _transitionHeight = 0,
_isMousedown = false; _isMousedown = false,
_canRefresh = false;
_element.addEventListener( _element.addEventListener(
"mousedown", "mousedown",
function(e) { function(e) {
var event = e || window.event; var event = e || window.event;
_isMousedown = true; _isMousedown = true;
_canRefresh = false;
console.log("##########", event); console.log("##########", event);
console.log("初始位置:", event.pageX); console.log("初始位置:", event.pageX);
_startPos = event.pageX; _startPos = event.pageX;
...@@ -272,6 +287,7 @@ export default { ...@@ -272,6 +287,7 @@ export default {
console.log("当前位置:", event.pageX); console.log("当前位置:", event.pageX);
_transitionHeight = event.pageX - _startPos; _transitionHeight = event.pageX - _startPos;
if (_transitionHeight > 0 && _transitionHeight < 40) { if (_transitionHeight > 0 && _transitionHeight < 40) {
_canRefresh = true;
// _refreshText.innerText = "下拉刷新"; // _refreshText.innerText = "下拉刷新";
_refreshText.innerText = ""; _refreshText.innerText = "";
_element.style.transform = _element.style.transform =
...@@ -293,8 +309,10 @@ export default { ...@@ -293,8 +309,10 @@ export default {
_element.style.transform = "translateY(0px)"; _element.style.transform = "translateY(0px)";
// _refreshText.innerText = "更新中"; // _refreshText.innerText = "更新中";
_refreshText.innerText = ""; _refreshText.innerText = "";
// todo... if (_canRefresh) {
_this.getOldMSGHistory(); _canRefresh = false;
_this.getOldMSGHistory();
}
}, },
false false
); );
...@@ -328,7 +346,7 @@ export default { ...@@ -328,7 +346,7 @@ export default {
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
...@@ -352,7 +370,7 @@ export default { ...@@ -352,7 +370,7 @@ export default {
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
...@@ -379,7 +397,7 @@ export default { ...@@ -379,7 +397,7 @@ export default {
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
...@@ -449,6 +467,10 @@ export default { ...@@ -449,6 +467,10 @@ export default {
if (directFlag === 1) { if (directFlag === 1) {
this.messageList = cMessageList; this.messageList = cMessageList;
this.$nextTick( () => {
const scrollBoxDom = document.querySelector('.scroll-box')
scrollBoxDom.scrollTop = 200000;
});
} else if (directFlag === 2) { } else if (directFlag === 2) {
this.messageList.push(...cMessageList); this.messageList.push(...cMessageList);
} else { } else {
...@@ -463,24 +485,25 @@ export default { ...@@ -463,24 +485,25 @@ export default {
].timestamp; ].timestamp;
} }
if(directFlag == 1) { if (directFlag == 1) {
forwardMsgIntervalId && clearInterval(forwardMsgIntervalId); forwardMsgIntervalId && clearInterval(forwardMsgIntervalId);
forwardMsgIntervalId = setInterval(() => { forwardMsgIntervalId = setInterval(() => {
this.getMSGForward(); this.getMSGForward();
}, 10000); }, 10000);
} }
console.log("this.messageList", this.messageList); console.log("this.messageList", this.messageList);
}, },
// 选择一个会话 // 选择一个会话
selectSession(session, index) { selectSession(session, index) {
// 点击当前的,不再重新请求数据
if (this.currentTaskLogId == session.taskLogId) return;
console.log("selectSession"); console.log("selectSession");
this.currentTaskLogId = session.id; this.currentTaskLogId = session.taskLogId;
this.currentToAccId = session.toAccId; this.currentToAccId = session.toAccId;
this.currentSession = session; this.currentSession = session;
this.currentSessionIndex = index; this.currentSessionIndex = index;
// 获取当前消息列表(最新的历史消息) // 获取当前消息列表(最新的历史消息)
// TODO
this.getMSGHistory(this.currentSession); this.getMSGHistory(this.currentSession);
// 获取医生信息 // 获取医生信息
this.getDoctorInfo(this.currentToAccId); this.getDoctorInfo(this.currentToAccId);
...@@ -499,11 +522,12 @@ export default { ...@@ -499,11 +522,12 @@ export default {
fetchOneTask() { fetchOneTask() {
this.GET("/im/session/kf/fetchOneTask").then(res => { this.GET("/im/session/kf/fetchOneTask").then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.currentTaskLogId = "";
this.getSessionList(); this.getSessionList();
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
...@@ -521,10 +545,12 @@ export default { ...@@ -521,10 +545,12 @@ export default {
}; };
let sLength = this.sessionListData.sessionList.length; let sLength = this.sessionListData.sessionList.length;
// 第一次进入页面 // 第一次进入页面
if (!this.currentTaskLogId) { if (sLength && !this.currentTaskLogId) {
this.currentSession = this.sessionListData.sessionList[0]; // this.currentSession = this.sessionListData.sessionList[0];
this.currentSessionIndex = 0; // this.currentSessionIndex = 0;
this.currentTaskLogId = this.currentSession.id; this.currentSession = this.sessionListData.sessionList[sLength - 1];
this.currentSessionIndex = sLength - 1;
this.currentTaskLogId = this.currentSession.taskLogId;
this.currentToAccId = this.currentSession.toAccId; this.currentToAccId = this.currentSession.toAccId;
this.getDoctorInfo(this.currentToAccId); this.getDoctorInfo(this.currentToAccId);
this.getMSGHistory(this.currentSession); this.getMSGHistory(this.currentSession);
...@@ -537,7 +563,7 @@ export default { ...@@ -537,7 +563,7 @@ export default {
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
...@@ -585,7 +611,7 @@ export default { ...@@ -585,7 +611,7 @@ export default {
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
...@@ -599,13 +625,14 @@ export default { ...@@ -599,13 +625,14 @@ export default {
this.POST(`/im/session/kf/closeOneTask`, params).then(res => { this.POST(`/im/session/kf/closeOneTask`, params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
console.log("in closeOneTask", res); console.log("in closeOneTask", res);
if(res.data == 1) { if (res.data == 1) {
this.currentTaskLogId = "";
this.getSessionList(); this.getSessionList();
} }
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
...@@ -614,7 +641,7 @@ export default { ...@@ -614,7 +641,7 @@ export default {
// 设置全部消息已读 // 设置全部消息已读
readAllMsg() { readAllMsg() {
let fromAccount = this.currentToAccId, let fromAccount = this.currentToAccId,
toAccount = this.picakfAccId; toAccount = this.picakfAccId;
let params = { let params = {
fromAccount, fromAccount,
toAccount toAccount
...@@ -632,7 +659,7 @@ export default { ...@@ -632,7 +659,7 @@ export default {
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
...@@ -662,7 +689,7 @@ export default { ...@@ -662,7 +689,7 @@ export default {
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
...@@ -670,10 +697,9 @@ export default { ...@@ -670,10 +697,9 @@ export default {
// 上传文件 // 上传文件
beforeUploadFile(file) { beforeUploadFile(file) {
let vm = this;
console.log("file", file); console.log("file", file);
doUpload( doUpload(
vm, _this,
file, file,
getFilePath(file, null), getFilePath(file, null),
"preview4", "preview4",
...@@ -696,13 +722,13 @@ export default { ...@@ -696,13 +722,13 @@ export default {
let image = new Image(); let image = new Image();
image.src = params.url; image.src = params.url;
image.onload = function() { image.onload = function() {
let _this = this; let _img = this;
params.width = _this.width; params.width = _img.width;
params.height = _this.height; params.height = _img.height;
vm.sendCommonMsg(params); _this.sendCommonMsg(params);
}; };
} else { } else {
vm.sendCommonMsg(params); _this.sendCommonMsg(params);
} }
}); });
}, },
...@@ -762,7 +788,7 @@ export default { ...@@ -762,7 +788,7 @@ export default {
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: "warning" type: "error"
}); });
} }
}); });
......
...@@ -3,13 +3,17 @@ ...@@ -3,13 +3,17 @@
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb> <bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet"> <div class="component-content screenSet" id="screenSet">
<div class="search-title"> <div class="search-title">
<p>当前共有<span class="num">{{tableData.length}}</span>用户正在等待</p> <p>当前共有<span class="num">{{total}}</span>用户正在等待</p>
<el-button type="primary" size="small" @click="getNextSession()">给我一个任务吧</el-button> <el-button type="primary" size="small" @click="getNextSession()">给我一个任务吧</el-button>
</div> </div>
<el-table :data="tableData" style="width: 100%" v-loading="loading"> <el-table :data="tableData" style="width: 100%" v-loading="loading">
<el-table-column prop="userName" label="用户名" min-width="50" align="center"></el-table-column> <el-table-column prop="userName" label="用户名" min-width="50" align="center"></el-table-column>
<el-table-column prop="waitTime" label="等待时间" min-width="100" align="center"></el-table-column> <el-table-column prop="waitTime" label="等待时间" min-width="100" align="center"></el-table-column>
<el-table-column prop="idType" label="用户类型" min-width="50" align="center"></el-table-column> <el-table-column prop="idType" label="用户类型" min-width="50" align="center">
<template slot-scope="scope">
<span>{{scope.row.idType | typeFilter}}</span>
</template>
</el-table-column>
<el-table-column prop="certStatus" label="认证状况" min-width="100" align="center"></el-table-column> <el-table-column prop="certStatus" label="认证状况" min-width="100" align="center"></el-table-column>
<el-table-column prop="hospitalName" label="所属机构" min-width="50" align="center"></el-table-column> <el-table-column prop="hospitalName" label="所属机构" min-width="50" align="center"></el-table-column>
<div slot="empty"> <div slot="empty">
...@@ -40,13 +44,22 @@ export default { ...@@ -40,13 +44,22 @@ export default {
curmbFirst: "云鹊客服", curmbFirst: "云鹊客服",
curmbSecond: "等待会话", curmbSecond: "等待会话",
tableData: [], tableData: [],
total: 0,
loading: false, loading: false,
}; };
}, },
computed: { computed: {
}, },
filters: { filters: {
typeFilter(index) {
let str = "";
if (index == 1) {
str = "医生";
} else if (index == 2) {
str = "居民";
}
return str;
}
}, },
created() { created() {
this.getListData(); this.getListData();
...@@ -67,10 +80,11 @@ export default { ...@@ -67,10 +80,11 @@ export default {
this.loading = false; this.loading = false;
if( res.code === '000000') { if( res.code === '000000') {
this.tableData = res.data.list || []; this.tableData = res.data.list || [];
this.total = res.data.total;
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: 'warning' type: 'error'
}); });
} }
}) })
...@@ -84,7 +98,7 @@ export default { ...@@ -84,7 +98,7 @@ export default {
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
type: 'warning' type: 'error'
}); });
} }
}) })
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册