修改bug
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-21 14:30:17
|
||||
* @LastEditTime: 2023-06-26 15:32:36
|
||||
* @LastEditTime: 2023-07-10 15:39:29
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -60,7 +60,7 @@
|
||||
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-col>""
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</template>
|
||||
@@ -163,8 +163,8 @@ export default {
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: i18n.t('export'),
|
||||
btnName: i18n.t('export'),
|
||||
name: 'export',
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
@@ -256,37 +256,36 @@ export default {
|
||||
// console.log(11111);
|
||||
// this.conditionSearchSubmit();
|
||||
},
|
||||
exportHandle() {
|
||||
this.$http.get(this.urlOptions.exportURL, { responseType: 'blob' }, {
|
||||
...this.dataForm
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
// if (res !== 0) {
|
||||
// return this.$message.error(res.msg)
|
||||
// }
|
||||
let fileName = ''
|
||||
const contentDisposition = res.headers['content-disposition']
|
||||
if (contentDisposition) {
|
||||
const temp = res.headers['content-disposition']
|
||||
.split(';')[1]
|
||||
.split('=')[1]
|
||||
// 对文件名乱码转义--【Node.js】使用iconv-lite解决中文乱码
|
||||
fileName = decodeURI(temp)
|
||||
console.log(temp)
|
||||
}
|
||||
const blob = new Blob([res.data])
|
||||
const reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = (e) => {
|
||||
const a = document.createElement('a')
|
||||
a.download = fileName
|
||||
a.href = e.target.result
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
}
|
||||
}).catch(() => { })
|
||||
},
|
||||
// exportHandle() {
|
||||
// console.log(1111)
|
||||
// this.$http.get(this.urlOptions.exportURL, { responseType: 'blob' }).then((res) => {
|
||||
// console.log(res)
|
||||
// // if (res !== 0) {
|
||||
// // return this.$message.error(res.msg)
|
||||
// // }
|
||||
// let fileName = ''
|
||||
// const contentDisposition = res.headers['content-disposition']
|
||||
// if (contentDisposition) {
|
||||
// const temp = res.headers['content-disposition']
|
||||
// .split(';')[1]
|
||||
// .split('=')[1]
|
||||
// // 对文件名乱码转义--【Node.js】使用iconv-lite解决中文乱码
|
||||
// fileName = decodeURI(temp)
|
||||
// console.log(temp)
|
||||
// }
|
||||
// const blob = new Blob([res.data])
|
||||
// const reader = new FileReader()
|
||||
// reader.readAsDataURL(blob)
|
||||
// reader.onload = (e) => {
|
||||
// const a = document.createElement('a')
|
||||
// a.download = fileName
|
||||
// a.href = e.target.result
|
||||
// document.body.appendChild(a)
|
||||
// a.click()
|
||||
// document.body.removeChild(a)
|
||||
// }
|
||||
// }).catch(() => { })
|
||||
// },
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
if (val.type === "delete") {
|
||||
@@ -368,7 +367,7 @@ export default {
|
||||
this.getDataList();
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle();
|
||||
this.exportHandle()
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = "新增";
|
||||
@@ -390,7 +389,6 @@ export default {
|
||||
// this.$refs.palletTable1.setCurrent("palletTable", -1);
|
||||
// break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user