index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="top">
  5. <top></top>
  6. </el-col>
  7. <el-col :span="24" class="menu">
  8. <div class="w_1200">
  9. <menus></menus>
  10. </div>
  11. </el-col>
  12. <el-col :span="24" class="main">
  13. <div class="w_1200">
  14. <el-col :span="12" class="maintopleft">
  15. <dynamic></dynamic>
  16. </el-col>
  17. <el-col :span="12" class="maintopright">
  18. <jobs :jobsList="jobsList"></jobs>
  19. </el-col>
  20. <el-col :span="8" class="context">
  21. <notice :noticeList="noticeList"></notice>
  22. </el-col>
  23. <el-col :span="8" class="between">
  24. <service :serviceList="serviceList"></service>
  25. </el-col>
  26. <el-col :span="8" class="context">
  27. <technology :jishuList="jishuList"></technology>
  28. </el-col>
  29. <el-col :span="24" class="lianjie">
  30. <links></links>
  31. </el-col>
  32. </div>
  33. </el-col>
  34. <el-col :span="24" class="foot">
  35. <div class="w_1200">
  36. <foot></foot>
  37. </div>
  38. </el-col>
  39. </el-row>
  40. </div>
  41. </template>
  42. <script>
  43. import { mapState, createNamespacedHelpers } from 'vuex';
  44. const { mapActions: news } = createNamespacedHelpers('news');
  45. import top from '@/layout/common/top.vue';
  46. import menus from '@/layout/common/menus.vue';
  47. import dynamic from '@/layout/index/dynamic.vue';
  48. import jobs from '@/layout/index/jobs.vue';
  49. import notice from '@/layout/index/notice.vue';
  50. import service from '@/layout/index/service.vue';
  51. import technology from '@/layout/index/technology.vue';
  52. import links from '@/layout/index/links.vue';
  53. import foot from '@/layout/common/foot.vue';
  54. export default {
  55. name: 'index',
  56. props: {},
  57. components: {
  58. top,
  59. menus,
  60. dynamic,
  61. jobs,
  62. notice,
  63. service,
  64. technology,
  65. links,
  66. foot,
  67. },
  68. data: () => ({
  69. week: '',
  70. date: '',
  71. serviceList: [],
  72. jishuList: [],
  73. noticeList: [],
  74. jobsList: [],
  75. }),
  76. created() {
  77. this.search();
  78. },
  79. computed: {},
  80. methods: {
  81. ...news({ newsQuery: 'query', newsFetch: 'fetch' }),
  82. async search() {
  83. let res = await this.newsQuery({ skip: 0, limit: 6, col_name: '工作动态', status: 2 });
  84. if (this.$checkRes(res)) this.$set(this, `jobsList`, res.data);
  85. res = await this.newsQuery({ skip: 0, limit: 6, col_name: '通知通告', status: 2 });
  86. if (this.$checkRes(res)) this.$set(this, `noticeList`, res.data);
  87. res = await this.newsQuery({ skip: 0, limit: 6, col_name: '科技合作', status: 2 });
  88. if (this.$checkRes(res)) this.$set(this, `serviceList`, res.data);
  89. res = await this.newsQuery({ skip: 0, limit: 6, col_name: '技术问答', status: 2 });
  90. if (this.$checkRes(res)) this.$set(this, `jishuList`, res.data);
  91. },
  92. },
  93. };
  94. </script>
  95. <style lang="less" scoped>
  96. .w_1200 {
  97. width: 1200px;
  98. margin: 0 auto;
  99. }
  100. .main {
  101. height: 730px;
  102. overflow: hidden;
  103. margin: 10px 0 0 0;
  104. }
  105. .maintopleft {
  106. height: 300px;
  107. background-color: #fff;
  108. margin: 0 10px 0 0;
  109. width: 595px;
  110. }
  111. .maintopleft .leftcontext {
  112. padding: 0 20px 0 20px;
  113. font-size: 16px;
  114. }
  115. .maintopright {
  116. height: 300px;
  117. background-color: #fff;
  118. width: 595px;
  119. overflow: hidden;
  120. }
  121. .context {
  122. height: 300px;
  123. background-color: #fff;
  124. margin: 10px 0 0 0;
  125. width: 400px;
  126. }
  127. .between {
  128. height: 300px;
  129. background-color: #fff;
  130. margin: 10px 10px 0 10px;
  131. width: 380px;
  132. }
  133. .main .lianjie {
  134. height: 100px;
  135. background-color: #fff;
  136. margin: 10px 0 0 0;
  137. }
  138. .foot {
  139. height: 135px;
  140. }
  141. </style>