修改问题
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="统计指标" label-width="80px">
|
||||
<el-select
|
||||
style="width: 200px"
|
||||
multiple
|
||||
:multiple-limit="3"
|
||||
collapse-tags
|
||||
@@ -199,7 +200,7 @@ queryByCode(
|
||||
// }
|
||||
// )
|
||||
// } else {
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1)
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1)
|
||||
// }
|
||||
if (!countDataCopy.value[index].count || countDataCopy.value[index].count.length == 0) {
|
||||
countDataCopy.value[index].count = countDataCopy.value[index].countOptions[0]
|
||||
@@ -866,4 +867,13 @@ defineExpose({ getTrendRequest })
|
||||
min-width: 100px;
|
||||
}
|
||||
}
|
||||
:deep(.el-select__selected-item) {
|
||||
.is-closable {
|
||||
width: 100px !important;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-form--inline .el-form-item) {
|
||||
margin-right: 15px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<template v-slot:select :key="num">
|
||||
<el-form-item for="-" label="统计指标">
|
||||
<el-select
|
||||
style="min-width: 200px"
|
||||
style="min-width: 240px"
|
||||
filterable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
@@ -519,7 +519,7 @@ const lineStyle = [{ type: 'solid' }, { type: 'dashed' }, { type: 'dotted' }]
|
||||
|
||||
const titleList: any = ref('(未绑定数据)')
|
||||
const init = (flag: boolean) => {
|
||||
titleList.value = '(未绑定数据)'
|
||||
titleList.value = ''
|
||||
let list: any = []
|
||||
|
||||
//颜色数组
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<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" :style="`height: calc(${tableStore.table.height} + 65px)`">
|
||||
@@ -144,6 +146,7 @@ import { getLineExport } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
defineOptions({
|
||||
name: 'TransientReport/monitoringpointReport'
|
||||
})
|
||||
const loading = ref(false)
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
const dictData = useDictData()
|
||||
@@ -210,7 +213,7 @@ const exportEvent = () => {
|
||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||
}
|
||||
let a = ''
|
||||
|
||||
loading.value = true
|
||||
// formd.value.lineId = monitoringPoint.state.lineId
|
||||
// formd.value.lineName = monitoringPoint.state.lineName.split('>').at(-1)
|
||||
formd.value.lineId = dotList.value.id
|
||||
@@ -219,26 +222,37 @@ const exportEvent = () => {
|
||||
formd.value.searchEndTime = TableHeaderRef.value.datePickerRef.timeValue[1]
|
||||
formd.value.flag = TableHeaderRef.value.datePickerRef.interval
|
||||
ElMessage('生成报告中,请稍等!')
|
||||
const now = new Date()
|
||||
|
||||
const now = new Date()
|
||||
const year = now.getFullYear() // 4位年份
|
||||
const month = now.getMonth() + 1 // 月份0-11,需+1
|
||||
const day = now.getDate() // 日期1-31
|
||||
|
||||
// 格式化YYYY - MM - DD(补零)
|
||||
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
||||
getLineExport(formd.value).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
getLineExport(formd.value)
|
||||
.then(async (res: any) => {
|
||||
if (res == undefined) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
|
||||
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 + formattedDate // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
loading.value = false
|
||||
})
|
||||
.catch((err: any) => {
|
||||
loading.value = false
|
||||
})
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = dotList.value.name+formattedDate // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
<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">
|
||||
@@ -85,7 +87,7 @@ const TableHeaderRef = ref()
|
||||
const dotList: any = ref({})
|
||||
const Template: any = ref({})
|
||||
const uploadList: any = ref([])
|
||||
|
||||
const loading = ref(false)
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
@@ -125,7 +127,6 @@ const exportEvent = () => {
|
||||
if (dotList.value?.level != 4) {
|
||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||
}
|
||||
|
||||
let form = new FormData()
|
||||
form.append('lineIndex', dotList.value.id)
|
||||
form.append('name', dotList.value.name)
|
||||
@@ -147,6 +148,8 @@ const exportEvent = () => {
|
||||
message: '包含特殊字符,请注意修改!'
|
||||
})
|
||||
} else {
|
||||
loading.value = true
|
||||
|
||||
ElMessage('生成报告中...')
|
||||
const now = new Date()
|
||||
const year = now.getFullYear() // 4位年份
|
||||
@@ -155,19 +158,28 @@ const exportEvent = () => {
|
||||
|
||||
// 格式化YYYY - MM - DD(补零)
|
||||
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
||||
exportModel(form).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
exportModel(form)
|
||||
.then((res: any) => {
|
||||
if (res == undefined) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
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 + formattedDate // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = dotList.value.name + formattedDate // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user