修改问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
// 查询设备数据趋势
|
// 查询设备数据趋势
|
||||||
export function getDeviceDataTrend(data: any) {
|
export function getDeviceDataTrend(data: any) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -9,8 +9,6 @@ export function getDeviceDataTrend(data: any) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 波形下载
|
// 波形下载
|
||||||
export function getFileZip(params: any) {
|
export function getFileZip(params: any) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -27,5 +25,35 @@ export function exportModel(data: any) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
async function readJsonBlob(blob) {
|
||||||
|
try {
|
||||||
|
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||||
|
const jsonStr = await blob.text()
|
||||||
|
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||||
|
const jsonData = JSON.parse(jsonStr)
|
||||||
|
// 3. 拿到数据,后续随便用
|
||||||
|
return {
|
||||||
|
code: true,
|
||||||
|
data: jsonData
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
return {
|
||||||
|
code: false,
|
||||||
|
data: {}
|
||||||
|
}
|
||||||
|
// console.error('解析Blob的JSON数据失败:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
// 主要监测点列表查询>>分页
|
// 主要监测点列表查询>>分页
|
||||||
export function mainLineList(data: any) {
|
export function mainLineList(data: any) {
|
||||||
return request({
|
return request({
|
||||||
@@ -115,7 +115,6 @@ export function limitProbabilityData(data: any) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 电网侧指标越限统计列表
|
// 电网侧指标越限统计列表
|
||||||
export function gridSideLimitStatisticsList(data: any) {
|
export function gridSideLimitStatisticsList(data: any) {
|
||||||
return request({
|
return request({
|
||||||
@@ -152,7 +151,6 @@ export function getListByIds(data: any) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 上传治理报告
|
// 上传治理报告
|
||||||
export function uploadReport(data: any) {
|
export function uploadReport(data: any) {
|
||||||
return request({
|
return request({
|
||||||
@@ -260,14 +258,42 @@ export function getSimpleLine() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getLineExport(data: any) {
|
||||||
export function getLineExport(data:any) {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/cs-harmonic-boot/eventReport/getLineExport',
|
url: '/cs-harmonic-boot/eventReport/getLineExport',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function readJsonBlob(blob) {
|
||||||
|
try {
|
||||||
|
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||||
|
const jsonStr = await blob.text()
|
||||||
|
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||||
|
const jsonData = JSON.parse(jsonStr)
|
||||||
|
// 3. 拿到数据,后续随便用
|
||||||
|
return {
|
||||||
|
code: true,
|
||||||
|
data: jsonData
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
return {
|
||||||
|
code: false,
|
||||||
|
data: {}
|
||||||
|
}
|
||||||
|
// console.error('解析Blob的JSON数据失败:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 213 KiB |
@@ -26,12 +26,21 @@
|
|||||||
<div v-loading="tableStore.table.loading">
|
<div v-loading="tableStore.table.loading">
|
||||||
<my-echart
|
<my-echart
|
||||||
class="tall"
|
class="tall"
|
||||||
|
v-if="lineShow"
|
||||||
:options="echartList1"
|
:options="echartList1"
|
||||||
:style="{
|
:style="{
|
||||||
width: prop.width,
|
width: prop.width,
|
||||||
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
|
<el-empty
|
||||||
|
v-else
|
||||||
|
description="暂无监测点"
|
||||||
|
:style="{
|
||||||
|
width: prop.width,
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
|
||||||
|
}"
|
||||||
|
/>
|
||||||
<!-- <my-echart
|
<!-- <my-echart
|
||||||
class="mt10"
|
class="mt10"
|
||||||
:options="echartList1"
|
:options="echartList1"
|
||||||
@@ -68,7 +77,7 @@ const lineList = ref()
|
|||||||
const headerHeight = ref(57)
|
const headerHeight = ref(57)
|
||||||
|
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
|
const lineShow = ref(true)
|
||||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||||
headerHeight.value = height
|
headerHeight.value = height
|
||||||
|
|
||||||
@@ -99,6 +108,11 @@ const probabilityData = ref()
|
|||||||
|
|
||||||
const initLineList = async () => {
|
const initLineList = async () => {
|
||||||
cslineList({}).then(res => {
|
cslineList({}).then(res => {
|
||||||
|
if (res.data.length == 0) {
|
||||||
|
lineShow.value = false
|
||||||
|
return (tableStore.table.loading = false)
|
||||||
|
}
|
||||||
|
lineShow.value = true
|
||||||
lineList.value = res.data
|
lineList.value = res.data
|
||||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
</TableHeader>
|
</TableHeader>
|
||||||
<div v-loading="tableStore.table.loading">
|
<div v-loading="tableStore.table.loading">
|
||||||
<my-echart
|
<my-echart
|
||||||
|
v-if="lineShow"
|
||||||
class="tall"
|
class="tall"
|
||||||
:options="echartList"
|
:options="echartList"
|
||||||
:style="{
|
:style="{
|
||||||
@@ -31,6 +32,14 @@
|
|||||||
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
|
<el-empty
|
||||||
|
v-else
|
||||||
|
description="暂无监测点"
|
||||||
|
:style="{
|
||||||
|
width: prop.width,
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
|
||||||
|
}"
|
||||||
|
/>
|
||||||
<!-- <my-echart
|
<!-- <my-echart
|
||||||
class="mt10"
|
class="mt10"
|
||||||
:options="echartList1"
|
:options="echartList1"
|
||||||
@@ -59,7 +68,7 @@ const prop = defineProps({
|
|||||||
timeValue: { type: Object },
|
timeValue: { type: Object },
|
||||||
interval: { type: Number }
|
interval: { type: Number }
|
||||||
})
|
})
|
||||||
|
const lineShow = ref(true)
|
||||||
// const options = ref(JSON.parse(window.localStorage.getItem('lineIdList') || '[]'))
|
// const options = ref(JSON.parse(window.localStorage.getItem('lineIdList') || '[]'))
|
||||||
|
|
||||||
const lineList = ref()
|
const lineList = ref()
|
||||||
@@ -98,6 +107,11 @@ const probabilityData = ref()
|
|||||||
|
|
||||||
const initLineList = async () => {
|
const initLineList = async () => {
|
||||||
cslineList({}).then(res => {
|
cslineList({}).then(res => {
|
||||||
|
if (res.data.length == 0) {
|
||||||
|
lineShow.value = false
|
||||||
|
return (tableStore.table.loading = false)
|
||||||
|
}
|
||||||
|
lineShow.value = true
|
||||||
lineList.value = res.data
|
lineList.value = res.data
|
||||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
|
|||||||
@@ -75,12 +75,21 @@
|
|||||||
<div v-loading="tableStore.table.loading">
|
<div v-loading="tableStore.table.loading">
|
||||||
<my-echart
|
<my-echart
|
||||||
class="tall"
|
class="tall"
|
||||||
|
v-if="lineShow"
|
||||||
:options="echartList"
|
:options="echartList"
|
||||||
:style="{
|
:style="{
|
||||||
width: prop.width,
|
width: prop.width,
|
||||||
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
|
<el-empty
|
||||||
|
v-else
|
||||||
|
description="暂无监测点"
|
||||||
|
:style="{
|
||||||
|
width: prop.width,
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
|
||||||
|
}"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -114,7 +123,7 @@ const lineList: any = ref()
|
|||||||
const powerList: any = ref()
|
const powerList: any = ref()
|
||||||
|
|
||||||
const chartsList = ref<any>([])
|
const chartsList = ref<any>([])
|
||||||
|
const lineShow = ref(true)
|
||||||
// 计算是否全屏展示
|
// 计算是否全屏展示
|
||||||
const fullscreen = computed(() => {
|
const fullscreen = computed(() => {
|
||||||
const w = Number(prop.w)
|
const w = Number(prop.w)
|
||||||
@@ -141,6 +150,11 @@ const indicatorList = ref()
|
|||||||
|
|
||||||
const initLineList = async () => {
|
const initLineList = async () => {
|
||||||
cslineList({}).then(res => {
|
cslineList({}).then(res => {
|
||||||
|
if (res.data.length == 0) {
|
||||||
|
lineShow.value = false
|
||||||
|
return (tableStore.table.loading = false)
|
||||||
|
}
|
||||||
|
lineShow.value = true
|
||||||
lineList.value = res.data
|
lineList.value = res.data
|
||||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||||
initCode()
|
initCode()
|
||||||
|
|||||||
@@ -166,8 +166,8 @@ const tableStore: any = new TableStore({
|
|||||||
// ...row,
|
// ...row,
|
||||||
// duration: row.persistTime // 将 persistTime 值赋给 duration
|
// duration: row.persistTime // 将 persistTime 值赋给 duration
|
||||||
// }
|
// }
|
||||||
boxoList.value.featureAmplitude =
|
boxoList.value.featureAmplitude = (row.amplitude - 0) / 100
|
||||||
row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
|
// row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
|
||||||
boxoList.value.systemType = 'YPT'
|
boxoList.value.systemType = 'YPT'
|
||||||
wp.value = res.data
|
wp.value = res.data
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,8 +166,9 @@ const tableStore: any = new TableStore({
|
|||||||
// ...row,
|
// ...row,
|
||||||
// duration: row.persistTime // 将 persistTime 值赋给 duration
|
// duration: row.persistTime // 将 persistTime 值赋给 duration
|
||||||
// }
|
// }
|
||||||
boxoList.value.featureAmplitude =
|
// boxoList.value.featureAmplitude =
|
||||||
row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
|
// row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
|
||||||
|
boxoList.value.featureAmplitude = (row.amplitude - 0) / 100
|
||||||
boxoList.value.systemType = 'YPT'
|
boxoList.value.systemType = 'YPT'
|
||||||
wp.value = res.data
|
wp.value = res.data
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div v-loading="loading" style="position: relative; height: 100%">
|
<div v-loading="loading" style="position: relative; height: 100%">
|
||||||
<div id="boxr">
|
<div id="boxr">
|
||||||
<div id="rmsp" :style="`height:${vh};overflow: hidden;min-height: 200px;`">
|
<div id="rmsp" :style="`height:${vh};overflow: hidden;min-height: 200px;`">
|
||||||
<div class="bx" id="rms" style="min-height: 200px;"></div>
|
<div class="bx" id="rms" style="min-height: 200px"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -749,7 +749,7 @@ const initWave = (
|
|||||||
y: -10
|
y: -10
|
||||||
},
|
},
|
||||||
max: rmscm[0]?.[1] * 1.06 || 0,
|
max: rmscm[0]?.[1] * 1.06 || 0,
|
||||||
min: rmscu[0]?.[1] - rmscu[0]?.[1] * 0.04 || 0,
|
min: rmscu[0]?.[1] - rmscu[0]?.[1] * 0.2 || 0,
|
||||||
boundaryGap: [0, '100%'],
|
boundaryGap: [0, '100%'],
|
||||||
showLastLabel: true,
|
showLastLabel: true,
|
||||||
opposite: false,
|
opposite: false,
|
||||||
@@ -768,7 +768,7 @@ const initWave = (
|
|||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
color: props.DColor ? '#000' : echartsColor.WordColor,
|
color: props.DColor ? '#000' : echartsColor.WordColor,
|
||||||
formatter: function (value: number) {
|
formatter: function (value: number) {
|
||||||
return (value - 0).toFixed(2)
|
return Math.floor(value * 1000) / 1000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
@@ -1092,7 +1092,8 @@ const drawPics = (
|
|||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
color: props.DColor ? '#000' : echartsColor.WordColor,
|
color: props.DColor ? '#000' : echartsColor.WordColor,
|
||||||
formatter: function (value: number) {
|
formatter: function (value: number) {
|
||||||
return (value - 0).toFixed(2)
|
// return (value - 0).toFixed(2)
|
||||||
|
return Math.floor(value * 1000) / 1000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div v-loading="loading" class="boxbx" style="position: relative; height: 100%">
|
<div v-loading="loading" class="boxbx" style="position: relative; height: 100%">
|
||||||
<div id="boxsj">
|
<div id="boxsj">
|
||||||
<div id="shushi" :style="`height:${vh};overflow: hidden;min-height: 200px;`">
|
<div id="shushi" :style="`height:${vh};overflow: hidden;min-height: 200px;`">
|
||||||
<div class="bx" id="wave" style="min-height: 200px;"></div>
|
<div class="bx" id="wave" style="min-height: 200px"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -499,7 +499,8 @@ const initWave = (
|
|||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
color: props.DColor ? '#000' : echartsColor.WordColor,
|
color: props.DColor ? '#000' : echartsColor.WordColor,
|
||||||
formatter: function (value: number) {
|
formatter: function (value: number) {
|
||||||
return (value - 0).toFixed(2)
|
// return (value - 0).toFixed(2)
|
||||||
|
return Math.floor(value * 1000) / 1000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
@@ -806,7 +807,8 @@ const drawPics = (
|
|||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
color: props.DColor ? '#000' : echartsColor.WordColor,
|
color: props.DColor ? '#000' : echartsColor.WordColor,
|
||||||
formatter: function (value: number) {
|
formatter: function (value: number) {
|
||||||
return (value - 0).toFixed(2)
|
// return (value - 0).toFixed(2)
|
||||||
|
return Math.floor(value * 1000) / 1000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div ref="tableHeader" class="cn-table-header">
|
<div ref="tableHeader" class="cn-table-header">
|
||||||
<div class="table-header ba-scroll-style" :key="num">
|
<div class="table-header ba-scroll-style" :key="num">
|
||||||
<el-form
|
<el-form
|
||||||
style="flex: 1; height: 34px; margin-right: 20px; display: flex; flex-wrap: wrap"
|
style="flex: 1; height: 34px; margin-right: 0px; display: flex; flex-wrap: wrap"
|
||||||
ref="headerForm"
|
ref="headerForm"
|
||||||
@submit.prevent=""
|
@submit.prevent=""
|
||||||
@keyup.enter="onComSearch"
|
@keyup.enter="onComSearch"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="统计指标" label-width="80px">
|
<el-form-item label="统计指标" label-width="80px">
|
||||||
<el-select
|
<el-select
|
||||||
|
style="width: 200px"
|
||||||
multiple
|
multiple
|
||||||
:multiple-limit="3"
|
:multiple-limit="3"
|
||||||
collapse-tags
|
collapse-tags
|
||||||
@@ -199,7 +200,7 @@ queryByCode(
|
|||||||
// }
|
// }
|
||||||
// )
|
// )
|
||||||
// } else {
|
// } 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) {
|
if (!countDataCopy.value[index].count || countDataCopy.value[index].count.length == 0) {
|
||||||
countDataCopy.value[index].count = countDataCopy.value[index].countOptions[0]
|
countDataCopy.value[index].count = countDataCopy.value[index].countOptions[0]
|
||||||
@@ -866,4 +867,13 @@ defineExpose({ getTrendRequest })
|
|||||||
min-width: 100px;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
<template v-slot:select :key="num">
|
<template v-slot:select :key="num">
|
||||||
<el-form-item for="-" label="统计指标">
|
<el-form-item for="-" label="统计指标">
|
||||||
<el-select
|
<el-select
|
||||||
style="min-width: 200px"
|
style="min-width: 240px"
|
||||||
filterable
|
filterable
|
||||||
collapse-tags
|
collapse-tags
|
||||||
collapse-tags-tooltip
|
collapse-tags-tooltip
|
||||||
@@ -519,7 +519,7 @@ const lineStyle = [{ type: 'solid' }, { type: 'dashed' }, { type: 'dotted' }]
|
|||||||
|
|
||||||
const titleList: any = ref('(未绑定数据)')
|
const titleList: any = ref('(未绑定数据)')
|
||||||
const init = (flag: boolean) => {
|
const init = (flag: boolean) => {
|
||||||
titleList.value = '(未绑定数据)'
|
titleList.value = ''
|
||||||
let list: any = []
|
let list: any = []
|
||||||
|
|
||||||
//颜色数组
|
//颜色数组
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<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>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<div class="box" :style="`height: calc(${tableStore.table.height} + 65px)`">
|
<div class="box" :style="`height: calc(${tableStore.table.height} + 65px)`">
|
||||||
@@ -144,6 +146,7 @@ import { getLineExport } from '@/api/harmonic-boot/cockpit/cockpit'
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'TransientReport/monitoringpointReport'
|
name: 'TransientReport/monitoringpointReport'
|
||||||
})
|
})
|
||||||
|
const loading = ref(false)
|
||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const size = ref(0)
|
const size = ref(0)
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
@@ -210,7 +213,7 @@ const exportEvent = () => {
|
|||||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||||
}
|
}
|
||||||
let a = ''
|
let a = ''
|
||||||
|
loading.value = true
|
||||||
// formd.value.lineId = monitoringPoint.state.lineId
|
// formd.value.lineId = monitoringPoint.state.lineId
|
||||||
// formd.value.lineName = monitoringPoint.state.lineName.split('>').at(-1)
|
// formd.value.lineName = monitoringPoint.state.lineName.split('>').at(-1)
|
||||||
formd.value.lineId = dotList.value.id
|
formd.value.lineId = dotList.value.id
|
||||||
@@ -219,26 +222,37 @@ const exportEvent = () => {
|
|||||||
formd.value.searchEndTime = TableHeaderRef.value.datePickerRef.timeValue[1]
|
formd.value.searchEndTime = TableHeaderRef.value.datePickerRef.timeValue[1]
|
||||||
formd.value.flag = TableHeaderRef.value.datePickerRef.interval
|
formd.value.flag = TableHeaderRef.value.datePickerRef.interval
|
||||||
ElMessage('生成报告中,请稍等!')
|
ElMessage('生成报告中,请稍等!')
|
||||||
const now = new Date()
|
|
||||||
|
const now = new Date()
|
||||||
const year = now.getFullYear() // 4位年份
|
const year = now.getFullYear() // 4位年份
|
||||||
const month = now.getMonth() + 1 // 月份0-11,需+1
|
const month = now.getMonth() + 1 // 月份0-11,需+1
|
||||||
const day = now.getDate() // 日期1-31
|
const day = now.getDate() // 日期1-31
|
||||||
|
|
||||||
// 格式化YYYY - MM - DD(补零)
|
// 格式化YYYY - MM - DD(补零)
|
||||||
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
||||||
getLineExport(formd.value).then((res: any) => {
|
getLineExport(formd.value)
|
||||||
let blob = new Blob([res], {
|
.then(async (res: any) => {
|
||||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
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>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -43,7 +43,9 @@
|
|||||||
<el-button icon="el-icon-Upload" type="primary" class="mr10 ml10">上传接线图</el-button>
|
<el-button icon="el-icon-Upload" type="primary" class="mr10 ml10">上传接线图</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</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>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
@@ -85,7 +87,7 @@ const TableHeaderRef = ref()
|
|||||||
const dotList: any = ref({})
|
const dotList: any = ref({})
|
||||||
const Template: any = ref({})
|
const Template: any = ref({})
|
||||||
const uploadList: any = ref([])
|
const uploadList: any = ref([])
|
||||||
|
const loading = ref(false)
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '',
|
url: '',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -125,7 +127,6 @@ const exportEvent = () => {
|
|||||||
if (dotList.value?.level != 4) {
|
if (dotList.value?.level != 4) {
|
||||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||||
}
|
}
|
||||||
|
|
||||||
let form = new FormData()
|
let form = new FormData()
|
||||||
form.append('lineIndex', dotList.value.id)
|
form.append('lineIndex', dotList.value.id)
|
||||||
form.append('name', dotList.value.name)
|
form.append('name', dotList.value.name)
|
||||||
@@ -147,6 +148,8 @@ const exportEvent = () => {
|
|||||||
message: '包含特殊字符,请注意修改!'
|
message: '包含特殊字符,请注意修改!'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
loading.value = true
|
||||||
|
|
||||||
ElMessage('生成报告中...')
|
ElMessage('生成报告中...')
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
const year = now.getFullYear() // 4位年份
|
const year = now.getFullYear() // 4位年份
|
||||||
@@ -155,19 +158,28 @@ const exportEvent = () => {
|
|||||||
|
|
||||||
// 格式化YYYY - MM - DD(补零)
|
// 格式化YYYY - MM - DD(补零)
|
||||||
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
||||||
exportModel(form).then((res: any) => {
|
exportModel(form)
|
||||||
let blob = new Blob([res], {
|
.then((res: any) => {
|
||||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
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>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user