修改冀北页面

This commit is contained in:
guanj
2025-12-01 13:19:18 +08:00
parent a19cbf233e
commit dac950c4c1
13 changed files with 848 additions and 647 deletions

View File

@@ -346,7 +346,7 @@ const echart = () => {
name: '异常占比',
type: 'bar',
barWidth: 13,
data: [monitoringPoints.value.totalOnlineRate - 0],
data: [monitoringPoints.value.totalOnlineRate ==0?'':monitoringPoints.value.totalOnlineRate],
z: 0,
zlevel: 0,
itemStyle: {

View File

@@ -345,7 +345,7 @@ const echart = () => {
name: '异常占比',
type: 'bar',
barWidth: 13,
data: [monitoringPoints.value.totalOnlineRate - 0],
data: [monitoringPoints.value.totalOnlineRate == 0 ? '' : monitoringPoints.value.totalOnlineRate],
z: 0,
zlevel: 0,
itemStyle: {

View File

@@ -44,6 +44,9 @@
<el-tab-pane label="实时数据" name="7" lazy v-if="!isReload && !VITE_FLAG">
<Shishishuju v-if="activeName == '7'" />
</el-tab-pane>
<el-tab-pane label="统计报表" name="8" lazy v-if="!isReload && VITE_FLAG">
<StatisticalReport v-if="activeName == '8'" />
</el-tab-pane>
</el-tabs>
<!-- <div
class="monitoring-point"
@@ -70,6 +73,7 @@ import Xiebopingpu from './xiebopingpu/index.vue'
import Gaojingshujutongji from './gaojingshujutongji/index.vue'
import Yunxingzhuangtai from './yunxingzhuangtai/index.vue'
import Shishishuju from './shishishuju/index.vue'
import StatisticalReport from './statisticalReport/index.vue'
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
import router from '@/router'

View File

@@ -0,0 +1,189 @@
<template>
<div class="" :style="height">
<TableHeader ref="TableHeaderRef" datePicker @selectChange="selectChange">
<template v-slot:select>
<el-form-item label="模板策略">
<el-select v-model="Template" @change="changetype" placeholder="请选择模版" value-key="id">
<el-option
v-for="item in templatePolicy"
:key="item.id"
:label="item.name"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="报表类型">
<el-input readonly type="text" value="分析报表"></el-input>
<!-- <el-select-->
<!-- :disabled="true"-->
<!-- v-model="reportForm"-->
<!-- :popper-append-to-body="false"-->
<!-- placeholder="请选择报表类型"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in reportFormList"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出excel</el-button>
<el-button icon="el-icon-Download" :loading="loading" @click="exportReport" type="primary">
下载报告
</el-button>
</template>
</TableHeader>
<div class="box">
<div id="luckysheet" :style="`height: calc(${tableStore.table.height} )`"></div>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, provide } from 'vue'
import 'splitpanes/dist/splitpanes.css'
import { Splitpanes, Pane } from 'splitpanes'
import TableStore from '@/utils/tableStore'
import PointTree from '@/components/tree/pqs/pointTree.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { exportModelJB } from '@/api/harmonic-boot/harmonic'
import { mainHeight } from '@/utils/layout'
import { getTemplateByDept } from '@/api/harmonic-boot/luckyexcel'
import { exportExcel } from '@/views/system/reportForms/export.js'
import { ElMessage } from 'element-plus'
import { useMonitoringPoint } from '@/stores/monitoringPoint'
defineOptions({
name: 'harmonic-boot/xieboReport'
})
const monitoringPoint = useMonitoringPoint()
const showTree = ref(false)
const height = mainHeight(20)
const size = ref(0)
const dictData = useDictData()
const TableHeaderRef = ref()
const dotList: any = ref({})
const Template: any = ref({})
const reportForm: any = ref('')
const templatePolicy: any = ref([])
const tableStore = new TableStore({
url: '/harmonic-boot/customReport/getCustomReport',
method: 'POST',
column: [],
publicHeight: 30,
beforeSearchFun: () => {
tableStore.table.params.tempId = Template.value.id
tableStore.table.params.lineId =monitoringPoint.state.lineId
},
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.data1 ? (item.data = JSON.parse(item.data1)) : ''
item.celldata.forEach((k: any) => {
item.data[k.r][k.c].v ? (item.data[k.r][k.c] = k.v) : ''
})
})
console.log(tableStore.table.data)
setTimeout(() => {
luckysheet.create({
container: 'luckysheet',
title: '', // 表 头名
lang: 'zh', // 中文
showtoolbar: false, // 是否显示工具栏
showinfobar: false, // 是否显示顶部信息栏
showsheetbar: true, // 是否显示底部sheet按钮
allowEdit: false, // 禁止所有编辑操作(必填)
data: tableStore.table.data
})
}, 10)
}
})
const loading = ref(false)
provide('tableStore', tableStore)
onMounted(() => {
const dom = document.getElementById('navigation-splitpanes')
if (dom) {
size.value = Math.round((180 / dom.offsetHeight) * 100)
}
})
getTemplateByDept({ id: dictData.state.area[0].id })
.then((res: any) => {
templatePolicy.value = res.data
Template.value = res.data[0]
reportForm.value = res.data[0]?.reportForm
showTree.value = true
tableStore.index()
})
.catch((err: any) => {
showTree.value = true
})
const changetype = (val: any) => {
reportForm.value = val.reportForm
}
const selectChange = () => {
console.log('🚀 ~ selectChange ~ tableStore.table.data.lnegth :', tableStore.table.data.length)
if (tableStore.table.data.length != 0) {
setTimeout(() => {
luckysheet && luckysheet?.resize()
}, 10)
}
}
const exportEvent = () => {
exportExcel(luckysheet.getAllSheets(), '统计报表下载')
}
const exportReport = () => {
loading.value = true
let form = new FormData()
form.append('isUrl', false)
form.append('lineIndex', dotList.value.id)
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
form.append('type', 0)
form.append('name', dotList.value.name)
ElMessage({
message: '下载报告中,请稍等.....',
duration: 1000
})
exportModelJB(form)
.then(async res => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download =
dotList.value.name +
TableHeaderRef.value.datePickerRef.timeValue[0] +
'_' +
TableHeaderRef.value.datePickerRef.timeValue[1] // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
loading.value = false
})
.catch(() => {
loading.value = false
})
}
</script>
<style lang="scss">
.splitpanes.default-theme .splitpanes__pane {
background: #eaeef1;
}
.box {
padding: 10px;
}
</style>

View File

@@ -165,14 +165,7 @@ const exportEvent = () => {
exportExcel(luckysheet.getAllSheets(), '统计报表下载')
}
const exportReport = () => {
if (!line) {
ElMessage({
type: 'warning',
message: '请选择要导出的数据'
})
return
}
loading.value = true
let form = new FormData()
form.append('isUrl', false)