Browse Source

问卷统计,具体数据没有显示

lrf402788946 5 years ago
parent
commit
d4f41133a7
4 changed files with 23 additions and 2 deletions
  1. 1 0
      config/menu-config.js
  2. 7 2
      parts/statistics/report.vue
  3. 5 0
      store/student.js
  4. 10 0
      store/util.js

+ 1 - 0
config/menu-config.js

@@ -162,6 +162,7 @@ export const menu = [
           { path: '/questionnaire/index', name: '问卷管理' },
           { path: '/itembank/index', name: '问卷题库' },
           { path: '/questionstate/index', name: '问卷进度' },
+          { path: '/questionnaire/export/setting', name: '问卷导出设置' },
         ],
       },
       {

+ 7 - 2
parts/statistics/report.vue

@@ -5,8 +5,9 @@
         <el-row type="flex" align="middle" justify="center" class="btn_bar">
           <el-col :span="18"> {{ answer.topic }} [{{ answer.type | topicType }}] </el-col>
         </el-row>
-        <el-row type="flex" align="middle" justify="center" class="btn_bar">
-          <el-col :span="18" v-if="answer.type == 0">{{ answer.answer }}</el-col>
+        <el-row type="flex" align="middle" justify="center" class="btn_bar" style="color:blue">
+          <el-col :span="18" v-if="answer.type != 1">{{ answer.answer }}</el-col>
+          <el-col :span="18" v-else>{{ answer.answer | checkBoxAnswer }}</el-col>
         </el-row>
       </div>
     </template>
@@ -14,6 +15,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'report',
@@ -38,6 +40,9 @@ export default {
       if (val == 1) return '多选题';
       if (val == 2) return '简答题';
     },
+    checkBoxAnswer(val) {
+      return _.join(val, ';');
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };

+ 5 - 0
store/student.js

@@ -9,6 +9,7 @@ const api = {
   bedroom: `/api/train/student/findbedroom`,
   removeClass: `/api/train/student/deleteclass`, //ids
   findscore: `/api/train/student/findscore`,
+  findList: `/api/train/student/findbystuids`,
 };
 const state = () => ({});
 const mutations = {};
@@ -50,6 +51,10 @@ const actions = {
     const res = await this.$axios.$get(`${api.findscore}`, { skip, limit, ...info });
     return res;
   },
+  async findList({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.findList}`, { data: payload });
+    return res;
+  },
   async mergeRequest({ commit, dispatch }, { method, data }) {
     let toRequest = () => {
       let res = [];

+ 10 - 0
store/util.js

@@ -7,6 +7,8 @@ import axios from 'axios';
 Vue.use(Vuex);
 const api = {
   interface: modelname => `/api/train/common/findone/${modelname}`,
+  findModel: model => `/api/train/common/findbymodel?modelname=${model}`,
+  findByIds: model => `/api/train/common/findbyids/${model}`,
 };
 const state = () => ({});
 const mutations = {};
@@ -16,6 +18,14 @@ const actions = {
     const res = await this.$axios.$get(`${api.interface(model)}`, { skip, limit, ...info });
     return res;
   },
+  async findModel({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.findModel(payload)}`);
+    return res;
+  },
+  async findIds({ commit }, { model, ids }) {
+    const res = await this.$axios.$get(`${api.findByIds(model)}`, { data: ids });
+    return res;
+  },
 };
 export default {
   namespaced: true,