优化项目
This commit is contained in:
@@ -92,8 +92,8 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '设备名称', field: 'ndid', align: 'center' },
|
||||
{ title: '异常时间', field: 'evtTime', align: 'center', sortable: true },
|
||||
{ title: '设备名称', field: 'ndid', align: 'center' },
|
||||
{
|
||||
title: '告警代码',
|
||||
field: 'code',
|
||||
|
||||
@@ -99,16 +99,17 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '设备名称', field: 'equipmentName', align: 'center', width: 120 },
|
||||
{ title: '监测点名称', field: 'lineName', align: 'center', width: 140 },
|
||||
{ title: '工程名称', field: 'engineeringName', align: 'center', width: 120 },
|
||||
{ title: '项目名称', field: 'projectName', align: 'center', width: 120 },
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', width: 180, sortable: true },
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', minWidth: 180, sortable: true },
|
||||
{ title: '工程名称', field: 'engineeringName', align: 'center', minWidth: 120 },
|
||||
{ title: '项目名称', field: 'projectName', align: 'center', minWidth: 120 },
|
||||
{ title: '设备名称', field: 'equipmentName', align: 'center', minWidth: 120 },
|
||||
{ title: '监测点名称', field: 'lineName', align: 'center', minWidth: 120 },
|
||||
|
||||
{
|
||||
title: '模块信息',
|
||||
field: 'moduleNo',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
@@ -117,7 +118,7 @@ const tableStore = new TableStore({
|
||||
title: '告警代码',
|
||||
field: 'code',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
minWidth: 100,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue ? '\u200B' + row.cellValue : '/'
|
||||
},
|
||||
@@ -125,13 +126,13 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
title: '事件描述',
|
||||
minWidth: 250,
|
||||
minWidth: 300,
|
||||
field: 'showName'
|
||||
},
|
||||
{
|
||||
title: '级别',
|
||||
field: 'level',
|
||||
width: 100,
|
||||
width: 110,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
// 1:Ⅰ级 2:Ⅱ级 3:Ⅲ级 4:DEBUG 5:NORMAL 6:WARN 7:ERROR
|
||||
@@ -202,7 +203,7 @@ tableStore.table.params.deviceTypeId = ''
|
||||
tableStore.table.params.deviceTypeName = ''
|
||||
const deviceTreeOptions = ref<any>(props.deviceTree)
|
||||
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||
if (item.children.length == 0) {
|
||||
if (item?.children.length == 0) {
|
||||
deviceTreeOptions.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -78,10 +78,10 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '前置服务器名称', field: 'lineId', align: 'center', width: 120 },
|
||||
{ title: '前置服务器ip', field: 'wavePath', align: 'center', width: 120 },
|
||||
{ title: '进程号', field: 'clDid', align: 'center', width: 60 },
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', width: 180, sortable: true },
|
||||
{ title: '前置服务器名称', field: 'lineId', align: 'center', width: 150 },
|
||||
{ title: '前置服务器ip', field: 'wavePath', align: 'center', width: 150 },
|
||||
{ title: '进程号', field: 'clDid', align: 'center', width: 70 },
|
||||
|
||||
{
|
||||
title: '事件描述',
|
||||
@@ -102,7 +102,7 @@ const tableStore = new TableStore({
|
||||
{
|
||||
title: '级别',
|
||||
field: 'level',
|
||||
width: 100,
|
||||
width: 110,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
// 1:Ⅰ级 2:Ⅱ级 3:Ⅲ级 4:DEBUG 5:NORMAL 6:WARN 7:ERROR
|
||||
@@ -153,7 +153,7 @@ tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.level = ''
|
||||
const deviceTreeOptions = ref<any>(props.deviceTree)
|
||||
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||
if (item.children.length == 0) {
|
||||
if (item?.children.length == 0) {
|
||||
deviceTreeOptions.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,16 +2,9 @@
|
||||
<TableHeader datePicker ref="refheader" showExport>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="数据来源">
|
||||
<el-cascader
|
||||
v-model.trim="tableStore.table.params.cascader"
|
||||
filterable
|
||||
placeholder="请选择数据来源"
|
||||
@change="sourceChange"
|
||||
:options="deviceTreeOptions"
|
||||
:show-all-levels="false"
|
||||
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
||||
clearable
|
||||
></el-cascader>
|
||||
<el-cascader v-model.trim="tableStore.table.params.cascader" filterable placeholder="请选择数据来源"
|
||||
@change="sourceChange" :options="deviceTreeOptions" :show-all-levels="false"
|
||||
:props="{ checkStrictly: true, value: 'id', label: 'name' }" clearable></el-cascader>
|
||||
<!-- <el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.searchValue" placeholder="请输入设备名称" /> -->
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="级别">
|
||||
@@ -83,14 +76,15 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '设备名称', field: 'equipmentName', align: 'center' },
|
||||
{ title: '工程名称', field: 'engineeringName', align: 'center' },
|
||||
{ title: '项目名称', field: 'projectName', align: 'center' },
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', sortable: true },
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', sortable: true, minWidth: 180, },
|
||||
{ title: '工程名称', field: 'engineeringName', align: 'center', minWidth: 120, },
|
||||
{ title: '项目名称', field: 'projectName', align: 'center', minWidth: 120, },
|
||||
{ title: '设备名称', field: 'equipmentName', align: 'center', minWidth: 120, },
|
||||
|
||||
{ title: '事件描述', field: 'showName', align: 'center' }
|
||||
|
||||
{ title: '事件描述', field: 'showName', align: 'center', minWidth: 250, }
|
||||
],
|
||||
beforeSearchFun: () => {}
|
||||
beforeSearchFun: () => { }
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
@@ -112,7 +106,7 @@ tableStore.table.params.deviceTypeName = ''
|
||||
|
||||
const deviceTreeOptions = ref<any>(props.deviceTree)
|
||||
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||
if (item.children.length == 0) {
|
||||
if (item?.children.length == 0) {
|
||||
deviceTreeOptions.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
@@ -143,6 +137,6 @@ onMounted(() => {
|
||||
setTimeout(() => {
|
||||
tableStore.table.height = mainHeight(200).height as any
|
||||
}, 0)
|
||||
const addMenu = () => {}
|
||||
const addMenu = () => { }
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
@@ -3,16 +3,10 @@
|
||||
<TableHeader datePicker showExport>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="数据来源">
|
||||
<el-cascader
|
||||
placeholder="请选择数据来源"
|
||||
@change="sourceChange"
|
||||
filterable
|
||||
v-model.trim="tableStore.table.params.cascader"
|
||||
:options="deviceTreeOptions"
|
||||
:show-all-levels="false"
|
||||
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
||||
clearable
|
||||
></el-cascader>
|
||||
<el-cascader placeholder="请选择数据来源" @change="sourceChange" filterable
|
||||
v-model.trim="tableStore.table.params.cascader" :options="deviceTreeOptions"
|
||||
:show-all-levels="false" :props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
||||
clearable></el-cascader>
|
||||
<!-- <el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.searchValue" placeholder="请输入设备名称" /> -->
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="级别">
|
||||
@@ -26,13 +20,8 @@
|
||||
|
||||
<Table></Table>
|
||||
</div>
|
||||
<waveFormAnalysis
|
||||
v-loading="loading"
|
||||
v-if="isWaveCharts"
|
||||
ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false"
|
||||
:wp="wp"
|
||||
/>
|
||||
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false" :wp="wp" />
|
||||
<!-- <div style="height: 300px;"> -->
|
||||
|
||||
<!-- <div style="padding: 10px" v-if="!view" v-loading="loading">
|
||||
@@ -129,16 +118,20 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '设备名称', field: 'equipmentName', minWidth: 120, align: 'center' },
|
||||
{ title: '暂降发生时刻', field: 'startTime', align: 'center', minWidth: 180, sortable: true },
|
||||
|
||||
|
||||
{ title: '暂降(骤升)幅值(%)', minWidth: 160, field: 'evtParamVVaDepth', align: 'center', sortable: true },
|
||||
|
||||
{ title: '持续时间(s)', field: 'evtParamTm', minWidth: 110, align: 'center', sortable: true },
|
||||
{ title: '相别', field: 'evtParamPhase', minWidth: 80, align: 'center' },
|
||||
|
||||
{ title: '触发类型', field: 'showName', minWidth: 120, align: 'center' },
|
||||
{ title: '工程名称', field: 'engineeringName', minWidth: 120, align: 'center' },
|
||||
{ title: '项目名称', field: 'projectName', minWidth: 120, align: 'center' },
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', minWidth: 180, sortable: true },
|
||||
{ title: '设备名称', field: 'equipmentName', minWidth: 120, align: 'center' },
|
||||
{ title: '监测点名称', field: 'lineName', minWidth: 120, align: 'center' },
|
||||
{ title: '事件描述', field: 'showName', minWidth: 120, align: 'center' },
|
||||
{ title: '事件发生位置', field: 'evtParamPosition', minWidth: 150, align: 'center' },
|
||||
{ title: '相别', field: 'evtParamPhase', minWidth: 80, align: 'center' },
|
||||
{ title: '持续时间(s)', field: 'evtParamTm', minWidth: 80, align: 'center', sortable: true },
|
||||
{ title: '暂降(聚升)幅值(%)', minWidth: 100, field: 'evtParamVVaDepth', align: 'center', sortable: true },
|
||||
{ title: '发生位置', field: 'evtParamPosition', minWidth: 150, align: 'center' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
@@ -219,6 +212,7 @@ const tableStore = new TableStore({
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
ElMessage.info('下载中......')
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
@@ -228,6 +222,7 @@ const tableStore = new TableStore({
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
ElMessage.success('波形下载成功')
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -238,7 +233,7 @@ const tableStore = new TableStore({
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.showName != '未知'
|
||||
return row.wavePath
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -295,7 +290,7 @@ tableStore.table.params.deviceTypeName = ''
|
||||
|
||||
const deviceTreeOptions: any = ref<any>(props.deviceTree)
|
||||
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||
if (item.children.length == 0) {
|
||||
if (item?.children.length == 0) {
|
||||
deviceTreeOptions.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
@@ -380,6 +375,6 @@ setTimeout(() => {
|
||||
tableStore.table.height = mainHeight(200).height as any
|
||||
}, 0)
|
||||
|
||||
const addMenu = () => {}
|
||||
const addMenu = () => { }
|
||||
</script>
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@@ -9,44 +9,23 @@
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计指标:">
|
||||
<el-select
|
||||
style="width: 200px"
|
||||
v-model.trim="formInline.statisticalId"
|
||||
filterable
|
||||
@change="frequencyFlag"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in zblist"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-select style="width: 200px" v-model.trim="formInline.statisticalId" filterable
|
||||
@change="frequencyFlag" placeholder="请选择">
|
||||
<el-option v-for="item in zblist" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="谐波次数:" v-show="frequencyShow">
|
||||
<el-select
|
||||
v-model.trim="formInline.frequency"
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 100px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in 49"
|
||||
:key="item + 1"
|
||||
:label="item + 1"
|
||||
:value="item + 1"
|
||||
></el-option>
|
||||
<el-select v-model.trim="formInline.frequency" filterable placeholder="请选择"
|
||||
style="width: 100px">
|
||||
<el-option v-for="item in 49" :key="item + 1" :label="item + 1"
|
||||
:value="item + 1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="值类型:">
|
||||
<el-select v-model.trim="formInline.valueType" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in typelist"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-option v-for="item in typelist" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -149,7 +128,7 @@ const deviceTypeChange = (val: any, obj: any) => {
|
||||
nodeClick(obj)
|
||||
}
|
||||
const nodeClick = async (e: anyObj) => {
|
||||
if (e.level == 2 && flag.value) {
|
||||
if ((e.level == 2 || e.level == 3) && flag.value) {
|
||||
formInline.devId = e.id
|
||||
loading.value = true
|
||||
if (zblist.value.length === 0) {
|
||||
@@ -158,7 +137,7 @@ const nodeClick = async (e: anyObj) => {
|
||||
getDevCapacity(formInline.devId)
|
||||
.then(res => {
|
||||
devCapacity.value = res.data
|
||||
|
||||
|
||||
search()
|
||||
})
|
||||
.catch(() => {
|
||||
@@ -261,19 +240,19 @@ const setEchart = () => {
|
||||
// ]),
|
||||
data: timeControl.value
|
||||
? completeTimeSeries(
|
||||
phaseList[j].map(item => [
|
||||
item.time,
|
||||
Math.floor(item.statisticalData * 100) / 100,
|
||||
unit,
|
||||
lineName.type
|
||||
])
|
||||
)
|
||||
phaseList[j].map(item => [
|
||||
item.time,
|
||||
Math.floor(item.statisticalData * 100) / 100,
|
||||
unit,
|
||||
lineName.type
|
||||
])
|
||||
)
|
||||
: phaseList[j].map(item => [
|
||||
item.time,
|
||||
Math.floor(item.statisticalData * 100) / 100,
|
||||
unit,
|
||||
lineName.type
|
||||
]),
|
||||
item.time,
|
||||
Math.floor(item.statisticalData * 100) / 100,
|
||||
unit,
|
||||
lineName.type
|
||||
]),
|
||||
|
||||
lineStyle: lineName,
|
||||
yAxisIndex: unit.indexOf(units)
|
||||
@@ -315,9 +294,8 @@ const setEchart = () => {
|
||||
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
|
||||
}
|
||||
|
||||
str += `${marker}${el.seriesName.split('(')[0]}:${
|
||||
el.value[1] != null ? el.value[1] + ' ' + (el.value[2] == 'null' ? '' : el.value[2]) : '-'
|
||||
}<br>`
|
||||
str += `${marker}${el.seriesName.split('(')[0]}:${el.value[1] != null ? el.value[1] + ' ' + (el.value[2] == 'null' ? '' : el.value[2]) : '-'
|
||||
}<br>`
|
||||
})
|
||||
return str
|
||||
}
|
||||
|
||||
@@ -122,15 +122,16 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '事件描述', field: 'showName', minWidth: 150 },
|
||||
{ title: '暂降发生时刻', field: 'startTime', sortable: true, minWidth: 180 },
|
||||
{
|
||||
title: '发生位置', field: 'evtParamPosition', minWidth: 150,
|
||||
title: '暂降(骤升)幅值(%)',
|
||||
field: 'evtParamVVaDepth',
|
||||
minWidth: 160,
|
||||
formatter: (row: any) => {
|
||||
const val = row.cellValue
|
||||
if (val === null || val === undefined || val === '' || val === '-') return '/'
|
||||
|
||||
return val
|
||||
}
|
||||
let a = row.cellValue.split('%')[0] - 0
|
||||
return a ? a.toFixed(2) : '/'
|
||||
},
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '持续时间(s)',
|
||||
@@ -145,17 +146,19 @@ const tableStore = new TableStore({
|
||||
return Math.floor(num * 10000) / 100
|
||||
}
|
||||
},
|
||||
{ title: '触发类型', field: 'showName', minWidth: 150 },
|
||||
{
|
||||
title: '暂降(聚升)幅值(%)',
|
||||
field: 'evtParamVVaDepth',
|
||||
minWidth: 150,
|
||||
title: '发生位置', field: 'evtParamPosition', minWidth: 150,
|
||||
formatter: (row: any) => {
|
||||
let a = row.cellValue.split('%')[0] - 0
|
||||
return a ? a.toFixed(2) : '/'
|
||||
},
|
||||
sortable: true
|
||||
const val = row.cellValue
|
||||
if (val === null || val === undefined || val === '' || val === '-') return '/'
|
||||
|
||||
return val
|
||||
}
|
||||
},
|
||||
{ title: '发生时刻', field: 'startTime', sortable: true, minWidth: 180 },
|
||||
|
||||
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
@@ -229,6 +232,7 @@ const tableStore = new TableStore({
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
ElMessage.info('下载中......')
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
@@ -238,6 +242,7 @@ const tableStore = new TableStore({
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
ElMessage.success('波形下载成功')
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -262,7 +267,7 @@ const deviceTypeChange = (val: any, obj: any) => {
|
||||
}
|
||||
const nodeClick = async (e: anyObj) => {
|
||||
// console.log("🚀 ~ nodeClick ~ e:", e)
|
||||
if (e.level == 2 && flag.value) {
|
||||
if ((e.level == 2 || e.level == 3) && flag.value) {
|
||||
loading.value = false
|
||||
tableStore.table.params.deviceId = e.id
|
||||
nextTick(() => {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</TableHeader>
|
||||
</div>
|
||||
|
||||
<el-empty description="暂无数据" v-if="!echartsData" style="flex: 1"></el-empty>
|
||||
<el-empty description="暂无数据" v-if="!echartsData" style="flex: 1;margin-top: 10%"></el-empty>
|
||||
<template v-else>
|
||||
<div :style="echartHeight">
|
||||
<MyEchart :options="echartsData" />
|
||||
|
||||
@@ -42,13 +42,14 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import { onMounted, onUnmounted, ref, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import pointTreeWx from '@/components/tree/govern/pointTreeWx.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { exportExcel } from '@/views/system/reportForms/export.js'
|
||||
import { destroyLuckysheet, exportLuckysheetFile, renderLuckysheetReport } from '@/utils/luckysheetHelper'
|
||||
import { isLineTreeLeaf } from '@/components/tree/govern/lineTreeUtils'
|
||||
import DatePicker from '@/components/form/datePicker/time.vue'
|
||||
import CloudDeviceEntryTree from '@/components/tree/govern/cloudDeviceEntryTreeZL.vue'
|
||||
import { getListByIds } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
@@ -77,35 +78,20 @@ const tableStore = new TableStore({
|
||||
// ;(tableStore.table.params.startTime = datePickerRef.value.timeValue[0]),
|
||||
// (tableStore.table.params.endTime = datePickerRef.value.timeValue[1]),
|
||||
if (!tableStore.table.params.tempId) {
|
||||
return ElMessage.warning('请选择模板')
|
||||
ElMessage.warning('请选择模板')
|
||||
return false
|
||||
}
|
||||
if (!dotList.value?.id) {
|
||||
ElMessage.warning('请选择监测点')
|
||||
return false
|
||||
}
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
},
|
||||
loadCallback: () => {
|
||||
console.log('🚀 ~ tableStore.table:', tableStore.table.data)
|
||||
name.value = dotList.value.name
|
||||
// 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) : ''
|
||||
// })
|
||||
// })
|
||||
|
||||
setTimeout(() => {
|
||||
luckysheet.create({
|
||||
container: 'luckysheet',
|
||||
title: '', // 表 头名
|
||||
lang: 'zh', // 中文
|
||||
showtoolbar: false, // 是否显示工具栏
|
||||
showinfobar: false, // 是否显示顶部信息栏
|
||||
showsheetbar: true, // 是否显示底部sheet按钮
|
||||
allowEdit: false, // 禁止所有编辑操作(必填)
|
||||
data: tableStore.table.data
|
||||
// tableStore.table.data
|
||||
})
|
||||
}, 10)
|
||||
renderLuckysheetReport('luckysheet', tableStore.table.data, { allowEdit: false })
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
@@ -115,6 +101,9 @@ const flag = ref(true)
|
||||
onMounted(() => {
|
||||
initListByIds()
|
||||
})
|
||||
onUnmounted(() => {
|
||||
destroyLuckysheet()
|
||||
})
|
||||
|
||||
const idList = ref([])
|
||||
// 监测对象
|
||||
@@ -131,7 +120,6 @@ const initListByIds = () => {
|
||||
})
|
||||
}
|
||||
const stencil = (val: any) => {
|
||||
console.log('🚀 ~ stencil ~ val:', val)
|
||||
templatePolicy.value = val.filter((item: any) => item.excelType == '4')
|
||||
Template.value = templatePolicy.value[0]
|
||||
reportForm.value = templatePolicy.value[0]?.excelType
|
||||
@@ -142,7 +130,7 @@ const changetype = (val: any) => {
|
||||
}
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
if (data?.level == 3) {
|
||||
if (isLineTreeLeaf(data) || data?.level == 3) {
|
||||
dotList.value = data
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
@@ -160,7 +148,7 @@ const exportEvent = () => {
|
||||
|
||||
// 格式化YYYY - MM - DD(补零)
|
||||
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
||||
exportExcel(luckysheet.getAllSheets(), name.value + formattedDate)
|
||||
exportLuckysheetFile(name.value + formattedDate, tableStore.table.data.length > 0)
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -484,7 +484,7 @@
|
||||
<div style="height: calc(100vh - 340px)" v-if="dataSet.indexOf('_trenddata') != -1">
|
||||
<Trend ref="trendRef" :TrendList="TrendList"></Trend>
|
||||
</div>
|
||||
<!-- 电镀数据 -->
|
||||
<!-- 电度数据 -->
|
||||
<div style="height: calc(100vh - 340px)" v-if="dataSet.indexOf('_kilowattHour') != -1">
|
||||
<electroplating ref="electroplatingRef" :TrendList="TrendList"></electroplating>
|
||||
</div>
|
||||
@@ -585,7 +585,7 @@ import { ElMessage } from 'element-plus'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import Trend from './tabs/trend.vue' //趋势数据
|
||||
import realTime from './tabs/realtime.vue' //实时数据-主界面
|
||||
import electroplating from './tabs/electroplating.vue' //电镀数据-主界面
|
||||
import electroplating from './tabs/electroplating.vue' //电度数据-主界面
|
||||
import realTrend from './tabs/components/realtrend.vue' //实时数据-实时趋势
|
||||
import operatingTrend from './tabs/operatingTrend.vue' //运行趋势
|
||||
import harmonicSpectrum from './tabs/components/harmonicSpectrum.vue' //实时数据-谐波频谱子页面
|
||||
@@ -705,6 +705,25 @@ const activeTrendName: any = ref(0)
|
||||
const trendTimer: any = ref()
|
||||
const trendDataTime: any = ref()
|
||||
const showButton = ref(false)
|
||||
|
||||
const decodeMqttPayload = (message: any) => {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
|
||||
} catch {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
/** 谐波频谱 MQTT 消息(命名函数,便于 off 避免重复注册) */
|
||||
const onMqttTrendMessage = (topic: any, message: any) => {
|
||||
const obj = decodeMqttPayload(message) || {}
|
||||
if ((obj.hasOwnProperty('data1') || obj.hasOwnProperty('data2')) && obj.dataTime) {
|
||||
trendDataTime.value = obj.dataTime
|
||||
realTrendRef.value?.setRealTrendData(obj)
|
||||
tableLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
//谐波频谱方法
|
||||
const handleTrend = async () => {
|
||||
realTimeFlag.value = false
|
||||
@@ -728,21 +747,7 @@ const handleTrend = async () => {
|
||||
// console.log(res, '获取谐波频谱数据')
|
||||
})
|
||||
}, 30000)
|
||||
mqttRef.value.on('message', (topic: any, message: any) => {
|
||||
let obj = JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message)))) || {}
|
||||
if ((obj.hasOwnProperty('data1') || obj.hasOwnProperty('data2')) && obj.dataTime) {
|
||||
trendDataTime.value = obj.dataTime
|
||||
realTrendRef.value && realTrendRef.value.setRealTrendData(obj)
|
||||
tableLoading.value = false
|
||||
// console.log(
|
||||
// '谐波频谱---mqtt接收到消息',
|
||||
// JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
|
||||
// )
|
||||
}
|
||||
// else {
|
||||
// trendDataTime.value = obj.dataTime
|
||||
// }
|
||||
})
|
||||
bindMqttMessage(onMqttTrendMessage)
|
||||
} else {
|
||||
ElMessage.warning('设备应答失败')
|
||||
}
|
||||
@@ -885,8 +890,8 @@ const lineId: any = ref('')
|
||||
const dataLevel: any = ref('')
|
||||
const dataSource = ref([])
|
||||
const engineeringName = ref('')
|
||||
const nodeClick = async (e: anyObj, node: any) => {
|
||||
if (e == undefined || e.level == 2) {
|
||||
const nodeClick = async (e: anyObj, node?: any) => {
|
||||
if (e == undefined) {
|
||||
return (loading.value = false)
|
||||
}
|
||||
searchValue.value = ''
|
||||
@@ -900,7 +905,7 @@ const nodeClick = async (e: anyObj, node: any) => {
|
||||
}
|
||||
|
||||
//选中设备名称后,点击标签页也能查询数据,要求点击设备名称后,点击标签页默认查询第一个监测点数据
|
||||
if (e.level == 3 || e.level == 2) {
|
||||
if (e.level == 3 ) {
|
||||
engineeringName.value = node?.parent.parent.data.name
|
||||
|
||||
await queryDictType({
|
||||
@@ -940,7 +945,7 @@ const nodeClick = async (e: anyObj, node: any) => {
|
||||
if (item.type === 'trenddata') {
|
||||
item.id = item.id + '_trenddata'
|
||||
}
|
||||
//电镀数据
|
||||
//电度数据
|
||||
if (item.type === 'kilowattHour') {
|
||||
item.id = item.id + '_kilowattHour'
|
||||
}
|
||||
@@ -995,6 +1000,14 @@ const trendRef: any = ref()
|
||||
const eventRef: any = ref()
|
||||
const mqttRef = ref()
|
||||
const url: any = window.localStorage.getItem('MQTTURL')
|
||||
|
||||
/** 同一 handler 先 off 再 on,避免重复 message 监听 */
|
||||
const bindMqttMessage = (handler: (topic: any, message: any) => void) => {
|
||||
if (!mqttRef.value) return
|
||||
mqttRef.value.off('message', handler)
|
||||
mqttRef.value.on('message', handler)
|
||||
}
|
||||
|
||||
const connectMqtt = () => {
|
||||
if (mqttRef.value) {
|
||||
if (mqttRef.value.connected) {
|
||||
@@ -1035,16 +1048,44 @@ const getRealDataMqttMsg = async () => {
|
||||
// console.log(res, '获取基础实时数据')
|
||||
})
|
||||
}, 30000)
|
||||
mqttRef.value.on('message', (topic: any, message: any) => {
|
||||
// console.log(
|
||||
// '实时数据&实时趋势---mqtt接收到消息',
|
||||
// JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
|
||||
// )
|
||||
let obj = JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
|
||||
bindMqttMessage(onMqttRealDataMessage)
|
||||
//2.建立mqtt通讯
|
||||
//每隔30s调用一下接口,通知后台推送mqtt消息
|
||||
|
||||
if (lineId.value != obj.lineId || adminInfo.userIndex != obj.userId) return
|
||||
mqttRef.value.on('error', (error: any) => {
|
||||
console.log('mqtt连接失败...', error)
|
||||
mqttRef.value.end()
|
||||
})
|
||||
|
||||
//处理mqtt数据 1转2除 2转1乘
|
||||
mqttRef.value.on('close', function () {
|
||||
console.log('mqtt客户端已断开连接.....')
|
||||
})
|
||||
setTimeout(() => {
|
||||
tableLoading.value = false
|
||||
}, 6000)
|
||||
} else {
|
||||
ElMessage.success('设备应答失败')
|
||||
tableLoading.value = false
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
setTimeout(() => {
|
||||
tableLoading.value = false
|
||||
}, 0)
|
||||
})
|
||||
}
|
||||
//tab点击事件
|
||||
|
||||
const realDataTimer: any = ref()
|
||||
const mqttMessage = ref<any>({})
|
||||
|
||||
/** 实时数据 / 实时趋势 MQTT 消息(命名函数,便于 off 避免重复注册) */
|
||||
const onMqttRealDataMessage = (topic: any, message: any) => {
|
||||
let obj = decodeMqttPayload(message)
|
||||
|
||||
if (lineId.value != obj.lineId || adminInfo.userIndex != obj.userId) return
|
||||
|
||||
//处理mqtt数据 1转2除 2转1乘
|
||||
//如果消息返回值是二次值,下拉框是二次值只需要单位换算 除以1000
|
||||
//如果消息返回值是一次值,下拉框是一次值只需要单位换算 除以1000
|
||||
if (obj.dataLevel == formInline.dataLevel) {
|
||||
@@ -1178,36 +1219,8 @@ const getRealDataMqttMsg = async () => {
|
||||
// sonTab.value == 1 &&
|
||||
// realTrendRef.value &&
|
||||
// realTrendRef.value.setRealTrendData(obj)
|
||||
})
|
||||
//2.建立mqtt通讯
|
||||
//每隔30s调用一下接口,通知后台推送mqtt消息
|
||||
|
||||
mqttRef.value.on('error', (error: any) => {
|
||||
console.log('mqtt连接失败...', error)
|
||||
mqttRef.value.end()
|
||||
})
|
||||
|
||||
mqttRef.value.on('close', function () {
|
||||
console.log('mqtt客户端已断开连接.....')
|
||||
})
|
||||
setTimeout(() => {
|
||||
tableLoading.value = false
|
||||
}, 6000)
|
||||
} else {
|
||||
ElMessage.success('设备应答失败')
|
||||
tableLoading.value = false
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
setTimeout(() => {
|
||||
tableLoading.value = false
|
||||
}, 0)
|
||||
})
|
||||
}
|
||||
//tab点击事件
|
||||
|
||||
const realDataTimer: any = ref()
|
||||
const mqttMessage = ref<any>({})
|
||||
const handleClick = async (tab?: any) => {
|
||||
tableLoading.value = true
|
||||
showButton.value = false
|
||||
@@ -1272,7 +1285,7 @@ const handleClick = async (tab?: any) => {
|
||||
tableLoading.value = false
|
||||
}, 0)
|
||||
}
|
||||
//电镀数据
|
||||
//电度数据
|
||||
if (dataSet.value.includes('_kilowattHour')) {
|
||||
let obj = {
|
||||
devId: deviceId.value, //e.id
|
||||
@@ -1475,6 +1488,8 @@ const handleClick = async (tab?: any) => {
|
||||
window.clearInterval(trendTimer.value)
|
||||
}
|
||||
if (mqttRef.value) {
|
||||
mqttRef.value.off('message', onMqttTrendMessage)
|
||||
mqttRef.value.off('message', onMqttRealDataMessage)
|
||||
mqttRef.value.end()
|
||||
}
|
||||
}
|
||||
@@ -1557,6 +1572,8 @@ onBeforeUnmount(() => {
|
||||
realDataTimer.value = 0
|
||||
trendTimer.value = 0
|
||||
if (mqttRef.value) {
|
||||
mqttRef.value.off('message', onMqttTrendMessage)
|
||||
mqttRef.value.off('message', onMqttRealDataMessage)
|
||||
mqttRef.value.end()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -293,31 +293,31 @@ const setRealTrendData = (val: any) => {
|
||||
if (selectValue.value == '2') {
|
||||
if (activeName.value == 2) {
|
||||
if (numberPart % 2 !== 0 && numberPart < 17) {
|
||||
tableData.value[key] = val[key]
|
||||
tableData.value[key] = val[key].toFixed(2)
|
||||
}
|
||||
} else {
|
||||
if (numberPart % 2 === 0) {
|
||||
tableData.value[key] = val[key]
|
||||
tableData.value[key] = val[key].toFixed(2)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (activeName.value == 2) {
|
||||
if (numberPart % 2 === 0 && numberPart < 17) {
|
||||
tableData.value[key] = val[key]
|
||||
tableData.value[key] = val[key].toFixed(2)
|
||||
}
|
||||
} else {
|
||||
if (numberPart % 2 !== 0) {
|
||||
tableData.value[key] = val[key]
|
||||
tableData.value[key] = val[key].toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (activeName.value == 2) {
|
||||
if (numberPart < 17) {
|
||||
tableData.value[key] = val[key]
|
||||
tableData.value[key] = val[key].toFixed(2)
|
||||
}
|
||||
} else {
|
||||
tableData.value[key] = val[key]
|
||||
tableData.value[key] = val[key].toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,25 +20,15 @@
|
||||
|
||||
<el-button @click="handleBack" :icon="Back">返回</el-button>
|
||||
</div>
|
||||
<!-- v-loading="loading" -->
|
||||
<el-tabs class="home_body" type="border-card" v-model.trim="activeName1" @tab-click="handleClick">
|
||||
<!-- -->
|
||||
<el-tabs class="home_body" v-loading="loading" type="border-card" v-model.trim="activeName1" @tab-click="handleClick">
|
||||
<el-tab-pane label="瞬时波形" name="ssbx" :style="'height:' + bxecharts + ';overflow-y: auto;'">
|
||||
<shushiboxi
|
||||
v-if="isWp && wp && activeName == 'ssbx' && showBoxi"
|
||||
:value="value"
|
||||
:boxoList="boxoList"
|
||||
:parentHeight="parentHeight"
|
||||
:wp="wp"
|
||||
></shushiboxi>
|
||||
<shushiboxi v-if="isWp && wp && activeName == 'ssbx' && showBoxi" :value="value" :boxoList="boxoList"
|
||||
:parentHeight="parentHeight" :wp="wp"></shushiboxi>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="RMS波形" name="rmsbx" :style="'height:' + bxecharts + ';overflow-y: auto;'">
|
||||
<rmsboxi
|
||||
v-if="isWp && wp && activeName == 'rmsbx' && showBoxi"
|
||||
:value="value"
|
||||
:boxoList="boxoList"
|
||||
:parentHeight="parentHeight"
|
||||
:wp="wp"
|
||||
></rmsboxi>
|
||||
<rmsboxi v-if="isWp && wp && activeName == 'rmsbx' && showBoxi" :value="value" :boxoList="boxoList"
|
||||
:parentHeight="parentHeight" :wp="wp"></rmsboxi>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -117,11 +107,10 @@ const getWpData = (val: any, list: any) => {
|
||||
const changeView = () => {
|
||||
showBoxi.value = false
|
||||
loading.value = true
|
||||
|
||||
setTimeout(() => {
|
||||
value.value = theTypeOfValue.value
|
||||
showBoxi.value = true
|
||||
}, 500)
|
||||
setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 1000)
|
||||
}
|
||||
@@ -148,7 +137,7 @@ const setHeight = (h: any, vh: any, num = 1) => {
|
||||
bxecharts.value = mainHeight(vh, num).height
|
||||
}, 100)
|
||||
}
|
||||
onMounted(() => {})
|
||||
onMounted(() => { })
|
||||
defineExpose({ getWpData, setHeight })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 电镀数据数据 -->
|
||||
<!-- 电度数据数据 -->
|
||||
<div>
|
||||
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
|
||||
<template v-slot:select>
|
||||
@@ -310,7 +310,7 @@ const setEchart = () => {
|
||||
exportCSV(
|
||||
echartsData.value.options.series.map((item: any) => item.name),
|
||||
dataList,
|
||||
'电镀数据.csv'
|
||||
'电度数据.csv'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,8 @@
|
||||
<TableHeader datePicker ref="headerRef" :showReset="false"></TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
<waveFormAnalysis
|
||||
v-loading="loading"
|
||||
v-if="isWaveCharts"
|
||||
ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false"
|
||||
:wp="wp"
|
||||
/>
|
||||
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false" :wp="wp" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@@ -57,16 +52,23 @@ const tableStore: any = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'startTime', title: '发生时刻', minWidth: 170, sortable: true },
|
||||
{ field: 'showName', title: '事件描述', minWidth: 120 },
|
||||
{ field: 'startTime', title: '暂降发生时刻', minWidth: 180, sortable: true },
|
||||
|
||||
{
|
||||
field: 'phaseType',
|
||||
title: '相别',
|
||||
minWidth: 80,
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降(骤升)幅值(%)',
|
||||
minWidth: 160,
|
||||
sortable: true,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
//row.cellValue = row.cellValue + '' ? row.cellValue.toFixed(2) : '/'
|
||||
row.cellValue = row.cellValue != null ? Number(row.cellValue).toFixed(2) : '/'
|
||||
if (String(row.cellValue).split('.')[1] == '00') {
|
||||
row.cellValue = String(row.cellValue).split('.')[0]
|
||||
}
|
||||
return row.cellValue
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'persistTime',
|
||||
title: '持续时间(s)',
|
||||
@@ -79,18 +81,17 @@ const tableStore: any = new TableStore({
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降(聚升)幅值(%)',
|
||||
minWidth: 130,
|
||||
field: 'phaseType',
|
||||
title: '相别',
|
||||
minWidth: 80,
|
||||
formatter: (row: any) => {
|
||||
//row.cellValue = row.cellValue + '' ? row.cellValue.toFixed(2) : '/'
|
||||
row.cellValue = row.cellValue != null ? Number(row.cellValue).toFixed(2) : '/'
|
||||
if (String(row.cellValue).split('.')[1] == '00') {
|
||||
row.cellValue = String(row.cellValue).split('.')[0]
|
||||
}
|
||||
return row.cellValue
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
},
|
||||
{ field: 'showName', title: '触发类型', minWidth: 120 },
|
||||
|
||||
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
@@ -111,7 +112,7 @@ const tableStore: any = new TableStore({
|
||||
},
|
||||
click: async row => {
|
||||
row.loading1 = true
|
||||
|
||||
|
||||
await analyseWave(row.id)
|
||||
.then(res => {
|
||||
isWaveCharts.value = true
|
||||
@@ -149,7 +150,7 @@ const tableStore: any = new TableStore({
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.showName != '未知'
|
||||
return row.wavePath
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -164,6 +165,7 @@ const tableStore: any = new TableStore({
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
ElMessage.info('下载中......')
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
@@ -173,6 +175,7 @@ const tableStore: any = new TableStore({
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
ElMessage.success('波形下载成功')
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -202,7 +205,7 @@ const tableStore: any = new TableStore({
|
||||
tableStore.table.params.list = tableParams.value.list
|
||||
tableStore.table.params.type = 3
|
||||
},
|
||||
loadCallback: () => {}
|
||||
loadCallback: () => { }
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
const isWaveCharts = ref(false)
|
||||
|
||||
@@ -238,7 +238,7 @@ const deviceTypeChange = (val: any, obj: any) => {
|
||||
nodeClick(obj)
|
||||
}
|
||||
const nodeClick = (e: any) => {
|
||||
if (e && (e.level == 2 || e.type == 'device')) {
|
||||
if (e && (e.level == 2 || e.level == 3 || e.type == 'device')) {
|
||||
loading.value = true
|
||||
nDid.value = e.ndid
|
||||
devId.value = e.id
|
||||
|
||||
@@ -137,12 +137,11 @@ const deviceTypeChange = (val: any, obj: any) => {
|
||||
}
|
||||
// 树节点点击
|
||||
const nodeClick = (e: anyObj) => {
|
||||
console.log('🚀 ~ nodeClick ~ e:', e)
|
||||
if (!e) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
if (e.level == 2) {
|
||||
if (e.level == 2 || e.level == 3) {
|
||||
pName.value = e.pName
|
||||
nDid.value = e.ndid
|
||||
loading.value = true
|
||||
|
||||
@@ -44,30 +44,11 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'startTime', title: '发生时刻', minWidth: 170, sortable: true },
|
||||
{ field: 'showName', title: '事件描述', minWidth: 170 },
|
||||
{
|
||||
field: 'phaseType',
|
||||
title: '相别',
|
||||
minWidth: 100,
|
||||
formatter: (row: any) => {
|
||||
row.cellValue = row.cellValue ? row.cellValue : '/'
|
||||
return row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'persistTime',
|
||||
title: '持续时间(s)',
|
||||
minWidth: 100,
|
||||
formatter: (row: any) => {
|
||||
row.cellValue = row.cellValue ? row.cellValue.toFixed(2) : '/'
|
||||
return row.cellValue
|
||||
}, sortable: true
|
||||
},
|
||||
{ field: 'startTime', title: '暂降发生时刻', minWidth: 170, sortable: true },
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降(聚升)幅值(%)',
|
||||
minWidth: 100,
|
||||
title: '暂降(骤升)幅值(%)',
|
||||
minWidth: 160,
|
||||
formatter: (row: any) => {
|
||||
row.cellValue = row.cellValue + '' ? row.cellValue.toFixed(2) : '/'
|
||||
if (String(row.cellValue).split('.')[1] == '00') {
|
||||
@@ -76,11 +57,32 @@ const tableStore = new TableStore({
|
||||
return row.cellValue
|
||||
}, sortable: true
|
||||
},
|
||||
{
|
||||
field: 'persistTime',
|
||||
title: '持续时间(s)',
|
||||
minWidth: 110,
|
||||
formatter: (row: any) => {
|
||||
row.cellValue = row.cellValue ? row.cellValue.toFixed(2) : '/'
|
||||
return row.cellValue
|
||||
}, sortable: true
|
||||
},
|
||||
{
|
||||
field: 'phaseType',
|
||||
title: '相别',
|
||||
minWidth: 100,
|
||||
formatter: (row: any) => {
|
||||
row.cellValue = row.cellValue ? row.cellValue : '/'
|
||||
return row.cellValue
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{ field: 'showName', title: '触发类型', minWidth: 170 },
|
||||
{
|
||||
title: '操作', fixed: 'right',
|
||||
width: 180,
|
||||
render: 'buttons',
|
||||
|
||||
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
@@ -95,7 +97,7 @@ const tableStore = new TableStore({
|
||||
},
|
||||
click: async row => {
|
||||
row.loading1 = true
|
||||
|
||||
|
||||
await analyseWave(row.id)
|
||||
.then(res => {
|
||||
loading.value = true
|
||||
@@ -143,6 +145,7 @@ const tableStore = new TableStore({
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
ElMessage.info('下载中......')
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
@@ -152,7 +155,7 @@ const tableStore = new TableStore({
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
|
||||
ElMessage.success('波形下载成功')
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
<template>
|
||||
<div class="device-manage" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||
<DeviceTree
|
||||
ref="treeRef"
|
||||
:showCheckbox="true"
|
||||
:default-checked-keys="defaultCheckedKeys"
|
||||
@checkChange="checkChange"
|
||||
:height="35"
|
||||
:engineering="true"
|
||||
></DeviceTree>
|
||||
<DeviceTree ref="treeRef" :showCheckbox="true" :default-checked-keys="defaultCheckedKeys"
|
||||
@checkChange="checkChange" :height="35" :engineering="true"></DeviceTree>
|
||||
<div class="device-manage-right" :style="{ height: pageHeight.height }">
|
||||
<vxe-table v-bind="defaultAttribute" :data="tableData" height="auto" style="width: 100%">
|
||||
<vxe-column field="enginerName" title="工程名称"></vxe-column>
|
||||
@@ -36,6 +30,7 @@ const tableData = ref([])
|
||||
const treeRef = ref(null)
|
||||
const ignoreCheckChange = ref(false)
|
||||
const checkChange = (data: any) => {
|
||||
console.log("🚀 ~ checkChange ~ data:", data)
|
||||
if (data == undefined) return (loading.value = false)
|
||||
if (data.data.pName == '便携式设备') {
|
||||
if (ignoreCheckChange.value) {
|
||||
@@ -47,7 +42,7 @@ const checkChange = (data: any) => {
|
||||
return treeRef.value?.treRef?.treeRef2?.setCheckedKeys([])
|
||||
}
|
||||
|
||||
if (data.data.level === 2) {
|
||||
if (data.data.level === 2 || data.data.level === 3) {
|
||||
if (data.checked) {
|
||||
defaultCheckedKeys.value.push(data.data.id)
|
||||
} else {
|
||||
@@ -100,6 +95,7 @@ onMounted(() => {
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
padding: 10px 10px 10px 0;
|
||||
|
||||
.el-descriptions__header {
|
||||
height: 36px;
|
||||
margin-bottom: 7px;
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.glfbfz">暂降幅值</el-checkbox>
|
||||
<el-checkbox v-model="formd.glfbfz">暂降(骤升)幅值</el-checkbox>
|
||||
<el-checkbox v-model="formd.glfbsj">持续时间</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -144,6 +144,7 @@ import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
import type { UploadProps, UploadUserFile } from 'element-plus'
|
||||
import pointTree from '@/components/tree/govern/pointTree.vue'
|
||||
import { getLineExport } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { isReportMonitorPoint } from '@/components/tree/govern/lineTreeUtils'
|
||||
defineOptions({
|
||||
name: 'TransientReport/monitoringpointReport'
|
||||
})
|
||||
@@ -194,7 +195,7 @@ const pointTypeChange = (val: any, obj: any) => {
|
||||
handleNodeClick(obj)
|
||||
}
|
||||
const handleNodeClick = (data: any,) => {
|
||||
dotList.value = data
|
||||
dotList.value = data
|
||||
}
|
||||
// 上传
|
||||
const choose = (files: any) => {
|
||||
@@ -212,7 +213,7 @@ const choose = (files: any) => {
|
||||
|
||||
//生成报告
|
||||
const exportEvent = () => {
|
||||
if (dotList.value?.level != 3) {
|
||||
if (!isReportMonitorPoint(dotList.value)) {
|
||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||
}
|
||||
let a = ''
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="default-main" :style="height" style="display: flex; height: 100%; overflow: hidden">
|
||||
<div class="default-main" :style="height" style="display: flex; overflow: hidden">
|
||||
<div style="width: 280px; flex-shrink: 0; height: 100%; overflow: hidden">
|
||||
<pointTree
|
||||
ref="TerminalRef"
|
||||
@@ -73,6 +73,7 @@ import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
import type { UploadProps, UploadUserFile } from 'element-plus'
|
||||
import pointTree from '@/components/tree/govern/pointTree.vue'
|
||||
import { exportModel } from '@/api/cs-harmonic-boot/datatrend'
|
||||
import { isReportMonitorPoint } from '@/components/tree/govern/lineTreeUtils'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/report/word'
|
||||
})
|
||||
@@ -97,7 +98,9 @@ const pointTypeChange = (val: any, obj: any) => {
|
||||
handleNodeClick(obj)
|
||||
}
|
||||
const handleNodeClick = (data: any) => {
|
||||
dotList.value = data
|
||||
if (isReportMonitorPoint(data)) {
|
||||
dotList.value = data
|
||||
}
|
||||
}
|
||||
// 上传
|
||||
const choose = (files: any) => {
|
||||
@@ -115,7 +118,7 @@ const choose = (files: any) => {
|
||||
// 生成
|
||||
const exportEvent = () => {
|
||||
console.log('🚀 ~ exportEvent ~ dotList.value:', dotList.value)
|
||||
if (dotList.value?.level != 3) {
|
||||
if (!isReportMonitorPoint(dotList.value)) {
|
||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||
}
|
||||
let form = new FormData()
|
||||
|
||||
@@ -29,13 +29,14 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import { onMounted, onUnmounted, ref, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import PointTree from '@/components/tree/govern/pointTree.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { exportExcel } from '@/views/system/reportForms/export.js'
|
||||
import { destroyLuckysheet, exportLuckysheetFile, renderLuckysheetReport } from '@/utils/luckysheetHelper'
|
||||
import { isLineTreeLeaf } from '@/components/tree/govern/lineTreeUtils'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
// import data from './123.json'
|
||||
@@ -74,25 +75,7 @@ const tableStore = new TableStore({
|
||||
tableStore.table.params.lineId = dotList.value.id
|
||||
},
|
||||
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) : ''
|
||||
})
|
||||
})
|
||||
setTimeout(() => {
|
||||
luckysheet.create({
|
||||
container: 'luckysheet',
|
||||
title: '', // 表 头名
|
||||
lang: 'zh', // 中文
|
||||
showtoolbar: false, // 是否显示工具栏
|
||||
showinfobar: false, // 是否显示顶部信息栏
|
||||
showsheetbar: true, // 是否显示底部sheet按钮
|
||||
data: tableStore.table.data
|
||||
// tableStore.table.data
|
||||
})
|
||||
}, 10)
|
||||
renderLuckysheetReport('luckysheet', tableStore.table.data)
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
@@ -104,6 +87,9 @@ onMounted(() => {
|
||||
size.value = ((280 / (dom.offsetWidth - 7)) * 100)
|
||||
}
|
||||
})
|
||||
onUnmounted(() => {
|
||||
destroyLuckysheet()
|
||||
})
|
||||
|
||||
|
||||
const stencil = (val: any) => {
|
||||
@@ -118,7 +104,7 @@ const changetype = (val: any) => {
|
||||
}
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
if (data?.type == "line") {
|
||||
if (isLineTreeLeaf(data)) {
|
||||
dotList.value = data
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
@@ -127,7 +113,7 @@ const handleNodeClick = (data: any, node: any) => {
|
||||
}
|
||||
|
||||
const exportEvent = () => {
|
||||
exportExcel(luckysheet.getAllSheets(), '统计报表下载')
|
||||
exportLuckysheetFile('统计报表下载', tableStore.table.data.length > 0)
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -31,14 +31,15 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, provide } from 'vue'
|
||||
import { ref, provide, onUnmounted } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import pointTreeWx from '@/components/tree/govern/pointTreeWx.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { exportExcel } from '@/views/system/reportForms/export.js'
|
||||
import { destroyLuckysheet, exportLuckysheetFile, renderLuckysheetReport } from '@/utils/luckysheetHelper'
|
||||
import DatePicker from '@/components/form/datePicker/time.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
const name = ref('')
|
||||
// import data from './123.json'
|
||||
defineOptions({
|
||||
@@ -61,33 +62,19 @@ const tableStore = new TableStore({
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.tempId = Template.value.id
|
||||
tableStore.table.params.lineId = dotList.value.id
|
||||
tableStore.table.params.startTime = datePickerRef.value.timeValue[0],
|
||||
tableStore.table.params.endTime = datePickerRef.value.timeValue[1],
|
||||
if (!datePickerRef.value?.timeValue?.[0] || !datePickerRef.value?.timeValue?.[1]) {
|
||||
ElMessage.warning('请选择时间')
|
||||
return false
|
||||
}
|
||||
tableStore.table.params.startTime = datePickerRef.value.timeValue[0]
|
||||
tableStore.table.params.endTime = datePickerRef.value.timeValue[1]
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
},
|
||||
loadCallback: () => {
|
||||
name.value = dotList.value.name
|
||||
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) : ''
|
||||
})
|
||||
})
|
||||
setTimeout(() => {
|
||||
luckysheet.create({
|
||||
container: 'luckysheet',
|
||||
title: '', // 表 头名
|
||||
lang: 'zh', // 中文
|
||||
showtoolbar: false, // 是否显示工具栏
|
||||
showinfobar: false, // 是否显示顶部信息栏
|
||||
showsheetbar: true, // 是否显示底部sheet按钮
|
||||
data: tableStore.table.data
|
||||
// tableStore.table.data
|
||||
})
|
||||
}, 10)
|
||||
renderLuckysheetReport('luckysheet', tableStore.table.data, { allowEdit: false })
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
@@ -127,8 +114,11 @@ const exportEvent = () => {
|
||||
|
||||
// 格式化YYYY - MM - DD(补零)
|
||||
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
||||
exportExcel(luckysheet.getAllSheets(), name.value + formattedDate)
|
||||
exportLuckysheetFile(name.value + formattedDate, tableStore.table.data.length > 0)
|
||||
}
|
||||
onUnmounted(() => {
|
||||
destroyLuckysheet()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.report-zl-page {
|
||||
|
||||
@@ -55,13 +55,14 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, provide } from 'vue'
|
||||
import { ref, provide, onUnmounted } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import pointTreeWx from '@/components/tree/govern/pointTreeWx.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { exportExcel } from '@/views/system/reportForms/export.js'
|
||||
import { destroyLuckysheet, exportLuckysheetFile, renderLuckysheetReport } from '@/utils/luckysheetHelper'
|
||||
import { isLineTreeLeaf } from '@/components/tree/govern/lineTreeUtils'
|
||||
import DatePicker from '@/components/form/datePicker/time.vue'
|
||||
import pointTree from '@/components/tree/govern/pointTree.vue'
|
||||
// import data from './123.json'
|
||||
@@ -92,36 +93,8 @@ const tableStore = new TableStore({
|
||||
delete tableStore.table.params.timeFlag
|
||||
},
|
||||
loadCallback: () => {
|
||||
console.log('🚀 ~ tableStore.table:', tableStore.table)
|
||||
name.value = dotList.value.name
|
||||
// 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) : ''
|
||||
// })
|
||||
// })
|
||||
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:', tableStore.table)
|
||||
|
||||
setTimeout(() => {
|
||||
luckysheet.create({
|
||||
container: 'luckysheet',
|
||||
title: '', // 表 头名
|
||||
lang: 'zh', // 中文
|
||||
showtoolbar: false, // 是否显示工具栏
|
||||
showinfobar: false, // 是否显示顶部信息栏
|
||||
showsheetbar: true, // 是否显示底部sheet按钮
|
||||
allowEdit: false, // 禁止所有编辑操作(必填)
|
||||
data: tableStore.table.data
|
||||
// tableStore.table.data
|
||||
})
|
||||
}, 10)
|
||||
renderLuckysheetReport('luckysheet', tableStore.table.data, { allowEdit: false })
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
@@ -143,7 +116,7 @@ const pointTypeChange = (val: any, obj: any) => {
|
||||
}
|
||||
|
||||
const handleNodeClick = (data: any) => {
|
||||
if (data?.level == 3) {
|
||||
if (isLineTreeLeaf(data)) {
|
||||
dotList.value = data
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
@@ -155,14 +128,15 @@ const handleNodeClick = (data: any) => {
|
||||
|
||||
const exportEvent = () => {
|
||||
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 year = now.getFullYear()
|
||||
const month = now.getMonth() + 1
|
||||
const day = now.getDate()
|
||||
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
||||
exportExcel(luckysheet.getAllSheets(), name.value + formattedDate)
|
||||
exportLuckysheetFile(name.value + formattedDate, tableStore.table.data.length > 0)
|
||||
}
|
||||
onUnmounted(() => {
|
||||
destroyLuckysheet()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.report-zl-page {
|
||||
|
||||
@@ -43,13 +43,14 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import { onMounted, onUnmounted, ref, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import pointTreeWx from '@/components/tree/govern/pointTreeWx.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { exportExcel } from '@/views/system/reportForms/export.js'
|
||||
import { destroyLuckysheet, exportLuckysheetFile, renderLuckysheetReport } from '@/utils/luckysheetHelper'
|
||||
import { isLineTreeLeaf } from '@/components/tree/govern/lineTreeUtils'
|
||||
import DatePicker from '@/components/form/datePicker/time.vue'
|
||||
import CloudDeviceEntryTree from '@/components/tree/govern/cloudDeviceEntryTreeZL.vue'
|
||||
import { getListByIds } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
@@ -80,35 +81,20 @@ const tableStore = new TableStore({
|
||||
// ;(tableStore.table.params.startTime = datePickerRef.value.timeValue[0]),
|
||||
// (tableStore.table.params.endTime = datePickerRef.value.timeValue[1]),
|
||||
if (!tableStore.table.params.tempId) {
|
||||
return ElMessage.warning('请选择模板')
|
||||
ElMessage.warning('请选择模板')
|
||||
return false
|
||||
}
|
||||
if (!dotList.value?.id) {
|
||||
ElMessage.warning('请选择监测点')
|
||||
return false
|
||||
}
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
},
|
||||
loadCallback: () => {
|
||||
console.log('🚀 ~ tableStore.table:', tableStore.table.data)
|
||||
name.value = dotList.value.name
|
||||
// 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) : ''
|
||||
// })
|
||||
// })
|
||||
|
||||
setTimeout(() => {
|
||||
luckysheet.create({
|
||||
container: 'luckysheet',
|
||||
title: '', // 表 头名
|
||||
lang: 'zh', // 中文
|
||||
showtoolbar: false, // 是否显示工具栏
|
||||
showinfobar: false, // 是否显示顶部信息栏
|
||||
showsheetbar: true, // 是否显示底部sheet按钮
|
||||
allowEdit: false, // 禁止所有编辑操作(必填)
|
||||
data: tableStore.table.data
|
||||
// tableStore.table.data
|
||||
})
|
||||
}, 10)
|
||||
renderLuckysheetReport('luckysheet', tableStore.table.data, { allowEdit: false })
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
@@ -118,6 +104,9 @@ const flag = ref(true)
|
||||
onMounted(() => {
|
||||
initListByIds()
|
||||
})
|
||||
onUnmounted(() => {
|
||||
destroyLuckysheet()
|
||||
})
|
||||
|
||||
const idList = ref([])
|
||||
// 监测对象
|
||||
@@ -134,7 +123,6 @@ const initListByIds = () => {
|
||||
})
|
||||
}
|
||||
const stencil = (val: any) => {
|
||||
console.log('🚀 ~ stencil ~ val:', val)
|
||||
templatePolicy.value = val.filter((item: any) => item.excelType == '4')
|
||||
Template.value = templatePolicy.value[0]
|
||||
reportForm.value = templatePolicy.value[0]?.excelType
|
||||
@@ -145,7 +133,7 @@ const changetype = (val: any) => {
|
||||
}
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
if (data?.level == 3) {
|
||||
if (isLineTreeLeaf(data) || data?.level == 3) {
|
||||
dotList.value = data
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
@@ -163,7 +151,7 @@ const exportEvent = () => {
|
||||
|
||||
// 格式化YYYY - MM - DD(补零)
|
||||
const formattedDate = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
|
||||
exportExcel(luckysheet.getAllSheets(), name.value + formattedDate)
|
||||
exportLuckysheetFile(name.value + formattedDate, tableStore.table.data.length > 0)
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user