dashboardMsgList.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <script>
  2. export default {
  3. data() {
  4. return {
  5. contentWidth: '60%'
  6. }
  7. },
  8. props: {
  9. data: Array
  10. },
  11. mounted() {
  12. let width = this.$refs.dashboardMsgList.$el.clientWidth
  13. this.contentWidth = width * 0.7 + 'px'
  14. },
  15. methods: {}
  16. }
  17. </script>
  18. <template>
  19. <a-list class="dashboardMsgList" item-layout="horizontal" :data-source="data" :split="false" ref="dashboardMsgList">
  20. <a-list-item slot="renderItem" slot-scope="item, index">
  21. <a-row style="width: 100%" justify="start">
  22. <div style="width: 100%">
  23. <span v-if="item.isRead">【已阅】</span>
  24. <span v-else>【待阅】</span>
  25. <span class="msg-warn" v-if="item.type==1" style="color: #5495F1">①</span>
  26. <span class="msg-warn" v-else-if="item.type==2" style="color: #3BC5B0">②</span>
  27. <span class="msg-warn" v-else-if="item.type==3" style="color: #F1934E">③</span>
  28. <span class="msg-warn" v-else ></span>
  29. <span class="msg-content-span" >{{ item.msg }}</span>
  30. </div>
  31. <!--<a-col :span="6">-->
  32. <!-- <span v-if="item.isRead">【已阅】</span>-->
  33. <!-- <span v-else>【待阅】</span>-->
  34. <!-- <span v-if="item.type==1" style="color: #5495F1">①</span>-->
  35. <!-- <span v-else-if="item.type==2" style="color: #3BC5B0">②</span>-->
  36. <!-- <span v-else-if="item.type==3" style="color: #F1934E">③</span>-->
  37. <!--</a-col>-->
  38. <!--&lt;!&ndash;<a-col :span="1">&ndash;&gt;-->
  39. <!--&lt;!&ndash; <span v-if="item.type==1" style="color: #5495F1">①</span>&ndash;&gt;-->
  40. <!--&lt;!&ndash; <span v-else-if="item.type==2" style="color: #3BC5B0">②</span>&ndash;&gt;-->
  41. <!--&lt;!&ndash; <span v-else-if="item.type==3" style="color: #F1934E">③</span>&ndash;&gt;-->
  42. <!--&lt;!&ndash;</a-col>&ndash;&gt;-->
  43. <!--<a-col :span="17">-->
  44. <!-- <div class="msg-content" :style="{width: contentWidth}">-->
  45. <!--</div>-->
  46. <!--</a-col>-->
  47. </a-row>
  48. <!--<div class="msg-read">-->
  49. <!-- -->
  50. <!--</div>-->
  51. <!--<div class="msg-type">-->
  52. <!-- <span v-if="item.type==1" style="color: #5495F1">①</span>-->
  53. <!-- <span v-else-if="item.type==2" style="color: #3BC5B0">②</span>-->
  54. <!-- <span v-else-if="item.type==3" style="color: #F1934E">③</span>-->
  55. <!--</div>-->
  56. </a-list-item>
  57. </a-list>
  58. </template>
  59. <style lang="less" scoped>
  60. .dashboardMsgList {
  61. .ant-list-item {
  62. padding: 0 !important;
  63. line-height: 30px;
  64. width: 100%;
  65. }
  66. .msg-read {
  67. display: inline-block;
  68. width: 120px !important;
  69. flex-direction: row;
  70. }
  71. .msg-type {
  72. display: inline-block;
  73. width: 20px;
  74. flex-direction: row;
  75. text-align: left;
  76. }
  77. .msg-warn {
  78. display: inline-block;
  79. width: 20px;
  80. text-align: left;
  81. }
  82. .msg-content-span {
  83. display: inline-block;
  84. width: 70%;
  85. vertical-align: top;
  86. overflow: hidden;
  87. text-overflow: ellipsis;
  88. white-space: nowrap;
  89. }
  90. }
  91. </style>