|
@@ -10,7 +10,7 @@
|
|
<el-image :src="leftIcon"></el-image>
|
|
<el-image :src="leftIcon"></el-image>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="22" class="info">
|
|
<el-col :span="22" class="info">
|
|
- <el-col :span="24" class="name">{{ item.sender_name }}</el-col>
|
|
|
|
|
|
+ <el-col :span="24" class="name">{{ item.sender_name }}[{{ getTime(item) }}]</el-col>
|
|
<el-col :span="24" class="content">
|
|
<el-col :span="24" class="content">
|
|
{{ item.content }}
|
|
{{ item.content }}
|
|
</el-col>
|
|
</el-col>
|
|
@@ -20,7 +20,7 @@
|
|
<template v-else>
|
|
<template v-else>
|
|
<el-col :span="24" class="left right">
|
|
<el-col :span="24" class="left right">
|
|
<el-col :span="22" class="info">
|
|
<el-col :span="22" class="info">
|
|
- <el-col :span="24" class="name">{{ item.sender_name }}</el-col>
|
|
|
|
|
|
+ <el-col :span="24" class="name">[{{ getTime(item) }}]{{ item.sender_name }}</el-col>
|
|
<el-col :span="24" class="content">
|
|
<el-col :span="24" class="content">
|
|
{{ item.content }}
|
|
{{ item.content }}
|
|
</el-col>
|
|
</el-col>
|
|
@@ -50,6 +50,7 @@ import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions: clientApply } = createNamespacedHelpers('clientApply');
|
|
const { mapActions: clientApply } = createNamespacedHelpers('clientApply');
|
|
const { mapActions: mapChat } = createNamespacedHelpers('chat');
|
|
const { mapActions: mapChat } = createNamespacedHelpers('chat');
|
|
const { mapActions: chatRecord } = createNamespacedHelpers('chatRecord');
|
|
const { mapActions: chatRecord } = createNamespacedHelpers('chatRecord');
|
|
|
|
+const moment = require('moment');
|
|
export default {
|
|
export default {
|
|
name: 'chat',
|
|
name: 'chat',
|
|
props: {
|
|
props: {
|
|
@@ -137,6 +138,12 @@ export default {
|
|
container.scrollTop = container.scrollHeight;
|
|
container.scrollTop = container.scrollHeight;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 整理时间
|
|
|
|
+ getTime(item) {
|
|
|
|
+ const ct = _.get(item.meta, 'createdAt');
|
|
|
|
+ if (!ct) return;
|
|
|
|
+ return moment(ct).format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|