告警事件添加设备选取功能

This commit is contained in:
guanj
2026-07-14 09:18:32 +08:00
parent 0e70182c89
commit a7b5762946
19 changed files with 315 additions and 660 deletions

View File

@@ -4,10 +4,10 @@
"version": "0.0.0", "version": "0.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite --mode ypt" ,
"dev:zl": "vite --mode zl", "dev:zl": "vite --mode zl",
"dev:ypt": "vite --mode ypt", "dev:ypt": "vite --mode ypt",
"build": "vite build", "build": "vite build --mode ypt",
"build:zl": "vite build --mode zl", "build:zl": "vite build --mode zl",
"build:ypt": "vite build --mode ypt", "build:ypt": "vite build --mode ypt",
"preview": "vite preview" "preview": "vite preview"

View File

@@ -14,10 +14,17 @@ import html2canvas from 'html2canvas'
import $ from 'jquery' import $ from 'jquery'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { calcRmsYAxisRange, formatAxisLabel } from '@/utils/chartAxisHelper' import {
calcRmsYAxisRange,
createWaveLineSeries,
formatAxisLabel,
formatWaveAxisTooltip,
WAVE_AXIS_POINTER,
WAVE_DATA_ZOOM
} from '@/utils/chartAxisHelper'
import url from '@/assets/img/point.png' import url from '@/assets/img/point.png'
import url2 from '@/assets/img/dw.png' import url2 from '@/assets/img/dw.png'
import { buildWaveCacheKey, getWaveCache, setWaveCache } from '@/utils/waveCache' import { buildWaveCacheKey, getWaveCache, setWaveCache, removeWaveCacheByEvent } from '@/utils/waveCache'
import { getRmsWorker, buildWorkerPayload } from '@/utils/waveWorkerPool' import { getRmsWorker, buildWorkerPayload } from '@/utils/waveWorkerPool'
import { buildExportBaseName, formatExportDateTime } from '@/utils/echartMethod' import { buildExportBaseName, formatExportDateTime } from '@/utils/echartMethod'
let waveRequestId = 0 let waveRequestId = 0
@@ -186,6 +193,9 @@ onMounted(() => {
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => {
waveRequestId++
pendingCacheKeys.clear()
removeWaveCacheByEvent(props.wp, props.boxoList)
backbxlb() backbxlb()
window.removeEventListener('resize', handleResize) window.removeEventListener('resize', handleResize)
}) })
@@ -660,21 +670,9 @@ const initWave = (
tooltip: { tooltip: {
top: '10px', top: '10px',
trigger: 'axis', trigger: 'axis',
axisPointer: WAVE_AXIS_POINTER,
borderColor: 'grey', borderColor: 'grey',
formatter: function (params: any) { formatter: (params: any) => formatWaveAxisTooltip(params),
let tips = '时刻:' + params[0].data[0] + '</br/>'
for (let i = 0; i < params.length; i++) {
if (params[i].seriesName != '暂降触发点') {
tips +=
params[i].marker +
params[i].seriesName +
':' +
(params[i].value[1] - 0).toFixed(2) +
'<br/>'
}
}
return tips
},
textStyle: { textStyle: {
color: '#fff', color: '#fff',
fontStyle: 'normal', fontStyle: 'normal',
@@ -814,52 +812,11 @@ const initWave = (
top: '60px' top: '60px'
// containLabel: true // containLabel: true
}, },
dataZoom: [ dataZoom: WAVE_DATA_ZOOM,
{
type: 'inside',
height: 13,
start: 0,
bottom: '10px',
end: 100,
filterMode: 'none'
},
{
start: 0,
height: 13,
bottom: '10px',
end: 100,
filterMode: 'none'
}
],
series: [ series: [
{ createWaveLineSeries(a, radata, '#DAA520'),
name: a, createWaveLineSeries(b, rbdata, '#2E8B57'),
type: 'line', createWaveLineSeries(c, rcdata, '#A52a2a'),
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#DAA520' },
data: radata
},
{
name: b,
type: 'line',
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#2E8B57' },
data: rbdata
},
{
name: c,
type: 'line',
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#A52a2a' },
data: rcdata
},
{ {
name: '暂降触发点', name: '暂降触发点',
type: 'scatter', type: 'scatter',
@@ -1024,21 +981,9 @@ const drawPics = (
tooltip: { tooltip: {
top: '10px', top: '10px',
trigger: 'axis', trigger: 'axis',
axisPointer: WAVE_AXIS_POINTER,
borderColor: 'grey', borderColor: 'grey',
formatter: function (params: any) { formatter: (params: any) => formatWaveAxisTooltip(params, { showMarker: false }),
let tips = '时刻:' + params[0].data[0] + '</br/>'
for (let i = 0; i < params.length; i++) {
if (params[i].seriesName != '暂降触发点') {
tips +=
params[i].marker +
params[i].seriesName +
':' +
(params[i].value[1] - 0).toFixed(2) +
'<br/>'
}
}
return tips
},
textStyle: { textStyle: {
color: '#fff', color: '#fff',
fontStyle: 'normal', fontStyle: 'normal',
@@ -1163,52 +1108,11 @@ const drawPics = (
top: '60px' top: '60px'
// containLabel: true // containLabel: true
}, },
dataZoom: [ dataZoom: WAVE_DATA_ZOOM,
{
type: 'inside',
height: 13,
start: 0,
bottom: '10px',
end: 100,
filterMode: 'none'
},
{
start: 0,
height: 13,
bottom: '10px',
end: 100,
filterMode: 'none'
}
],
series: [ series: [
{ createWaveLineSeries(a, radata, '#DAA520'),
name: a, createWaveLineSeries(b, rbdata, '#2E8B57'),
type: 'line', createWaveLineSeries(c, rcdata, '#A52a2a')
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#DAA520' },
data: radata
},
{
name: b,
type: 'line',
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#2E8B57' },
data: rbdata
},
{
name: c,
type: 'line',
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#A52a2a' },
data: rcdata
}
] ]
} }

View File

@@ -14,9 +14,17 @@ import html2canvas from 'html2canvas'
import $ from 'jquery' import $ from 'jquery'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { calcShuYAxisRange, formatAxisLabel } from '@/utils/chartAxisHelper' import {
calcShuYAxisRange,
createWaveLineSeries,
formatAxisLabel,
formatWaveAxisTooltip,
WAVE_AXIS_POINTER,
WAVE_DATA_ZOOM
} from '@/utils/chartAxisHelper'
import url from '@/assets/img/point.png' import url from '@/assets/img/point.png'
import { buildWaveCacheKey, getWaveCache, setWaveCache } from '@/utils/waveCache'
import { buildWaveCacheKey, getWaveCache, setWaveCache, removeWaveCacheByEvent } from '@/utils/waveCache'
import { getShuWorker, buildWorkerPayload } from '@/utils/waveWorkerPool' import { getShuWorker, buildWorkerPayload } from '@/utils/waveWorkerPool'
import { buildExportBaseName, formatExportDateTime } from '@/utils/echartMethod' import { buildExportBaseName, formatExportDateTime } from '@/utils/echartMethod'
@@ -192,6 +200,9 @@ onMounted(() => {
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => {
waveRequestId++
pendingCacheKeys.clear()
removeWaveCacheByEvent(props.wp, props.boxoList)
backbxlb() backbxlb()
window.removeEventListener('resize', handleResize) window.removeEventListener('resize', handleResize)
}) })
@@ -430,26 +441,14 @@ const initWave = (
tooltip: { tooltip: {
top: '10px', top: '10px',
trigger: 'axis', trigger: 'axis',
axisPointer: WAVE_AXIS_POINTER,
borderColor: 'grey', borderColor: 'grey',
style: { style: {
color: '#fff', color: '#fff',
fontSize: '15px', fontSize: '15px',
padding: 10 padding: 10
}, },
formatter: function (params: any) { formatter: (params: any) => formatWaveAxisTooltip(params),
let tips = '时刻:' + params[0].data[0] + '</br/>'
for (let i = 0; i < params.length; i++) {
if (params[i].seriesName != '暂降触发点') {
tips +=
params[i].marker +
params[i].seriesName +
':' +
(params[i].value[1] - 0).toFixed(2) +
'<br/>'
}
}
return tips
},
textStyle: { textStyle: {
color: '#fff', color: '#fff',
fontStyle: 'normal', fontStyle: 'normal',
@@ -577,55 +576,11 @@ const initWave = (
bottom: '45px', bottom: '45px',
top: '60px' top: '60px'
}, },
dataZoom: [ dataZoom: WAVE_DATA_ZOOM,
{
type: 'inside',
height: 13,
start: 0,
bottom: '10px',
end: 100,
filterMode: 'none'
},
{
start: 0,
height: 13,
bottom: '10px',
end: 100,
filterMode: 'none'
}
],
series: [ series: [
{ createWaveLineSeries(a, adata, '#DAA520'),
name: a, createWaveLineSeries(b, bdata, '#2E8B57'),
type: 'line', createWaveLineSeries(c, cdata, '#A52a2a'),
large: true,
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#DAA520' },
data: adata
},
{
name: b,
type: 'line',
large: true,
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#2E8B57' },
data: bdata
},
{
name: c,
type: 'line',
large: true,
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#A52a2a' },
data: cdata
},
{ {
name: '暂降触发点', name: '暂降触发点',
type: 'scatter', type: 'scatter',
@@ -778,16 +733,9 @@ const drawPics = (
const option = { const option = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: WAVE_AXIS_POINTER,
borderColor: 'grey', borderColor: 'grey',
formatter: function (params: any) { formatter: (params: any) => formatWaveAxisTooltip(params, { showMarker: false }),
let tips = '时刻:' + params[0].data[0] + '</br/>'
for (let i = 0; i < params.length; i++) {
if (params[i].seriesName != '暂降触发点') {
tips += params[i].seriesName + ':' + (params[i].value[1] - 0).toFixed(2) + '<br/>'
}
}
return tips
},
textStyle: { textStyle: {
color: '#fff', color: '#fff',
fontStyle: 'normal', fontStyle: 'normal',
@@ -905,55 +853,11 @@ const drawPics = (
top: '60px' top: '60px'
// containLabel: true // containLabel: true
}, },
dataZoom: [ dataZoom: WAVE_DATA_ZOOM,
{
type: 'inside',
height: 13,
start: 0,
bottom: '10px',
end: 100,
filterMode: 'none'
},
{
start: 0,
height: 13,
bottom: '10px',
end: 100,
filterMode: 'none'
}
],
series: [ series: [
{ createWaveLineSeries(a, adata, '#DAA520'),
name: a, createWaveLineSeries(b, bdata, '#2E8B57'),
type: 'line', createWaveLineSeries(c, cdata, '#A52a2a')
large: true,
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#DAA520' },
data: adata
},
{
name: b,
type: 'line',
large: true,
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#2E8B57' },
data: bdata
},
{
name: c,
type: 'line',
large: true,
smooth: true,
symbol: 'none',
sampling: 'average',
itemStyle: { color: '#A52a2a' },
data: cdata
}
] ]
} }

View File

@@ -16,7 +16,7 @@ export default defineComponent({
required: true required: true
}, },
size: { size: {
type: String, type: [String, Number],
default: '18px' default: '18px'
}, },
color: { color: {
@@ -27,7 +27,7 @@ export default defineComponent({
setup(props) { setup(props) {
const iconStyle = computed((): CSSProperties => { const iconStyle = computed((): CSSProperties => {
const { size, color } = props const { size, color } = props
let s = `${size.replace('px', '')}px` const s = typeof size === 'number' ? `${size}px` : `${String(size).replace('px', '')}px`
return { return {
fontSize: s, fontSize: s,
color: color color: color

View File

@@ -10,7 +10,7 @@ import { computed, type CSSProperties } from 'vue'
import { isExternal } from '@/utils/common' import { isExternal } from '@/utils/common'
interface Props { interface Props {
name: string name: string
size: string size: string | number
color: string color: string
} }
@@ -20,19 +20,21 @@ const props = withDefaults(defineProps<Props>(), {
color: '#000000', color: '#000000',
}) })
const s = `${props.size.replace('px', '')}px` const s = computed(() =>
typeof props.size === 'number' ? `${props.size}px` : `${String(props.size).replace('px', '')}px`
)
const iconName = computed(() => `#${props.name}`) const iconName = computed(() => `#${props.name}`)
const iconStyle = computed((): CSSProperties => { const iconStyle = computed((): CSSProperties => {
return { return {
color: props.color, color: props.color,
fontSize: s, fontSize: s.value,
} }
}) })
const isUrl = computed(() => isExternal(props.name)) const isUrl = computed(() => isExternal(props.name))
const urlIconStyle = computed(() => { const urlIconStyle = computed(() => {
return { return {
width: s, width: s.value,
height: s, height: s.value,
mask: `url(${props.name}) no-repeat 50% 50%`, mask: `url(${props.name}) no-repeat 50% 50%`,
'-webkit-mask': `url(${props.name}) no-repeat 50% 50%`, '-webkit-mask': `url(${props.name}) no-repeat 50% 50%`,
} }

View File

@@ -1,16 +1,16 @@
import { VxeTableProps } from 'vxe-table' import { VxeTableProps } from 'vxe-table'
export const defaultAttribute: VxeTableProps = { export const defaultAttribute: VxeTableProps = {
align: 'center', align: 'center',
headerCellClassName: 'table-header-cell', headerCellClassName: 'table-header-cell',
border: true, border: true,
stripe: true, stripe: true,
size: 'small', size: 'small',
columnConfig: { resizable: true }, columnConfig: { resizable: true },
rowConfig: { isCurrent: true, isHover: true }, rowConfig: { isCurrent: true, isHover: true },
scrollX: { scrollToLeftOnChange: true }, scrollX: { scrollToLeftOnChange: true },
scrollY: { scrollToTopOnChange: true, enabled: true, gt: 100 }, scrollY: { scrollToTopOnChange: true, enabled: true, gt: 100 },
customConfig: { enabled: true, allowFixed: false, showFooter: false, immediate: true ,mode:'default'}, customConfig: { enabled: true, allowFixed: false, showFooter: false, immediate: true ,mode:'default'},
showOverflow: 'tooltip', showOverflow: 'tooltip',
showHeaderOverflow: false showHeaderOverflow: false
} }

View File

@@ -25,7 +25,7 @@
</template> </template>
</el-input> </el-input>
<!-- <Icon <!-- <Icon
@click="onMenuCollapse" @click="onMenuCollapse"
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
:class="menuCollapse ? 'unfold' : ''" :class="menuCollapse ? 'unfold' : ''"
size="18px" size="18px"
@@ -86,7 +86,7 @@
</template> </template>
</el-tree> </el-tree>
</div> </div>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
<div v-if="treeType == '2'" class="engineering-tree-wrap" v-loading="loading"> <div v-if="treeType == '2'" class="engineering-tree-wrap" v-loading="loading">
<el-tree class="engineering-tree pt10 collapse-tree" ref="treeRef4" :props="defaultProps" <el-tree class="engineering-tree pt10 collapse-tree" ref="treeRef4" :props="defaultProps"

View File

@@ -89,6 +89,83 @@ export function calcShuYAxisRange(dataMin: number, dataMax: number): YAxisRange
return buildYAxisRange(axisMin, axisMax) return buildYAxisRange(axisMin, axisMax)
} }
/** 波形图 dataZoom默认 filterMode仅缩放 X 轴) */
export const WAVE_DATA_ZOOM = [
{
type: 'inside' as const,
xAxisIndex: 0,
start: 0,
end: 100,
},
{
type: 'slider' as const,
xAxisIndex: 0,
height: 13,
bottom: '10px',
start: 0,
end: 100
}
]
export const WAVE_AXIS_POINTER = {
type: 'line' as const,
snap: true
}
/** 波形折线 series不做 sampling/smooth保证 tooltip 与折线位置一致 */
export function createWaveLineSeries(name: string | null, data: number[][], color: string) {
return {
name,
type: 'line' as const,
large: data.length > 2000,
largeThreshold: 2000,
smooth: false,
symbol: 'none' as const,
itemStyle: { color },
data
}
}
const WAVE_TOOLTIP_SKIP_SERIES = new Set(['暂降触发点', '最小暂降幅值'])
/** 波形图 axis tooltip从 data/value 中安全取 [x, y] */
export function formatWaveAxisTooltip(
params: any[],
options?: { showMarker?: boolean }
): string {
if (!params?.length) return ''
const showMarker = options?.showMarker !== false
let time = ''
const axisValue = params[0]?.axisValue
if (axisValue != null && Number.isFinite(Number(axisValue))) {
time = String(Number(Number(axisValue).toFixed(2)))
} else {
for (const param of params) {
if (!param || WAVE_TOOLTIP_SKIP_SERIES.has(param.seriesName)) continue
const point = param.data ?? param.value
if (Array.isArray(point) && point.length >= 2) {
time = String(point[0])
break
}
}
}
let tips = `时刻:${time}<br/>`
for (const param of params) {
if (!param?.seriesName || WAVE_TOOLTIP_SKIP_SERIES.has(param.seriesName)) continue
const point = param.data ?? param.value
const y = Array.isArray(point) ? Number(point[1]) : Number(point)
if (!Number.isFinite(y)) continue
const prefix = showMarker ? param.marker || '' : ''
tips += `${prefix}${param.seriesName}:${y.toFixed(2)}<br/>`
}
return tips
}
/** RMS 波形 Y 轴范围 */ /** RMS 波形 Y 轴范围 */
export function calcRmsYAxisRange(dataMin: number, dataMax: number): YAxisRange { export function calcRmsYAxisRange(dataMin: number, dataMax: number): YAxisRange {
const min = Number(dataMin) const min = Number(dataMin)

View File

@@ -40,3 +40,27 @@ export function setWaveCache(key: string, value: unknown): void {
if (oldest !== undefined) cache.delete(oldest) if (oldest !== undefined) cache.delete(oldest)
} }
} }
export function removeWaveCache(key: string): void {
if (key) cache.delete(key)
}
/** 关闭波形页时清空全部缓存 */
export function clearWaveCache(): void {
cache.clear()
}
/** 移除当前事件相关的 shu/rms 缓存(一次值、二次值、开环等组合) */
export function removeWaveCacheByEvent(
wp: Record<string, any> | undefined,
boxoList: Record<string, any>
): void {
if (!wp) return
for (const type of ['shu', 'rms'] as const) {
for (const value of [1, 2]) {
for (const isOpen of [true, false]) {
removeWaveCache(buildWaveCacheKey(type, wp, value, isOpen, boxoList))
}
}
}
}

View File

@@ -1,10 +1,10 @@
<template> <template>
<TableHeader datePicker ref="refheader" showCustomColumn showExport> <TableHeader datePicker ref="refheader" showCustomColumn showExport>
<template v-slot:select> <template v-slot:select>
<!-- <el-form-item label="设备选取"> <el-form-item label="设备选取">
<el-tree-select <el-tree-select
v-model="tableStore.table.params.cascader" v-model="tableStore.table.params.cascader"
:data="deviceTreeOptions" :data="deviceTree"
clearable clearable
:props="treeProps" :props="treeProps"
filterable filterable
@@ -12,9 +12,11 @@
check-strictly check-strictly
default-expand-all default-expand-all
placeholder="请选择需要筛选的数据" placeholder="请选择需要筛选的数据"
@node-click="sourceChange"
@clear="onTreeClear"
style="width: 100%" style="width: 100%"
></el-tree-select> ></el-tree-select>
</el-form-item> --> </el-form-item>
<el-form-item label="关键字筛选"> <el-form-item label="关键字筛选">
<el-input <el-input
maxlength="32" maxlength="32"
@@ -22,7 +24,7 @@
style="width: 240px" style="width: 240px"
v-model.trim="tableStore.table.params.searchValue" v-model.trim="tableStore.table.params.searchValue"
clearable clearable
placeholder="请输入设备名称/告警代码" placeholder="请输入告警代码"
/> />
</el-form-item> </el-form-item>
<el-form-item label="级别"> <el-form-item label="级别">
@@ -199,47 +201,35 @@ provide('tableStore', tableStore)
// "type": "", // "type": "",
// "userId": "" // "userId": ""
tableStore.table.params.searchValue = '' tableStore.table.params.searchValue = ''
// tableStore.table.params.cascader = '' tableStore.table.params.engineeringid = ''
// tableStore.table.params.level = '' tableStore.table.params.projectId = ''
// tableStore.table.params.engineeringid = '' tableStore.table.params.deviceId = ''
// tableStore.table.params.projectId = '' tableStore.table.params.lineId = ''
// tableStore.table.params.deviceId = '' tableStore.table.params.cascader = ''
tableStore.table.params.type = 3 tableStore.table.params.type = 3
// tableStore.table.params.eventIds = [] tableStore.table.params.level = ''
// tableStore.table.params.status = ''
// tableStore.table.params.target = []
// tableStore.table.params.userId = ''
// 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) {
deviceTreeOptions.value.splice(index, 1)
}
})
const filterNode = createTreeFilterNode() const filterNode = createTreeFilterNode()
const sourceChange = (e: any) => {
tableStore.table.params.deviceTypeId = '' const onTreeClear = () => {
tableStore.table.params.engineeringid = '' tableStore.table.params.engineeringid = ''
tableStore.table.params.projectId = '' tableStore.table.params.projectId = ''
tableStore.table.params.deviceId = '' tableStore.table.params.deviceId = ''
if (e) { tableStore.table.params.lineId = ''
let name = deviceTreeOptions.value.filter((item: any) => {
return item.id == e[0]
})[0].name
tableStore.table.params.deviceTypeName = name
if (name == '便携式设备') {
tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.deviceId = e[1] || ''
} else {
tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.engineeringid = e[1] || ''
tableStore.table.params.projectId = e[2] || ''
tableStore.table.params.deviceId = e[3] || ''
}
}
} }
const sourceChange = (e: any) => {
onTreeClear()
if (e.level == 0) {
tableStore.table.params.engineeringid = e.id
} else if (e.level == 1) {
tableStore.table.params.projectId = e.id
} else if (e.level == 2) {
tableStore.table.params.deviceId = e.id
} else if (e.level == 3) {
tableStore.table.params.lineId = e.id
}
}
onMounted(() => { onMounted(() => {
tableStore.index() tableStore.index()
}) })

View File

@@ -1,26 +1,32 @@
<template> <template>
<TableHeader datePicker ref="refheader" showCustomColumn showExport> <TableHeader datePicker ref="refheader" showCustomColumn showExport>
<template v-slot:select> <template v-slot:select>
<!-- <el-form-item label="设备选取"> <el-form-item label="设备选取">
<el-tree-select <el-tree-select
v-model="tableStore.table.params.cascader" v-model="tableStore.table.params.cascader"
:data="deviceTreeOptions" :data="deviceTree"
clearable clearable
:props="treeProps" :props="treeProps"
filterable filterable
:filter-node-method="filterNode" :filter-node-method="filterNode"
check-strictly check-strictly
default-expand-all default-expand-all
placeholder="请选择需要筛选的数据" placeholder="请选择需要筛选的数据"
style="width: 100%" @node-click="sourceChange"
> @clear="onTreeClear"
style="width: 100%"
</el-tree-select> ></el-tree-select>
</el-form-item> --> </el-form-item>
<el-form-item label="关键字筛选"> <!-- <el-form-item label="关键字筛选">
<el-input maxlength="32" show-word-limit style="width: 240px" <el-input
v-model.trim="tableStore.table.params.searchValue" clearable placeholder="请输入监测点名称" /> maxlength="32"
</el-form-item> show-word-limit
style="width: 240px"
v-model.trim="tableStore.table.params.searchValue"
clearable
placeholder="请输入监测点名称"
/>
</el-form-item> -->
<!-- <el-form-item label="级别"> <!-- <el-form-item label="级别">
<el-select v-model.trim="tableStore.table.params.level" placeholder="请选择级别" clearable> <el-select v-model.trim="tableStore.table.params.level" placeholder="请选择级别" clearable>
<el-option <el-option
@@ -65,18 +71,23 @@ const tableStore = new TableStore({
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} }
}, },
{ title: '发生时刻', field: 'startTime', align: 'center', sortable: true, minWidth: 180, }, { title: '发生时刻', field: 'startTime', align: 'center', sortable: true, minWidth: 180 },
{ title: '监测点名称', field: 'lineName', align: 'center', minWidth: 150,formatter: (row: any) => { {
title: '监测点名称',
field: 'lineName',
align: 'center',
minWidth: 150,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/' return row.cellValue ? row.cellValue : '/'
} }, }
{ title: '设备名称', field: 'equipmentName', align: 'center', minWidth: 150, }, },
{ title: '项目名称', field: 'projectName', align: 'center', minWidth: 150, }, { title: '设备名称', field: 'equipmentName', align: 'center', minWidth: 150 },
{ title: '工程名称', field: 'engineeringName', align: 'center', minWidth: 150, }, { title: '项目名称', field: 'projectName', align: 'center', minWidth: 150 },
{ title: '工程名称', field: 'engineeringName', align: 'center', minWidth: 150 },
{ title: '事件描述', field: 'showName', align: 'center', minWidth: 250 }
{ title: '事件描述', field: 'showName', align: 'center', minWidth: 250, }
], ],
beforeSearchFun: () => { } beforeSearchFun: () => {}
}) })
provide('tableStore', tableStore) provide('tableStore', tableStore)
@@ -84,33 +95,40 @@ provide('tableStore', tableStore)
// "type": "", // "type": "",
// "userId": "" // "userId": ""
tableStore.table.params.searchValue = '' tableStore.table.params.searchValue = ''
// tableStore.table.params.engineeringid = '' tableStore.table.params.engineeringid = ''
// tableStore.table.params.deviceTypeId = '' tableStore.table.params.projectId = ''
// tableStore.table.params.projectId = '' tableStore.table.params.deviceId = ''
// tableStore.table.params.deviceId = '' tableStore.table.params.lineId = ''
tableStore.table.params.cascader = ''
tableStore.table.params.type = 1 tableStore.table.params.type = 1
// tableStore.table.params.eventIds = []
// tableStore.table.params.status = ''
// tableStore.table.params.target = []
// tableStore.table.params.userId = ''
// tableStore.table.params.cascader = ''
// tableStore.table.params.deviceTypeName = ''
// tableStore.table.params.level=''
const deviceTreeOptions = ref<any>(props.deviceTree)
deviceTreeOptions.value.map((item: any, index: any) => {
if (item?.children.length == 0) {
deviceTreeOptions.value.splice(index, 1)
}
})
const filterNode = createTreeFilterNode() const filterNode = createTreeFilterNode()
const onTreeClear = () => {
tableStore.table.params.engineeringid = ''
tableStore.table.params.projectId = ''
tableStore.table.params.deviceId = ''
tableStore.table.params.lineId = ''
}
const sourceChange = (e: any) => {
onTreeClear()
if (e.level == 0) {
tableStore.table.params.engineeringid = e.id
} else if (e.level == 1) {
tableStore.table.params.projectId = e.id
} else if (e.level == 2) {
tableStore.table.params.deviceId = e.id
} else if (e.level == 3) {
tableStore.table.params.lineId = e.id
}
}
onMounted(() => { onMounted(() => {
tableStore.index() tableStore.index()
}) })
setTimeout(() => { setTimeout(() => {
tableStore.table.height = mainHeight(200).height as any tableStore.table.height = mainHeight(200).height as any
}, 0) }, 0)
const addMenu = () => { } const addMenu = () => {}
</script> </script>
<style></style> <style></style>

View File

@@ -2,10 +2,10 @@
<div ref="refheader" v-show="!isWaveCharts" style="width: 100%"> <div ref="refheader" v-show="!isWaveCharts" style="width: 100%">
<TableHeader datePicker showExport showCustomColumn @onResetForm="onResetForm"> <TableHeader datePicker showExport showCustomColumn @onResetForm="onResetForm">
<template v-slot:select> <template v-slot:select>
<!-- <el-form-item label="设备选取"> <el-form-item label="设备选取">
<el-tree-select <el-tree-select
v-model="tableStore.table.params.cascader" v-model="tableStore.table.params.cascader"
:data="deviceTreeOptions" :data="deviceTree"
clearable clearable
:props="treeProps" :props="treeProps"
filterable filterable
@@ -13,10 +13,12 @@
check-strictly check-strictly
default-expand-all default-expand-all
placeholder="请选择需要筛选的数据" placeholder="请选择需要筛选的数据"
@node-click="sourceChange"
@clear="onTreeClear"
style="width: 100%" style="width: 100%"
></el-tree-select> ></el-tree-select>
</el-form-item> --> </el-form-item>
<el-form-item label="关键字筛选"> <!-- <el-form-item label="关键字筛选">
<el-input <el-input
maxlength="32" maxlength="32"
show-word-limit show-word-limit
@@ -25,7 +27,7 @@
clearable clearable
placeholder="请输入监测点名称" placeholder="请输入监测点名称"
/> />
</el-form-item> </el-form-item> -->
<!-- <el-form-item> <!-- <el-form-item>
<el-button type="primary" plain @click="openFilterDialog">事件筛选</el-button> <el-button type="primary" plain @click="openFilterDialog">事件筛选</el-button>
</el-form-item> --> </el-form-item> -->
@@ -309,17 +311,14 @@ provide('tableStore', tableStore)
// "type": "", // "type": "",
// "userId": "" // "userId": ""
tableStore.table.params.searchValue = '' tableStore.table.params.searchValue = ''
// tableStore.table.params.engineeringid = '' tableStore.table.params.engineeringid = ''
// tableStore.table.params.projectId = '' tableStore.table.params.projectId = ''
// tableStore.table.params.deviceTypeId = '' tableStore.table.params.deviceId = ''
// tableStore.table.params.deviceId = '' tableStore.table.params.lineId = ''
tableStore.table.params.cascader = ''
tableStore.table.params.type = 0 tableStore.table.params.type = 0
// tableStore.table.params.eventIds = []
// tableStore.table.params.status = ''
// tableStore.table.params.target = []
// tableStore.table.params.userId = ''
// tableStore.table.params.cascader = ''
// tableStore.table.params.deviceTypeName = ''
Object.assign(tableStore.table.params, { Object.assign(tableStore.table.params, {
featureAmplitudeMin: undefined, featureAmplitudeMin: undefined,
featureAmplitudeMax: undefined, featureAmplitudeMax: undefined,
@@ -334,54 +333,26 @@ Object.assign(tableStore.table.params, {
const openFilterDialog = () => { const openFilterDialog = () => {
filterVisible.value = true filterVisible.value = true
} }
const onTreeClear = () => {
const deviceTreeOptions: any = ref<any>(props.deviceTree)
deviceTreeOptions.value.map((item: any, index: any) => {
if (item?.children.length == 0) {
deviceTreeOptions.value.splice(index, 1)
}
})
const sourceChange = (e: any) => {
tableStore.table.params.deviceTypeId = ''
tableStore.table.params.engineeringid = '' tableStore.table.params.engineeringid = ''
tableStore.table.params.projectId = '' tableStore.table.params.projectId = ''
tableStore.table.params.deviceId = '' tableStore.table.params.deviceId = ''
if (e) { tableStore.table.params.lineId = ''
let name = deviceTreeOptions.value.filter((item: any) => {
return item.id == e[0]
})[0].name
tableStore.table.params.deviceTypeName = name
if (name == '便携式设备') {
tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.deviceId = e[1] || ''
} else {
tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.engineeringid = e[1] || ''
tableStore.table.params.projectId = e[2] || ''
tableStore.table.params.deviceId = e[3] || ''
}
}
// tableStore.table.params.engineeringid = e[1] || ''
// tableStore.table.params.projectId = e[2] || ''
// const zlIndex = deviceTreeOptions.value.findIndex((item: any) => {
// return item.name == '治理设备'
// })
// const bxsIndex = deviceTreeOptions.value.findIndex((item: any) => {
// return item.name == '便携式设备'
// })
// console.log("🚀 ~ zlIndex ~ zlIndex:", zlIndex,bxsIndex)
// //便携式设备特殊处理
// if (bxsIndex != -1 && deviceTreeOptions.value[bxsIndex].id == e[0] && e.length == 2) {
// tableStore.table.params.deviceId = e[1]
// }
// //治理设备
// if (zlIndex != -1 && deviceTreeOptions.value[zlIndex].id == e[0]) {
// tableStore.table.params.deviceId = e[2] || ''
// }
} }
const sourceChange = (e: any) => {
onTreeClear()
if (e.level == 0) {
tableStore.table.params.engineeringid = e.id
} else if (e.level == 1) {
tableStore.table.params.projectId = e.id
} else if (e.level == 2) {
tableStore.table.params.deviceId = e.id
} else if (e.level == 3) {
tableStore.table.params.lineId = e.id
}
}
const filterNode = createTreeFilterNode() const filterNode = createTreeFilterNode()
const onFilterConfirm = () => { const onFilterConfirm = () => {
tableStore.onTableAction('search', {}) tableStore.onTableAction('search', {})

View File

@@ -5,7 +5,6 @@
<Transient <Transient
v-if="!showEventStatistics" v-if="!showEventStatistics"
:deviceTree="deviceTree" :deviceTree="deviceTree"
:key="key"
@statistics="showEventStatistics = true" @statistics="showEventStatistics = true"
/> />
<eventStatistics v-else @back="showEventStatistics = false" /> <eventStatistics v-else @back="showEventStatistics = false" />
@@ -14,13 +13,13 @@
</el-tab-pane> --> </el-tab-pane> -->
<el-tab-pane label="稳态越限告警" name="3"> <el-tab-pane label="稳态越限告警" name="3">
<Steady v-if="activeName == '3'" :deviceTree="deviceTree" :key="key" /> <Steady :deviceTree="deviceTree" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="设备告警" name="1"> <el-tab-pane label="设备告警" name="1">
<Device v-if="activeName == '1'" :deviceTree="deviceTree" :key="key" /> <Device :deviceTree="deviceTree" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="前置告警" name="2"> <el-tab-pane label="前置告警" name="2">
<Front v-if="activeName == '2'" :deviceTree="deviceTree" :key="key" /> <Front />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
@@ -48,9 +47,8 @@ watch(activeName, val => {
} }
}) })
getLineTree({ type: 'engineering' }).then(res => { getLineTree({ type: 'engineering' }).then(res => {
deviceTree.value = res.data deviceTree.value = res.data
key.value += 1
activeName.value = '4' activeName.value = '4'
}) })
onMounted(() => {}) onMounted(() => {})

View File

@@ -42,6 +42,7 @@ import rmsboxi from '@/components/echarts/rmsboxi.vue'
import MyEchart from '@/components/echarts/MyEchart.vue' import MyEchart from '@/components/echarts/MyEchart.vue'
import { Platform, TrendCharts, DataLine, Back } from '@element-plus/icons-vue' import { Platform, TrendCharts, DataLine, Back } from '@element-plus/icons-vue'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { clearWaveCache } from '@/utils/waveCache'
const props = defineProps(['wp']) const props = defineProps(['wp'])
const searchForm = ref({ const searchForm = ref({
type: 0 type: 0
@@ -126,6 +127,7 @@ const handleClick = (tab: any, event: any) => {
}, 1000) }, 1000)
} }
const handleBack = () => { const handleBack = () => {
clearWaveCache()
emit('handleHideCharts') emit('handleHideCharts')
} }
const setHeight = (h: any, vh: any, num = 1) => { const setHeight = (h: any, vh: any, num = 1) => {

View File

@@ -31,7 +31,7 @@
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="接入方式"> <el-descriptions-item label="接入方式">
{{ deviceData.devAccessMethod =='CLD'?'1056协议':deviceData.devAccessMethod || '/' }} {{ deviceData.devAccessMethod == 'CLD' ? '1056协议' : deviceData.devAccessMethod || '/' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="网络设备ID"> <el-descriptions-item label="网络设备ID">
{{ deviceData.ndid || '/' }} {{ deviceData.ndid || '/' }}
@@ -309,7 +309,7 @@ const exportData = () => {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.device-manage { .device-manage {
display: flex; display: flex;
@@ -343,4 +343,7 @@ const exportData = () => {
right: 10px; right: 10px;
z-index: 10; z-index: 10;
} }
:deep(.el-tabs__header) {
width: calc(100% - 100px);
}
</style> </style>

View File

@@ -84,7 +84,7 @@ const tableStore: any = new TableStore({
{ title: '协议版本', field: 'protocolVersion', minWidth: '100', formatter: (row: any) => { return row.cellValue || '/' } }, { title: '协议版本', field: 'protocolVersion', minWidth: '100', formatter: (row: any) => { return row.cellValue || '/' } },
{ title: '版本日期', field: 'versionDate', minWidth: '150', formatter: (row: any) => { return row.cellValue || '/' } }, { title: '版本日期', field: 'versionDate', minWidth: '150', formatter: (row: any) => { return row.cellValue || '/' } },
{ title: '设备型号', field: 'devModelName', minWidth: '120', formatter: (row: any) => { return row.cellValue || '/' } }, { title: '设备型号', field: 'devModelName', minWidth: '120', formatter: (row: any) => { return row.cellValue || '/' } },
{ title: 'icd模型', field: 'icd', minWidth: '120', formatter: (row: any) => { return icdList.value.filter((item: any) => item.id == row.cellValue)[0]?.name || '/' } }, { title: 'icd模型', field: 'icd', minWidth: '120', formatter: (row: any) => { return icdList.value?.filter((item: any) => item.id == row.cellValue)[0]?.name || '/' } },
{ title: '所属工程', field: 'associatedEngineering', minWidth: '120', formatter: (row: any) => { return row.cellValue || '/' } }, { title: '所属工程', field: 'associatedEngineering', minWidth: '120', formatter: (row: any) => { return row.cellValue || '/' } },
{ title: '所属项目', field: 'associatedProject', minWidth: '120', formatter: (row: any) => { return row.cellValue || '/' } }, { title: '所属项目', field: 'associatedProject', minWidth: '120', formatter: (row: any) => { return row.cellValue || '/' } },
{ {

View File

@@ -26,8 +26,8 @@ export default defineConfig({
// target: 'http://192.168.1.24:10215', // // target: 'http://192.168.1.24:10215', //
// target: 'http://192.168.1.122:10215', //gfh // target: 'http://192.168.1.122:10215', //gfh
// target: 'http://192.168.1.127:10215', //cdf // target: 'http://192.168.1.127:10215', //cdf
// target: 'http://192.168.1.125:10215',
target: 'http://192.168.1.103:10215', target: 'http://192.168.1.103:10215',
// target: 'http://pqmcn.com:27707/api',
// target: 'https://pqmcn.com:8092/api', //治理 // target: 'https://pqmcn.com:8092/api', //治理
// target:'http://www.zhilitest.com:8089/api', // target:'http://www.zhilitest.com:8089/api',
changeOrigin: true, changeOrigin: true,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long