修改历史趋势和方案数据选择指标存在默认值问题
This commit is contained in:
@@ -62,11 +62,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted, reactive, nextTick, defineEmits } from 'vue'
|
import { ref, onMounted, defineEmits } from 'vue'
|
||||||
import { VxeGridProps, VxeGridPropTypes } from 'vxe-table'
|
import { VxeGridProps } from 'vxe-table'
|
||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
import { getDeviceTrendDataGroup, getDeviceTrendData } from '@/api/cs-device-boot/EquipmentDelivery.ts'
|
|
||||||
const activeName = ref(0)
|
const activeName = ref(0)
|
||||||
const emit = defineEmits(['changeTrendType'])
|
const emit = defineEmits(['changeTrendType'])
|
||||||
const tableList: any = []
|
const tableList: any = []
|
||||||
@@ -199,16 +198,16 @@ const init = () => {
|
|||||||
})
|
})
|
||||||
if (barCharts.value) {
|
if (barCharts.value) {
|
||||||
barCharts.value[activeName.value]?.initChart()
|
barCharts.value[activeName.value]?.initChart()
|
||||||
loading.value=false
|
loading.value = false
|
||||||
}else{
|
} else {
|
||||||
loading.value=true
|
loading.value = true
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = (tab: any, event: any) => {
|
const handleClick = (tab: any, event: any) => {
|
||||||
tableData.value=[]
|
tableData.value = []
|
||||||
echartsData.value={}
|
echartsData.value = {}
|
||||||
loading.value = true
|
loading.value = true
|
||||||
params.value.groupId = tabsList.value[tab.index].id
|
params.value.groupId = tabsList.value[tab.index].id
|
||||||
emit('changeTrendType', tab.index)
|
emit('changeTrendType', tab.index)
|
||||||
@@ -224,7 +223,6 @@ const setRealTrendData = (val: any) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
loading.value = true
|
loading.value = true
|
||||||
console.log(val, '----------------谐波频谱------------------')
|
|
||||||
tableData.value = {}
|
tableData.value = {}
|
||||||
mqttMessage.value = val
|
mqttMessage.value = val
|
||||||
for (let key in val) {
|
for (let key in val) {
|
||||||
@@ -232,8 +230,7 @@ const setRealTrendData = (val: any) => {
|
|||||||
tableData.value[key] = val[key]
|
tableData.value[key] = val[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(tabsList.value[activeName.value].groupName, '-------')
|
if (!tabsList.value[activeName.value].groupName.includes('间谐波')) {
|
||||||
if (tabsList.value[activeName.value].groupName.includes('间谐波') == false) {
|
|
||||||
delete tableData.value.data1
|
delete tableData.value.data1
|
||||||
} else {
|
} else {
|
||||||
console.log('不删除')
|
console.log('不删除')
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
<div>
|
<div>
|
||||||
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
|
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
|
||||||
<template v-slot:select :key="num">
|
<template v-slot:select :key="num">
|
||||||
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -40,7 +39,6 @@
|
|||||||
:label="item.name.includes('次数') ? item.name : item.name + '谐波次数'"
|
:label="item.name.includes('次数') ? item.name : item.name + '谐波次数'"
|
||||||
v-show="item.countOptions.length != 0"
|
v-show="item.countOptions.length != 0"
|
||||||
>
|
>
|
||||||
<!-- v-if="item.countOptions.length != 0" -->
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="item.count"
|
v-model="item.count"
|
||||||
@change="onCountChange($event, index)"
|
@change="onCountChange($event, index)"
|
||||||
@@ -50,8 +48,6 @@
|
|||||||
<el-option v-for="vv in item.countOptions" :key="vv" :label="vv" :value="vv"></el-option>
|
<el-option v-for="vv in item.countOptions" :key="vv" :label="vv" :value="vv"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- </el-form> -->
|
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-button type="primary" icon="el-icon-Search" @click="init()">查询</el-button>
|
<el-button type="primary" icon="el-icon-Search" @click="init()">查询</el-button>
|
||||||
@@ -64,27 +60,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import popup from './components/popup.vue'
|
|
||||||
import schemeTree from './components/schemeTree.vue'
|
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||||
import { ref, reactive, onMounted, provide, nextTick, watch } from 'vue'
|
import { ref, onMounted, watch } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
import { getTestRecordInfo, getHistoryTrend } from '@/api/cs-device-boot/planData'
|
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { queryStatistical } from '@/api/system-boot/csstatisticalset'
|
import { queryStatistical } from '@/api/system-boot/csstatisticalset'
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import { isNonNullChain } from 'typescript'
|
|
||||||
import { position } from 'html2canvas/dist/types/css/property-descriptors/position'
|
|
||||||
import { read, writeFile, utils } from 'xlsx'
|
|
||||||
import TableStore from '@/utils/tableStore'
|
|
||||||
import Table from '@/components/table/index.vue'
|
|
||||||
import { yMethod, exportCSV } from '@/utils/echartMethod'
|
import { yMethod, exportCSV } from '@/utils/echartMethod'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { getTabsDataByType } from '@/api/cs-device-boot/EquipmentDelivery'
|
import { getTabsDataByType } from '@/api/cs-device-boot/EquipmentDelivery'
|
||||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||||
import { color, gradeColor3 } from '@/components/echarts/color'
|
import { color } from '@/components/echarts/color'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'govern/device/control'
|
name: 'govern/device/control'
|
||||||
@@ -214,7 +201,11 @@ const init = async () => {
|
|||||||
startTime: datePickerRef.value && datePickerRef.value.timeValue[0],
|
startTime: datePickerRef.value && datePickerRef.value.timeValue[0],
|
||||||
endTime: datePickerRef.value && datePickerRef.value.timeValue[1]
|
endTime: datePickerRef.value && datePickerRef.value.timeValue[1]
|
||||||
}
|
}
|
||||||
|
if (searchForm.value.index.length == 0) {
|
||||||
|
ElMessage.warning('请选择统计指标')
|
||||||
|
loading.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
if (obj.devId && obj.list.length != 0) {
|
if (obj.devId && obj.list.length != 0) {
|
||||||
try {
|
try {
|
||||||
await getTabsDataByType(obj)
|
await getTabsDataByType(obj)
|
||||||
@@ -228,7 +219,7 @@ const init = async () => {
|
|||||||
// y轴单位数组
|
// y轴单位数组
|
||||||
let unitList: any = []
|
let unitList: any = []
|
||||||
|
|
||||||
let groupedData = chartsList.reduce((acc, item) => {
|
let groupedData = chartsList.reduce((acc: any, item: any) => {
|
||||||
let key = item.anotherName
|
let key = item.anotherName
|
||||||
if (!acc[key]) {
|
if (!acc[key]) {
|
||||||
acc[key] = []
|
acc[key] = []
|
||||||
@@ -596,9 +587,9 @@ const onCountChange = (val: any, index: any) => {
|
|||||||
}
|
}
|
||||||
const onIndexChange = (val: any) => {
|
const onIndexChange = (val: any) => {
|
||||||
num.value += 1
|
num.value += 1
|
||||||
if (val.length == 0) {
|
// if (val.length == 0) {
|
||||||
searchForm.value.index = [indexOptions.value[0].id]
|
// searchForm.value.index = [indexOptions.value[0].id]
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
watch(
|
watch(
|
||||||
() => searchForm.value.index,
|
() => searchForm.value.index,
|
||||||
|
|||||||
@@ -343,9 +343,9 @@ const nodeClick = async (e: anyObj) => {
|
|||||||
}
|
}
|
||||||
const onIndexChange = (val: any) => {
|
const onIndexChange = (val: any) => {
|
||||||
num.value += 1
|
num.value += 1
|
||||||
if (val.length == 0) {
|
// if (val.length == 0) {
|
||||||
searchForm.value.index = [indexOptions.value[0].id]
|
// searchForm.value.index = [indexOptions.value[0].id]
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
const dialogRef = ref()
|
const dialogRef = ref()
|
||||||
const dailogForm = ref()
|
const dailogForm = ref()
|
||||||
@@ -386,7 +386,6 @@ const range = (start: any, end: any, step: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const init = (flag: boolean) => {
|
const init = (flag: boolean) => {
|
||||||
//调用子组件的方法切换的时候tree的节点也变化
|
|
||||||
let list: any = []
|
let list: any = []
|
||||||
//颜色数组
|
//颜色数组
|
||||||
|
|
||||||
@@ -446,6 +445,10 @@ const init = (flag: boolean) => {
|
|||||||
dataLevel: searchForm.value.dataLevel,
|
dataLevel: searchForm.value.dataLevel,
|
||||||
valueType: searchForm.value.type
|
valueType: searchForm.value.type
|
||||||
}
|
}
|
||||||
|
if (searchForm.value.index.length == 0 && flag) {
|
||||||
|
ElMessage.warning('请选择统计指标')
|
||||||
|
return
|
||||||
|
}
|
||||||
if (flag) {
|
if (flag) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getHistoryTrend(obj)
|
getHistoryTrend(obj)
|
||||||
@@ -596,7 +599,6 @@ const init = (flag: boolean) => {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
// echartsData.value = {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -745,7 +747,7 @@ const formatCountOptions = (list: any) => {
|
|||||||
if (kk.harmStart && kk.harmEnd) {
|
if (kk.harmStart && kk.harmEnd) {
|
||||||
range(0, 0, 0)
|
range(0, 0, 0)
|
||||||
|
|
||||||
if (kk.showName=='间谐波电压含有率') {
|
if (kk.showName == '间谐波电压含有率') {
|
||||||
countData.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map(
|
countData.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map(
|
||||||
(item: any) => {
|
(item: any) => {
|
||||||
return item - 0.5
|
return item - 0.5
|
||||||
|
|||||||
Reference in New Issue
Block a user