|
@@ -33,12 +33,24 @@
|
|
|
</a-row>
|
|
|
<a-row>
|
|
|
<div class="container">
|
|
|
- <a-table :columns="columns" :data-source="data" bordered>
|
|
|
- <template #name="{ text }">
|
|
|
- <a>{{ text }}</a>
|
|
|
+ <a-table
|
|
|
+ align="center"
|
|
|
+ :columns="columns"
|
|
|
+ :data-source="msgList"
|
|
|
+ :pagination="pagination"
|
|
|
+ bordered
|
|
|
+ >
|
|
|
+ <template #bodyCell="{ column, text }">
|
|
|
+ <template v-if="column.dataIndex === 'firstInRoomTime'">
|
|
|
+ {{ dayjs(text).format('YYYY-MM-DD HH:mm') }}
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'lastOutRoomTime'">
|
|
|
+ {{ dayjs(text).format('YYYY-MM-DD HH:mm') }}
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'texts'">
|
|
|
+ {{ text.join(';') }}
|
|
|
+ </template>
|
|
|
</template>
|
|
|
- <!-- <template #title>Header</template>
|
|
|
- <template #footer>Footer</template> -->
|
|
|
</a-table>
|
|
|
</div>
|
|
|
</a-row>
|
|
@@ -48,6 +60,23 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { computed, onMounted, UnwrapRef, reactive } from 'vue'
|
|
|
import { TableColumnProps } from 'ant-design-vue'
|
|
|
+import { useStatisticStore } from '@/store/modules/statistic'
|
|
|
+import dayjs from 'dayjs'
|
|
|
+
|
|
|
+const statisticStore = useStatisticStore()
|
|
|
+
|
|
|
+const msgList = computed(() => statisticStore.roomMsg.list)
|
|
|
+
|
|
|
+const pagination = reactive({
|
|
|
+ current: 1,
|
|
|
+ total: statisticStore.roomMsg.total,
|
|
|
+ pageSize: 20, //每页中显示10条数据
|
|
|
+ showSizeChanger: true,
|
|
|
+ pageSizeOptions: ['10', '20', '50', '100'], //每页中显示的数据
|
|
|
+ showTotal: (total: string) => `共有 ${total} 条数据` //分页中显示总的数据
|
|
|
+})
|
|
|
+
|
|
|
+console.log('msgList', msgList)
|
|
|
|
|
|
interface FormState {
|
|
|
roomTitle: string
|
|
@@ -58,10 +87,6 @@ const formState: UnwrapRef<FormState> = reactive({
|
|
|
userTime: []
|
|
|
})
|
|
|
const columns: TableColumnProps[] = [
|
|
|
- // {
|
|
|
- // title: '房间id',
|
|
|
- // dataIndex: 'roomId'
|
|
|
- // },
|
|
|
{
|
|
|
title: '昵称',
|
|
|
dataIndex: 'nickName'
|
|
@@ -69,7 +94,7 @@ const columns: TableColumnProps[] = [
|
|
|
{
|
|
|
title: '手机号',
|
|
|
// className: 'column-money',
|
|
|
- dataIndex: 'phone'
|
|
|
+ dataIndex: 'phoneNumber'
|
|
|
},
|
|
|
{
|
|
|
title: '房间名称',
|
|
@@ -77,74 +102,48 @@ const columns: TableColumnProps[] = [
|
|
|
},
|
|
|
{
|
|
|
title: '时长/分',
|
|
|
- dataIndex: 'onlineDuration'
|
|
|
+ dataIndex: 'onlineTime',
|
|
|
+ width: 120
|
|
|
},
|
|
|
{
|
|
|
title: '初次进入房间',
|
|
|
- dataIndex: 'firstEnterRoomTime'
|
|
|
+ dataIndex: 'firstInRoomTime',
|
|
|
+ width: 200
|
|
|
},
|
|
|
{
|
|
|
title: '最后离开房间',
|
|
|
- dataIndex: 'lastLeaveRoomTime'
|
|
|
+ dataIndex: 'lastOutRoomTime',
|
|
|
+ width: 200
|
|
|
},
|
|
|
{
|
|
|
title: '数量',
|
|
|
- dataIndex: 'messageCount'
|
|
|
+ dataIndex: 'textCount',
|
|
|
+ width: 80
|
|
|
},
|
|
|
{
|
|
|
title: '留言内容',
|
|
|
- dataIndex: 'messageContents'
|
|
|
+ dataIndex: 'texts',
|
|
|
+ width: 140
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-const data = [
|
|
|
- {
|
|
|
- key: '1',
|
|
|
- nickName: '测试房间',
|
|
|
- phone: '1388888522',
|
|
|
- roomTitle: '测试房间',
|
|
|
- onlineDuration: 1212121212,
|
|
|
- firstEnterRoomTime: '2023-02-14 23:20',
|
|
|
- lastLeaveRoomTime: '2023-02-14 23:20',
|
|
|
- messageCount: 1010,
|
|
|
- messageContents: 'dddjjdjd'
|
|
|
- },
|
|
|
- {
|
|
|
- key: '2',
|
|
|
- nickName: '测试房间',
|
|
|
- phone: '1388888522',
|
|
|
- roomTitle: '测试房间',
|
|
|
- onlineDuration: 1212121212,
|
|
|
- firstEnterRoomTime: '2023-02-14 23:20',
|
|
|
- lastLeaveRoomTime: '2023-02-14 23:20',
|
|
|
- messageCount: 1010,
|
|
|
- messageContents: 'dddjjdjd'
|
|
|
- },
|
|
|
- {
|
|
|
- key: '3',
|
|
|
- nickName: '测试房间',
|
|
|
- phone: '1388888522',
|
|
|
- roomTitle: '测试房间',
|
|
|
- onlineDuration: 1212121212,
|
|
|
- firstEnterRoomTime: '2023-02-14 23:20',
|
|
|
- lastLeaveRoomTime: '2023-02-14 23:20',
|
|
|
- messageCount: 1010,
|
|
|
- messageContents: 'dddjjdjd'
|
|
|
- },
|
|
|
- {
|
|
|
- key: '4',
|
|
|
- nickName: '测试房间',
|
|
|
- phone: '1388888522',
|
|
|
- roomTitle: '测试房间',
|
|
|
- onlineDuration: 1212121212,
|
|
|
- firstEnterRoomTime: '2023-02-14 23:20',
|
|
|
- lastLeaveRoomTime: '2023-02-14 23:20',
|
|
|
- messageCount: 1010,
|
|
|
- messageContents: 'dddjjdjd'
|
|
|
- }
|
|
|
-]
|
|
|
-
|
|
|
-const handleFinish = () => {}
|
|
|
+onMounted(async () => {
|
|
|
+ await statisticStore.fetchRoomMsglist({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 1000,
|
|
|
+ startTime: '',
|
|
|
+ endTime: ''
|
|
|
+ })
|
|
|
+})
|
|
|
+const handleFinish = () => {
|
|
|
+ statisticStore.fetchRoomMsglist({
|
|
|
+ startTime: formState.userTime[0],
|
|
|
+ endTime: formState.userTime[1],
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ roomTitle: formState.roomTitle
|
|
|
+ })
|
|
|
+}
|
|
|
const handleFinishFailed = () => {}
|
|
|
</script>
|
|
|
<style lang="less">
|