Commit 238fbc45 by pangchong

fix: 事件聊天记录时间顺序

parent 6551c8b2
......@@ -24,7 +24,7 @@
</div>
<div class="overflow-y-auto" v-if="details?.total">
<template v-if="active == 0">
<template v-for="item in details.list" :key="item._id">
<template v-for="item in getChatList" :key="item._id">
<div class="flex-center mb-4" v-if="item.fileType == 'txt'">
<div class="flex-center flex-col shadow-lg rounded bg-fill-bg2 p-4">
<div>{{ item.content }}</div>
......@@ -77,7 +77,7 @@
</template>
<script setup lang="ts">
import { IconLeft, IconPlayCircle, IconDownload } from '@arco-design/web-vue/es/icon'
import { IconLeft, IconDownload } from '@arco-design/web-vue/es/icon'
import { eventDetailsColumns1, eventDetailsColumns2 } from './constants/data.config'
import { timeStampFormat } from '@/utils/dataTypes/dateRelated/formatDate'
import { directlyDownloadFromURL } from '@/utils/downloadData/downloadBlob'
......@@ -104,6 +104,10 @@ const showList = () => {
es('showList')
active.value = 0
}
//获取事件聊天记录
const getChatList = computed(() => {
return ps.details?.list.sort((a, b) => a.createdTime - b.createdTime) || []
})
//获取表格列名称
const getEventDetailsColumns = computed(() => {
if (active.value == 1 || active.value == 2) {
......@@ -115,13 +119,13 @@ const getEventDetailsColumns = computed(() => {
//获取表格数据
const getEventDetailsData = computed(() => {
if (active.value == 1) {
return ps.details?.list.filter((item) => item.fileType == 'image')
return getChatList.value.filter((item) => item.fileType == 'image')
}
if (active.value == 2) {
return ps.details?.list.filter((item) => item.fileType == 'file')
return getChatList.value.filter((item) => item.fileType == 'file')
}
if (active.value == 3) {
return ps.details?.list.filter((item) => item.fileType == 'video')
return getChatList.value.filter((item) => item.fileType == 'video')
}
return []
})
......
<template>
<div class="g-block ml-4">
<div class="flex justify-between items-center mb-4 px-4">
<a-typography-paragraph editable v-model:editText="videoTitle">
{{ videoTitle }}
</a-typography-paragraph>
<div class="flex justify-end items-center mb-4 px-4">
<a-space size="medium">
<div class="tool py-[9px] bg-fill-bg1">
<global-icon icon="view-gallery" :size="12"></global-icon>
......@@ -44,8 +41,6 @@ const userVideoContainerSet = computed(function () {
inCenter: inCenterUserVideoId.value
}
})
const videoTitle = ref('2024-02-17 10:22:23远程协助事件')
</script>
<style lang="less" scoped>
:deep(.arco-typography-operation-edit) {
......
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