index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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="one">
  7. <el-col :span="12" class="left">
  8. <question :questionList="questionList" :questionnaireList="questionnaireList"></question>
  9. </el-col>
  10. <el-col :span="12" class="right">
  11. <work :workList="hyyjList"></work>
  12. </el-col>
  13. </el-col>
  14. <el-col :span="24" class="two">
  15. <el-image :src="jlhd"></el-image>
  16. </el-col>
  17. <el-col :span="24" class="thr">
  18. <gzcy :list="gzcyList" @show="show"></gzcy>
  19. </el-col>
  20. </div>
  21. </el-col>
  22. </el-row>
  23. <el-dialog title="展会服务" :visible.sync="zhfwdialog" width="50%" :before-close="handleClose">
  24. <zhfw></zhfw>
  25. </el-dialog>
  26. <el-dialog title="成果评价" :visible.sync="zxzxdialog" width="50%" :before-close="handleClose">
  27. <cgpj></cgpj>
  28. </el-dialog>
  29. <el-dialog title="建言献策" :visible.sync="jyxcdialog" width="30%" :before-close="handleClose">
  30. <jyxc @handleClose="handleClose"></jyxc>
  31. </el-dialog>
  32. <el-dialog title="网上调查" :visible.sync="wsdcdialog" width="30%" :before-close="handleClose">
  33. <wsdc @handleClose="handleClose"></wsdc>
  34. </el-dialog>
  35. <el-dialog title="举报邮箱" :visible.sync="jbyxdialog" width="30%" :before-close="handleClose">
  36. <jbyx></jbyx>
  37. </el-dialog>
  38. </div>
  39. </template>
  40. <script>
  41. import question from './index/question.vue';
  42. import work from './index/work.vue';
  43. // 公众参与
  44. import gzcy from './parts/gzcy.vue';
  45. //展会服务
  46. import zhfw from './gzcy/zhfw.vue';
  47. //在线咨询
  48. // import zxzx from './gzcy/zxzx.vue';
  49. // 成果评价
  50. import cgpj from './gzcy/cgpj.vue';
  51. // 建言献策
  52. import jyxc from './gzcy/jyxc.vue';
  53. // 网上调查
  54. import wsdc from './gzcy/wsdc.vue';
  55. // 举报邮箱
  56. import jbyx from './gzcy/jbyx.vue';
  57. import { mapState, createNamespacedHelpers } from 'vuex';
  58. const { mapActions: column } = createNamespacedHelpers('column');
  59. const { mapActions: news } = createNamespacedHelpers('news');
  60. const { mapActions: mapQuestion } = createNamespacedHelpers('question');
  61. const { mapActions: questionnaire } = createNamespacedHelpers('questionnaire');
  62. export default {
  63. metaInfo() {
  64. return { title: this.$route.meta.title };
  65. },
  66. name: 'index',
  67. props: {},
  68. components: { question, work, gzcy, zhfw, cgpj, jyxc, wsdc, jbyx },
  69. data: function() {
  70. return {
  71. jlhd: require('@p/center/jlhd.png'),
  72. // 公众参与
  73. gzcyList: [
  74. {
  75. url: require('@p/techolchat/zhfw.png'),
  76. title: '展会服务',
  77. },
  78. {
  79. url: require('@p/techolchat/zxzx.png'),
  80. title: '成果评价',
  81. },
  82. {
  83. url: require('@p/techolchat/fb.png'),
  84. title: '我要发布',
  85. },
  86. {
  87. url: require('@p/techolchat/jy.png'),
  88. title: '建言献策',
  89. },
  90. {
  91. url: require('@p/techolchat/wsdc.png'),
  92. title: '网上调查',
  93. },
  94. {
  95. url: require('@p/techolchat/lbyx.png'),
  96. title: '举报邮箱',
  97. },
  98. ],
  99. // 展会服务
  100. zhfwdialog: false,
  101. // 在线咨询
  102. zxzxdialog: false,
  103. // 建言献策
  104. jyxcdialog: false,
  105. // 网上调查
  106. wsdcdialog: false,
  107. // 举报邮箱
  108. jbyxdialog: false,
  109. // 栏目列表
  110. columnList: [],
  111. // 调研调查
  112. questionList: [],
  113. // 行业研究
  114. hyyjList: [],
  115. // 问卷调查
  116. questionnaireList: [],
  117. };
  118. },
  119. async created() {
  120. await this.searchOther();
  121. await this.search();
  122. },
  123. methods: {
  124. ...questionnaire({ getQuest: 'query' }),
  125. ...column({ columnQuery: 'query' }),
  126. ...news(['query']),
  127. ...mapQuestion({ questionQuery: 'query' }),
  128. async search({ skip = 0, limit = 5, ...info } = {}) {
  129. // 行业研究
  130. let column = this.columnList.find(i => i.site == 'hyyj');
  131. let res = await this.query({ skip, limit, column_id: column.id, ...info });
  132. if (this.$checkRes(res)) {
  133. this.$set(this, `${column.site}List`, res.data);
  134. }
  135. // 调研调查
  136. res = await this.questionQuery({ skip, limit: 2, ...info });
  137. if (this.$checkRes(res)) {
  138. this.$set(this, `questionList`, res.data);
  139. }
  140. // 问卷调查
  141. res = await this.getQuest({ skip, limit: 2 });
  142. if (this.$checkRes(res)) {
  143. this.$set(this, `questionnaireList`, res.data);
  144. }
  145. },
  146. async searchOther() {
  147. let res = await this.columnQuery();
  148. if (this.$checkRes(res)) this.$set(this, `columnList`, res.data);
  149. },
  150. show(data) {
  151. if (data.title == '展会服务') {
  152. this.zhfwdialog = true;
  153. } else if (data.title == '我要发布') {
  154. this.$router.push({ path: '/techolchat/product' });
  155. } else if (data.title == '建言献策') {
  156. this.jyxcdialog = true;
  157. } else if (data.title == '成果评价') {
  158. this.zxzxdialog = true;
  159. } else if (data.title == '网上调查') {
  160. this.wsdcdialog = true;
  161. // TODO跳转至问卷列表页
  162. // if (this.user && this.user.id) this.$router.push('/questionnaire/index');
  163. // else this.$message({ type: 'danger', message: '请登录后填写调查问卷!' });
  164. } else if (data.title == '举报邮箱') {
  165. this.jbyxdialog = true;
  166. }
  167. },
  168. // 公共关闭
  169. handleClose() {
  170. // 展会服务
  171. this.zhfwdialog = false;
  172. // 在线咨询
  173. this.zxzxdialog = false;
  174. // 建言献策
  175. this.jyxcdialog = false;
  176. // 网上调查
  177. this.wsdcdialog = false;
  178. // 举报邮箱
  179. this.jbyxdialog = false;
  180. },
  181. },
  182. computed: {
  183. ...mapState(['user']),
  184. },
  185. watch: {},
  186. };
  187. </script>
  188. <style lang="less" scoped>
  189. .main {
  190. padding: 15px 0;
  191. .one {
  192. margin: 0 0 10px 0;
  193. .left {
  194. width: 49%;
  195. min-height: 530px;
  196. background: #ffffff;
  197. padding: 15px;
  198. border-radius: 20px;
  199. margin: 0 24px 0 0;
  200. box-shadow: 0 0 5px #409eff;
  201. }
  202. .right {
  203. width: 49%;
  204. min-height: 530px;
  205. background: #ffffff;
  206. border-radius: 20px;
  207. padding: 15px;
  208. box-shadow: 0 0 5px #409eff;
  209. }
  210. }
  211. .two {
  212. height: 140px;
  213. overflow: hidden;
  214. margin: 0 0 10px 0;
  215. }
  216. .thr {
  217. overflow: hidden;
  218. height: 255px;
  219. box-shadow: 0 0 10px #2d64b3;
  220. border-radius: 10px;
  221. margin: 15px 0 0 0;
  222. }
  223. }
  224. </style>