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

样式及bug修改

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