| | |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | handlerFile(res){ |
| | | let reader = new FileReader(); |
| | | reader.readAsText(res.data); |
| | | reader.onload = (result) =>{ |
| | | try { |
| | | let resData = JSON.parse(result.target.result); // 解析对象成功 |
| | | if (resData.code != 200) { |
| | | this.$message.error(resData.msg); |
| | | } |
| | | } catch (err) { |
| | | // console.log("err",err)// 解析成对象失败,说明是正常的文件流 |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('下载成功,请查看!'); |
| | | } |
| | | }; |
| | | }, |
| | | escHandler() { |
| | | this.$emit('update:visible', false); |
| | | this.value = []; |
| | |
| | | 'conditionMap[oid]': this.ids, ...this.exportArrTwo, |
| | | limit: -1 |
| | | }).then(res => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | this.handlerFile(res); |
| | | this.escHandler(); |
| | | }) |
| | | } else { |
| | | |
| | |
| | | 'conditionMap[oid]': this.ids, ...this.exportArr |
| | | }).then(res => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | this.handlerFile(res); |
| | | this.escHandler(); |
| | | |
| | | }) |
| | | |
| | | } |
| | |
| | | this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; |
| | | }); |
| | | exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArrTwo, limit: -1}).then(res => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | this.escHandler(); |
| | | } |
| | | }) |
| | | } else { |
| | | exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: -1}).then(res => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | this.handlerFile(res); |
| | | this.escHandler(); |
| | | }) |
| | | } |
| | | } else if (this.radio === 2) { |
| | |
| | | endPage: end |
| | | }).then((res) => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | this.handlerFile(res); |
| | | this.escHandler(); |
| | | |
| | | }); |
| | | } else { |
| | | this.tableHeadData.map(item => item.prop) |
| | |
| | | page: start, |
| | | endPage: end |
| | | }).then(res => { |
| | | // console.log('res',res) |
| | | if (res) { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.escHandler() |
| | | } |
| | | console.log('res',res) |
| | | this.handlerFile(res); |
| | | this.escHandler(); |
| | | }) |
| | | } |
| | | } |