java后端下载excel模板

vue

handleDownloadTemplate () {
      const queryParams = this.queryParams
      this.$confirm('是否确认模板?', '警告', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          return downloadTemplate(queryParams)
        })
        .then((response) => {
          this.download(response.msg)
        })
        .catch(() => { })
    },
export function downloadTemplate(query) {
  return request({
    url: '/material/info/downloadTemplate',
    method: 'get',
    params: query
  }

java

    @GetMapping("/downloadTemplate")
    public AjaxResult downloadTemplate(WmsMaterialInfoDto wmsMaterialInfoDto)
    {
        ExcelUtil util = new ExcelUtil(WmsMaterialInfoDto.class);
        return util.exportExcel(null, "器材信息模板");
    }

你可能感兴趣的:(java,python,前端)