index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24">
  5. <div class="w_1200">
  6. <el-col class="bt">{{ noticeInfo.title }}</el-col>
  7. <el-col :span="5" class="ly">来源:{{ noticeInfo.source }}</el-col>
  8. <el-col :span="5" class="time">时间:{{ noticeInfo.create_time }}</el-col>
  9. <el-col :span="24" class="content" v-html="noticeInfo.content"></el-col>
  10. <el-col :span="24">
  11. <el-button type="primary" @click="clickk">信息申报</el-button>
  12. </el-col>
  13. </div>
  14. </el-col>
  15. </el-row>
  16. </div>
  17. </template>
  18. <script>
  19. import { mapState, createNamespacedHelpers } from 'vuex';
  20. import productForm from './productForm.vue';
  21. const { mapActions: notice } = createNamespacedHelpers('notice');
  22. export default {
  23. name: 'index',
  24. props: {},
  25. components: {},
  26. data: function() {
  27. return {
  28. noticeInfo: {},
  29. };
  30. },
  31. created() {
  32. this.search();
  33. },
  34. methods: {
  35. ...notice(['query']),
  36. // 列表
  37. async search({ skip = 0, limit = 10, ...info } = {}) {
  38. let arr = await this.query({ skip, limit, ...info });
  39. this.$set(this, `noticeInfo`, arr.data[0]);
  40. },
  41. click(id) {
  42. this.$router.push({ path: '/notice/productForm', query: { id: id } });
  43. },
  44. },
  45. computed: {
  46. ...mapState(['user']),
  47. pageTitle() {
  48. return `${this.$route.meta.title}`;
  49. },
  50. },
  51. metaInfo() {
  52. return { title: this.$route.meta.title };
  53. },
  54. };
  55. </script>
  56. <style lang="less" scoped>
  57. .w_1200 {
  58. width: 80%;
  59. margin: 0 auto;
  60. }
  61. .bt {
  62. font-size: 36px;
  63. text-align: center;
  64. margin-top: 50px;
  65. }
  66. .ly {
  67. margin: 20px 120px 0 480px;
  68. font-size: 24px;
  69. }
  70. .time {
  71. margin-top: 20px;
  72. font-size: 24px;
  73. }
  74. .content {
  75. margin-top: 20px;
  76. text-indent: 5em;
  77. }
  78. </style>