guhongwei 3 năm trước cách đây
mục cha
commit
e1319bcf3b
2 tập tin đã thay đổi với 14 bổ sung1 xóa
  1. 2 0
      src/store/index.js
  2. 12 1
      src/views/homeIndex.vue

+ 2 - 0
src/store/index.js

@@ -8,6 +8,7 @@ import adminLogin from './adminLogin';
 import answer from '@common/src/store/question/answer';
 import question from '@common/src/store/question/question';
 import questionnaire from '@common/src/store/question/questionnaire';
+import investigation from '@common/src/store/question/investigation';
 
 Vue.use(Vuex);
 
@@ -20,5 +21,6 @@ export default new Vuex.Store({
     answer,
     question,
     questionnaire,
+    investigation,
   },
 });

+ 12 - 1
src/views/homeIndex.vue

@@ -3,6 +3,7 @@
     <el-row>
       <el-col :span="24">
         <p>homeIndex</p>
+        <el-button type="primary" size="small" @click="toExport()">导出</el-button>
       </el-col>
     </el-row>
   </div>
@@ -10,6 +11,8 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: investigation } = createNamespacedHelpers('investigation');
+
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -21,7 +24,15 @@ export default {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    ...investigation(['export']),
+    async toExport() {
+      let res = await this.export();
+      if (this.$checkRes(res)) {
+        console.log(res);
+      }
+    },
+  },
   computed: {
     ...mapState(['user']),
   },