修改历史趋势和方案数据选择指标存在默认值问题
This commit is contained in:
@@ -62,11 +62,10 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, reactive, nextTick, defineEmits } from 'vue'
|
||||
import { VxeGridProps, VxeGridPropTypes } from 'vxe-table'
|
||||
import { ref, onMounted, defineEmits } from 'vue'
|
||||
import { VxeGridProps } from 'vxe-table'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getDeviceTrendDataGroup, getDeviceTrendData } from '@/api/cs-device-boot/EquipmentDelivery.ts'
|
||||
const activeName = ref(0)
|
||||
const emit = defineEmits(['changeTrendType'])
|
||||
const tableList: any = []
|
||||
@@ -224,7 +223,6 @@ const setRealTrendData = (val: any) => {
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
console.log(val, '----------------谐波频谱------------------')
|
||||
tableData.value = {}
|
||||
mqttMessage.value = val
|
||||
for (let key in val) {
|
||||
@@ -232,8 +230,7 @@ const setRealTrendData = (val: any) => {
|
||||
tableData.value[key] = val[key]
|
||||
}
|
||||
}
|
||||
console.log(tabsList.value[activeName.value].groupName, '-------')
|
||||
if (tabsList.value[activeName.value].groupName.includes('间谐波') == false) {
|
||||
if (!tabsList.value[activeName.value].groupName.includes('间谐波')) {
|
||||
delete tableData.value.data1
|
||||
} else {
|
||||
console.log('不删除')
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<div>
|
||||
<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>
|
||||
@@ -40,7 +39,6 @@
|
||||
:label="item.name.includes('次数') ? item.name : item.name + '谐波次数'"
|
||||
v-show="item.countOptions.length != 0"
|
||||
>
|
||||
<!-- v-if="item.countOptions.length != 0" -->
|
||||
<el-select
|
||||
v-model="item.count"
|
||||
@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-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- </el-form> -->
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-Search" @click="init()">查询</el-button>
|
||||
@@ -64,27 +60,18 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import popup from './components/popup.vue'
|
||||
import schemeTree from './components/schemeTree.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import { ref, reactive, onMounted, provide, nextTick, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getTestRecordInfo, getHistoryTrend } from '@/api/cs-device-boot/planData'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
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 TableHeader from '@/components/table/header/index.vue'
|
||||
import { getTabsDataByType } from '@/api/cs-device-boot/EquipmentDelivery'
|
||||
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()
|
||||
defineOptions({
|
||||
name: 'govern/device/control'
|
||||
@@ -214,7 +201,11 @@ const init = async () => {
|
||||
startTime: datePickerRef.value && datePickerRef.value.timeValue[0],
|
||||
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) {
|
||||
try {
|
||||
await getTabsDataByType(obj)
|
||||
@@ -228,7 +219,7 @@ const init = async () => {
|
||||
// y轴单位数组
|
||||
let unitList: any = []
|
||||
|
||||
let groupedData = chartsList.reduce((acc, item) => {
|
||||
let groupedData = chartsList.reduce((acc: any, item: any) => {
|
||||
let key = item.anotherName
|
||||
if (!acc[key]) {
|
||||
acc[key] = []
|
||||
@@ -596,9 +587,9 @@ const onCountChange = (val: any, index: any) => {
|
||||
}
|
||||
const onIndexChange = (val: any) => {
|
||||
num.value += 1
|
||||
if (val.length == 0) {
|
||||
searchForm.value.index = [indexOptions.value[0].id]
|
||||
}
|
||||
// if (val.length == 0) {
|
||||
// searchForm.value.index = [indexOptions.value[0].id]
|
||||
// }
|
||||
}
|
||||
watch(
|
||||
() => searchForm.value.index,
|
||||
|
||||
@@ -343,9 +343,9 @@ const nodeClick = async (e: anyObj) => {
|
||||
}
|
||||
const onIndexChange = (val: any) => {
|
||||
num.value += 1
|
||||
if (val.length == 0) {
|
||||
searchForm.value.index = [indexOptions.value[0].id]
|
||||
}
|
||||
// if (val.length == 0) {
|
||||
// searchForm.value.index = [indexOptions.value[0].id]
|
||||
// }
|
||||
}
|
||||
const dialogRef = ref()
|
||||
const dailogForm = ref()
|
||||
@@ -386,7 +386,6 @@ const range = (start: any, end: any, step: any) => {
|
||||
}
|
||||
|
||||
const init = (flag: boolean) => {
|
||||
//调用子组件的方法切换的时候tree的节点也变化
|
||||
let list: any = []
|
||||
//颜色数组
|
||||
|
||||
@@ -446,6 +445,10 @@ const init = (flag: boolean) => {
|
||||
dataLevel: searchForm.value.dataLevel,
|
||||
valueType: searchForm.value.type
|
||||
}
|
||||
if (searchForm.value.index.length == 0 && flag) {
|
||||
ElMessage.warning('请选择统计指标')
|
||||
return
|
||||
}
|
||||
if (flag) {
|
||||
loading.value = true
|
||||
getHistoryTrend(obj)
|
||||
@@ -596,7 +599,6 @@ const init = (flag: boolean) => {
|
||||
})
|
||||
} else {
|
||||
loading.value = false
|
||||
// echartsData.value = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user