index.vue 1.8 KB

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