修改冀北页面
This commit is contained in:
@@ -42,7 +42,8 @@
|
||||
{{
|
||||
isNaN((monitoringPoints.abnormalNum / monitoringPoints.runNum) * 100)
|
||||
? 0
|
||||
: ((monitoringPoints.abnormalNum / monitoringPoints.runNum) * 100).toFixed(2)
|
||||
: Math.floor((monitoringPoints.abnormalNum / monitoringPoints.runNum) * 10000) /
|
||||
100
|
||||
}}%
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div style="height: 135px" class="box1">
|
||||
<div class="boxDiv hexagon hexagon2">
|
||||
<div style="color: #fff">{{ statisticsList.checkNum }}</div>
|
||||
<div class="mt10 divBot">检修</div>
|
||||
<div class="mt10 divBot">调试</div>
|
||||
</div>
|
||||
<div class="boxDiv hexagon hexagon3">
|
||||
<div style="color: #fff">{{ statisticsList.stopRunNum }}</div>
|
||||
@@ -201,9 +201,9 @@ const tableStore: any = new TableStore({
|
||||
|
||||
// tableStore.table.data
|
||||
statisticsList.value.allNum = totalData.value.length
|
||||
statisticsList.value.runNum = tableStore.table.data.allNum
|
||||
statisticsList.value.checkNum = tableStore.table.data.allNum
|
||||
statisticsList.value.stopRunNum = tableStore.table.data.allNum
|
||||
statisticsList.value.runNum = totalData.value.filter(item => item.runFlag === '运行').length
|
||||
statisticsList.value.checkNum = totalData.value.filter(item => item.runFlag === '调试').length
|
||||
statisticsList.value.stopRunNum = totalData.value.filter(item => item.runFlag === '停运').length
|
||||
|
||||
abnormal.value = tableStore.table.data
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,7 +60,8 @@
|
||||
{{
|
||||
isNaN((monitoringPoints.abnormalNum / monitoringPoints.runNum) * 100)
|
||||
? 0
|
||||
: ((monitoringPoints.abnormalNum / monitoringPoints.runNum) * 100).toFixed(2)
|
||||
: Math.floor((monitoringPoints.abnormalNum / monitoringPoints.runNum) * 10000) /
|
||||
100
|
||||
}}%
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<template>
|
||||
<div style="height: 145px" class="box1">
|
||||
<div class="boxDiv hexagon">
|
||||
<div class="text-style">{{ props.params.allNum }}</div>
|
||||
<div class="text-style" @click="change('')">{{ props.params.allNum }}</div>
|
||||
<!-- <div class="hexagon"></div> -->
|
||||
<div class="mt10 divBot">总数</div>
|
||||
</div>
|
||||
<div class="boxDiv hexagon hexagon1">
|
||||
<div class="text-style">{{ props.params.runNum }}</div>
|
||||
<div class="text-style" @click="change('运行')">{{ props.params.runNum }}</div>
|
||||
<!-- <div class="hexagon"></div> -->
|
||||
<div class="mt10 divBot">在运</div>
|
||||
</div>
|
||||
<div class="boxDiv hexagon hexagon2">
|
||||
<div class="text-style">{{ props.params.checkNum }}</div>
|
||||
<div class="text-style" @click="change('调试')">{{ props.params.checkNum }}</div>
|
||||
<!-- <div class="hexagon"></div> -->
|
||||
<div class="mt10 divBot">检修</div>
|
||||
<div class="mt10 divBot">调试</div>
|
||||
</div>
|
||||
<div class="boxDiv hexagon hexagon3">
|
||||
<div class="text-style">{{ props.params.stopRunNum }}</div>
|
||||
<div class="text-style" @click="change('停运')">{{ props.params.stopRunNum }}</div>
|
||||
<!-- <div class="hexagon"></div> -->
|
||||
<div class="mt10 divBot">停运</div>
|
||||
</div>
|
||||
@@ -27,6 +27,7 @@ import { ref, reactive, onMounted } from 'vue'
|
||||
import MyEChart from '@/components/echarts/MyEchart.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { color } from '@/components/echarts/color'
|
||||
const emit=defineEmits(['change'])
|
||||
const height = mainHeight(330, 3)
|
||||
const props = defineProps({
|
||||
params: {
|
||||
@@ -34,6 +35,9 @@ const props = defineProps({
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
const change = (e: string) => {
|
||||
emit('change',e)
|
||||
}
|
||||
const info = () => {}
|
||||
onMounted(() => {
|
||||
info()
|
||||
|
||||
@@ -30,9 +30,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<statistics :params="statisticsList" />
|
||||
|
||||
|
||||
<statistics :params="statisticsList" @change="change" />
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="mt10">
|
||||
@@ -82,7 +80,7 @@
|
||||
<span
|
||||
style="width: 90px; color: #388e3c"
|
||||
class="text text-style"
|
||||
@click="renderTable(o.list, o.name+'_')"
|
||||
@click="renderTable(o.list, o.name + '_')"
|
||||
>
|
||||
{{ o.count }}
|
||||
</span>
|
||||
@@ -197,7 +195,7 @@ import statistics from './components/statistics.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getMonitorVerifyDay } from '@/api/device-boot/dataVerify'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
name: 'runManage/runEvaluate'
|
||||
})
|
||||
|
||||
const dictData = useDictData()
|
||||
@@ -267,9 +265,9 @@ const tableStore = new TableStore({
|
||||
|
||||
// tableStore.table.data
|
||||
statisticsList.value.allNum = totalData.value.length
|
||||
statisticsList.value.runNum = tableStore.table.data.allNum
|
||||
statisticsList.value.checkNum = tableStore.table.data.allNum
|
||||
statisticsList.value.stopRunNum = tableStore.table.data.allNum
|
||||
statisticsList.value.runNum = totalData.value.filter(item => item.runFlag === '运行').length
|
||||
statisticsList.value.checkNum = totalData.value.filter(item => item.runFlag === '调试').length
|
||||
statisticsList.value.stopRunNum = totalData.value.filter(item => item.runFlag === '停运').length
|
||||
|
||||
abnormal.value = tableStore.table.data
|
||||
// 合并子集数据 并去重
|
||||
@@ -423,6 +421,16 @@ const totalTable = (num: number, t: string) => {
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
const change = (e: string) => {
|
||||
title.value = e==''?'' : e+'_'
|
||||
loading.value = true
|
||||
pageNum.value = 1
|
||||
dataList.value = []
|
||||
dataList.value = totalData.value.filter(item => item.runFlag == e)
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
// 渲染表格
|
||||
const renderTable = (list: any, t: string) => {
|
||||
title.value = t
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<el-tab-pane label="运行情况" name="4" lazy :style="height" v-if="!isReload">
|
||||
<RunningCondition />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="暂态报告" name="5" lazy >
|
||||
<el-tab-pane label="暂态报告" name="5" lazy v-if="VITE_FLAG">
|
||||
<TransientReport />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@@ -31,7 +31,7 @@ import TransientReport from './transientReport/index.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import router from '@/router'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
defineOptions({
|
||||
name: 'Descentsystem/monitoringpoint'
|
||||
})
|
||||
|
||||
@@ -155,8 +155,8 @@ const dotList: any = ref({
|
||||
})
|
||||
|
||||
const formd: any = ref({
|
||||
xq: false,
|
||||
lb: false,
|
||||
xq: true,
|
||||
lb: true,
|
||||
mdbg: false,
|
||||
mdtx: false,
|
||||
sjdITIC: false,
|
||||
|
||||
Reference in New Issue
Block a user