修改曲靖问题
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
<pane style="background: #fff" :style="height">
|
||||
<TableHeader ref="TableHeaderRef" datePicker :show-search="false">
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">生成</el-button>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent" :loading="loading">
|
||||
生成
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div class="box">
|
||||
@@ -47,6 +49,7 @@ defineOptions({
|
||||
})
|
||||
const height = mainHeight(20)
|
||||
const size = ref(19)
|
||||
const loading = ref(false)
|
||||
const dictData = useDictData()
|
||||
const TableHeaderRef = ref()
|
||||
const dotList: any = ref({})
|
||||
@@ -75,26 +78,32 @@ const handleNodeClick = (data: any, node: any) => {
|
||||
|
||||
// 生成
|
||||
const exportEvent = () => {
|
||||
loading.value = true
|
||||
ElMessage('生成报告中...')
|
||||
areaHarmonicReport({
|
||||
deptId: dotList.value.id,
|
||||
areaReportFlag: 1,
|
||||
startTime: TableHeaderRef.value.datePickerRef.timeValue[0],
|
||||
endTime: TableHeaderRef.value.datePickerRef.timeValue[1]
|
||||
}).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
})
|
||||
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = dotList.value.name + '区域稳态报告' + dayjs().format('YYYYMMDD') // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
.then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
})
|
||||
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = dotList.value.name + '区域稳态报告' + dayjs().format('YYYYMMDD') // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<el-button icon="el-icon-Upload" type="primary" class="mr10 ml10">上传接线图</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">生成</el-button>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent" :loading="loading">生成</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div class="box">
|
||||
@@ -76,6 +76,7 @@ import dayjs from 'dayjs'
|
||||
defineOptions({
|
||||
// name: 'harmonic-boot/report/word'
|
||||
})
|
||||
const loading = ref(false)
|
||||
const height = mainHeight(20)
|
||||
const size = ref(19)
|
||||
const dictData = useDictData()
|
||||
@@ -143,6 +144,7 @@ const exportEvent = () => {
|
||||
message: '包含特殊字符,请注意修改!'
|
||||
})
|
||||
} else {
|
||||
loading.value = true
|
||||
ElMessage('生成报告中...')
|
||||
exportModel(form).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
@@ -156,6 +158,9 @@ const exportEvent = () => {
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
loading.value =false
|
||||
}).catch((err: any) => {
|
||||
loading.value =false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user