room.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div id="room">
  3. <el-col :span="24" class="leftTop"> <span>|</span> <span>消息管理</span> </el-col>
  4. <el-table :data="list" border stripe :show-header="false" @row-click="toChat">
  5. <el-table-column prop="buyer_name" align="center"></el-table-column>
  6. <el-table-column align="center">
  7. <template v-slot="{ row }">
  8. <template v-if="row.needRead == 0">
  9. 暂无未读消息
  10. </template>
  11. <template v-if="row.needRead > 0">
  12. <span style="color:red">您有{{ row.needRead }}条未读消息 </span>
  13. </template>
  14. </template>
  15. </el-table-column>
  16. </el-table>
  17. </div>
  18. </template>
  19. <script>
  20. import { mapState, createNamespacedHelpers } from 'vuex';
  21. export default {
  22. name: 'room',
  23. props: {
  24. list: { type: Array, default: () => [] },
  25. },
  26. components: {},
  27. data: () => {
  28. return {};
  29. },
  30. created() {},
  31. methods: {
  32. toChat(row) {
  33. this.$emit('toChat', row);
  34. },
  35. },
  36. computed: {
  37. ...mapState(['user']),
  38. pageTitle() {
  39. return `${this.$route.meta.title}`;
  40. },
  41. },
  42. metaInfo() {
  43. return { title: this.$route.meta.title };
  44. },
  45. };
  46. </script>
  47. <style lang="less" scoped>
  48. /deep/.el-table {
  49. width: 95%;
  50. margin: 20px;
  51. }
  52. .leftTop {
  53. font-size: 18px;
  54. width: 96%;
  55. height: 41px;
  56. line-height: 35px;
  57. border-bottom: 1px solid #e5e5e5;
  58. position: relative;
  59. bottom: 1px;
  60. margin: 10px;
  61. font-weight: 600;
  62. color: #22529a;
  63. }
  64. </style>