jbft.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div id="jbft">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-col :span="24" class="list" v-for="(item, index) in list" :key="index" @click.native="detailBtn(item)">
  6. <el-col :span="19" class="textOver title">
  7. {{ item.title }}
  8. </el-col>
  9. <el-col :span="5" class="date">
  10. {{ item.publish_time }}
  11. </el-col>
  12. <el-col :span="24" class="textOver orgin">
  13. 来源:<span>{{ item.orgin }} </span>
  14. </el-col>
  15. <el-col :span="24" class="titlejj">
  16. 简介:<span>{{ item.titlejj }}</span>
  17. </el-col>
  18. </el-col>
  19. </el-col>
  20. </el-row>
  21. </div>
  22. </template>
  23. <script>
  24. import { mapState, createNamespacedHelpers } from 'vuex';
  25. const { mapActions: newsguidance } = createNamespacedHelpers('newsguidance');
  26. export default {
  27. name: 'jbft',
  28. props: {},
  29. components: {},
  30. data: function() {
  31. return {
  32. // 展会id
  33. dock_id: '',
  34. list: [],
  35. };
  36. },
  37. async created() {
  38. if (this.id) {
  39. this.$set(this, `dock_id`, this.id);
  40. }
  41. await this.search();
  42. },
  43. methods: {
  44. ...newsguidance(['query']),
  45. async search() {
  46. let res = await this.query({ dock_id: this.dock_id });
  47. if (this.$checkRes(res)) this.$set(this, `list`, res.data);
  48. },
  49. // 详情页面
  50. detailBtn(data) {
  51. this.$router.push({ path: '/service/techDetail', query: { id: data.id, type: '3' } });
  52. },
  53. },
  54. computed: {
  55. ...mapState(['user']),
  56. id() {
  57. return this.$route.query.id;
  58. },
  59. },
  60. watch: {},
  61. };
  62. </script>
  63. <style lang="less" scoped>
  64. .style {
  65. min-height: 365px;
  66. max-height: 365px;
  67. overflow-y: auto;
  68. .list {
  69. padding: 5px 0;
  70. border-bottom: 1px dashed #ccc;
  71. .title {
  72. font-size: 16px;
  73. font-weight: bold;
  74. }
  75. .date {
  76. font-size: 14px;
  77. text-align: right;
  78. padding: 3px 0 0 0;
  79. }
  80. .orgin {
  81. font-size: 14px;
  82. padding: 5px 0;
  83. span {
  84. color: #999;
  85. }
  86. }
  87. .titlejj {
  88. font-size: 14px;
  89. overflow: hidden;
  90. text-overflow: ellipsis;
  91. -webkit-line-clamp: 2;
  92. word-break: break-all;
  93. display: -webkit-box;
  94. -webkit-box-orient: vertical;
  95. span {
  96. color: #999;
  97. }
  98. }
  99. }
  100. }
  101. </style>