|
@@ -1,21 +1,24 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
- <el-form :label-position="labelPosition" label-width="80px" :model="formLabelAlign">
|
|
|
- <el-row>
|
|
|
- <el-col :span="24" class="text_auto">{{ info.name }}</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24" class="text_left" v-for="(item, index) in info.question" :key="index">
|
|
|
- {{ item.type }}
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <topNav></topNav>
|
|
|
</el-col>
|
|
|
- <el-col :span="24" class="text_center">456</el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <footInfo></footInfo>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <question :info="info"></question>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="foot">
|
|
|
+ <footInfo></footInfo>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import topNav from '@/layout/index/topInfo.vue';
|
|
|
+import question from '@question/src/views/index.vue';
|
|
|
import footInfo from '@/layout/index/footInfo.vue';
|
|
|
import { createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
const { mapActions: mapQuestion } = createNamespacedHelpers('questionnaire');
|
|
@@ -23,13 +26,20 @@ export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
components: {
|
|
|
+ topNav, //头部导航
|
|
|
footInfo,
|
|
|
+ question, //问卷调查框架
|
|
|
},
|
|
|
data: () => ({
|
|
|
info: {
|
|
|
name: '2020年疫情发展问卷调查',
|
|
|
num: '1',
|
|
|
- question: [],
|
|
|
+ question: [
|
|
|
+ {
|
|
|
+ type: 'created',
|
|
|
+ name: '测试',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
}),
|
|
|
created() {
|
|
@@ -37,46 +47,17 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
- ...mapQuestion(['query', 'fetch']),
|
|
|
+ ...mapQuestion(['query', 'fetch', 'update']),
|
|
|
async searchInfo({ ...info } = {}) {
|
|
|
const res = await this.query({ ...info });
|
|
|
- console.log(res.data);
|
|
|
- // this.$set(this, `leaveList`, res.data);
|
|
|
+ for (const val of res.data) {
|
|
|
+ const result = await this.fetch(val.id);
|
|
|
+ // console.log(result.data.question);
|
|
|
+ console.log(result.data);
|
|
|
+ this.$set(this, `info`, result.data);
|
|
|
+ this.$set(this.info, `question`, result.data.question);
|
|
|
+ }
|
|
|
},
|
|
|
- // let result;
|
|
|
- // for (const val of result.data) {
|
|
|
- // console.log(val);
|
|
|
- // for (const res of val.question) {
|
|
|
- // console.log(id);
|
|
|
- // this.$set(this, `question`, res.data);
|
|
|
- // }
|
|
|
- // }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
-<style lang="less" scoped>
|
|
|
-.text_auto {
|
|
|
- width: 100%;
|
|
|
- // height: 50px;
|
|
|
- line-height: 50px;
|
|
|
- position: relative;
|
|
|
- text-align: center;
|
|
|
- border-bottom: 1px dashed #333;
|
|
|
-}
|
|
|
-
|
|
|
-.text_left {
|
|
|
- width: 100%;
|
|
|
- // height: 50px;
|
|
|
- line-height: 50px;
|
|
|
- position: relative;
|
|
|
- padding-left: 25px;
|
|
|
- color: blue;
|
|
|
-}
|
|
|
-.text_center {
|
|
|
- width: 100%;
|
|
|
- line-height: 10px;
|
|
|
- position: relative;
|
|
|
- padding-left: 50px;
|
|
|
-}
|
|
|
-</style>
|