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

高度问题等

上级 7344ca1b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.component-content { .component-content {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
min-height: 600px; // min-height: 600px;
min-width: 1200px; min-width: 1200px;
font-size: 14px; font-size: 14px;
.left { .left {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<span @click="fetchOneTask">再来一个</span> <span @click="fetchOneTask">再来一个</span>
</div> </div>
<p class="c-num">当前等待会话:{{this.sessionListData.waitingTaskCount}}</p> <p class="c-num">当前等待会话:{{this.sessionListData.waitingTaskCount}}</p>
<ul class="session-list" :style="{'height': containerHeight + 'px'}"> <ul id="sessionListId" class="session-list" :style="{'height': containerHeight + 'px'}">
<li <li
class="item" class="item"
:class="{'current': currentTaskLogId == session.taskLogId}" :class="{'current': currentTaskLogId == session.taskLogId}"
...@@ -51,7 +51,11 @@ ...@@ -51,7 +51,11 @@
<!-- <span class="close-btn">结束会话</span> --> <!-- <span class="close-btn">结束会话</span> -->
</section> </section>
<p class="refreshText"></p> <p class="refreshText"></p>
<section class="msg-content scroll-box" :style="{'height': (containerHeight - 35) + 'px'}"> <section
id="msgContentId"
class="msg-content scroll-box"
:style="{'height': (containerHeight - 35) + 'px'}"
>
<article <article
v-for="(item, index) in messageList" v-for="(item, index) in messageList"
:key="index" :key="index"
...@@ -199,8 +203,8 @@ import { ...@@ -199,8 +203,8 @@ import {
import * as commonUtil from "@/utils/utils"; import * as commonUtil from "@/utils/utils";
import { getPicaKFAccid, getPhomeDemain } from "@/utils"; import { getPicaKFAccid, getPhomeDemain } from "@/utils";
import UserInfo from "@/components/IM/user-info.vue"; import UserInfo from "@/components/IM/user-info.vue";
const CONTAINER_HEIGHT = 300; // const CONTAINER_HEIGHT = 300;
// const CONTAINER_HEIGHT = 700; const CONTAINER_HEIGHT = 700;
let forwardMsgIntervalId = null; let forwardMsgIntervalId = null;
let sessionIntervalId = null; let sessionIntervalId = null;
let continueIntervalId = null; let continueIntervalId = null;
...@@ -285,10 +289,10 @@ export default { ...@@ -285,10 +289,10 @@ export default {
// 监听消息列表的变化,添加sessionFlag(会话结束标志) // 监听消息列表的变化,添加sessionFlag(会话结束标志)
messageList: { messageList: {
handler(newMsgList) { handler(newMsgList) {
let l = newMsgList.length; let l = newMsgList.length;
if(l >= 2) { if (l >= 2) {
for(let i = 1; i < l; i ++) { for (let i = 1; i < l; i++) {
if(newMsgList[i-1].taskLogId !== newMsgList[i].taskLogId) { if (newMsgList[i - 1].taskLogId !== newMsgList[i].taskLogId) {
newMsgList[i].sessionFlag = true; newMsgList[i].sessionFlag = true;
} }
} }
...@@ -300,6 +304,15 @@ export default { ...@@ -300,6 +304,15 @@ export default {
mounted() { mounted() {
// this.resizeHeight(); // this.resizeHeight();
this.$nextTick(() => {
_this.containerHeight =
_this.p_getElm('slidebar-container').getBoundingClientRect().height - 15;
_this.p_getElm('screenSet').style.height =
_this.containerHeight - 152 + "px";
console.log('_this.containerHeight', _this.containerHeight);
_this.p_getElm("sessionListId").style.height = "1000px";
_this.p_getElm("msgContentId").style.height = "965px";
});
}, },
methods: { methods: {
...@@ -314,9 +327,9 @@ export default { ...@@ -314,9 +327,9 @@ export default {
_this.p_getElm(refHeightId).getBoundingClientRect().height - 15; _this.p_getElm(refHeightId).getBoundingClientRect().height - 15;
_this.p_getElm(containerHeightId).style.height = _this.p_getElm(containerHeightId).style.height =
_this.containerHeight - cMinusHeight + "px"; _this.containerHeight - cMinusHeight + "px";
console.log('containerHeight', _this.containerHeight); console.log("containerHeight", _this.containerHeight);
window.onresize = function() { window.onresize = function() {
console.log('containerHeight2', _this.containerHeight); console.log("containerHeight2", _this.containerHeight);
_this.containerHeight = _this.containerHeight =
_this.p_getElm(refHeightId).getBoundingClientRect().height - 15; _this.p_getElm(refHeightId).getBoundingClientRect().height - 15;
_this.p_getElm(containerHeightId).style.height = _this.p_getElm(containerHeightId).style.height =
...@@ -324,8 +337,8 @@ export default { ...@@ -324,8 +337,8 @@ export default {
}; };
}, },
p_getElm(elmId){ p_getElm(elmId) {
return document.getElementById(elmId) return document.getElementById(elmId);
}, },
// 处理发送消息 // 处理发送消息
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册