notice.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div id="notice">
  3. <el-row>
  4. <el-col :span="24" class="notice">
  5. <el-col :span="24" class="topTit">
  6. <el-col :span="20">
  7. <span :style="`border-color:${borderColor}`">最新公告</span>
  8. </el-col>
  9. <el-col :span="4">
  10. <el-link :underline="false" :style="`color:${Color}`" @click="$router.push({ path: `/info/list/${notice.column.id}` })">
  11. MORE<i class="el-icon-video-play"></i>
  12. </el-link>
  13. </el-col>
  14. </el-col>
  15. <el-col :span="24" class="noticeMain">
  16. <el-col
  17. :span="24"
  18. class="noticeList"
  19. v-for="(item, index) in notice.infoList"
  20. :key="index"
  21. :name="`${index}`"
  22. @click.native="$router.push({ path: `/info/detail?id=${item.id}` })"
  23. >
  24. <el-col :span="4" class="time">
  25. {{ item.publish_time | getDate }}
  26. </el-col>
  27. <el-col :span="20" class="title">
  28. <el-link :underline="false">
  29. <p class="textOver">{{ item.title }}</p>
  30. </el-link>
  31. </el-col>
  32. </el-col>
  33. </el-col>
  34. </el-col>
  35. </el-row>
  36. </div>
  37. </template>
  38. <script>
  39. export default {
  40. name: 'notice',
  41. props: {
  42. notice: null,
  43. },
  44. components: {},
  45. data: () => ({
  46. borderColor: '#850000',
  47. Color: '#850000',
  48. }),
  49. created() {},
  50. computed: {},
  51. methods: {},
  52. filters: {
  53. getDate(date) {
  54. let arr = date.split('-');
  55. return `${arr[1]}-${arr[2]}`;
  56. },
  57. },
  58. };
  59. </script>
  60. <style lang="less" scoped>
  61. p {
  62. margin: 0;
  63. padding: 0;
  64. }
  65. .textOver {
  66. overflow: hidden;
  67. text-overflow: ellipsis;
  68. white-space: nowrap;
  69. }
  70. .notice {
  71. padding: 10px;
  72. }
  73. .topTit {
  74. border-bottom: 1px solid #ccc;
  75. }
  76. .topTit span {
  77. display: inline-block;
  78. height: 30px;
  79. border-bottom: 1px solid transparent;
  80. }
  81. .noticeList {
  82. padding: 7px 0;
  83. border-bottom: 1px dashed #ccc;
  84. }
  85. .noticeList .time {
  86. height: 38px;
  87. line-height: 38px;
  88. text-align: center;
  89. background: #850000;
  90. color: #fff;
  91. font-size: 18px;
  92. }
  93. .noticeList .title p {
  94. width: 290px;
  95. padding: 10px;
  96. }
  97. </style>