优化暂态事件列表
This commit is contained in:
@@ -110,14 +110,14 @@ provide('tableStore', tableStore)
|
||||
// "target": [],
|
||||
// "type": "",
|
||||
// "userId": ""
|
||||
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.type = 3
|
||||
tableStore.table.params.eventIds = []
|
||||
tableStore.table.params.status = ''
|
||||
tableStore.table.params.target = []
|
||||
tableStore.table.params.userId = ''
|
||||
// tableStore.table.params.eventIds = []
|
||||
// tableStore.table.params.status = ''
|
||||
// tableStore.table.params.target = []
|
||||
// tableStore.table.params.userId = ''
|
||||
tableStore.table.params.searchValue = ''
|
||||
|
||||
const sourceChange = (e: any) => {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</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="请输入监测点、设备、项目、工程" />
|
||||
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>
|
||||
@@ -193,18 +193,18 @@ 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.cascader = ''
|
||||
// tableStore.table.params.level = ''
|
||||
// tableStore.table.params.engineeringid = ''
|
||||
// tableStore.table.params.projectId = ''
|
||||
// tableStore.table.params.deviceId = ''
|
||||
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 = ''
|
||||
// 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) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
placeholder="请输入前置服务器名称,ip"
|
||||
placeholder="请输入前置服务器名称、ip"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="级别">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</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="请输入监测点、设备、项目、工程" />
|
||||
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>
|
||||
@@ -98,17 +98,17 @@ 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.deviceTypeId = ''
|
||||
// tableStore.table.params.projectId = ''
|
||||
// tableStore.table.params.deviceId = ''
|
||||
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.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)
|
||||
|
||||
@@ -10,18 +10,23 @@
|
||||
</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>
|
||||
<el-button type="primary" plain @click="openFilterDialog">多条件筛选</el-button>
|
||||
v-model.trim="tableStore.table.params.searchValue" clearable placeholder="请输入监测点名称" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-button type="primary" plain @click="openFilterDialog">事件筛选</el-button>
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" icon="el-icon-Operation" @click="openFilterDialog">事件筛选</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<MultiCondition v-model:visible="filterVisible" :params="tableStore.table.params"
|
||||
ref="multiConditionRef" @confirm="onFilterConfirm" />
|
||||
<MultiCondition v-model:visible="filterVisible" :params="tableStore.table.params" ref="multiConditionRef"
|
||||
@confirm="onFilterConfirm" />
|
||||
|
||||
<Table></Table>
|
||||
<!-- 补召日志 -->
|
||||
<analysisList ref="analysisListRef"></analysisList>
|
||||
</div>
|
||||
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false" :wp="wp" />
|
||||
@@ -32,13 +37,15 @@ import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import MultiCondition from './multiCondition.vue'
|
||||
import MultiCondition from '@/views/govern/alarm/multiCondition.vue'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
|
||||
import { analyseWave, getFileByEventId } from '@/api/common'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import analysisList from '@/views/govern/device/control/analysisList/index.vue'
|
||||
const props = defineProps(['deviceTree'])
|
||||
|
||||
const refheader = ref()
|
||||
@@ -50,15 +57,12 @@ const showBoxi = ref(true)
|
||||
const loading = ref(false)
|
||||
const bxactiveName = ref('ssbx')
|
||||
const boxoList: any = ref({})
|
||||
|
||||
const analysisListRef = ref()
|
||||
const wp = ref({})
|
||||
const dictData = useDictData()
|
||||
const ReasonList: any = dictData.getBasicData('Event_Reason')
|
||||
const EventTypeList = [
|
||||
{ label: '电压暂降', value: '电压暂降' },
|
||||
{ label: '电压暂升', value: '电压暂升' },
|
||||
{ label: '电压中断', value: '电压中断' }
|
||||
]
|
||||
const DeviceType = ref([])
|
||||
const EventTypeList: any = dictData.getBasicData('Event_Type')
|
||||
|
||||
const filterVisible = ref(false)
|
||||
const multiConditionRef = ref<InstanceType<typeof MultiCondition>>()
|
||||
@@ -82,16 +86,21 @@ const tableStore = new TableStore({
|
||||
{ title: '暂降幅值(%)', minWidth: 120, field: 'evtParamVVaDepth', align: 'center', sortable: true, },
|
||||
|
||||
{ title: '持续时间(s)', field: 'evtParamTm', minWidth: 110, align: 'center', sortable: true },
|
||||
{
|
||||
title: '严重度', field: 'severity', minWidth: 80, align: 'center', sortable: true, formatter: (row: any) => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{ title: '相别', field: 'evtParamPhase', minWidth: 80, align: 'center' },
|
||||
{ title: '触发类型', field: 'showName', minWidth: 120, align: 'center' },
|
||||
{ title: '触发类型', field: 'showName', minWidth: 100, align: 'center' },
|
||||
{
|
||||
title: '暂降原因', field: 'advanceReason', minWidth: 100, align: 'center', formatter: (row: any) => {
|
||||
return ReasonList.find((item: any) => item.value == row.cellValue)?.label || '未知'
|
||||
return ReasonList.find((item: any) => item.id == row.cellValue)?.name || '未知'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '暂降类型', field: 'advanceType', minWidth: 100, align: 'center', formatter: (row: any) => {
|
||||
return EventTypeList.find((item: any) => item.value == row.cellValue)?.label || '未知'
|
||||
return EventTypeList.find((item: any) => item.id == row.cellValue)?.name || '未知'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -104,11 +113,11 @@ const tableStore = new TableStore({
|
||||
{ title: '工程名称', field: 'engineeringName', minWidth: 130, align: 'center' },
|
||||
{
|
||||
title: '发生位置', field: 'sagSource', minWidth: 120, align: 'center', formatter: (row: any) => {
|
||||
|
||||
return row.cellValue == 1 ? '上游' : row.cellValue == 2 ? '下游' : '未知'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
@@ -209,30 +218,53 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
text: '暂无波形',
|
||||
text: '暂不支持补召',
|
||||
type: 'info',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code
|
||||
return !(code == 'Direct_Connected_Device' || code == 'Gateway')
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
text: '波形补召',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
loading: 'loading2',
|
||||
disabled: row => {
|
||||
return row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code
|
||||
|
||||
if (code == 'Portable') {
|
||||
// 便携式设备
|
||||
analysisListRef.value &&
|
||||
analysisListRef.value.open({
|
||||
lineId: row.lineId,
|
||||
deviceData: row,
|
||||
deviceId: row.deviceId
|
||||
})
|
||||
|
||||
} else if (code == 'DEV_CLD') {
|
||||
row.loading2 = true
|
||||
// 监测设备
|
||||
getFileByEventId(row.id).then(res => {
|
||||
ElMessage.success(res.message)
|
||||
tableStore.index()
|
||||
row.loading2 = false
|
||||
}).catch(() => {
|
||||
row.loading2 = false
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
// {
|
||||
// name: 'edit',
|
||||
// title: '波形补召',
|
||||
// type: 'primary',
|
||||
// icon: 'el-icon-Check',
|
||||
// render: 'basicButton',
|
||||
// disabled: row => {
|
||||
// return row.wavePath || row.showName === '未知'
|
||||
// },
|
||||
// click: row => {
|
||||
// getFileByEventId(row.id).then(res => {
|
||||
// ElMessage.success(res.message)
|
||||
// tableStore.index()
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -257,21 +289,24 @@ 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.deviceTypeId = ''
|
||||
// tableStore.table.params.deviceId = ''
|
||||
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 = ''
|
||||
// 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, {
|
||||
featureAmplitude: '',
|
||||
evtParamTm: '',
|
||||
showName: '',
|
||||
featureAmplitudeMin: undefined,
|
||||
featureAmplitudeMax: undefined,
|
||||
evtParamTmMin: undefined,
|
||||
evtParamTmMax: undefined,
|
||||
severityMin: undefined,
|
||||
severityMax: undefined,
|
||||
fileFlag: ''
|
||||
})
|
||||
// tableStore.table.params.level=''
|
||||
@@ -345,6 +380,11 @@ const onResetForm = () => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
queryByCode('Device_Type').then(res => {
|
||||
queryCsDictTree(res.data.id).then((list: any) => {
|
||||
DeviceType.value = list.data
|
||||
})
|
||||
})
|
||||
tableStore.index()
|
||||
})
|
||||
const bxecharts = mainHeight(175).height as any
|
||||
|
||||
@@ -1,37 +1,42 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" title="多条件筛选" width="450px" append-to-body draggable
|
||||
class="transient-filter-dialog">
|
||||
<el-dialog v-model="visible" title="事件筛选" width="450px" append-to-body draggable class="transient-filter-dialog">
|
||||
<el-form label-width="auto" class="filter-form">
|
||||
<el-form-item label="暂态幅值(%)">
|
||||
<div class="range-inputs">
|
||||
<el-input-number v-model="filterForm.featureAmplitudeMin" class="range-input-item" :min="0"
|
||||
:max="200" :precision="3" :step="0.01" :controls="false" placeholder="0"
|
||||
@change="onRangeMinChange($event, 'featureAmplitudeMax')" />
|
||||
<span class="range-sep">< 幅值 <</span>
|
||||
<el-input-number v-model="filterForm.featureAmplitudeMax" class="range-input-item" :min="0"
|
||||
:max="200" :precision="3" :step="0.01" :controls="false" placeholder="200"
|
||||
@change="onRangeMaxChange($event, filterForm.featureAmplitudeMin, 'featureAmplitudeMax', '暂态幅值')" />
|
||||
<el-input-number v-model="params.featureAmplitudeMin" class="range-input-item" :min="0" :max="180"
|
||||
:precision="2" :step="0.01" :controls="false" placeholder="0" />
|
||||
<span class="range-sep"><   幅值   <</span>
|
||||
<el-input-number v-model="params.featureAmplitudeMax" class="range-input-item" :min="0" :max="180"
|
||||
:precision="2" :step="0.01" :controls="false" placeholder="180" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="暂态持续时间">
|
||||
<el-form-item label="暂态持续时间(s)">
|
||||
<div class="range-inputs">
|
||||
<el-input-number v-model="filterForm.evtParamTmMin" class="range-input-item" :min="0"
|
||||
:precision="3" :step="0.01" :controls="false" placeholder="X毫秒"
|
||||
@change="onRangeMinChange($event, 'evtParamTmMax')" />
|
||||
<span class="range-sep">< 持续时间 <</span>
|
||||
<el-input-number v-model="filterForm.evtParamTmMax" class="range-input-item" :min="0"
|
||||
:precision="3" :step="0.01" :controls="false" placeholder="X毫秒"
|
||||
@change="onRangeMaxChange($event, filterForm.evtParamTmMin, 'evtParamTmMax', '暂态持续时间')" />
|
||||
<el-input-number v-model="params.evtParamTmMin" class="range-input-item" :min="0" :max="60"
|
||||
:precision="2" :step="0.01" :controls="false" placeholder="X秒" />
|
||||
<span class="range-sep">< 持续时间 <</span>
|
||||
<el-input-number v-model="params.evtParamTmMax" class="range-input-item" :min="0" :max="60"
|
||||
:precision="2" :step="0.01" :controls="false" placeholder="X秒" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="事件严重度">
|
||||
<div class="range-inputs">
|
||||
<el-input-number v-model="params.severityMin" class="range-input-item" :min="0" :max="10"
|
||||
:precision="2" :step="1" :controls="false" placeholder="0" />
|
||||
<span class="range-sep">< 严重度  <</span>
|
||||
<el-input-number v-model="params.severityMax" class="range-input-item" :min="0" :max="10"
|
||||
:precision="2" :step="1" :controls="false" placeholder="10" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="触发类型">
|
||||
<el-select v-model="params.showName" clearable placeholder="请选择触发类型" style="width: 100%">
|
||||
<el-select v-model="params.target" clearable placeholder="请选择触发类型" multiple collapse-tags
|
||||
style="width: 317px">
|
||||
<el-option v-for="item in eventTypeList" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否存在波形">
|
||||
<el-select v-model="params.fileFlag" clearable placeholder="请选择是否存在波形" style="width: 100%">
|
||||
<el-select v-model="params.fileFlag" clearable placeholder="请选择是否存在波形" style="width: 317px">
|
||||
<el-option v-for="item in fileFlagOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
@@ -46,13 +51,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const getDefaultFilterParams = () => ({
|
||||
featureAmplitude: '',
|
||||
evtParamTm: '',
|
||||
showName: '',
|
||||
featureAmplitudeMin: undefined as number | undefined,
|
||||
featureAmplitudeMax: undefined as number | undefined,
|
||||
evtParamTmMin: undefined as number | undefined,
|
||||
evtParamTmMax: undefined as number | undefined,
|
||||
severityMin: undefined as number | undefined,
|
||||
severityMax: undefined as number | undefined,
|
||||
target: [] as string[],
|
||||
fileFlag: '' as string | number
|
||||
})
|
||||
|
||||
@@ -67,9 +75,11 @@ const emit = defineEmits<{
|
||||
}>()
|
||||
|
||||
const eventTypeList = [
|
||||
{ label: '电压暂降', value: '电压暂降' },
|
||||
{ label: '电压暂升', value: '电压暂升' },
|
||||
{ label: '电压中断', value: '电压中断' }
|
||||
{ label: '暂降', value: '暂降' },
|
||||
{ label: '暂升', value: '暂升' },
|
||||
{ label: '中断', value: '中断' },
|
||||
{ label: '瞬态', value: '瞬态' },
|
||||
{ label: '振荡', value: '振荡' },
|
||||
]
|
||||
|
||||
const fileFlagOptions = [
|
||||
@@ -77,50 +87,6 @@ const fileFlagOptions = [
|
||||
{ label: '不存在', value: 0 }
|
||||
]
|
||||
|
||||
type RangeMaxField = 'featureAmplitudeMax' | 'evtParamTmMax'
|
||||
|
||||
const filterForm = ref<{
|
||||
featureAmplitudeMin?: number
|
||||
featureAmplitudeMax?: number
|
||||
evtParamTmMin?: number
|
||||
evtParamTmMax?: number
|
||||
}>({})
|
||||
|
||||
const parseRangeParam = (val: string): [number | undefined, number | undefined] => {
|
||||
if (!val) return [undefined, undefined]
|
||||
const [min = '', max = ''] = String(val).split(',')
|
||||
const minNum = min !== '' ? Number(min) : undefined
|
||||
const maxNum = max !== '' ? Number(max) : undefined
|
||||
return [
|
||||
minNum != null && !Number.isNaN(minNum) ? minNum : undefined,
|
||||
maxNum != null && !Number.isNaN(maxNum) ? maxNum : undefined
|
||||
]
|
||||
}
|
||||
|
||||
const joinRangeParam = (min?: number, max?: number) => {
|
||||
if (min == null && max == null) return ''
|
||||
return `${min ?? ''},${max ?? ''}`
|
||||
}
|
||||
|
||||
const onRangeMinChange = (min: number | undefined, maxField: RangeMaxField) => {
|
||||
const max = filterForm.value[maxField]
|
||||
if (min != null && max != null && max <= min) {
|
||||
filterForm.value[maxField] = undefined
|
||||
}
|
||||
}
|
||||
|
||||
const onRangeMaxChange = (
|
||||
max: number | undefined,
|
||||
min: number | undefined,
|
||||
maxField: RangeMaxField,
|
||||
label: string
|
||||
) => {
|
||||
if (min != null && max != null && max <= min) {
|
||||
ElMessage.warning(`${label}最大值必须大于最小值`)
|
||||
filterForm.value[maxField] = undefined
|
||||
}
|
||||
}
|
||||
|
||||
const validateRange = (
|
||||
min: number | undefined,
|
||||
max: number | undefined,
|
||||
@@ -132,15 +98,8 @@ const validateRange = (
|
||||
|
||||
if (!hasMin && !hasMax) return true
|
||||
|
||||
if (hasMin !== hasMax) {
|
||||
ElMessage.warning(`${label}请同时填写最小值和最大值`)
|
||||
return false
|
||||
}
|
||||
|
||||
if (min! <= 0 || max! <= 0) {
|
||||
ElMessage.warning(`${label}必须大于0`)
|
||||
return false
|
||||
}
|
||||
// 只填最小值或最大值其中一个时,不做范围校验
|
||||
if (hasMin !== hasMax) return true
|
||||
|
||||
if (max! <= min!) {
|
||||
ElMessage.warning(`${label}最大值必须大于最小值`)
|
||||
@@ -155,41 +114,30 @@ const validateRange = (
|
||||
return true
|
||||
}
|
||||
|
||||
const syncFromParams = () => {
|
||||
const [faMin, faMax] = parseRangeParam(props.params.featureAmplitude)
|
||||
const [tmMin, tmMax] = parseRangeParam(props.params.evtParamTm)
|
||||
filterForm.value.featureAmplitudeMin = faMin
|
||||
filterForm.value.featureAmplitudeMax = faMax
|
||||
filterForm.value.evtParamTmMin = tmMin
|
||||
filterForm.value.evtParamTmMax = tmMax
|
||||
}
|
||||
|
||||
const reset = () => {
|
||||
filterForm.value = {}
|
||||
Object.assign(props.params, getDefaultFilterParams())
|
||||
}
|
||||
|
||||
const onConfirm = () => {
|
||||
const { featureAmplitudeMin, featureAmplitudeMax, evtParamTmMin, evtParamTmMax } = filterForm.value
|
||||
const { featureAmplitudeMin, featureAmplitudeMax, evtParamTmMin, evtParamTmMax, severityMin, severityMax } = props.params
|
||||
|
||||
if (!validateRange(featureAmplitudeMin, featureAmplitudeMax, '暂态幅值', { maxLimit: 200 })) {
|
||||
if (!validateRange(featureAmplitudeMin, featureAmplitudeMax, '暂态幅值', { maxLimit: 180 })) {
|
||||
return
|
||||
}
|
||||
if (!validateRange(evtParamTmMin, evtParamTmMax, '暂态持续时间')) {
|
||||
if (!validateRange(evtParamTmMin, evtParamTmMax, '暂态持续时间', { maxLimit: 60 })) {
|
||||
return
|
||||
}
|
||||
if (!validateRange(severityMin, severityMax, '严重度', { maxLimit: 10 })) {
|
||||
return
|
||||
}
|
||||
|
||||
props.params.featureAmplitude = joinRangeParam(featureAmplitudeMin, featureAmplitudeMax)
|
||||
props.params.evtParamTm = joinRangeParam(evtParamTmMin, evtParamTmMax)
|
||||
visible.value = false
|
||||
emit('confirm')
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
watch(visible, val => {
|
||||
if (val) syncFromParams()
|
||||
})
|
||||
|
||||
defineExpose({ reset, syncFromParams })
|
||||
defineExpose({ reset })
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user