告警事件添加设备选取功能
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"dev": "vite --mode ypt" ,
|
||||
"dev:zl": "vite --mode zl",
|
||||
"dev:ypt": "vite --mode ypt",
|
||||
"build": "vite build",
|
||||
"build": "vite build --mode ypt",
|
||||
"build:zl": "vite build --mode zl",
|
||||
"build:ypt": "vite build --mode ypt",
|
||||
"preview": "vite preview"
|
||||
|
||||
@@ -14,10 +14,17 @@ import html2canvas from 'html2canvas'
|
||||
import $ from 'jquery'
|
||||
import * as echarts from 'echarts'
|
||||
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 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 { buildExportBaseName, formatExportDateTime } from '@/utils/echartMethod'
|
||||
let waveRequestId = 0
|
||||
@@ -186,6 +193,9 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
waveRequestId++
|
||||
pendingCacheKeys.clear()
|
||||
removeWaveCacheByEvent(props.wp, props.boxoList)
|
||||
backbxlb()
|
||||
window.removeEventListener('resize', handleResize)
|
||||
})
|
||||
@@ -660,21 +670,9 @@ const initWave = (
|
||||
tooltip: {
|
||||
top: '10px',
|
||||
trigger: 'axis',
|
||||
axisPointer: WAVE_AXIS_POINTER,
|
||||
borderColor: 'grey',
|
||||
formatter: function (params: any) {
|
||||
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
|
||||
},
|
||||
formatter: (params: any) => formatWaveAxisTooltip(params),
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
@@ -814,52 +812,11 @@ const initWave = (
|
||||
top: '60px'
|
||||
// containLabel: true
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
height: 13,
|
||||
start: 0,
|
||||
|
||||
bottom: '10px',
|
||||
end: 100,
|
||||
filterMode: 'none'
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
height: 13,
|
||||
bottom: '10px',
|
||||
end: 100,
|
||||
filterMode: 'none'
|
||||
}
|
||||
],
|
||||
dataZoom: WAVE_DATA_ZOOM,
|
||||
series: [
|
||||
{
|
||||
name: a,
|
||||
type: 'line',
|
||||
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
|
||||
},
|
||||
createWaveLineSeries(a, radata, '#DAA520'),
|
||||
createWaveLineSeries(b, rbdata, '#2E8B57'),
|
||||
createWaveLineSeries(c, rcdata, '#A52a2a'),
|
||||
{
|
||||
name: '暂降触发点',
|
||||
type: 'scatter',
|
||||
@@ -1024,21 +981,9 @@ const drawPics = (
|
||||
tooltip: {
|
||||
top: '10px',
|
||||
trigger: 'axis',
|
||||
axisPointer: WAVE_AXIS_POINTER,
|
||||
borderColor: 'grey',
|
||||
formatter: function (params: any) {
|
||||
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
|
||||
},
|
||||
formatter: (params: any) => formatWaveAxisTooltip(params, { showMarker: false }),
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
@@ -1163,52 +1108,11 @@ const drawPics = (
|
||||
top: '60px'
|
||||
// containLabel: true
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
height: 13,
|
||||
start: 0,
|
||||
|
||||
bottom: '10px',
|
||||
end: 100,
|
||||
filterMode: 'none'
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
height: 13,
|
||||
bottom: '10px',
|
||||
end: 100,
|
||||
filterMode: 'none'
|
||||
}
|
||||
],
|
||||
dataZoom: WAVE_DATA_ZOOM,
|
||||
series: [
|
||||
{
|
||||
name: a,
|
||||
type: 'line',
|
||||
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
|
||||
}
|
||||
createWaveLineSeries(a, radata, '#DAA520'),
|
||||
createWaveLineSeries(b, rbdata, '#2E8B57'),
|
||||
createWaveLineSeries(c, rcdata, '#A52a2a')
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,17 @@ import html2canvas from 'html2canvas'
|
||||
import $ from 'jquery'
|
||||
import * as echarts from 'echarts'
|
||||
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 { buildWaveCacheKey, getWaveCache, setWaveCache } from '@/utils/waveCache'
|
||||
|
||||
import { buildWaveCacheKey, getWaveCache, setWaveCache, removeWaveCacheByEvent } from '@/utils/waveCache'
|
||||
import { getShuWorker, buildWorkerPayload } from '@/utils/waveWorkerPool'
|
||||
import { buildExportBaseName, formatExportDateTime } from '@/utils/echartMethod'
|
||||
|
||||
@@ -192,6 +200,9 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
waveRequestId++
|
||||
pendingCacheKeys.clear()
|
||||
removeWaveCacheByEvent(props.wp, props.boxoList)
|
||||
backbxlb()
|
||||
window.removeEventListener('resize', handleResize)
|
||||
})
|
||||
@@ -430,26 +441,14 @@ const initWave = (
|
||||
tooltip: {
|
||||
top: '10px',
|
||||
trigger: 'axis',
|
||||
axisPointer: WAVE_AXIS_POINTER,
|
||||
borderColor: 'grey',
|
||||
style: {
|
||||
color: '#fff',
|
||||
fontSize: '15px',
|
||||
padding: 10
|
||||
},
|
||||
formatter: function (params: any) {
|
||||
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
|
||||
},
|
||||
formatter: (params: any) => formatWaveAxisTooltip(params),
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
@@ -577,55 +576,11 @@ const initWave = (
|
||||
bottom: '45px',
|
||||
top: '60px'
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
height: 13,
|
||||
start: 0,
|
||||
|
||||
bottom: '10px',
|
||||
end: 100,
|
||||
filterMode: 'none'
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
height: 13,
|
||||
bottom: '10px',
|
||||
end: 100,
|
||||
filterMode: 'none'
|
||||
}
|
||||
],
|
||||
dataZoom: WAVE_DATA_ZOOM,
|
||||
series: [
|
||||
{
|
||||
name: a,
|
||||
type: 'line',
|
||||
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
|
||||
},
|
||||
createWaveLineSeries(a, adata, '#DAA520'),
|
||||
createWaveLineSeries(b, bdata, '#2E8B57'),
|
||||
createWaveLineSeries(c, cdata, '#A52a2a'),
|
||||
{
|
||||
name: '暂降触发点',
|
||||
type: 'scatter',
|
||||
@@ -778,16 +733,9 @@ const drawPics = (
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: WAVE_AXIS_POINTER,
|
||||
borderColor: 'grey',
|
||||
formatter: function (params: any) {
|
||||
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
|
||||
},
|
||||
formatter: (params: any) => formatWaveAxisTooltip(params, { showMarker: false }),
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
@@ -905,55 +853,11 @@ const drawPics = (
|
||||
top: '60px'
|
||||
// containLabel: true
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
height: 13,
|
||||
start: 0,
|
||||
|
||||
bottom: '10px',
|
||||
end: 100,
|
||||
filterMode: 'none'
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
height: 13,
|
||||
bottom: '10px',
|
||||
end: 100,
|
||||
filterMode: 'none'
|
||||
}
|
||||
],
|
||||
dataZoom: WAVE_DATA_ZOOM,
|
||||
series: [
|
||||
{
|
||||
name: a,
|
||||
type: 'line',
|
||||
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
|
||||
}
|
||||
createWaveLineSeries(a, adata, '#DAA520'),
|
||||
createWaveLineSeries(b, bdata, '#2E8B57'),
|
||||
createWaveLineSeries(c, cdata, '#A52a2a')
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export default defineComponent({
|
||||
required: true
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
type: [String, Number],
|
||||
default: '18px'
|
||||
},
|
||||
color: {
|
||||
@@ -27,7 +27,7 @@ export default defineComponent({
|
||||
setup(props) {
|
||||
const iconStyle = computed((): CSSProperties => {
|
||||
const { size, color } = props
|
||||
let s = `${size.replace('px', '')}px`
|
||||
const s = typeof size === 'number' ? `${size}px` : `${String(size).replace('px', '')}px`
|
||||
return {
|
||||
fontSize: s,
|
||||
color: color
|
||||
|
||||
@@ -10,7 +10,7 @@ import { computed, type CSSProperties } from 'vue'
|
||||
import { isExternal } from '@/utils/common'
|
||||
interface Props {
|
||||
name: string
|
||||
size: string
|
||||
size: string | number
|
||||
color: string
|
||||
}
|
||||
|
||||
@@ -20,19 +20,21 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
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 iconStyle = computed((): CSSProperties => {
|
||||
return {
|
||||
color: props.color,
|
||||
fontSize: s,
|
||||
fontSize: s.value,
|
||||
}
|
||||
})
|
||||
const isUrl = computed(() => isExternal(props.name))
|
||||
const urlIconStyle = computed(() => {
|
||||
return {
|
||||
width: s,
|
||||
height: s,
|
||||
width: s.value,
|
||||
height: s.value,
|
||||
mask: `url(${props.name}) no-repeat 50% 50%`,
|
||||
'-webkit-mask': `url(${props.name}) no-repeat 50% 50%`,
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { VxeTableProps } from 'vxe-table'
|
||||
|
||||
export const defaultAttribute: VxeTableProps = {
|
||||
align: 'center',
|
||||
headerCellClassName: 'table-header-cell',
|
||||
border: true,
|
||||
stripe: true,
|
||||
size: 'small',
|
||||
columnConfig: { resizable: true },
|
||||
rowConfig: { isCurrent: true, isHover: true },
|
||||
scrollX: { scrollToLeftOnChange: true },
|
||||
scrollY: { scrollToTopOnChange: true, enabled: true, gt: 100 },
|
||||
customConfig: { enabled: true, allowFixed: false, showFooter: false, immediate: true ,mode:'default'},
|
||||
showOverflow: 'tooltip',
|
||||
showHeaderOverflow: false
|
||||
}
|
||||
import { VxeTableProps } from 'vxe-table'
|
||||
|
||||
export const defaultAttribute: VxeTableProps = {
|
||||
align: 'center',
|
||||
headerCellClassName: 'table-header-cell',
|
||||
border: true,
|
||||
stripe: true,
|
||||
size: 'small',
|
||||
columnConfig: { resizable: true },
|
||||
rowConfig: { isCurrent: true, isHover: true },
|
||||
scrollX: { scrollToLeftOnChange: true },
|
||||
scrollY: { scrollToTopOnChange: true, enabled: true, gt: 100 },
|
||||
customConfig: { enabled: true, allowFixed: false, showFooter: false, immediate: true ,mode:'default'},
|
||||
showOverflow: 'tooltip',
|
||||
showHeaderOverflow: false
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</template>
|
||||
</el-input>
|
||||
<!-- <Icon
|
||||
@click="onMenuCollapse"
|
||||
@click="onMenuCollapse"
|
||||
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||
:class="menuCollapse ? 'unfold' : ''"
|
||||
size="18px"
|
||||
@@ -86,7 +86,7 @@
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<div v-if="treeType == '2'" class="engineering-tree-wrap" v-loading="loading">
|
||||
<el-tree class="engineering-tree pt10 collapse-tree" ref="treeRef4" :props="defaultProps"
|
||||
|
||||
@@ -89,6 +89,83 @@ export function calcShuYAxisRange(dataMin: number, dataMax: number): YAxisRange
|
||||
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 轴范围 */
|
||||
export function calcRmsYAxisRange(dataMin: number, dataMax: number): YAxisRange {
|
||||
const min = Number(dataMin)
|
||||
|
||||
@@ -40,3 +40,27 @@ export function setWaveCache(key: string, value: unknown): void {
|
||||
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))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<TableHeader datePicker ref="refheader" showCustomColumn showExport>
|
||||
<template v-slot:select>
|
||||
<!-- <el-form-item label="设备选取">
|
||||
<el-form-item label="设备选取">
|
||||
<el-tree-select
|
||||
v-model="tableStore.table.params.cascader"
|
||||
:data="deviceTreeOptions"
|
||||
:data="deviceTree"
|
||||
clearable
|
||||
:props="treeProps"
|
||||
filterable
|
||||
@@ -12,9 +12,11 @@
|
||||
check-strictly
|
||||
default-expand-all
|
||||
placeholder="请选择需要筛选的数据"
|
||||
@node-click="sourceChange"
|
||||
@clear="onTreeClear"
|
||||
style="width: 100%"
|
||||
></el-tree-select>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
@@ -22,7 +24,7 @@
|
||||
style="width: 240px"
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
placeholder="请输入设备名称/告警代码"
|
||||
placeholder="请输入告警代码"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="级别">
|
||||
@@ -199,47 +201,35 @@ provide('tableStore', tableStore)
|
||||
// "type": "",
|
||||
// "userId": ""
|
||||
tableStore.table.params.searchValue = ''
|
||||
// tableStore.table.params.cascader = ''
|
||||
// tableStore.table.params.level = ''
|
||||
// tableStore.table.params.engineeringid = ''
|
||||
// tableStore.table.params.projectId = ''
|
||||
// tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.engineeringid = ''
|
||||
tableStore.table.params.projectId = ''
|
||||
tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.lineId = ''
|
||||
tableStore.table.params.cascader = ''
|
||||
tableStore.table.params.type = 3
|
||||
// tableStore.table.params.eventIds = []
|
||||
// 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)
|
||||
}
|
||||
})
|
||||
tableStore.table.params.level = ''
|
||||
|
||||
const filterNode = createTreeFilterNode()
|
||||
const sourceChange = (e: any) => {
|
||||
tableStore.table.params.deviceTypeId = ''
|
||||
|
||||
const onTreeClear = () => {
|
||||
tableStore.table.params.engineeringid = ''
|
||||
tableStore.table.params.projectId = ''
|
||||
tableStore.table.params.deviceId = ''
|
||||
if (e) {
|
||||
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.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(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
<template>
|
||||
<TableHeader datePicker ref="refheader" showCustomColumn showExport>
|
||||
<template v-slot:select>
|
||||
<!-- <el-form-item label="设备选取">
|
||||
<el-tree-select
|
||||
v-model="tableStore.table.params.cascader"
|
||||
:data="deviceTreeOptions"
|
||||
clearable
|
||||
:props="treeProps"
|
||||
filterable
|
||||
:filter-node-method="filterNode"
|
||||
check-strictly
|
||||
default-expand-all
|
||||
placeholder="请选择需要筛选的数据"
|
||||
style="width: 100%"
|
||||
>
|
||||
|
||||
</el-tree-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input maxlength="32" show-word-limit style="width: 240px"
|
||||
v-model.trim="tableStore.table.params.searchValue" clearable placeholder="请输入监测点名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备选取">
|
||||
<el-tree-select
|
||||
v-model="tableStore.table.params.cascader"
|
||||
:data="deviceTree"
|
||||
clearable
|
||||
:props="treeProps"
|
||||
filterable
|
||||
:filter-node-method="filterNode"
|
||||
check-strictly
|
||||
default-expand-all
|
||||
placeholder="请选择需要筛选的数据"
|
||||
@node-click="sourceChange"
|
||||
@clear="onTreeClear"
|
||||
style="width: 100%"
|
||||
></el-tree-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
style="width: 240px"
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
placeholder="请输入监测点名称"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="级别">
|
||||
<el-select v-model.trim="tableStore.table.params.level" placeholder="请选择级别" clearable>
|
||||
<el-option
|
||||
@@ -65,18 +71,23 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', sortable: true, minWidth: 180, },
|
||||
{ title: '监测点名称', field: 'lineName', align: 'center', minWidth: 150,formatter: (row: any) => {
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', sortable: true, minWidth: 180 },
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
align: 'center',
|
||||
minWidth: 150,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
} },
|
||||
{ title: '设备名称', field: 'equipmentName', align: 'center', minWidth: 150, },
|
||||
{ title: '项目名称', field: 'projectName', align: 'center', minWidth: 150, },
|
||||
{ title: '工程名称', field: 'engineeringName', align: 'center', minWidth: 150, },
|
||||
}
|
||||
},
|
||||
{ title: '设备名称', field: 'equipmentName', 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)
|
||||
@@ -84,33 +95,40 @@ provide('tableStore', tableStore)
|
||||
// "type": "",
|
||||
// "userId": ""
|
||||
tableStore.table.params.searchValue = ''
|
||||
// tableStore.table.params.engineeringid = ''
|
||||
// tableStore.table.params.deviceTypeId = ''
|
||||
// tableStore.table.params.projectId = ''
|
||||
// tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.engineeringid = ''
|
||||
tableStore.table.params.projectId = ''
|
||||
tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.lineId = ''
|
||||
tableStore.table.params.cascader = ''
|
||||
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 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(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
setTimeout(() => {
|
||||
tableStore.table.height = mainHeight(200).height as any
|
||||
}, 0)
|
||||
const addMenu = () => { }
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<div ref="refheader" v-show="!isWaveCharts" style="width: 100%">
|
||||
<TableHeader datePicker showExport showCustomColumn @onResetForm="onResetForm">
|
||||
<template v-slot:select>
|
||||
<!-- <el-form-item label="设备选取">
|
||||
<el-form-item label="设备选取">
|
||||
<el-tree-select
|
||||
v-model="tableStore.table.params.cascader"
|
||||
:data="deviceTreeOptions"
|
||||
:data="deviceTree"
|
||||
clearable
|
||||
:props="treeProps"
|
||||
filterable
|
||||
@@ -13,10 +13,12 @@
|
||||
check-strictly
|
||||
default-expand-all
|
||||
placeholder="请选择需要筛选的数据"
|
||||
@node-click="sourceChange"
|
||||
@clear="onTreeClear"
|
||||
style="width: 100%"
|
||||
></el-tree-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="关键字筛选">
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
@@ -25,7 +27,7 @@
|
||||
clearable
|
||||
placeholder="请输入监测点名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item>
|
||||
<el-button type="primary" plain @click="openFilterDialog">事件筛选</el-button>
|
||||
</el-form-item> -->
|
||||
@@ -309,17 +311,14 @@ provide('tableStore', tableStore)
|
||||
// "type": "",
|
||||
// "userId": ""
|
||||
tableStore.table.params.searchValue = ''
|
||||
// tableStore.table.params.engineeringid = ''
|
||||
// tableStore.table.params.projectId = ''
|
||||
// tableStore.table.params.deviceTypeId = ''
|
||||
// tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.engineeringid = ''
|
||||
tableStore.table.params.projectId = ''
|
||||
tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.lineId = ''
|
||||
tableStore.table.params.cascader = ''
|
||||
|
||||
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, {
|
||||
featureAmplitudeMin: undefined,
|
||||
featureAmplitudeMax: undefined,
|
||||
@@ -334,54 +333,26 @@ Object.assign(tableStore.table.params, {
|
||||
const openFilterDialog = () => {
|
||||
filterVisible.value = true
|
||||
}
|
||||
|
||||
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 = ''
|
||||
const onTreeClear = () => {
|
||||
tableStore.table.params.engineeringid = ''
|
||||
tableStore.table.params.projectId = ''
|
||||
tableStore.table.params.deviceId = ''
|
||||
if (e) {
|
||||
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] || ''
|
||||
// }
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
const filterNode = createTreeFilterNode()
|
||||
const onFilterConfirm = () => {
|
||||
tableStore.onTableAction('search', {})
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<Transient
|
||||
v-if="!showEventStatistics"
|
||||
:deviceTree="deviceTree"
|
||||
:key="key"
|
||||
@statistics="showEventStatistics = true"
|
||||
/>
|
||||
<eventStatistics v-else @back="showEventStatistics = false" />
|
||||
@@ -14,13 +13,13 @@
|
||||
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="稳态越限告警" name="3">
|
||||
<Steady v-if="activeName == '3'" :deviceTree="deviceTree" :key="key" />
|
||||
<Steady :deviceTree="deviceTree" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="设备告警" name="1">
|
||||
<Device v-if="activeName == '1'" :deviceTree="deviceTree" :key="key" />
|
||||
<Device :deviceTree="deviceTree" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="前置告警" name="2">
|
||||
<Front v-if="activeName == '2'" :deviceTree="deviceTree" :key="key" />
|
||||
<Front />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -48,9 +47,8 @@ watch(activeName, val => {
|
||||
}
|
||||
})
|
||||
getLineTree({ type: 'engineering' }).then(res => {
|
||||
|
||||
deviceTree.value = res.data
|
||||
key.value += 1
|
||||
|
||||
activeName.value = '4'
|
||||
})
|
||||
onMounted(() => {})
|
||||
|
||||
@@ -42,6 +42,7 @@ import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { Platform, TrendCharts, DataLine, Back } from '@element-plus/icons-vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { clearWaveCache } from '@/utils/waveCache'
|
||||
const props = defineProps(['wp'])
|
||||
const searchForm = ref({
|
||||
type: 0
|
||||
@@ -126,6 +127,7 @@ const handleClick = (tab: any, event: any) => {
|
||||
}, 1000)
|
||||
}
|
||||
const handleBack = () => {
|
||||
clearWaveCache()
|
||||
emit('handleHideCharts')
|
||||
}
|
||||
const setHeight = (h: any, vh: any, num = 1) => {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="接入方式">
|
||||
{{ deviceData.devAccessMethod =='CLD'?'1056协议':deviceData.devAccessMethod || '/' }}
|
||||
{{ deviceData.devAccessMethod == 'CLD' ? '1056协议' : deviceData.devAccessMethod || '/' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="网络设备ID">
|
||||
{{ deviceData.ndid || '/' }}
|
||||
@@ -309,7 +309,7 @@ const exportData = () => {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.device-manage {
|
||||
display: flex;
|
||||
|
||||
@@ -343,4 +343,7 @@ const exportData = () => {
|
||||
right: 10px;
|
||||
z-index: 10;
|
||||
}
|
||||
:deep(.el-tabs__header) {
|
||||
width: calc(100% - 100px);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -84,7 +84,7 @@ const tableStore: any = new TableStore({
|
||||
{ title: '协议版本', field: 'protocolVersion', minWidth: '100', 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: '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: 'associatedProject', minWidth: '120', formatter: (row: any) => { return row.cellValue || '/' } },
|
||||
{
|
||||
|
||||
@@ -26,8 +26,8 @@ export default defineConfig({
|
||||
// target: 'http://192.168.1.24:10215', //
|
||||
// target: 'http://192.168.1.122:10215', //gfh
|
||||
// target: 'http://192.168.1.127:10215', //cdf
|
||||
// target: 'http://192.168.1.125:10215',
|
||||
target: 'http://192.168.1.103:10215',
|
||||
// target: 'http://pqmcn.com:27707/api',
|
||||
// target: 'https://pqmcn.com:8092/api', //治理
|
||||
// target:'http://www.zhilitest.com:8089/api',
|
||||
changeOrigin: true,
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user