修改测试bug
This commit is contained in:
@@ -2,41 +2,30 @@
|
||||
<div>
|
||||
<!-- 历史趋势数据 -->
|
||||
<div>
|
||||
<TableHeader :showSearch="false" @selectChange="selectChange">
|
||||
<template v-slot:select>
|
||||
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
|
||||
<template v-slot:select :key="num">
|
||||
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
|
||||
<el-form-item>
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计指标" label-width="80px">
|
||||
<el-select
|
||||
multiple
|
||||
:multiple-limit="3"
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
v-model="searchForm.index"
|
||||
placeholder="请选择统计指标"
|
||||
@change="onIndexChange($event)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in indexOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-select multiple :multiple-limit="3" collapse-tags collapse-tags-tooltip
|
||||
v-model="searchForm.index" placeholder="请选择统计指标" @change="onIndexChange($event)">
|
||||
<el-option v-for="item in indexOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div v-for="(item, index) in countData" :key="index">
|
||||
|
||||
|
||||
<el-form-item
|
||||
v-for="(item, index) in countData" :key="index"
|
||||
:label="item.name + '谐波次数'"
|
||||
v-if="item.countOptions.length != 0"
|
||||
|
||||
label-width="180px"
|
||||
>
|
||||
<!-- v-if="item.countOptions.length != 0" -->
|
||||
<el-select
|
||||
v-model="item.count"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
@change="onCountChange($event, index)"
|
||||
placeholder="请选择谐波次数"
|
||||
>
|
||||
@@ -48,7 +37,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- </el-form> -->
|
||||
</template>
|
||||
<template #operation>
|
||||
@@ -88,14 +77,16 @@ defineOptions({
|
||||
name: 'govern/device/control'
|
||||
})
|
||||
//电压等级
|
||||
const voltageLevelList = dictData.getBasicData('Dev_Voltage')
|
||||
const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//接线方式
|
||||
const volConTypeList = dictData.getBasicData('Dev_Connect')
|
||||
const num = ref(0)
|
||||
|
||||
//值类型
|
||||
const pageHeight = ref(mainHeight(290))
|
||||
const loading = ref(true)
|
||||
const searchForm = ref({})
|
||||
const tableHeaderRef = ref()
|
||||
const typeOptions = [
|
||||
{
|
||||
name: '平均值',
|
||||
@@ -117,7 +108,7 @@ const typeOptions = [
|
||||
searchForm.value = {
|
||||
index: [],
|
||||
type: typeOptions[0].id,
|
||||
count: [],
|
||||
count: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: ''
|
||||
}
|
||||
@@ -189,7 +180,7 @@ const init = async () => {
|
||||
countData.value.map((item: any, index: any) => {
|
||||
lists[index] = {
|
||||
statisticalId: item.index,
|
||||
frequencys: item.count
|
||||
frequencys: [item.count]
|
||||
}
|
||||
})
|
||||
let obj = {
|
||||
@@ -260,9 +251,8 @@ const init = async () => {
|
||||
const xname = params[0].value[0]
|
||||
let str = `${xname}<br>`
|
||||
params.forEach((el, index) => {
|
||||
str += `${el.marker}${el.seriesName.split('(')[0]}:${el.value[1]}${
|
||||
el.value[2]
|
||||
}<br>`
|
||||
str += `${el.marker}${el.seriesName.split('(')[0]}:${el.value[1]}${el.value[2]
|
||||
}<br>`
|
||||
})
|
||||
return str
|
||||
}
|
||||
@@ -497,7 +487,7 @@ const initSearchFormIndexAndCount = (list: any) => {
|
||||
countData.value[index] = {
|
||||
index: item,
|
||||
countOptions: [],
|
||||
count: [],
|
||||
count: '',
|
||||
name: indexOptions.value.find((vv: any) => {
|
||||
return vv.id == item
|
||||
})?.name
|
||||
@@ -512,37 +502,48 @@ const initSearchFormIndexAndCount = (list: any) => {
|
||||
countData.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1)
|
||||
//添加默认值
|
||||
if (countData.value[index].count.length == 0) {
|
||||
countData.value[index].count = [countData.value[index].countOptions[0]]
|
||||
countData.value[index].count = countData.value[index].countOptions[0]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
countData.value = countData.value.filter(item => item.countOptions.length > 0);
|
||||
|
||||
}
|
||||
}
|
||||
// 判断下拉框是否存在
|
||||
const onCountChange = (val: any, index: any) => {
|
||||
if (val.length == 0) {
|
||||
countData.value[index].count = [countData.value[index].countOptions[0]]
|
||||
countData.value[index].count = countData.value[index].countOptions[0]
|
||||
}
|
||||
}
|
||||
const onIndexChange = (val: any) => {
|
||||
|
||||
num.value +=1
|
||||
if (val.length == 0) {
|
||||
searchForm.value.index = [indexOptions.value[0].id]
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableHeaderRef.value.computedSearchRow()
|
||||
},500)
|
||||
}
|
||||
watch(
|
||||
() => searchForm.value.index,
|
||||
(val: any, oldval: any) => {
|
||||
if (val) {
|
||||
initSearchFormIndexAndCount(val)
|
||||
setTimeout(() => {
|
||||
initSearchFormIndexAndCount(val)
|
||||
}, 100)
|
||||
if (val == 0) {
|
||||
countData.value = []
|
||||
}
|
||||
countData.value.map((item: any, key: any) => {
|
||||
if (
|
||||
val.findIndex((vv: any) => {
|
||||
|
||||
return vv == item.index
|
||||
}) == -1
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user