<template>
  <div class="app-container">

    <!-- 搜索工作栏 -->
    <el-form v-model="queryParams.questionType" ref="queryForm" size="small" :inline="true" label-width="68px">
      <el-form-item label="问卷类型" prop="type" label-width="98px">
        <el-select v-model="queryParams.questionType" placeholder="请选择问卷类型 住院、门诊" clearable size="small" @change="changeValue($event)">
          <el-option v-for="dict in this.getDictDatas(DICT_TYPE.WQ_TYPE)"
               :key="dict.value" :label="dict.label" :value="dict.value"/>
        </el-select>
      </el-form-item>
      <el-form-item label="创建时间"  label-width="108px">
        <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00','23:59:59']"/>
                        <!-- :default-value="[new Date(), new Date(new Date().setMonth(new Date().getMonth() + 1))]"/> -->
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- 列表 -->
    <div v-show="divShow[0]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[0]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[0].data" ref="table1" v-loading="loading"     
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>

    <!-- 列表 -->
    <div v-show="divShow[1]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[1]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[1].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>

    <!-- 列表 -->
    <div v-show="divShow[2]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[2]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[2].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    

    <!-- 列表 -->
    <div v-show="divShow[3]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[3]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[3].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    

    <!-- 列表 -->
    <div v-show="divShow[4]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[4]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[4].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[5]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[5]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[5].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[6]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[6]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[6].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[7]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[7]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[7].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[8]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[8]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[8].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[9]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[9]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[9].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[10]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[10]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[10].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">

        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[11]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[11]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[11].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[12]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[12]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[12].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[13]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[13]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[13].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[14]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[14]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[14].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[15]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[15]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[15].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[16]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[16]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[16].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[17]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[17]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[17].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[18]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[18]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[18].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[19]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[19]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[19].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[20]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[20]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[20].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[21]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[21]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[21].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[22]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[22]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[22].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[23]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[23]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[23].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[24]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[24]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[24].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[25]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[25]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[25].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[26]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[26]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[26].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[27]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[27]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[27].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[28]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[28]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[28].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[29]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[29]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[29].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[30]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[30]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[30].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[31]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[31]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[31].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[32]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[32]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[32].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[33]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[33]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[33].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[34]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[34]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[34].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    
    <!-- 列表 -->
    <div v-show="divShow[35]" style="width:800px; top:50px; vertical-align:center;border:0px solid;margin: auto;">
      <el-form style="border:0px solid" label-position="left" label-width="700px">
        <el-form-item :label="labelShow[35]" style="border:0px solid">
        </el-form-item>
      </el-form>
      <el-table :data="this.tablevData[35].data" ref="table1" v-loading="loading" 
      :summary-method="getSummaries"
      show-summary
      style="width: 100%; margin-top: 20px">
        <el-table-column label="选项名称" align="center" prop="questionTitle" />
        <el-table-column label="小计" align="center" prop="sum" />
        <el-table-column label="百分比" align="center" prop="progress" >
          <template slot-scope="scope">
              <el-progress
                type="line"
                :stroke-width="15"
                :percentage="scope.row.progress"
                :color="blue"
              ></el-progress>
          </template>
        </el-table-column>
      </el-table>
      <br/><br/><br/>
    </div>    

    
  </div>

</template>

<script>

import { getWqdaSum,createWqda, updateWqda, deleteWqda, getWqda, getWqdaPage, exportWqdaExcel } from "@/api/system/wqda";
// const table = this.$refs.table1;
const date = new Date();
const year = date.getFullYear();
const month = ('0' + (date.getMonth() )).slice(-2);
const month2 = ('0' + (date.getMonth() + 2)).slice(-2);
const day = ('0' + date.getDate()).slice(-2);
const hours = ('0' + date.getHours()).slice(-2);
const minutes = ('0' + date.getMinutes()).slice(-2);
const seconds = ('0' + date.getSeconds()).slice(-2);
const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
const formattedDate2 = `${year}-${month2}-${day} ${hours}:${minutes}:${seconds}`;

export default {
  data() {
    return {
      // 遮罩层
      loading: true,
      divShow: [false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false],
      labelShow: [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],
      // 查询参数
      arrsize: null,
      queryParams: {
        pageNo: 1,
        pageSize: 10,
        title: null,
        img: null,
        content: null,
        questionType: null,
        createTime: []
      },
      tablevData: [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}],
      tablesData: [{}]
    }
  },
  created() {
    this.queryParams.questionType = "101";
    let date1 = formattedDate;
    let date2 = formattedDate2;
    // let date1 = new Date(Date.parse(formattedDate));
    // let date2 = new Date(Date.parse(formattedDate2));
    // this.queryParams.createTime = [new Date(Date.parse(formattedDate)), new Date(Date.parse(formattedDate2))];
    this.queryParams.createTime = [date1, date2];

    this.getList();
  },
  // computed: {
  //   datasource:function(){
  //     this.$refs.table1.data = this.tablesData[0].data;
  //   }
  // },  
  methods: {
    getSummaries(param) {
        const { columns, data } = param;
        const sums = [];
        columns.forEach((column, index) => {
          if (index === 0) {
            sums[index] = '合计';
            return;
          }
          const values = data.map(item => Number(item[column.property]));
          if (!values.every(value => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => {
              const value = Number(curr);
              if (!isNaN(value)) {
                return prev + curr;
              } else {
                return prev;
              }
            }, 0);
            sums[index] += ' ';
          } else {
            sums[index] = 'N/A';
          }
          if (index === 2) {
            sums[index] = '100%';
            return;
          }

        });

        return sums;
      },    
    changeValue(value){
     // alert(value);
     this.queryParams.questionType = value;
     this.getList();
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNo = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 查询列表 */
    getList() {
      this.loading = true;
      // 执行查询
      getWqdaSum(this.queryParams).then(response => {
        this.tablesData = JSON.parse(response.data);
        // alert(JSON.stringify(this.tablesData[0].data));
        this.arrsize = this.tablesData.length;
       //Y alert(this.arrsize);
        this.loading = false;
       // this.divflag = false; //隐藏div

       this.divShow = [false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false];
       //判断后端数据size，决定显示几个table
       for(let i=0; i<this.arrsize; i++){
          this.tablevData[i] = this.tablesData[i];
          this.divShow[i] = true;

          this.labelShow[i] = this.tablevData[i].data[0].questionLabel;
          // alert(this.labelShow[i]);
       }

      });
    },
  }
}
</script>
