xjc 4 anos atrás
pai
commit
19e27856ab

+ 1 - 0
src/views/message/InnerSurvey.vue

@@ -104,6 +104,7 @@ a {
     }
     .el-radio,.el-checkbox{
       margin-bottom: 10px;
+      margin-right: 1px;
     }
   }
 }

+ 58 - 2
src/views/message/MessageAnalyse.vue

@@ -105,6 +105,36 @@
         :visible.sync="dialogVisible"
       >
         <div class="content">
+            <div class="filter">
+              <el-form
+                size="small"
+                label-width="70px"
+                :inline="true"
+                label-position="left"
+              >
+                <el-form-item label="">
+                  <el-input
+                    clearable
+                    placeholder="请输入标题"
+                    v-model="form.name"
+                    @clear="search"
+                    @keyup.enter.native="search"
+                  ></el-input>
+                </el-form-item>
+                <el-form-item>
+                  <el-button type="primary" @click="search">搜索</el-button>
+                </el-form-item>
+                <el-form-item style="float: right">
+                  <el-button
+                    type="primary"
+                    icon="el-icon-download"
+                    size="mini"
+                    @click="downloadItem(cur_item)"
+                    >导出excel</el-button
+                  >
+                </el-form-item>
+              </el-form>
+            </div>
             <el-table
               class="table"
               :data="analyseDataList"
@@ -115,6 +145,12 @@
               row-key="id"
               style="width: 100%"
             >
+            <el-table-column
+        label="序号"
+        type="index"
+        width="50"
+        align="center">
+</el-table-column>
               <el-table-column v-for="(item, key) in this.headers" :key="key" :prop="item" :label="item"> </el-table-column>
             </el-table>
             <Page
@@ -145,7 +181,8 @@ export default {
       dialogTitle:"",
       dialogVisible:false,
       analyseDataList:[],
-      headers:[]
+      headers:[],
+      cur_item:null
     };
   },
   filters: {
@@ -221,7 +258,6 @@ export default {
         });
     },
     showItemResult(item) {
-      console.log(item)
       this.dialogTitle = '"'+item.label+'"答案详情'
       let message_id = this.$route.query.id;
       let type = this.$route.query.type;
@@ -235,6 +271,21 @@ export default {
         this.analyseDataList = data
       })
       this.dialogVisible = true;
+      this.cur_item = item;
+    },
+    search() {
+      let item = this.cur_item;
+      let parm = this.form;
+      let message_id = this.$route.query.id;
+      let type = this.$route.query.type;
+      parm.message_id = message_id
+      parm.type = type
+      parm.item = item.label
+      this.$api.showAnalyseItem(parm).then((res)=>{
+        let data = res.data.data
+        this.headers = Object.keys(data[0])
+        this.analyseDataList = data
+      })
     },
     getData() {
       let message_id = this.$route.query.id;
@@ -346,6 +397,11 @@ export default {
               //     console.log(val,"")
               //     return '中国科' //对每个标签处理后的结果(通过js字符串方法处理)
               // },
+              formatter: function (value, index) {
+                // 10 6 这些你自定义就行
+                  var v = value.substring(0, 6) + '...'
+                  return value.length > 10 ? v : value
+              },
               // x轴字体颜色
               textStyle: {
                 color: "#999999",

+ 4 - 1
src/views/message/OutSurvey.vue

@@ -89,9 +89,12 @@ a {
     }
     .el-radio,.el-checkbox{
       margin-bottom: 10px;
+      margin-right: 1px;
     }
-    .cus_select .el-checkbox{
+    /deep/.cus_select .el-checkbox{
       line-height: 20px;
+      margin-right:none;
+
     }
     .cus_select .el-radio, .el-radio__input{
       white-space: normal;

+ 51 - 19
src/views/message/survey/answer.html

@@ -9,7 +9,7 @@
   <!-- import CSS -->
   <link rel="stylesheet" href="static/index.css">
 </head>
-<style>
+<style lang="scss" scoped>
   body {
     margin: 0px;
     padding: 0px;
@@ -18,27 +18,59 @@
   #app {
     display: none;
   }
-
   .tpl_title {
     font-size: 18px;
     margin: 10px 0;
   }
-
   .item-main {
     padding: 10px 15px;
   }
-
+  .survey_logo {
+    width: 125px;
+  }
+  /* 选项样式 */
+  .el-form-item__content{
+    line-height: 1;
+  }
   .el-form-item__label {
-    font-weight: 600;
     float: none;
+    font-weight: 600;
+    display: block;
+    line-height: 20px;
+    margin-bottom: 10px;
+    text-align: left;
   }
-
-  .el-message-box {
-    width: 80%;
+  .el-radio{
+    width: 93%!important;
   }
-
-  .survey_logo {
-    width: 125px;
+  .el-radio:not(:last-child){
+    margin-bottom: 10px;
+  }
+  .el-radio__label {
+    font-size: 14px;
+    padding-left: 10px;
+    line-height: 20px!important;
+    white-space: normal;
+    display: inline-block !important;
+    vertical-align: top;
+  }
+  .el-checkbox-group{
+        display:flex;
+        flex-direction: column;
+    }
+    .el-checkbox__label {
+    font-size: 14px;
+    padding-left: 10px;
+    line-height: 20px!important;
+    white-space: normal;
+    display: inline-block !important;
+    vertical-align: top;
+  }
+  .el-checkbox{
+    width: 93%!important;
+  }
+  .el-checkbox:not(:last-child){
+    margin-bottom: 10px!important;
   }
 </style>
 
@@ -53,12 +85,12 @@
           <el-input v-if="item.type == 'input'" v-model="form2[item.label]" :placeholder="item.placeholder"></el-input>
           <el-input v-if="item.type == 'textarea'" type="textarea" v-model="form2[item.label]"
             :placeholder="item.placeholder" :rows=4></el-input>
-          <el-radio-group v-if="item.type == 'radio'" v-model="form2[item.label]">
+          <el-radio-group v-if="item.type == 'radio'" v-model="form2[item.label]" class="cus_select">
             <el-radio :label="iitem.label" v-for="(iitem, index) in item.items" :key="index">{{ iitem.label }}
             </el-radio>
           </el-radio-group>
 
-          <el-checkbox-group v-else-if="item.type == 'checkbox'" v-model="form2[item.label]">
+          <el-checkbox-group v-else-if="item.type == 'checkbox'" v-model="form2[item.label]" class="cus_select">
             <el-checkbox :label="iitem.label" v-for="(iitem, index) in item.items" :key="index"></el-checkbox>
           </el-checkbox-group>
           <el-upload v-if="item.type == 'image'" action="/api/admin/uploadfile" list-type="picture-card"
@@ -178,12 +210,12 @@
               },
               success: res => {
                 if (res.code == 0) {
-                  this.$alert('提交成功', "提交成功", {
-                    center: true,
-                    showClose: false,
-                    confirmButtonText: '确定',
-                    type: "success"
-                  });
+                  // this.$alert('提交成功', "提交成功", {
+                  //   center: true,
+                  //   showClose: false,
+                  //   confirmButtonText: '确定',
+                  //   type: "success"
+                  // });
                   window.location.href = "/survey/success.html?title=" + encodeURIComponent(res.data)
                 } else {
                   this.$alert("提交失败请稍后再试!", "提交失败", {