Commit 633dea5c authored by yaya's avatar yaya

feat: 历史消息数据展示优化

parent a0ce4755
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<el-button size="mini" class="filter-item" @click="handleReset">重置</el-button> <el-button size="mini" class="filter-item" @click="handleReset">重置</el-button>
<el-main style="background-color: rgb(238, 241, 246); padding: 0; border: 1px solid #eee"> <el-main style="background-color: rgb(238, 241, 246); padding: 0; border: 1px solid #eee">
<div class="chat-message"> <div class="chat-message">
<div class="chat-message-list" style="overflow:auto"> <div v-if="messageList && messageList.length > 0" class="chat-message-list" style="overflow:auto">
<div <div
v-if="isHasNextPage" v-if="isHasNextPage"
class="chat-message-list__more" class="chat-message-list__more"
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
</ul> </ul>
<div class="hash" /> <div class="hash" />
</div> </div>
<div v-else class="chat-message-empty">暂无记录</div>
</div> </div>
</el-main> </el-main>
...@@ -109,7 +110,7 @@ export default { ...@@ -109,7 +110,7 @@ export default {
findHistoryRecord(params).then(response => { findHistoryRecord(params).then(response => {
if (response && response.data && response.data.data && response.data.data.dataList) { if (response && response.data && response.data.data && response.data.data.dataList) {
this.isHasNextPage = response.data.data.isHasNextPage this.isHasNextPage = response.data.data.isHasNextPage
const list = [] let list = []
response.data.data.dataList.map((item) => { response.data.data.dataList.map((item) => {
const messageItem = { const messageItem = {
id: item.msgKey, id: item.msgKey,
...@@ -122,6 +123,7 @@ export default { ...@@ -122,6 +123,7 @@ export default {
} }
list.push(messageItem) list.push(messageItem)
}) })
list = list.reverse()
if (this.listQuery.page === 1) { if (this.listQuery.page === 1) {
this.messageList = list this.messageList = list
this.scrollToBottom(true) this.scrollToBottom(true)
...@@ -201,6 +203,19 @@ export default { ...@@ -201,6 +203,19 @@ export default {
} }
} }
} }
.chat-message-empty {
height: 100%;
width: 100%;
font-size: 20px;
font-family: PingFangSC-Semibold, PingFang SC;
color: #989CA8;
line-height: 40px;
text-align: center;
justify-self: center;
display: flex;
justify-content: center;
align-items: center;
}
.chat-message-input { .chat-message-input {
border: 1px solid #DCDFE6; border: 1px solid #DCDFE6;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment