2024-06-24 14:38:42 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="default-main device-manage" :style="{ height: pageHeight.height }">
|
2024-12-11 11:33:44 +08:00
|
|
|
|
|
2024-09-25 16:31:45 +08:00
|
|
|
|
<!-- @node-change="nodeClick" -->
|
2024-11-19 10:39:46 +08:00
|
|
|
|
<schemeTree @node-change="nodeClick" @node-click="nodeClick" @init="nodeClick" @onAdd="onAdd" @bind="bind"
|
|
|
|
|
|
ref="schemeTreeRef"></schemeTree>
|
2024-06-24 14:38:42 +08:00
|
|
|
|
<div class="device-manage-right" v-if="deviceData">
|
2024-09-25 16:31:45 +08:00
|
|
|
|
<el-descriptions title="方案信息" :column="2" border>
|
2024-11-19 10:39:46 +08:00
|
|
|
|
<!-- <template #extra>
|
2024-09-25 16:31:45 +08:00
|
|
|
|
<el-button type="primary" icon="el-icon-Plus" @click="handleOpen(0)">新增方案</el-button>
|
2024-11-19 10:39:46 +08:00
|
|
|
|
</template> -->
|
2024-06-24 14:38:42 +08:00
|
|
|
|
<el-descriptions-item label="方案名称" width="60">
|
|
|
|
|
|
{{ deviceData.itemName }}
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="方案描述" width="60">
|
|
|
|
|
|
{{ deviceData.describe ? deviceData.describe : '/' }}
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
</el-descriptions>
|
2024-12-25 10:53:07 +08:00
|
|
|
|
<el-collapse v-model.trim="activeColName" @change="handleChange" accordion>
|
2024-09-29 16:12:34 +08:00
|
|
|
|
<el-collapse-item title="测试项信息" name="0">
|
|
|
|
|
|
<div class="monitor_info" v-if="deviceData.records && deviceData.records.length != 0">
|
|
|
|
|
|
<!-- <div class="history_title">
|
|
|
|
|
|
<p>测试项信息</p>
|
|
|
|
|
|
</div> -->
|
2024-12-25 10:53:07 +08:00
|
|
|
|
<el-tabs v-model.trim="activeName" type="border-card" @tab-change="handleClickTabs">
|
2024-11-04 18:27:26 +08:00
|
|
|
|
<el-tab-pane v-for="(item, index) in deviceData?.records" :label="item.itemName"
|
|
|
|
|
|
:name="item.id" :key="index">
|
2024-09-29 16:12:34 +08:00
|
|
|
|
<template #label>
|
|
|
|
|
|
<span class="custom-tabs-label">
|
|
|
|
|
|
<el-icon>
|
|
|
|
|
|
<TrendCharts />
|
|
|
|
|
|
</el-icon>
|
|
|
|
|
|
<span>{{ item.itemName }}</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-descriptions size="small" width="180" :column="4" border>
|
2024-12-11 16:33:23 +08:00
|
|
|
|
<!-- <el-descriptions-item label="测试项名称" width="160">
|
2024-09-29 16:12:34 +08:00
|
|
|
|
{{ item.itemName }}
|
2024-12-11 16:33:23 +08:00
|
|
|
|
</el-descriptions-item> -->
|
2024-09-29 16:12:34 +08:00
|
|
|
|
<el-descriptions-item label="测量间隔" width="160">
|
|
|
|
|
|
{{ item.statisticalInterval }}分钟
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="电压等级" width="160">
|
|
|
|
|
|
{{
|
|
|
|
|
|
voltageLevelList.find(vv => {
|
|
|
|
|
|
return vv.id == item.voltageLevel
|
|
|
|
|
|
})?.name
|
|
|
|
|
|
}}
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="接线方式" width="160">
|
|
|
|
|
|
{{
|
|
|
|
|
|
volConTypeList.find(vv => {
|
|
|
|
|
|
return vv.id == item.volConType
|
|
|
|
|
|
})?.name
|
|
|
|
|
|
}}
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="最小短路容量" width="160">
|
|
|
|
|
|
{{ item.capacitySscmin }}MVA
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="用户协议容量" width="160">
|
|
|
|
|
|
{{ item.capacitySi }}MVA
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="基准短路容量" width="160">
|
|
|
|
|
|
{{ item.capacitySscb }}MVA
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="供电设备容量" width="160">
|
|
|
|
|
|
{{ item.capacitySt }}MVA
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="PT变比" width="160">
|
2024-10-28 20:11:53 +08:00
|
|
|
|
{{ item.pt && item.pt1 ? item.pt + '/' + item.pt1 : '/' }}
|
2024-09-29 16:12:34 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="CT变比" width="160">
|
2024-10-28 20:11:53 +08:00
|
|
|
|
{{ item.ct && item.ct1 ? item.ct + '/' + item.ct1 : '/' }}
|
2024-09-29 16:12:34 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="起始时间" width="160">
|
|
|
|
|
|
<span style="width: 140px; overflow: hidden; display: block">
|
|
|
|
|
|
{{ item.startTime }}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="结束时间" width="160">
|
|
|
|
|
|
<span style="width: 140px; overflow: hidden; display: block">
|
|
|
|
|
|
{{ item.endTime }}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="监测位置" width="160">
|
|
|
|
|
|
{{ item.location }}
|
|
|
|
|
|
</el-descriptions-item>
|
2024-11-19 10:39:46 +08:00
|
|
|
|
<!-- <el-descriptions-item label="操作" width="160">
|
2024-09-29 16:12:34 +08:00
|
|
|
|
<el-button type="primary" icon="el-icon-Tools" @click="handleOpen(3)">
|
|
|
|
|
|
数据绑定
|
|
|
|
|
|
</el-button>
|
2024-11-19 10:39:46 +08:00
|
|
|
|
</el-descriptions-item> -->
|
2024-09-29 16:12:34 +08:00
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
</el-tabs>
|
2024-07-03 19:31:29 +08:00
|
|
|
|
</div>
|
2024-10-09 08:49:19 +08:00
|
|
|
|
<div class="monitor_info" v-else>
|
|
|
|
|
|
<el-empty />
|
|
|
|
|
|
</div>
|
2024-09-29 16:12:34 +08:00
|
|
|
|
</el-collapse-item>
|
2024-10-14 20:15:54 +08:00
|
|
|
|
</el-collapse>
|
2024-10-29 10:38:50 +08:00
|
|
|
|
|
2024-11-12 14:06:41 +08:00
|
|
|
|
<div v-if="JSON.stringify(echartsData) != '{}' && deviceData?.records?.length != 0">
|
2024-12-09 16:30:40 +08:00
|
|
|
|
<!-- <h3 class="mt10 mb10">历史趋势</h3> -->
|
2024-12-25 10:53:07 +08:00
|
|
|
|
<el-tabs v-model.trim="childTab" type="border-card" class="mt10">
|
2024-12-17 20:57:07 +08:00
|
|
|
|
<el-tab-pane label="历史趋势" name="0">
|
2024-12-11 11:33:44 +08:00
|
|
|
|
<div class="history_trend" v-if="titleList != '(未绑定数据)'">
|
|
|
|
|
|
<div class="history_header" ref="headerRef">
|
|
|
|
|
|
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
|
|
|
|
|
|
<TableHeader :showSearch="false" ref="tableHeaderRef" @selectChange="selectChange">
|
|
|
|
|
|
<template v-slot:select :key="num">
|
|
|
|
|
|
<el-form-item for="-" label="统计指标">
|
|
|
|
|
|
<el-select style="min-width: 200px" collapse-tags collapse-tags-tooltip
|
2024-12-25 10:53:07 +08:00
|
|
|
|
v-model.trim="searchForm.index" placeholder="请选择统计指标"
|
2024-12-11 11:33:44 +08:00
|
|
|
|
@change="onIndexChange($event)" multiple :multiple-limit="3">
|
|
|
|
|
|
<el-option v-for="item in indexOptions" :key="item.id"
|
|
|
|
|
|
:label="item.name" :value="item.id"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
2024-12-17 20:57:07 +08:00
|
|
|
|
<el-form-item>
|
2024-12-25 10:53:07 +08:00
|
|
|
|
<!-- <el-select style="width: 12px !important" v-model.trim="searchForm.dataLevel">
|
2024-12-17 20:57:07 +08:00
|
|
|
|
<el-option value="Primary" label="一次值"></el-option>
|
|
|
|
|
|
<el-option value="Secondary" label="二次值"></el-option>
|
|
|
|
|
|
</el-select> -->
|
2024-12-25 10:53:07 +08:00
|
|
|
|
<el-radio-group v-model.trim="searchForm.dataLevel" @change="init(true)">
|
2024-12-17 20:57:07 +08:00
|
|
|
|
<el-radio-button label="一次值" value="Primary" />
|
|
|
|
|
|
<el-radio-button label="二次值" value="Secondary" />
|
|
|
|
|
|
|
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
</el-form-item>
|
2024-12-11 11:33:44 +08:00
|
|
|
|
<el-form-item for="-" label="统计类型" label-width="80px">
|
2024-12-25 10:53:07 +08:00
|
|
|
|
<el-select style="width: 120px" v-model.trim="searchForm.type"
|
2024-12-11 11:33:44 +08:00
|
|
|
|
placeholder="请选择值类型">
|
|
|
|
|
|
<el-option v-for="item in typeOptions" :key="item.id" :label="item.name"
|
|
|
|
|
|
:value="item.id"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
2024-12-17 20:57:07 +08:00
|
|
|
|
|
2024-12-25 10:53:07 +08:00
|
|
|
|
<el-form-item>
|
|
|
|
|
|
<div for="-" v-for="(item, index) in countData" :key="index"
|
|
|
|
|
|
|
|
|
|
|
|
v-show="item.countOptions.length != 0">
|
|
|
|
|
|
<span class="mr12">{{item.name.includes('次数') ? item.name : item.name.includes('幅值') ? item.name.slice(0, -2) + '次数' : item.name + '谐波次数'}}</span>
|
|
|
|
|
|
<el-select v-model.trim="item.count" class="mr20" collapse-tags collapse-tags-tooltip
|
|
|
|
|
|
placeholder="请选择谐波次数" style="width: 120px">
|
|
|
|
|
|
<el-option v-for="vv in item.countOptions" :key="vv" :label="vv"
|
|
|
|
|
|
:value="vv"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</div>
|
2024-12-11 11:33:44 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:operation>
|
|
|
|
|
|
<!-- <el-button type="primary" icon="el-icon-Download" @click="handleExport">
|
2024-10-29 10:38:50 +08:00
|
|
|
|
数据导出
|
2024-11-13 09:21:26 +08:00
|
|
|
|
</el-button> -->
|
2024-12-11 11:33:44 +08:00
|
|
|
|
<el-button type="primary" icon="el-icon-Search"
|
|
|
|
|
|
@click="init(true)">查询</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</TableHeader>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- <div class="history_title">
|
2024-10-29 10:38:50 +08:00
|
|
|
|
<p>{{ chartTitle }}</p>
|
2024-11-12 11:41:46 +08:00
|
|
|
|
</div> -->
|
2024-12-11 11:33:44 +08:00
|
|
|
|
<div class="history_chart mt5" v-loading="loading" :style="EcharHeight"
|
|
|
|
|
|
:key="EcharHeight.height" ref="chartRef">
|
|
|
|
|
|
<MyEchart ref="historyChart" v-if="echartsData" :isExport="true"
|
|
|
|
|
|
:options="echartsData" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-empty :style="EcharHeight" v-else description="未绑定数据" />
|
|
|
|
|
|
</el-tab-pane>
|
2024-12-17 20:57:07 +08:00
|
|
|
|
<el-tab-pane label="暂态数据" name="1">
|
2024-12-25 10:53:07 +08:00
|
|
|
|
<transient :activeName='activeName' ref="transientRef" :activeColName="activeColName" />
|
2024-12-11 11:33:44 +08:00
|
|
|
|
</el-tab-pane>
|
2024-12-09 16:30:40 +08:00
|
|
|
|
|
|
|
|
|
|
</el-tabs>
|
2024-12-11 11:33:44 +08:00
|
|
|
|
|
2024-10-29 10:38:50 +08:00
|
|
|
|
</div>
|
2024-06-24 14:38:42 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<el-empty v-else description="请选择设备" class="device-manage-right" />
|
|
|
|
|
|
<popup ref="dialogRef" @onSubmit="refreshTree" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
import popup from './components/popup.vue'
|
|
|
|
|
|
import schemeTree from './components/schemeTree.vue'
|
|
|
|
|
|
import { mainHeight } from '@/utils/layout'
|
2024-09-25 16:31:45 +08:00
|
|
|
|
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
2024-10-09 08:49:19 +08:00
|
|
|
|
import { ref, onMounted, watch, nextTick } from 'vue'
|
2024-06-24 14:38:42 +08:00
|
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
|
|
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'
|
2024-11-19 10:39:46 +08:00
|
|
|
|
import { TrendCharts, Plus, Platform, } from '@element-plus/icons-vue'
|
2024-09-30 15:35:59 +08:00
|
|
|
|
import { yMethod } from '@/utils/echartMethod'
|
2024-10-14 20:15:54 +08:00
|
|
|
|
import { color, gradeColor3 } from '@/components/echarts/color'
|
2024-10-09 08:49:19 +08:00
|
|
|
|
import TableHeader from '@/components/table/header/index.vue'
|
2024-10-14 20:15:54 +08:00
|
|
|
|
import { useConfig } from '@/stores/config'
|
2024-11-12 11:41:46 +08:00
|
|
|
|
import { getDeviceList } from '@/api/cs-device-boot/planData'
|
2024-12-17 20:57:07 +08:00
|
|
|
|
import transient from './components/transient.vue'
|
2024-06-24 14:38:42 +08:00
|
|
|
|
const dictData = useDictData()
|
|
|
|
|
|
defineOptions({
|
2024-11-13 09:21:26 +08:00
|
|
|
|
// name: 'govern/device/planData/index'
|
2024-06-24 14:38:42 +08:00
|
|
|
|
})
|
2024-12-17 20:57:07 +08:00
|
|
|
|
const childTab = ref('0')
|
2024-10-28 09:52:23 +08:00
|
|
|
|
const num = ref(0)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
const config = useConfig()
|
2024-12-17 20:57:07 +08:00
|
|
|
|
const transientRef = ref()
|
2024-10-14 20:15:54 +08:00
|
|
|
|
color[0] = config.layout.elementUiPrimary[0]
|
2024-06-24 14:38:42 +08:00
|
|
|
|
//电压等级
|
2024-10-22 10:50:47 +08:00
|
|
|
|
const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
|
2024-06-24 14:38:42 +08:00
|
|
|
|
//接线方式
|
|
|
|
|
|
const volConTypeList = dictData.getBasicData('Dev_Connect')
|
|
|
|
|
|
//值类型
|
|
|
|
|
|
const pageHeight = mainHeight(20)
|
2024-12-23 11:30:28 +08:00
|
|
|
|
const EcharHeight = ref(mainHeight(436))
|
2024-09-26 11:20:12 +08:00
|
|
|
|
const loading = ref(false)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
const searchForm: any = ref({})
|
2024-06-24 14:38:42 +08:00
|
|
|
|
const typeOptions = [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '平均值',
|
|
|
|
|
|
id: 'avg'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '最大值',
|
|
|
|
|
|
id: 'max'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '最小值',
|
|
|
|
|
|
id: 'min'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'CP95值',
|
|
|
|
|
|
id: 'cp95'
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
searchForm.value = {
|
2024-09-29 16:12:34 +08:00
|
|
|
|
index: [],
|
2024-09-29 13:55:31 +08:00
|
|
|
|
dataLevel: 'Primary',
|
2024-06-27 09:39:53 +08:00
|
|
|
|
type: typeOptions[0].id,
|
|
|
|
|
|
count: []
|
2024-06-24 14:38:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
//统计指标
|
|
|
|
|
|
const indexOptions: any = ref([])
|
2024-06-27 09:39:53 +08:00
|
|
|
|
//谐波次数
|
|
|
|
|
|
const countOptions: any = ref([])
|
2024-06-24 14:38:42 +08:00
|
|
|
|
// Harmonic_Type
|
|
|
|
|
|
// portable-harmonic
|
|
|
|
|
|
const legendDictList: any = ref([])
|
|
|
|
|
|
queryByCode('portable-harmonic').then(res => {
|
|
|
|
|
|
queryCsDictTree(res.data.id).then(item => {
|
2024-10-29 15:46:35 +08:00
|
|
|
|
indexOptions.value = item.data.sort((a: any, b: any) => {
|
|
|
|
|
|
return a.sort - b.sort
|
|
|
|
|
|
})
|
2024-09-29 16:12:34 +08:00
|
|
|
|
searchForm.value.index[0] = indexOptions.value[0].id
|
|
|
|
|
|
// searchForm.value.index = indexOptions.value[0].id
|
2024-06-24 14:38:42 +08:00
|
|
|
|
})
|
|
|
|
|
|
queryStatistical(res.data.id).then(vv => {
|
|
|
|
|
|
legendDictList.value = vv.data
|
2024-12-17 20:57:07 +08:00
|
|
|
|
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]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
2024-06-24 14:38:42 +08:00
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
const activeName: any = ref()
|
2024-10-14 20:15:54 +08:00
|
|
|
|
const activeColName: any = ref('0')
|
2024-06-24 14:38:42 +08:00
|
|
|
|
const deviceData: any = ref([])
|
|
|
|
|
|
const schemeTreeRef = ref()
|
2024-06-27 09:39:53 +08:00
|
|
|
|
//历史趋势devId
|
|
|
|
|
|
const historyDevId: any = ref('')
|
2024-06-24 14:38:42 +08:00
|
|
|
|
const chartTitle: any = ref('')
|
2024-09-25 16:31:45 +08:00
|
|
|
|
//点击测试项切换树节点
|
2024-10-21 20:36:12 +08:00
|
|
|
|
const handleClickTabs = () => {
|
2024-10-17 15:42:07 +08:00
|
|
|
|
searchForm.value.index = [indexOptions.value[0].id]
|
2024-09-25 16:31:45 +08:00
|
|
|
|
historyDevId.value = activeName.value
|
|
|
|
|
|
schemeTreeRef.value.setCheckedNode(activeName.value)
|
2024-10-17 15:42:07 +08:00
|
|
|
|
setTimeout(() => {
|
2024-10-21 09:09:56 +08:00
|
|
|
|
init(true)
|
2024-12-19 10:16:08 +08:00
|
|
|
|
transientRef.value && transientRef.value.init()
|
2024-10-21 20:36:12 +08:00
|
|
|
|
}, 100)
|
2024-09-25 16:31:45 +08:00
|
|
|
|
}
|
2024-06-24 14:38:42 +08:00
|
|
|
|
const nodeClick = async (e: anyObj) => {
|
2024-10-21 09:09:56 +08:00
|
|
|
|
if (e == undefined) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2024-10-28 09:52:23 +08:00
|
|
|
|
// onIndexChange([])
|
2024-06-24 14:38:42 +08:00
|
|
|
|
deviceData.value = []
|
2024-10-21 09:09:56 +08:00
|
|
|
|
historyDevId.value = e?.children && e?.children.length != 0 ? e?.children[0].id : e?.id
|
2024-10-21 20:36:12 +08:00
|
|
|
|
let id = e.pid ? e.pid : e.id
|
2024-09-26 11:20:12 +08:00
|
|
|
|
|
2024-06-24 14:38:42 +08:00
|
|
|
|
//查询测试项信息
|
2024-10-22 16:32:28 +08:00
|
|
|
|
if (id) {
|
|
|
|
|
|
await getTestRecordInfo(id)
|
|
|
|
|
|
.then(async res => {
|
|
|
|
|
|
deviceData.value = res.data
|
|
|
|
|
|
if (res.data.records.length == 1) {
|
|
|
|
|
|
activeName.value = res.data.records[0].id
|
2024-10-21 20:36:12 +08:00
|
|
|
|
} else {
|
2024-12-17 20:57:07 +08:00
|
|
|
|
|
|
|
|
|
|
for (const item of res.data.records) {
|
2024-10-22 16:32:28 +08:00
|
|
|
|
if (item.id == e.id) {
|
2024-12-17 20:57:07 +08:00
|
|
|
|
activeName.value = item.id;
|
|
|
|
|
|
break; // 找到匹配项后停止遍历
|
2024-10-22 16:32:28 +08:00
|
|
|
|
}
|
2024-12-17 20:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
// 如果没有找到匹配项,默认设置为第一个元素的id
|
|
|
|
|
|
if (activeName.value !== e.id) { // 假设e.id是一个用于比较的初始值,表示未找到匹配项
|
|
|
|
|
|
activeName.value = res.data.records[0].id;
|
|
|
|
|
|
}
|
2024-10-21 20:36:12 +08:00
|
|
|
|
}
|
2024-12-17 20:57:07 +08:00
|
|
|
|
|
2024-10-28 09:52:23 +08:00
|
|
|
|
// if (searchForm.value.index.length == 0) {
|
|
|
|
|
|
// searchForm.value.index = [indexOptions.value[0].id]
|
|
|
|
|
|
// }
|
2024-12-19 10:16:08 +08:00
|
|
|
|
|
2024-10-22 16:32:28 +08:00
|
|
|
|
schemeTreeRef.value.getPlanData(deviceData.value)
|
|
|
|
|
|
await setTimeout(() => {
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
|
if (e.pid) {
|
|
|
|
|
|
init(true)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
init(false)
|
|
|
|
|
|
}
|
2024-12-17 20:57:07 +08:00
|
|
|
|
transientRef.value && transientRef.value.init()
|
2024-10-22 16:32:28 +08:00
|
|
|
|
}, 100)
|
|
|
|
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(e => {
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-06-24 14:38:42 +08:00
|
|
|
|
}
|
2024-10-28 09:52:23 +08:00
|
|
|
|
const onIndexChange = (val: any) => {
|
|
|
|
|
|
num.value += 1
|
2024-12-11 11:33:44 +08:00
|
|
|
|
let pp: any = []
|
|
|
|
|
|
indexOptions.value.forEach((item: any) => {
|
|
|
|
|
|
const filteredResult = val.filter(vv => item.id == vv);
|
|
|
|
|
|
if (filteredResult.length > 0) {
|
|
|
|
|
|
pp.push(filteredResult[0]);
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
searchForm.value.index = pp
|
2024-12-17 20:57:07 +08:00
|
|
|
|
formatCountOptions()
|
|
|
|
|
|
|
2024-11-01 15:20:43 +08:00
|
|
|
|
// if (val.length == 0) {
|
|
|
|
|
|
// searchForm.value.index = [indexOptions.value[0].id]
|
|
|
|
|
|
// }
|
2024-10-28 09:52:23 +08:00
|
|
|
|
}
|
2024-06-24 14:38:42 +08:00
|
|
|
|
const dialogRef = ref()
|
2024-09-26 11:20:12 +08:00
|
|
|
|
const dailogForm = ref()
|
2024-11-19 10:39:46 +08:00
|
|
|
|
const onAdd = () => {
|
|
|
|
|
|
handleOpen(0)
|
|
|
|
|
|
}
|
|
|
|
|
|
const bind = (data: any) => {
|
2024-12-09 16:30:40 +08:00
|
|
|
|
handleOpen(4, data)
|
2024-11-19 10:39:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
const handleOpen = (val: any, data?: any) => {
|
2024-10-23 15:49:27 +08:00
|
|
|
|
if (!deviceData.value) {
|
2024-10-22 16:32:28 +08:00
|
|
|
|
dialogRef.value.open(val, '')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2024-10-23 09:44:21 +08:00
|
|
|
|
deviceData.value?.records?.map((item: any) => {
|
2024-09-26 11:20:12 +08:00
|
|
|
|
if (item.id == activeName.value) {
|
|
|
|
|
|
dailogForm.value = item
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
dialogRef.value.details(dailogForm.value)
|
2024-06-24 14:38:42 +08:00
|
|
|
|
// deviceData.value.records[0].id
|
2024-11-19 10:39:46 +08:00
|
|
|
|
|
|
|
|
|
|
let ids: any = ''
|
|
|
|
|
|
let name: any = ''
|
2024-09-26 13:42:14 +08:00
|
|
|
|
//数据绑定
|
2024-09-25 16:31:45 +08:00
|
|
|
|
if (val == 3) {
|
2024-12-09 16:30:40 +08:00
|
|
|
|
ids = data?.id
|
|
|
|
|
|
// name = data?.name
|
|
|
|
|
|
dialogRef.value.detailsType('table')
|
|
|
|
|
|
} else if (val == 4) {
|
2024-11-19 10:39:46 +08:00
|
|
|
|
ids = data?.id
|
|
|
|
|
|
name = data?.name
|
2024-09-29 13:55:31 +08:00
|
|
|
|
dialogRef.value.detailsType('table')
|
2024-09-25 16:31:45 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
ids = ''
|
2024-11-19 10:39:46 +08:00
|
|
|
|
name = ''
|
2024-09-29 13:55:31 +08:00
|
|
|
|
dialogRef.value.detailsType('')
|
2024-09-25 16:31:45 +08:00
|
|
|
|
}
|
2024-11-19 10:39:46 +08:00
|
|
|
|
|
|
|
|
|
|
dialogRef.value.open(val, ids, name)
|
2024-06-24 14:38:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
const echartsData = ref<any>(null)
|
|
|
|
|
|
//加载echarts图表
|
|
|
|
|
|
//历史趋势数据
|
|
|
|
|
|
const historyDataList: any = ref([])
|
|
|
|
|
|
const refreshTree = () => {
|
|
|
|
|
|
schemeTreeRef.value.getTreeList()
|
|
|
|
|
|
}
|
2024-06-27 09:39:53 +08:00
|
|
|
|
const range = (start: any, end: any, step: any) => {
|
|
|
|
|
|
return Array.from({ length: (end - start) / step + 1 }, (_, i) => start + i * step)
|
|
|
|
|
|
}
|
2024-11-20 10:05:29 +08:00
|
|
|
|
const colors = ['#FFCC00', '#009900', '#CC0000']
|
|
|
|
|
|
const lineStyle = [{ type: 'solid', }, { type: 'dashed', }, { type: 'dotted', }]
|
|
|
|
|
|
|
2024-11-12 11:41:46 +08:00
|
|
|
|
const titleList: any = ref('')
|
2024-09-30 15:35:59 +08:00
|
|
|
|
const init = (flag: boolean) => {
|
2024-11-12 11:41:46 +08:00
|
|
|
|
titleList.value = ''
|
2024-06-27 09:39:53 +08:00
|
|
|
|
let list: any = []
|
2024-11-12 11:41:46 +08:00
|
|
|
|
|
2024-07-04 14:22:13 +08:00
|
|
|
|
//颜色数组
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-09-23 13:48:00 +08:00
|
|
|
|
if (historyDevId.value && legendDictList.value && legendDictList.value.selectedList) {
|
|
|
|
|
|
// 选择指标的时候切换legend内容和data数据
|
|
|
|
|
|
legendDictList.value?.selectedList?.map((item: any) => {
|
2024-09-29 16:12:34 +08:00
|
|
|
|
searchForm.value.index.map((vv: any) => {
|
|
|
|
|
|
if (item.dataType == vv) {
|
|
|
|
|
|
list.push(item.eleEpdPqdVOS)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-09-23 13:48:00 +08:00
|
|
|
|
})
|
2024-09-25 16:31:45 +08:00
|
|
|
|
|
2024-11-12 11:41:46 +08:00
|
|
|
|
|
2024-07-03 19:31:29 +08:00
|
|
|
|
//选择的指标使用方法处理
|
2024-12-17 20:57:07 +08:00
|
|
|
|
formatCountOptions()
|
2024-06-27 09:39:53 +08:00
|
|
|
|
//查询历史趋势
|
|
|
|
|
|
historyDataList.value = []
|
|
|
|
|
|
let middleTitle = ''
|
|
|
|
|
|
if (
|
|
|
|
|
|
deviceData.value.records &&
|
|
|
|
|
|
deviceData.value.records.length != 0 &&
|
|
|
|
|
|
deviceData.value.records.find((item: any) => {
|
|
|
|
|
|
return item.id == activeName.value
|
|
|
|
|
|
})?.itemName
|
|
|
|
|
|
) {
|
|
|
|
|
|
middleTitle = deviceData.value.records.find((item: any) => {
|
|
|
|
|
|
return item.id == activeName.value
|
|
|
|
|
|
})?.itemName
|
|
|
|
|
|
} else {
|
|
|
|
|
|
middleTitle = ''
|
|
|
|
|
|
}
|
2024-11-01 13:55:45 +08:00
|
|
|
|
let indexList = searchForm.value.index
|
2024-11-12 11:41:46 +08:00
|
|
|
|
chartTitle.value = ''//deviceData.value.itemName + '_' + middleTitle + '_'
|
2024-09-19 10:12:01 +08:00
|
|
|
|
indexList.map((item: any, indexs: any) => {
|
2024-07-03 19:31:29 +08:00
|
|
|
|
indexOptions.value.map((vv: any) => {
|
|
|
|
|
|
if (vv.id == item) {
|
2024-09-19 10:12:01 +08:00
|
|
|
|
chartTitle.value += indexs == indexList.length - 1 ? vv.name : vv.name + '/'
|
2024-07-03 19:31:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
2024-11-12 11:41:46 +08:00
|
|
|
|
|
2024-07-03 19:31:29 +08:00
|
|
|
|
let lists: any = []
|
2024-11-01 14:45:29 +08:00
|
|
|
|
let frequencys: any = null
|
2024-07-03 19:31:29 +08:00
|
|
|
|
countData.value.map((item: any, index: any) => {
|
2024-11-01 14:45:29 +08:00
|
|
|
|
if (item.name.includes('间谐波电压')) {
|
|
|
|
|
|
frequencys = item.count + 0.5
|
|
|
|
|
|
} else {
|
|
|
|
|
|
frequencys = item.count
|
|
|
|
|
|
}
|
2024-07-03 19:31:29 +08:00
|
|
|
|
lists[index] = {
|
|
|
|
|
|
statisticalId: item.index,
|
2024-11-01 14:45:29 +08:00
|
|
|
|
frequencys: frequencys && frequencys.length != 0 ? [frequencys] : []
|
2024-07-03 19:31:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-11-12 11:41:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-27 09:39:53 +08:00
|
|
|
|
let obj = {
|
|
|
|
|
|
devId: historyDevId.value,
|
2024-07-03 19:31:29 +08:00
|
|
|
|
list: lists,
|
2024-09-29 16:12:34 +08:00
|
|
|
|
dataLevel: searchForm.value.dataLevel,
|
2024-07-03 19:31:29 +08:00
|
|
|
|
valueType: searchForm.value.type
|
2024-06-27 09:39:53 +08:00
|
|
|
|
}
|
2024-11-01 15:20:43 +08:00
|
|
|
|
if (searchForm.value.index.length == 0 && flag) {
|
|
|
|
|
|
ElMessage.warning('请选择统计指标')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2024-09-30 15:35:59 +08:00
|
|
|
|
if (flag) {
|
2024-11-12 11:41:46 +08:00
|
|
|
|
|
|
|
|
|
|
getDeviceList({
|
|
|
|
|
|
id: historyDevId.value,
|
|
|
|
|
|
isTrueFlag: 1
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
if (res.data.length == 0) {
|
|
|
|
|
|
titleList.value = '(未绑定数据)'
|
|
|
|
|
|
}
|
|
|
|
|
|
chartTitle.value = chartTitle.value + titleList.value
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2024-09-30 15:35:59 +08:00
|
|
|
|
loading.value = true
|
|
|
|
|
|
getHistoryTrend(obj)
|
|
|
|
|
|
.then((res: any) => {
|
|
|
|
|
|
if (res.code === 'A0000') {
|
|
|
|
|
|
historyDataList.value = res.data
|
|
|
|
|
|
let chartsList = JSON.parse(JSON.stringify(res.data))
|
2024-10-14 15:09:58 +08:00
|
|
|
|
echartsData.value = {}
|
2024-09-30 15:35:59 +08:00
|
|
|
|
//icon图标替换legend图例
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-10-10 19:26:09 +08:00
|
|
|
|
// y轴单位数组
|
|
|
|
|
|
let unitList: any = []
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-11-01 13:55:45 +08:00
|
|
|
|
let groupedData = chartsList.reduce((acc: any, item: any) => {
|
2024-11-04 18:27:26 +08:00
|
|
|
|
let key = ''
|
|
|
|
|
|
if (item.phase == null) {
|
|
|
|
|
|
key = item.unit
|
|
|
|
|
|
} else {
|
2024-12-11 11:33:44 +08:00
|
|
|
|
key = item.anotherName
|
2024-11-04 18:27:26 +08:00
|
|
|
|
}
|
2024-10-14 20:15:54 +08:00
|
|
|
|
if (!acc[key]) {
|
2024-10-21 20:36:12 +08:00
|
|
|
|
acc[key] = []
|
2024-10-10 19:26:09 +08:00
|
|
|
|
}
|
2024-10-21 20:36:12 +08:00
|
|
|
|
acc[key].push(item)
|
|
|
|
|
|
return acc
|
2024-10-14 20:15:54 +08:00
|
|
|
|
}, {})
|
2024-10-21 20:36:12 +08:00
|
|
|
|
let result = Object.values(groupedData)
|
2024-11-04 18:27:26 +08:00
|
|
|
|
|
2024-10-14 20:15:54 +08:00
|
|
|
|
if (chartsList.length > 0) {
|
|
|
|
|
|
unitList = result.map((item: any) => {
|
|
|
|
|
|
return item[0].unit
|
2024-09-30 15:35:59 +08:00
|
|
|
|
})
|
2024-10-14 20:15:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-30 15:35:59 +08:00
|
|
|
|
echartsData.value = {
|
2024-11-13 09:21:26 +08:00
|
|
|
|
|
2024-12-09 16:30:40 +08:00
|
|
|
|
// title: {
|
|
|
|
|
|
// text: chartTitle.value,
|
|
|
|
|
|
// left: '0',
|
2024-11-13 09:21:26 +08:00
|
|
|
|
|
2024-12-09 16:30:40 +08:00
|
|
|
|
// textStyle: {
|
|
|
|
|
|
// color: '#000',
|
2024-12-11 11:33:44 +08:00
|
|
|
|
|
2024-12-09 16:30:40 +08:00
|
|
|
|
// fontSize: '16'
|
|
|
|
|
|
// },
|
|
|
|
|
|
// },
|
2024-11-13 09:21:26 +08:00
|
|
|
|
toolbox: {
|
|
|
|
|
|
featureProps: {
|
|
|
|
|
|
myTool1: {
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
title: '下载csv',
|
|
|
|
|
|
icon: 'path://M588.8 551.253333V512H352v39.253333h236.373333z m0 78.933334v-39.253334H352v39.253334h236.373333z m136.533333 78.933333V334.933333l-157.866666-157.866666H273.066667A59.306667 59.306667 0 0 0 213.333333 236.373333v551.253334a59.306667 59.306667 0 0 0 59.306667 59.306666h274.773333v42.666667H853.333333v-180.48zM568.746667 234.666667l100.266666 100.693333h-81.066666a20.053333 20.053333 0 0 1-19.626667-20.053333z m-20.48 573.013333H273.066667a19.2 19.2 0 0 1-17.493334-19.626667V236.373333a19.2 19.2 0 0 1 19.626667-19.626666h256v98.133333a58.88 58.88 0 0 0 58.88 59.306667h96.426667v334.933333h-98.133334v-39.68H352v39.68h196.266667z m100.266666 23.04a37.973333 37.973333 0 0 1-32 15.786667 38.826667 38.826667 0 0 1-32.426666-15.786667 53.76 53.76 0 0 1-10.24-32.853333 42.666667 42.666667 0 0 1 42.666666-47.786667 35.84 35.84 0 0 1 37.546667 29.866667h-12.8a23.893333 23.893333 0 0 0-24.746667-19.2c-17.066667 0-29.013333 14.08-29.013333 35.84s11.52 37.546667 28.586667 37.546666a26.453333 26.453333 0 0 0 26.453333-25.6h12.8a39.253333 39.253333 0 0 1-7.253333 22.186667z m59.733334 15.786667a35.84 35.84 0 0 1-40.106667-34.56H682.666667a23.893333 23.893333 0 0 0 26.88 23.04c12.8 0 22.613333-6.4 22.613333-15.786667s-4.266667-11.52-14.506667-13.653333l-21.333333-5.12c-17.066667-4.266667-24.32-11.52-24.32-23.893334s12.8-26.453333 34.133333-26.453333a31.573333 31.573333 0 0 1 35.413334 30.293333h-13.653334a19.626667 19.626667 0 0 0-22.613333-18.773333c-12.8 0-20.48 5.12-20.48 12.8s5.12 11.093333 17.066667 13.653333l14.933333 2.986667a42.666667 42.666667 0 0 1 20.906667 8.96 23.893333 23.893333 0 0 1 7.68 17.92c-0.426667 17.066667-14.506667 28.16-37.12 28.16z m88.746666 0h-14.506666l-32.426667-92.16h14.08l19.626667 59.733333 6.4 20.053333c0-9.386667 3.413333-12.8 5.546666-20.053333l19.2-59.733333h14.08z',
|
|
|
|
|
|
onclick: e => {
|
|
|
|
|
|
handleExport()
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-11-12 11:41:46 +08:00
|
|
|
|
},
|
2024-10-14 20:15:54 +08:00
|
|
|
|
legend: {
|
|
|
|
|
|
itemWidth: 20,
|
2024-11-28 16:26:21 +08:00
|
|
|
|
itemHeight: 20,
|
|
|
|
|
|
itemStyle: { opacity: 0 },//去圆点
|
2024-10-14 20:15:54 +08:00
|
|
|
|
type: 'scroll', // 开启滚动分页
|
2024-11-13 09:21:26 +08:00
|
|
|
|
right: 70,
|
2024-12-09 16:30:40 +08:00
|
|
|
|
// width: 550,
|
|
|
|
|
|
|
2024-11-28 16:26:21 +08:00
|
|
|
|
// height: 50
|
2024-10-14 20:15:54 +08:00
|
|
|
|
},
|
2024-11-04 18:27:26 +08:00
|
|
|
|
grid: {
|
|
|
|
|
|
top: '80px',
|
|
|
|
|
|
|
|
|
|
|
|
},
|
2024-10-14 20:15:54 +08:00
|
|
|
|
tooltip: {
|
|
|
|
|
|
axisPointer: {
|
|
|
|
|
|
type: 'cross',
|
|
|
|
|
|
label: {
|
2024-09-30 15:35:59 +08:00
|
|
|
|
color: '#fff',
|
2024-10-14 20:15:54 +08:00
|
|
|
|
fontSize: 16
|
2024-06-24 14:38:42 +08:00
|
|
|
|
}
|
2024-09-30 15:35:59 +08:00
|
|
|
|
},
|
2024-10-14 20:15:54 +08:00
|
|
|
|
textStyle: {
|
|
|
|
|
|
color: '#fff',
|
|
|
|
|
|
fontStyle: 'normal',
|
|
|
|
|
|
opacity: 0.35,
|
|
|
|
|
|
fontSize: 14
|
2024-09-30 15:35:59 +08:00
|
|
|
|
},
|
2024-12-11 16:33:23 +08:00
|
|
|
|
backgroundColor: 'rgba(0,0,0,0.55)',
|
2024-10-15 15:31:36 +08:00
|
|
|
|
borderWidth: 0,
|
2024-10-25 10:44:21 +08:00
|
|
|
|
formatter(params: any) {
|
2024-10-21 20:36:12 +08:00
|
|
|
|
const xname = params[0].value[0]
|
|
|
|
|
|
let str = `${xname}<br>`
|
2024-10-25 10:44:21 +08:00
|
|
|
|
params.forEach((el: any, index: any) => {
|
2024-12-11 11:33:44 +08:00
|
|
|
|
let marker = ''
|
2024-11-20 10:05:29 +08:00
|
|
|
|
|
2024-12-11 11:33:44 +08:00
|
|
|
|
if (el.value[3] == 'dashed') {
|
|
|
|
|
|
for (let i = 0; i < 3; i++) {
|
2024-12-11 16:33:23 +08:00
|
|
|
|
marker += `<span style="display:inline-block;border: 2px ${el.color} solid;margin-right:5px;width:10px;height:0px;background-color:#ffffff00;"></span>`
|
2024-12-11 11:33:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
|
|
|
|
|
|
}
|
|
|
|
|
|
str += `${marker}${el.seriesName.split('(')[0]}:${el.value[1] ? el.value[1] + ' ' + (el.value[2] || '') : '-'
|
2024-11-04 18:27:26 +08:00
|
|
|
|
}<br>`
|
2024-12-11 11:33:44 +08:00
|
|
|
|
|
2024-10-21 20:36:12 +08:00
|
|
|
|
})
|
|
|
|
|
|
return str
|
|
|
|
|
|
}
|
2024-10-14 20:15:54 +08:00
|
|
|
|
},
|
2024-11-20 10:05:29 +08:00
|
|
|
|
// color: ['#FFCC00', '#009900', '#CC0000', ...color],
|
2024-10-14 20:15:54 +08:00
|
|
|
|
xAxis: {
|
|
|
|
|
|
type: 'time',
|
|
|
|
|
|
axisLabel: {
|
|
|
|
|
|
formatter: {
|
|
|
|
|
|
day: '{MM}-{dd}',
|
|
|
|
|
|
month: '{MM}',
|
|
|
|
|
|
year: '{yyyy}'
|
2024-09-30 15:35:59 +08:00
|
|
|
|
}
|
2024-10-14 20:15:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2024-10-21 20:36:12 +08:00
|
|
|
|
yAxis: [{}],
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
|
|
|
|
|
options: {
|
2024-11-13 09:21:26 +08:00
|
|
|
|
|
2024-10-21 20:36:12 +08:00
|
|
|
|
series: []
|
2024-09-25 16:31:45 +08:00
|
|
|
|
}
|
2024-09-30 15:35:59 +08:00
|
|
|
|
}
|
2024-10-14 20:15:54 +08:00
|
|
|
|
if (chartsList.length > 0) {
|
2024-12-19 10:16:08 +08:00
|
|
|
|
let yData: any = []
|
2024-10-15 15:31:36 +08:00
|
|
|
|
echartsData.value.yAxis = []
|
2024-11-19 10:39:46 +08:00
|
|
|
|
let setList = [...new Set(unitList)];
|
2024-12-19 10:16:08 +08:00
|
|
|
|
|
2024-11-19 10:39:46 +08:00
|
|
|
|
setList.forEach((item: any, index: any) => {
|
2024-11-04 18:27:26 +08:00
|
|
|
|
if (index > 2) {
|
|
|
|
|
|
echartsData.value.grid.right = (index - 1) * 80
|
|
|
|
|
|
}
|
2024-12-19 10:16:08 +08:00
|
|
|
|
yData.push([])
|
2024-10-15 15:31:36 +08:00
|
|
|
|
let right = {
|
|
|
|
|
|
position: 'right',
|
2024-10-21 20:36:12 +08:00
|
|
|
|
offset: (index - 1) * 80
|
2024-10-15 15:31:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
echartsData.value.yAxis.push({
|
|
|
|
|
|
name: item,
|
|
|
|
|
|
yAxisIndex: index,
|
|
|
|
|
|
splitNumber: 5,
|
|
|
|
|
|
minInterval: 1,
|
|
|
|
|
|
splitLine: {
|
2024-10-21 20:36:12 +08:00
|
|
|
|
show: false
|
2024-10-15 15:31:36 +08:00
|
|
|
|
},
|
|
|
|
|
|
...(index > 0 ? right : null)
|
|
|
|
|
|
})
|
2024-10-14 20:15:54 +08:00
|
|
|
|
})
|
2024-12-11 11:33:44 +08:00
|
|
|
|
// console.log("🚀 ~ result.forEach ~ result:", result)
|
2024-11-20 10:05:29 +08:00
|
|
|
|
let ABCName = [...new Set(chartsList.map((item: any) => { return item.anotherName == '电压负序分量' ? '电压不平衡' : item.anotherName == '电压正序分量' ? '电压不平衡' : item.anotherName == '电压零序分量' ? '电压不平衡' : item.anotherName }))];
|
2024-12-19 10:16:08 +08:00
|
|
|
|
|
2024-12-11 11:33:44 +08:00
|
|
|
|
|
2024-10-15 15:31:36 +08:00
|
|
|
|
result.forEach((item: any, index: any) => {
|
|
|
|
|
|
let yMethodList: any = []
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-10-21 20:36:12 +08:00
|
|
|
|
let ABCList = Object.values(
|
|
|
|
|
|
item.reduce((acc, item) => {
|
2024-11-04 18:27:26 +08:00
|
|
|
|
let key = ''
|
|
|
|
|
|
if (item.phase == null) {
|
|
|
|
|
|
key = item.anotherName
|
|
|
|
|
|
} else {
|
|
|
|
|
|
key = item.phase
|
|
|
|
|
|
}
|
2024-11-20 10:05:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-10-21 20:36:12 +08:00
|
|
|
|
if (!acc[key]) {
|
|
|
|
|
|
acc[key] = []
|
|
|
|
|
|
}
|
|
|
|
|
|
acc[key].push(item)
|
|
|
|
|
|
return acc
|
|
|
|
|
|
}, {})
|
|
|
|
|
|
)
|
2024-11-20 10:05:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-21 20:36:12 +08:00
|
|
|
|
ABCList.forEach((kk: any) => {
|
2024-11-20 10:05:29 +08:00
|
|
|
|
let colorName = kk[0].phase?.charAt(0).toUpperCase()
|
|
|
|
|
|
let lineS = ABCName.findIndex(item => item === (kk[0].anotherName == '电压负序分量' ? '电压不平衡' : kk[0].anotherName == '电压正序分量' ? '电压不平衡' : kk[0].anotherName == '电压零序分量' ? '电压不平衡' : kk[0].anotherName));
|
2024-10-15 15:31:36 +08:00
|
|
|
|
let seriesList: any = []
|
|
|
|
|
|
kk.forEach((cc: any) => {
|
2024-10-29 14:49:34 +08:00
|
|
|
|
if (cc.statisticalData !== null) {
|
2024-12-19 10:16:08 +08:00
|
|
|
|
yData[setList.indexOf(kk[0].unit)].push(cc.statisticalData?.toFixed(2))
|
2024-10-15 15:31:36 +08:00
|
|
|
|
}
|
2024-12-11 11:33:44 +08:00
|
|
|
|
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit, lineStyle[lineS].type])
|
2024-10-15 15:31:36 +08:00
|
|
|
|
})
|
|
|
|
|
|
echartsData.value.options.series.push({
|
2024-10-29 14:31:07 +08:00
|
|
|
|
name: kk[0].phase
|
2024-11-04 18:27:26 +08:00
|
|
|
|
? kk[0].phase + '相' + kk[0].anotherName
|
|
|
|
|
|
: kk[0].anotherName,
|
2024-10-15 15:31:36 +08:00
|
|
|
|
type: 'line',
|
2024-11-20 10:05:29 +08:00
|
|
|
|
color: colorName == 'A' ? '#FFCC00' : colorName == 'B' ? '#009900' : colorName == 'C' ? '#CC0000' : '',
|
2024-10-15 15:31:36 +08:00
|
|
|
|
smooth: true,
|
|
|
|
|
|
symbol: 'none',
|
2024-11-20 10:05:29 +08:00
|
|
|
|
lineStyle: lineStyle[lineS],
|
2024-10-15 15:31:36 +08:00
|
|
|
|
data: seriesList,
|
2024-12-11 11:33:44 +08:00
|
|
|
|
yAxisIndex: setList.indexOf(kk[0].unit)
|
2024-10-15 15:31:36 +08:00
|
|
|
|
})
|
|
|
|
|
|
})
|
2024-11-20 10:05:29 +08:00
|
|
|
|
|
2024-12-19 10:16:08 +08:00
|
|
|
|
// let [min, max] = yMethod(yMethodList)
|
|
|
|
|
|
|
|
|
|
|
|
// echartsData.value.yAxis[index].min = min
|
|
|
|
|
|
// echartsData.value.yAxis[index].max = max
|
|
|
|
|
|
})
|
|
|
|
|
|
yData.forEach((item: any, index: any) => {
|
|
|
|
|
|
let [min, max] = yMethod(item)
|
2024-10-15 15:31:36 +08:00
|
|
|
|
echartsData.value.yAxis[index].min = min
|
|
|
|
|
|
echartsData.value.yAxis[index].max = max
|
|
|
|
|
|
})
|
2024-12-19 10:16:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-15 15:31:36 +08:00
|
|
|
|
}
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-12-19 10:16:08 +08:00
|
|
|
|
|
2024-09-30 15:35:59 +08:00
|
|
|
|
loading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(error => {
|
2024-06-24 14:38:42 +08:00
|
|
|
|
loading.value = false
|
2024-09-30 15:35:59 +08:00
|
|
|
|
})
|
2024-10-21 20:36:12 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
loading.value = false
|
2024-09-30 15:35:59 +08:00
|
|
|
|
}
|
2024-06-24 14:38:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//导出
|
|
|
|
|
|
const historyChart = ref()
|
2024-07-08 11:13:51 +08:00
|
|
|
|
const handleExport = async () => {
|
|
|
|
|
|
const planCsv = ref('')
|
|
|
|
|
|
const chartsCsv = ref('')
|
|
|
|
|
|
|
|
|
|
|
|
if (deviceData.value.records && deviceData.value.records.length != 0) {
|
|
|
|
|
|
let csv = '',
|
2024-09-25 16:31:45 +08:00
|
|
|
|
obj: any = {}
|
2024-07-08 11:13:51 +08:00
|
|
|
|
obj = deviceData.value.records.find((item: any) => {
|
|
|
|
|
|
return item.id == activeName.value
|
|
|
|
|
|
})
|
|
|
|
|
|
if (obj) {
|
2024-07-09 09:54:15 +08:00
|
|
|
|
//测试是否与变量名长度有关系
|
|
|
|
|
|
let cell1 = deviceData.value.itemName,
|
|
|
|
|
|
cell2 = deviceData.value.describe,
|
|
|
|
|
|
cell3 = obj?.itemName,
|
|
|
|
|
|
cell4 = obj?.statisticalInterval,
|
|
|
|
|
|
cell5 = voltageLevelList.find(vv => {
|
2024-07-08 11:13:51 +08:00
|
|
|
|
return vv.id == obj.voltageLevel
|
2024-07-09 09:54:15 +08:00
|
|
|
|
})?.name,
|
|
|
|
|
|
cell6 = volConTypeList.find(vv => {
|
2024-07-08 11:13:51 +08:00
|
|
|
|
return vv.id == obj.volConType
|
2024-07-09 09:54:15 +08:00
|
|
|
|
})?.name,
|
|
|
|
|
|
cell7 = obj.capacitySscmin,
|
|
|
|
|
|
cell8 = obj.capacitySi,
|
|
|
|
|
|
cell9 = obj.capacitySscb,
|
|
|
|
|
|
cell10 = obj.capacitySt,
|
|
|
|
|
|
cell11 = obj.pt && obj.pt1 ? obj.pt / obj.pt1 + '\b' : '/',
|
|
|
|
|
|
cell12 = obj.ct && obj.ct1 ? obj.ct / obj.ct1 + '\b' : '/',
|
|
|
|
|
|
cell13 = obj.startTime ? obj.startTime : '/',
|
|
|
|
|
|
cell14 = obj.endTime ? obj.endTime : '/',
|
|
|
|
|
|
cell15 = obj.location
|
|
|
|
|
|
csv = `方案测试项信息,
|
|
|
|
|
|
方案名称, ${cell1},
|
|
|
|
|
|
方案描述, ${cell2},
|
|
|
|
|
|
测试项名称, ${cell2},
|
|
|
|
|
|
测量间隔, ${cell4 + '分钟'},
|
|
|
|
|
|
电压等级, ${cell5},
|
|
|
|
|
|
接线方式, ${cell6},
|
|
|
|
|
|
最小短路容量, ${cell7 + 'MVA'},
|
|
|
|
|
|
用户协议容量, ${cell8 + 'MVA'},
|
|
|
|
|
|
基准短路容量, ${cell9 + 'MVA'},
|
|
|
|
|
|
供电设备容量, ${cell10 + 'MVA'},
|
|
|
|
|
|
PT变比, ${cell11},
|
|
|
|
|
|
CT变比, ${cell12},
|
|
|
|
|
|
起始时间, ${cell13},
|
|
|
|
|
|
结束时间, ${cell14},
|
|
|
|
|
|
监测位置, ${cell15}\n,
|
2024-07-08 11:13:51 +08:00
|
|
|
|
`
|
|
|
|
|
|
planCsv.value = csv
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (historyDataList.value.length != 0) {
|
2024-06-27 09:39:53 +08:00
|
|
|
|
let xAxis: any = []
|
2024-07-03 19:31:29 +08:00
|
|
|
|
let timeList: any = []
|
2024-06-27 09:39:53 +08:00
|
|
|
|
historyDataList.value.map((item: any) => {
|
2024-07-03 19:31:29 +08:00
|
|
|
|
timeList.push(item.time)
|
|
|
|
|
|
})
|
|
|
|
|
|
xAxis = timeList.sort((a: any, b: any) => {
|
2024-09-25 16:31:45 +08:00
|
|
|
|
new Date(a).getTime() - new Date(b).getTime()
|
2024-06-27 09:39:53 +08:00
|
|
|
|
})
|
2024-10-09 08:49:19 +08:00
|
|
|
|
xAxis = Array.from(new Set(xAxis))
|
2024-06-27 09:39:53 +08:00
|
|
|
|
// 使用这个函数转换数据为CSV格式
|
2024-07-03 19:31:29 +08:00
|
|
|
|
let csv: any = ''
|
2024-06-27 09:39:53 +08:00
|
|
|
|
const list = echartsData.value.options.series
|
2024-07-03 19:31:29 +08:00
|
|
|
|
csv = convertToCSV([], [])
|
2024-07-08 11:13:51 +08:00
|
|
|
|
chartsCsv.value = csv
|
2024-06-27 09:39:53 +08:00
|
|
|
|
// 如果你想提供下载链接
|
|
|
|
|
|
function convertToCSV(data: any, key: any) {
|
|
|
|
|
|
// 添加列头
|
2024-07-03 19:31:29 +08:00
|
|
|
|
let title = '统计时间,'
|
2024-06-27 09:39:53 +08:00
|
|
|
|
list.map((item: any, index: any) => {
|
|
|
|
|
|
index == list.length - 1 ? (title += `${item.name}\n`) : (title += `${item.name},`)
|
|
|
|
|
|
})
|
|
|
|
|
|
let csv = ''
|
|
|
|
|
|
csv = title
|
|
|
|
|
|
// 遍历数据并添加到CSV字符串中
|
2024-09-29 16:12:34 +08:00
|
|
|
|
list[0]?.data.map((vv: any, indexs: any) => {
|
2024-07-03 19:31:29 +08:00
|
|
|
|
let strs = '',
|
|
|
|
|
|
count = null
|
|
|
|
|
|
list.map((item: any, index: any) => {
|
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
|
count = index
|
|
|
|
|
|
}
|
2024-09-29 18:15:54 +08:00
|
|
|
|
let itemList: any = list[index].data[indexs]
|
2024-09-30 16:32:16 +08:00
|
|
|
|
if (itemList && itemList.length != 0) {
|
2024-10-23 15:49:27 +08:00
|
|
|
|
itemList[1] = itemList[1] ? itemList[1] : '/'
|
2024-09-30 16:06:38 +08:00
|
|
|
|
index == list.length - 1 ? (strs += itemList[1]) : (strs += itemList[1] + ',')
|
2024-09-30 16:32:16 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
index == list.length - 1 ? (strs += '/') : (strs += '/,')
|
2024-09-30 16:06:38 +08:00
|
|
|
|
}
|
2024-07-03 19:31:29 +08:00
|
|
|
|
})
|
|
|
|
|
|
if (count == 0 && xAxis[indexs]) {
|
|
|
|
|
|
csv += `${xAxis[indexs]},` + strs + '\n'
|
2024-09-30 15:35:59 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
strs += '/,'
|
2024-06-27 09:39:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
return csv
|
|
|
|
|
|
}
|
2024-07-08 11:13:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let csvs = ''
|
|
|
|
|
|
if (chartsCsv.value) {
|
|
|
|
|
|
csvs = planCsv.value + '历史趋势数据,\n\n' + chartsCsv.value
|
|
|
|
|
|
} else {
|
|
|
|
|
|
csvs = planCsv.value
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 如果你想提供下载链接
|
|
|
|
|
|
const blob = new Blob([csvs], { type: 'text/csv;charset=utf-8;' })
|
|
|
|
|
|
const link = document.createElement('a')
|
|
|
|
|
|
link.href = URL.createObjectURL(blob)
|
|
|
|
|
|
let obj = deviceData.value.records.find((item: any) => {
|
|
|
|
|
|
return item.id == activeName.value
|
|
|
|
|
|
})
|
2024-07-09 09:54:15 +08:00
|
|
|
|
const date = window.XEUtils.toDateString(new Date(), 'yyyyMMdd HHmmss').replace(' ', '_')
|
2024-07-08 11:13:51 +08:00
|
|
|
|
link.download = `${deviceData.value.itemName}_${obj?.itemName}_${date}.csv`
|
|
|
|
|
|
link.click()
|
|
|
|
|
|
return
|
2024-06-24 14:38:42 +08:00
|
|
|
|
}
|
2024-07-03 19:31:29 +08:00
|
|
|
|
const countData: any = ref([])
|
2024-12-17 20:57:07 +08:00
|
|
|
|
const countDataCopy: any = ref([])
|
2024-10-28 09:52:23 +08:00
|
|
|
|
const tableHeaderRef = ref()
|
2024-12-17 20:57:07 +08:00
|
|
|
|
|
2024-07-03 19:31:29 +08:00
|
|
|
|
//根据选择的指标处理谐波次数
|
2024-12-17 20:57:07 +08:00
|
|
|
|
const formatCountOptions = () => {
|
|
|
|
|
|
|
2024-12-11 11:33:44 +08:00
|
|
|
|
countData.value = []
|
2024-12-18 14:15:13 +08:00
|
|
|
|
// console.log(123, indexOptions.value);
|
2024-11-01 13:55:45 +08:00
|
|
|
|
|
2024-12-17 20:57:07 +08:00
|
|
|
|
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)
|
2024-07-03 19:31:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-12-17 20:57:07 +08:00
|
|
|
|
|
2024-07-03 19:31:29 +08:00
|
|
|
|
})
|
2024-12-17 20:57:07 +08:00
|
|
|
|
// 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]
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })
|
|
|
|
|
|
// })
|
2024-12-18 14:15:13 +08:00
|
|
|
|
// console.log("🚀 ~ vv.eleEpdPqdVOS.map ~ countData.value:", countDataCopy.value)
|
2024-12-17 20:57:07 +08:00
|
|
|
|
|
2024-10-30 16:06:55 +08:00
|
|
|
|
countData.value.map((item: any, key: any) => {
|
|
|
|
|
|
if (item.name.includes('谐波电流有效值')) {
|
|
|
|
|
|
item.name = '谐波电流次数'
|
2024-11-01 11:21:12 +08:00
|
|
|
|
}
|
2024-11-01 14:45:29 +08:00
|
|
|
|
if (item.name == '谐波电压含有率') {
|
2024-10-30 16:06:55 +08:00
|
|
|
|
item.name = '谐波电压次数'
|
2024-11-01 11:21:12 +08:00
|
|
|
|
}
|
2024-11-01 14:45:29 +08:00
|
|
|
|
if (item.name == '间谐波电压含有率') {
|
2024-10-30 16:06:55 +08:00
|
|
|
|
item.name = '间谐波电压次数'
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-10-25 10:44:21 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
countData.value = []
|
2024-07-03 19:31:29 +08:00
|
|
|
|
}
|
2024-10-28 09:52:23 +08:00
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
2024-11-08 14:02:27 +08:00
|
|
|
|
|
|
|
|
|
|
tableHeaderRef.value && tableHeaderRef.value?.computedSearchRow()
|
2024-10-28 09:52:23 +08:00
|
|
|
|
}, 100)
|
2024-07-03 19:31:29 +08:00
|
|
|
|
}
|
2024-10-14 20:15:54 +08:00
|
|
|
|
const flag = ref(false)
|
|
|
|
|
|
const selectChange = (e: boolean) => {
|
|
|
|
|
|
flag.value = e
|
2024-12-11 11:33:44 +08:00
|
|
|
|
// console.log("🚀 ~ handleChange ~ activeColName.value:", activeColName.value, flag.value)
|
2024-11-13 09:21:26 +08:00
|
|
|
|
|
2024-10-14 20:15:54 +08:00
|
|
|
|
if (activeColName.value == '0') {
|
|
|
|
|
|
if (flag.value) {
|
2024-12-23 11:30:28 +08:00
|
|
|
|
EcharHeight.value = mainHeight(480)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
} else {
|
2024-12-23 11:30:28 +08:00
|
|
|
|
EcharHeight.value = mainHeight(436)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (flag.value) {
|
2024-12-23 11:30:28 +08:00
|
|
|
|
EcharHeight.value = mainHeight(340)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
} else {
|
2024-12-23 11:30:28 +08:00
|
|
|
|
EcharHeight.value = mainHeight(300)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-11-13 09:21:26 +08:00
|
|
|
|
|
2024-10-14 20:15:54 +08:00
|
|
|
|
const handleChange = () => {
|
2024-12-19 10:16:08 +08:00
|
|
|
|
|
2024-10-14 20:15:54 +08:00
|
|
|
|
if (activeColName.value == '0') {
|
|
|
|
|
|
if (flag.value) {
|
2024-12-23 11:30:28 +08:00
|
|
|
|
EcharHeight.value = mainHeight(480)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
} else {
|
2024-12-23 11:30:28 +08:00
|
|
|
|
EcharHeight.value = mainHeight(436)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (flag.value) {
|
2024-12-23 11:30:28 +08:00
|
|
|
|
EcharHeight.value = mainHeight(340)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
} else {
|
2024-12-23 11:30:28 +08:00
|
|
|
|
EcharHeight.value = mainHeight(300)
|
2024-10-14 20:15:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-12-19 10:16:08 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
transientRef.value && transientRef.value.setHeight()
|
|
|
|
|
|
}, 100);
|
2024-10-14 20:15:54 +08:00
|
|
|
|
}
|
2024-10-28 09:52:23 +08:00
|
|
|
|
|
2024-07-03 19:31:29 +08:00
|
|
|
|
watch(
|
2024-09-23 13:48:00 +08:00
|
|
|
|
() => searchForm.value.index,
|
2024-07-03 19:31:29 +08:00
|
|
|
|
(val: any, oldval: any) => {
|
2024-12-11 11:33:44 +08:00
|
|
|
|
|
2024-12-17 20:57:07 +08:00
|
|
|
|
// if (val) {
|
|
|
|
|
|
|
|
|
|
|
|
// let list = val
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
// formatCountOptions(list)
|
|
|
|
|
|
// }, 100)
|
|
|
|
|
|
// countData.value.map((item: any, key: any) => {
|
|
|
|
|
|
// if (
|
|
|
|
|
|
// list.findIndex((vv: any) => {
|
|
|
|
|
|
// return vv == item.index
|
|
|
|
|
|
// }) == -1
|
|
|
|
|
|
// ) {
|
|
|
|
|
|
// countData.value.splice(key, 1)
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
// init(false)
|
|
|
|
|
|
// }
|
2024-07-03 19:31:29 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
immediate: true
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
2024-09-19 10:12:01 +08:00
|
|
|
|
onMounted(() => {
|
2024-12-17 20:57:07 +08:00
|
|
|
|
|
2024-09-23 13:48:00 +08:00
|
|
|
|
setTimeout(() => {
|
2024-09-30 15:35:59 +08:00
|
|
|
|
init(true)
|
2024-09-23 13:48:00 +08:00
|
|
|
|
}, 1500)
|
2024-09-19 10:12:01 +08:00
|
|
|
|
})
|
2024-06-24 14:38:42 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2024-10-21 20:36:12 +08:00
|
|
|
|
::v-deep .el-select {
|
|
|
|
|
|
min-width: 120px;
|
|
|
|
|
|
}
|
2024-10-28 09:52:23 +08:00
|
|
|
|
|
2024-06-24 14:38:42 +08:00
|
|
|
|
.device-manage {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
height: calc(100vh - 100px);
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-06-24 14:38:42 +08:00
|
|
|
|
// overflow-y: auto;
|
|
|
|
|
|
&-right {
|
|
|
|
|
|
// overflow: auto;
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
padding: 10px 10px 10px 0;
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-06-24 14:38:42 +08:00
|
|
|
|
.el-descriptions__header {
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
margin-bottom: 7px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.device-manage-right {
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
flex: 1 !important;
|
|
|
|
|
|
height: calc(100vh - 135px);
|
2024-12-23 11:30:28 +08:00
|
|
|
|
// padding: 10px 10px 10px 10px;
|
|
|
|
|
|
// border: 2px solid #eeeeee;
|
2024-06-24 14:38:42 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
|
|
|
|
.el-descriptions__header {
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
margin-bottom: 7px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-09-29 11:29:42 +08:00
|
|
|
|
|
2024-06-24 14:38:42 +08:00
|
|
|
|
.history_title {
|
|
|
|
|
|
width: 100%;
|
2024-10-21 20:36:12 +08:00
|
|
|
|
padding-left: 10px;
|
2024-10-28 09:52:23 +08:00
|
|
|
|
|
2024-06-24 14:38:42 +08:00
|
|
|
|
p {
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
line-height: 32px;
|
2024-09-25 16:31:45 +08:00
|
|
|
|
font-size: 16px;
|
2024-06-24 14:38:42 +08:00
|
|
|
|
font-weight: bold;
|
2024-09-23 13:48:00 +08:00
|
|
|
|
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
|
2024-06-24 14:38:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-12 16:55:10 +08:00
|
|
|
|
::v-deep .monitor_info {
|
2024-06-24 14:38:42 +08:00
|
|
|
|
width: 100%;
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-07-12 16:55:10 +08:00
|
|
|
|
.el-tabs__content {
|
|
|
|
|
|
padding: 0 !important;
|
2024-10-21 20:36:12 +08:00
|
|
|
|
// min-height: 130px !important;
|
2024-07-12 16:55:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-10-09 08:49:19 +08:00
|
|
|
|
.history_collapse {
|
|
|
|
|
|
height: calc(100vh - 300px);
|
|
|
|
|
|
width: 100%;
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-10-09 08:49:19 +08:00
|
|
|
|
.history_trend {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: calc(100vh - 340px);
|
2024-06-24 14:38:42 +08:00
|
|
|
|
display: flex;
|
2024-10-09 08:49:19 +08:00
|
|
|
|
flex-direction: column;
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-10-09 08:49:19 +08:00
|
|
|
|
.history_header {
|
|
|
|
|
|
width: 100%;
|
2024-07-08 11:13:51 +08:00
|
|
|
|
}
|
2024-10-14 20:15:54 +08:00
|
|
|
|
|
2024-10-09 08:49:19 +08:00
|
|
|
|
.history_chart {
|
|
|
|
|
|
margin: 10px 0;
|
2024-10-21 20:36:12 +08:00
|
|
|
|
z-index: 1001;
|
2024-06-24 14:38:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-08 11:13:51 +08:00
|
|
|
|
::v-deep .el-select {
|
2024-09-23 13:48:00 +08:00
|
|
|
|
width: 120px !important;
|
2024-07-08 11:13:51 +08:00
|
|
|
|
}
|
2024-09-29 16:12:34 +08:00
|
|
|
|
|
2024-09-29 18:15:54 +08:00
|
|
|
|
::v-deep .el-collapse-item__header {
|
2024-09-29 16:12:34 +08:00
|
|
|
|
font-size: 16px !important;
|
|
|
|
|
|
font-weight: 800 !important;
|
|
|
|
|
|
}
|
2024-06-24 14:38:42 +08:00
|
|
|
|
</style>
|