src/views/answer/dataStatistics.vue
@@ -9,6 +9,7 @@
      <el-form-item>
        <el-button type="primary" @click="submitForm">查询</el-button>
        <el-button type="danger"  @click="handleExport" class="link-left">导出</el-button>
        <el-button type="danger"  @click="downloadUrlFile" class="link-left">截图</el-button>
      </el-form-item>
    </el-form>
@@ -156,6 +157,16 @@
    });
  },
  methods: {
    downloadUrlFile(url, fileName) {
      // 获取base64图片
      const chartImgUrl = this.myChart.getDataURL({
          pixelRatio: 2,
          backgroundColor: '#fff'
      })
      console.log(chartImgUrl)
      // 下载base64图片
      this.downloadUrlFile(chartImgUrl, 'ECharts 2倍图')
    },
    handleExport(){
      let that = this
      let url ='/api/admin/examPaperAnswer/export?id=' +this.queryParam.id + '&type=' + this.queryParam.type