测试 用electron + springboot 构建桌面应用
he wei
2022-03-19 f33d9a4db3d9d1b7956153cbf42d3e506301fddd
src/main/demo/src/views/result.vue
@@ -36,6 +36,10 @@
        </flex-box>
      </div>
    </div>
    <!-- 导出用的图表 可变的那组图 -->
    <div class="hideContain">
      <normal-lines id="hideChart" ref="hideChart"></normal-lines>
    </div>
  </flex-layout>
</template>
@@ -86,6 +90,7 @@
      actualCapOption: null,
      residualCapOption: null,
      residualTimeOption: null,
      unit: ''
    };
  },
  methods: {
@@ -174,6 +179,7 @@
        series: SingleVol,
      };
      let testCapOption = {
          unit: 'AH',
          xData: times,
          series: [
            {
@@ -186,6 +192,7 @@
          ],
        },
        actualCapOption = {
          unit: 'AH',
          xData: times,
          series: [
            {
@@ -198,6 +205,7 @@
          ],
        },
        residualCapOption = {
          unit: 'AH',
          xData: times,
          series: [
            {
@@ -210,6 +218,7 @@
          ],
        },
        residualTimeOption = {
          unit: '',
          xData: times,
          series: [
            {
@@ -241,23 +250,22 @@
    },
    // 导出报表
    exportExcel() {
      // axios({
      //   url: 'export',
      //   method: 'POST',
      //   params: {
      //     filePath: this.info.filePath
      //   }
      // }).then((res) => {
      //   res = res.data;
      //   console.log(res, '======res');
      // });
      // 容量折线图
      let arr = ['testCap', 'actualCap'];
      let o_pic = {};
      arr.forEach((v) => {
        let option = this[v + 'Option'];
        this.unit = option.unit;
        this.$refs.hideChart.setData(option);
        o_pic[v] = this.$refs.hideChart.getDataURL();
      });
      let params = {
        filePath: this.info.filePath,
        groupVol_echart: this.$refs.groupVol.getDataURL(),
        curr_echart: this.$refs.groupCurr.getDataURL(),
        vol_echart: this.$refs.vol.getDataURL(),
        cap_echart: this.$refs.cap.getDataURL(),
        cap_echart: o_pic.testCap,
        actualCap_echart: o_pic.actualCap
      };
      let baseURL = axios.defaults.baseURL;
      baseURL = baseURL ? baseURL : "";
@@ -326,4 +334,10 @@
.flex-row + .flex-row {
  margin-top: 8px;
}
.hideContain {
  position: absolute;
  width: 0;
  height: 0;
  display: none;
}
</style>