|
|
@@ -128,6 +128,14 @@
|
|
|
:disabled="totalElements < 1"
|
|
|
>导出节目
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ @click="download1"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-download"
|
|
|
+ :loading="downloading"
|
|
|
+ :disabled="totalElements < 1"
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -464,6 +472,33 @@ export default {
|
|
|
this.$message.error(e.error);
|
|
|
});
|
|
|
},
|
|
|
+ download1() {
|
|
|
+ this.downloading = true;
|
|
|
+
|
|
|
+ let data = this.getBefore();
|
|
|
+ data.size = 2000;
|
|
|
+ this.$axios
|
|
|
+ .get('/programme/excel', {
|
|
|
+ responseType: 'blob',
|
|
|
+ params: data
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.downloading = false;
|
|
|
+ const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
+ const link = document.createElement('a');
|
|
|
+ link.href = downloadUrl;
|
|
|
+ link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ link.remove();
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.downloading = false;
|
|
|
+ this.$message.error(e.error);
|
|
|
+ });
|
|
|
+ },
|
|
|
getCode(value) {
|
|
|
return this.forTree(this.artTypes, value).code;
|
|
|
},
|