|
@@ -5,7 +5,7 @@
|
|
|
<div class="w_1200">
|
|
|
<el-col :span="24" class="one">
|
|
|
<el-col :span="12" class="left">
|
|
|
- <question :questionList="questionList"></question>
|
|
|
+ <question :questionList="questionList" :questionnaireList="questionnaireList"></question>
|
|
|
</el-col>
|
|
|
<el-col :span="12" class="right">
|
|
|
<work :workList="hyyjList"></work>
|
|
@@ -59,6 +59,7 @@ import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: column } = createNamespacedHelpers('column');
|
|
|
const { mapActions: news } = createNamespacedHelpers('news');
|
|
|
const { mapActions: mapQuestion } = createNamespacedHelpers('question');
|
|
|
+const { mapActions: questionnaire } = createNamespacedHelpers('questionnaire');
|
|
|
export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
@@ -113,6 +114,8 @@ export default {
|
|
|
questionList: [],
|
|
|
// 行业研究
|
|
|
hyyjList: [],
|
|
|
+ // 问卷调查
|
|
|
+ questionnaireList: [],
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -120,6 +123,7 @@ export default {
|
|
|
await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...questionnaire({ getQuest: 'query' }),
|
|
|
...column({ columnQuery: 'query' }),
|
|
|
...news(['query']),
|
|
|
...mapQuestion({ questionQuery: 'query' }),
|
|
@@ -131,10 +135,25 @@ export default {
|
|
|
this.$set(this, `${column.site}List`, res.data);
|
|
|
}
|
|
|
// 调研调查
|
|
|
- res = await this.questionQuery({ skip, limit, ...info });
|
|
|
+ res = await this.questionQuery({ skip, limit: 2, ...info });
|
|
|
if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `questionList`, res.data);
|
|
|
+ const data = this.toLimit(res.data);
|
|
|
+ this.$set(this, `questionList`, data);
|
|
|
}
|
|
|
+ // 问卷调查
|
|
|
+ res = await this.getQuest({ skip, limit: 2 });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ const data = this.toLimit(res.data);
|
|
|
+ this.$set(this, `questionnaireList`, data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ toLimit(data) {
|
|
|
+ if (data.length < 2) {
|
|
|
+ data = [...data, data[0]];
|
|
|
+ return this.toLimit(data);
|
|
|
+ }
|
|
|
+ return data;
|
|
|
},
|
|
|
async searchOther() {
|
|
|
let res = await this.columnQuery();
|