修改浙江无线测试用例bug
This commit is contained in:
@@ -49,7 +49,8 @@
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="history_chart" :style="pageHeight" v-loading="loading">
|
||||
<MyEchart ref="historyChart" :options="echartsData" />
|
||||
<MyEchart ref="historyChart" :options="echartsData" v-if="showEchart" />
|
||||
<el-empty :style="pageHeight" v-else description="暂无数据" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -76,7 +77,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
console.log("🚀 ~ props:", props.TrendList)
|
||||
|
||||
const showEchart = ref(true)
|
||||
//电压等级
|
||||
const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//接线方式
|
||||
@@ -132,6 +133,41 @@ queryByCode(props?.TrendList?.lineType == 0 ? 'apf-harmonic' : 'portable-harmoni
|
||||
})
|
||||
queryStatistical(res.data.id).then(vv => {
|
||||
legendDictList.value = vv.data
|
||||
indexOptions.value.map((item: any, index: any) => {
|
||||
if (!countDataCopy.value[index]) {
|
||||
countDataCopy.value[index] = {
|
||||
index: item.id,
|
||||
countOptions: [],
|
||||
count: [],
|
||||
name: indexOptions.value.find((vv: any) => {
|
||||
return vv.id == item.id
|
||||
})?.name
|
||||
}
|
||||
}
|
||||
legendDictList.value?.selectedList?.map((vv: any, vvs: any) => {
|
||||
//查找相等的指标
|
||||
if (item.id == vv.dataType) {
|
||||
vv.eleEpdPqdVOS.map((kk: any, kks: any) => {
|
||||
if (kk.harmStart && kk.harmEnd) {
|
||||
range(0, 0, 0)
|
||||
|
||||
if (kk.showName == '间谐波电压含有率') {
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map(
|
||||
(item: any) => {
|
||||
return item - 0.5
|
||||
}
|
||||
)
|
||||
} else {
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1)
|
||||
}
|
||||
if (!countDataCopy.value[index].count || countDataCopy.value[index].count.length == 0) {
|
||||
countDataCopy.value[index].count = countDataCopy.value[index].countOptions[0]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
const activeName: any = ref()
|
||||
@@ -171,7 +207,7 @@ const init = async () => {
|
||||
//颜色数组
|
||||
const colorList = color
|
||||
//选择的指标使用方法处理
|
||||
formatCountOptions(searchForm.value.index)
|
||||
formatCountOptions()
|
||||
//查询历史趋势
|
||||
historyDataList.value = []
|
||||
chartTitle.value = ''
|
||||
@@ -212,9 +248,15 @@ const init = async () => {
|
||||
}
|
||||
if (obj.devId && obj.list.length != 0) {
|
||||
try {
|
||||
showEchart.value = true
|
||||
await getTabsDataByType(obj)
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
if (res.data.length == 0) {
|
||||
loading.value = false
|
||||
showEchart.value = false
|
||||
return
|
||||
}
|
||||
historyDataList.value = res.data
|
||||
let chartsList = JSON.parse(JSON.stringify(res.data))
|
||||
echartsData.value = {}
|
||||
@@ -578,47 +620,56 @@ const handleExport = async () => {
|
||||
return
|
||||
}
|
||||
const countData: any = ref([])
|
||||
const countDataCopy: any = ref([])
|
||||
|
||||
//根据选择的指标处理谐波次数
|
||||
const formatCountOptions = (list: any) => {
|
||||
const formatCountOptions = () => {
|
||||
countData.value = []
|
||||
if (list.length != 0) {
|
||||
list.map((item: any, index: any) => {
|
||||
if (!countData.value[index]) {
|
||||
countData.value[index] = {
|
||||
index: item,
|
||||
countOptions: [],
|
||||
count: '',
|
||||
name: indexOptions.value.find((vv: any) => {
|
||||
return vv.id == item
|
||||
})?.name
|
||||
}
|
||||
}
|
||||
legendDictList.value?.selectedList?.map((vv: any, vvs: any) => {
|
||||
//查找相等的指标
|
||||
if (item == vv.dataType) {
|
||||
vv.eleEpdPqdVOS.map((kk: any, kks: any) => {
|
||||
if (kk.harmStart && kk.harmEnd) {
|
||||
range(0, 0, 0)
|
||||
countData.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1)
|
||||
if (kk.showName == '间谐波电压含有率') {
|
||||
countData.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map(
|
||||
(item: any) => {
|
||||
return item - 0.5
|
||||
}
|
||||
)
|
||||
} else {
|
||||
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]
|
||||
}
|
||||
}
|
||||
})
|
||||
if (searchForm.value.index.length != 0) {
|
||||
searchForm.value.index.forEach((item: any, index: any) => {
|
||||
countDataCopy.value.forEach((vv: any, vvs: any) => {
|
||||
if (vv.index == item) {
|
||||
countData.value.push(vv)
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
// list.map((item: any, index: any) => {
|
||||
// if (!countData.value[index]) {
|
||||
// countData.value[index] = {
|
||||
// index: item,
|
||||
// countOptions: [],
|
||||
// count: '',
|
||||
// name: indexOptions.value.find((vv: any) => {
|
||||
// return vv.id == item
|
||||
// })?.name
|
||||
// }
|
||||
// }
|
||||
// legendDictList.value?.selectedList?.map((vv: any, vvs: any) => {
|
||||
// //查找相等的指标
|
||||
// if (item == vv.dataType) {
|
||||
// vv.eleEpdPqdVOS.map((kk: any, kks: any) => {
|
||||
// if (kk.harmStart && kk.harmEnd) {
|
||||
// range(0, 0, 0)
|
||||
// countData.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1)
|
||||
// if (kk.showName == '间谐波电压含有率') {
|
||||
// countData.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map(
|
||||
// (item: any) => {
|
||||
// return item - 0.5
|
||||
// }
|
||||
// )
|
||||
// } else {
|
||||
// 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.map((item: any, key: any) => {
|
||||
if (item.name == '谐波电流有效值') {
|
||||
item.name = '谐波电流次数'
|
||||
@@ -651,7 +702,7 @@ const onIndexChange = (val: any) => {
|
||||
})
|
||||
searchForm.value.index = pp
|
||||
flag.value = true
|
||||
|
||||
formatCountOptions()
|
||||
|
||||
// if (val.length == 0) {
|
||||
// searchForm.value.index = [indexOptions.value[0].id]
|
||||
@@ -660,23 +711,23 @@ const onIndexChange = (val: any) => {
|
||||
watch(
|
||||
() => searchForm.value.index,
|
||||
(val: any, oldval: any) => {
|
||||
if (val) {
|
||||
setTimeout(() => {
|
||||
formatCountOptions(val)
|
||||
}, 100)
|
||||
if (val == 0) {
|
||||
countData.value = []
|
||||
}
|
||||
countData.value.map((item: any, key: any) => {
|
||||
if (
|
||||
val.findIndex((vv: any) => {
|
||||
return vv == item.index
|
||||
}) == -1
|
||||
) {
|
||||
countData.value.splice(key, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
// if (val) {
|
||||
// setTimeout(() => {
|
||||
// formatCountOptions(val)
|
||||
// }, 100)
|
||||
// if (val == 0) {
|
||||
// countData.value = []
|
||||
// }
|
||||
// countData.value.map((item: any, key: any) => {
|
||||
// if (
|
||||
// val.findIndex((vv: any) => {
|
||||
// return vv == item.index
|
||||
// }) == -1
|
||||
// ) {
|
||||
// countData.value.splice(key, 1)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
|
||||
Reference in New Issue
Block a user