2024-01-11 08:54:09 +08:00
|
|
|
|
<template>
|
2024-02-01 16:19:28 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="default-main device-control"
|
|
|
|
|
|
:style="{ height: pageHeight.height }"
|
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
|
style="position: relative"
|
|
|
|
|
|
>
|
2024-01-11 08:54:09 +08:00
|
|
|
|
<PointTree @node-click="nodeClick" @init="nodeClick"></PointTree>
|
|
|
|
|
|
<div class="device-control-right" v-if="deviceData">
|
|
|
|
|
|
<el-descriptions title="设备基本信息" class="mb10" :column="3" border>
|
2024-07-22 10:35:01 +08:00
|
|
|
|
<template #extra>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
v-if="dataSet.indexOf('_realtimedata') != -1"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
type="primary"
|
2024-07-23 17:28:31 +08:00
|
|
|
|
@click="handleDownLoadTemplate"
|
2024-07-22 10:35:01 +08:00
|
|
|
|
>
|
|
|
|
|
|
模版下载
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
v-if="dataSet.indexOf('_realtimedata') != -1"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleImport"
|
|
|
|
|
|
>
|
|
|
|
|
|
离线数据导入
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
v-if="dataSet.indexOf('_realtimedata') != -1"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
@click="handleaddDevice"
|
|
|
|
|
|
>
|
|
|
|
|
|
设备补招
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
v-if="dataSet.indexOf('_realtimedata') != -1"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
type="primary"
|
2024-07-23 17:28:31 +08:00
|
|
|
|
@click="handleAnalysisList"
|
2024-07-22 10:35:01 +08:00
|
|
|
|
>
|
|
|
|
|
|
解析列表
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</template>
|
2024-01-11 08:54:09 +08:00
|
|
|
|
<el-descriptions-item label="名称">
|
2024-06-27 09:39:53 +08:00
|
|
|
|
{{ deviceData.name ? deviceData.name : '/' }}
|
2024-01-11 08:54:09 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="类型">
|
|
|
|
|
|
{{ echoName(deviceData.devType, devTypeOptions) }}
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-descriptions-item label="接入方式">
|
2024-06-27 09:39:53 +08:00
|
|
|
|
{{ deviceData.devAccessMethod ? deviceData.devAccessMethod : '/' }}
|
2024-01-11 08:54:09 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="识别码">
|
2024-06-27 09:39:53 +08:00
|
|
|
|
{{ deviceData.ndid ? deviceData.ndid : '/' }}
|
2024-01-11 08:54:09 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="型号">
|
|
|
|
|
|
{{ echoName(deviceData.devModel, devModelOptions) }}
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="接入时间">
|
2024-06-27 09:39:53 +08:00
|
|
|
|
{{ deviceData.time ? deviceData.time : '/' }}
|
2024-01-11 08:54:09 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
</el-descriptions>
|
2024-01-29 16:30:24 +08:00
|
|
|
|
<el-tabs v-model="dataSet" type="border-card" class="device-control-box-card" @tab-click="handleClick">
|
2024-01-11 08:54:09 +08:00
|
|
|
|
<el-tab-pane
|
|
|
|
|
|
lazy
|
|
|
|
|
|
:label="item.name"
|
|
|
|
|
|
:name="item.id"
|
|
|
|
|
|
v-for="(item, index) in deviceData.dataSetList"
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
></el-tab-pane>
|
2024-07-03 19:31:43 +08:00
|
|
|
|
<el-form
|
|
|
|
|
|
:inline="true"
|
|
|
|
|
|
style="white-space: nowrap; margin-top: 10px"
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
dataSet.indexOf('_trenddata') == -1 &&
|
|
|
|
|
|
dataSet.indexOf('_realtimedata') == -1 &&
|
|
|
|
|
|
dataSet.indexOf('_event') == -1
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
2024-01-11 08:54:09 +08:00
|
|
|
|
<el-form-item label="指标">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="formInline.searchValue"
|
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
placeholder="请输入关键词"
|
|
|
|
|
|
></el-input>
|
|
|
|
|
|
</el-form-item>
|
2024-07-23 17:28:31 +08:00
|
|
|
|
<el-form-item label="日期" v-show="dataSet.indexOf('_history') != -1">
|
2024-01-11 08:54:09 +08:00
|
|
|
|
<DatePicker ref="datePickerRef"></DatePicker>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
2024-01-12 09:55:55 +08:00
|
|
|
|
<el-button type="primary" icon="el-icon-Search" @click="handleClick">查询</el-button>
|
2024-01-11 08:54:09 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
2024-06-27 09:39:53 +08:00
|
|
|
|
<div
|
|
|
|
|
|
style="overflow: auto"
|
|
|
|
|
|
:style="{ height: tableHeight }"
|
|
|
|
|
|
v-loading="tableLoading"
|
2024-07-03 19:31:43 +08:00
|
|
|
|
v-if="
|
|
|
|
|
|
dataSet.indexOf('_trenddata') == -1 &&
|
|
|
|
|
|
dataSet.indexOf('_realtimedata') == -1 &&
|
2024-07-23 17:28:31 +08:00
|
|
|
|
dataSet.indexOf('_event') == -1 &&
|
|
|
|
|
|
tableData.length != 0
|
2024-07-03 19:31:43 +08:00
|
|
|
|
"
|
2024-06-27 09:39:53 +08:00
|
|
|
|
>
|
2024-07-03 19:31:43 +08:00
|
|
|
|
<!-- 循环渲染的card 最新数据/历史数据显示 -->
|
|
|
|
|
|
<div class="content">
|
2024-01-11 08:54:09 +08:00
|
|
|
|
<el-card class="box-card" v-for="(item, index) in tableData" :key="index">
|
|
|
|
|
|
<template #header>
|
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
|
<span style="flex: 1">{{ item.name }}</span>
|
|
|
|
|
|
<Icon
|
|
|
|
|
|
name="el-icon-TrendCharts"
|
|
|
|
|
|
class="ml10"
|
|
|
|
|
|
@click="getDeviceDataTrend(item)"
|
|
|
|
|
|
style="font-size: 26px; cursor: pointer; color: #fff"
|
|
|
|
|
|
></Icon>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2024-06-27 09:39:53 +08:00
|
|
|
|
<!-- 模块数据 -->
|
2024-01-11 08:54:09 +08:00
|
|
|
|
<div class="box-card-content" v-if="dataSet.indexOf('_history') == -1">
|
|
|
|
|
|
<div v-for="(child, childIndex) in item.children" :key="childIndex">
|
|
|
|
|
|
{{ child.anotherName }}:
|
|
|
|
|
|
{{ child.dataValue === 3.1415926 ? '暂无数据' : child.dataValue }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="mt10">
|
|
|
|
|
|
统计时间:{{ item.children.length ? item.children[0].time : '' }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-else-if="item.children.length">
|
|
|
|
|
|
<div style="display: flex; align-items: center">
|
|
|
|
|
|
<el-tag
|
|
|
|
|
|
effect="dark"
|
|
|
|
|
|
type="danger"
|
|
|
|
|
|
style="width: 40px; text-align: center"
|
|
|
|
|
|
class="mr10"
|
|
|
|
|
|
>
|
|
|
|
|
|
MAX
|
|
|
|
|
|
</el-tag>
|
|
|
|
|
|
{{
|
2024-07-23 17:28:31 +08:00
|
|
|
|
item.children[0].maxValue === 3.1415956 || !item.children[0].maxValue
|
|
|
|
|
|
? '暂无数据'
|
|
|
|
|
|
: item.children[0].maxValue
|
2024-01-11 08:54:09 +08:00
|
|
|
|
}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="display: flex; align-items: center" class="mt10">
|
|
|
|
|
|
<el-tag
|
|
|
|
|
|
effect="dark"
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
style="width: 40px; text-align: center"
|
|
|
|
|
|
class="mr10"
|
|
|
|
|
|
>
|
|
|
|
|
|
AVG
|
|
|
|
|
|
</el-tag>
|
|
|
|
|
|
{{
|
2024-07-23 17:28:31 +08:00
|
|
|
|
item.children[0].avgValue === 3.1415956 || !item.children[0].avgValue
|
|
|
|
|
|
? '暂无数据'
|
|
|
|
|
|
: item.children[0].avgValue
|
2024-01-11 08:54:09 +08:00
|
|
|
|
}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="display: flex; align-items: center" class="mt10">
|
|
|
|
|
|
<el-tag
|
|
|
|
|
|
effect="dark"
|
|
|
|
|
|
type="warning"
|
|
|
|
|
|
style="width: 40px; text-align: center"
|
|
|
|
|
|
class="mr10"
|
|
|
|
|
|
>
|
|
|
|
|
|
MIN
|
|
|
|
|
|
</el-tag>
|
2024-08-09 17:24:46 +08:00
|
|
|
|
<!-- || !item.children[0].minValue -->
|
2024-01-11 08:54:09 +08:00
|
|
|
|
{{
|
2024-08-09 17:24:46 +08:00
|
|
|
|
item.children[0].minValue === 3.1415956
|
2024-07-23 17:28:31 +08:00
|
|
|
|
? '暂无数据'
|
|
|
|
|
|
: item.children[0].minValue
|
2024-01-11 08:54:09 +08:00
|
|
|
|
}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
<el-empty description="暂无数据" v-if="tableData.length === 0"></el-empty>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-pagination
|
2024-06-27 09:39:53 +08:00
|
|
|
|
v-if="
|
|
|
|
|
|
tableData.length &&
|
|
|
|
|
|
dataSet.indexOf('_trenddata') == -1 &&
|
|
|
|
|
|
dataSet.indexOf('_realtimedata') == -1 &&
|
|
|
|
|
|
dataSet.indexOf('_event') == -1
|
|
|
|
|
|
"
|
2024-01-11 08:54:09 +08:00
|
|
|
|
background
|
|
|
|
|
|
class="mr2 mt10"
|
|
|
|
|
|
style="float: right"
|
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
|
@current-change="pageChange"
|
|
|
|
|
|
:current-page="formInline.pageNum"
|
|
|
|
|
|
:page-sizes="[20, 30, 40, 50, 100]"
|
|
|
|
|
|
:page-size="formInline.pageSize"
|
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
|
:total="formInline.total"
|
|
|
|
|
|
></el-pagination>
|
2024-07-03 19:31:43 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 趋势数据 -->
|
2024-07-23 17:28:31 +08:00
|
|
|
|
<div style="height: calc(100vh - 200px)" v-show="dataSet.indexOf('_trenddata') != -1">
|
|
|
|
|
|
<Trend ref="trendRef"></Trend>
|
2024-07-03 19:31:43 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 实时数据 -->
|
|
|
|
|
|
<div style="height: calc(100vh - 200px)" v-if="dataSet.indexOf('_realtimedata') != -1">
|
2024-07-22 10:35:01 +08:00
|
|
|
|
<div class="view_top_btn" v-if="realTimeFlag">
|
2024-07-31 10:42:04 +08:00
|
|
|
|
<!-- <el-button type="primary" size="small" :icon="Platform" @click="handleRecordWaves">
|
2024-07-22 10:35:01 +08:00
|
|
|
|
实时录波
|
2024-07-31 10:42:04 +08:00
|
|
|
|
</el-button> -->
|
2024-07-22 10:35:01 +08:00
|
|
|
|
<el-button type="primary" size="small" :icon="TrendCharts" @click="handleTrend">
|
|
|
|
|
|
实时趋势
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button type="primary" size="small" :icon="DataLine" @click="handleHarmonicSpectrum">
|
|
|
|
|
|
谐波频谱
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="view_top_btn" v-if="!realTimeFlag">
|
|
|
|
|
|
<el-button type="primary" :icon="ArrowLeft" size="small" @click="handleReturn">返回</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 实时数据主界面组件 -->
|
|
|
|
|
|
<realTime v-if="realTimeFlag" ref="realTimeRef"></realTime>
|
|
|
|
|
|
<!-- 实时数据-实时录波组件 -->
|
|
|
|
|
|
<recordWoves v-if="!realTimeFlag && sonTab == 0"></recordWoves>
|
|
|
|
|
|
<!-- 实时数据-实时趋势组件 -->
|
2024-07-31 10:42:04 +08:00
|
|
|
|
<realTrend v-show="!realTimeFlag && sonTab == 1" ref="realTrendRef"></realTrend>
|
2024-07-22 10:35:01 +08:00
|
|
|
|
<!-- 实时数据-谐波频谱组件 -->
|
2024-08-01 15:01:32 +08:00
|
|
|
|
<harmonicSpectrum
|
|
|
|
|
|
v-show="!realTimeFlag && sonTab == 2"
|
|
|
|
|
|
ref="harmonicSpectrumRef"
|
|
|
|
|
|
></harmonicSpectrum>
|
2024-07-03 19:31:43 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 暂态事件 -->
|
2024-07-23 17:28:31 +08:00
|
|
|
|
<div style="height: calc(100vh - 200px)" v-show="dataSet.indexOf('_event') != -1">
|
|
|
|
|
|
<Event ref="eventRef"></Event>
|
2024-07-03 19:31:43 +08:00
|
|
|
|
</div>
|
2024-06-27 09:39:53 +08:00
|
|
|
|
<div v-if="!tableData" style="height: 42px"></div>
|
2024-01-11 08:54:09 +08:00
|
|
|
|
</el-tabs>
|
|
|
|
|
|
</div>
|
2024-08-08 15:38:59 +08:00
|
|
|
|
<el-empty v-else description="请选择设备" class="device-control-right" />
|
2024-02-01 16:19:28 +08:00
|
|
|
|
<Detail ref="detailRef" :detail="detail" @close="detail = null" v-if="detail"></Detail>
|
2024-07-22 10:35:01 +08:00
|
|
|
|
<!-- 离线数据导入组件 -->
|
|
|
|
|
|
<offLineDataImport ref="offLineDataImportRef"></offLineDataImport>
|
2024-07-23 17:28:31 +08:00
|
|
|
|
<!-- 解析列表 -->
|
|
|
|
|
|
<analysisList ref="analysisListRef"></analysisList>
|
2024-01-11 08:54:09 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
2024-02-01 16:19:28 +08:00
|
|
|
|
import Detail from './detail.vue'
|
2024-01-11 08:54:09 +08:00
|
|
|
|
import PointTree from '@/components/tree/govern/pointTree.vue'
|
|
|
|
|
|
import { mainHeight } from '@/utils/layout'
|
|
|
|
|
|
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
2024-07-22 10:35:01 +08:00
|
|
|
|
import { getDeviceData, getTabsDataByType } from '@/api/cs-device-boot/EquipmentDelivery'
|
|
|
|
|
|
import { deviceHisData, deviceRtData, getGroup } from '@/api/cs-device-boot/csGroup'
|
|
|
|
|
|
import { ref, reactive, nextTick, onMounted, watch } from 'vue'
|
2024-01-11 08:54:09 +08:00
|
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
|
|
import DatePicker from '@/components/form/datePicker/index.vue'
|
2024-07-22 10:35:01 +08:00
|
|
|
|
import Trend from './tabs/trend.vue' //趋势数据
|
|
|
|
|
|
import realTime from './tabs/realtime.vue' //实时数据-主界面
|
|
|
|
|
|
import realTrend from './tabs/components/realtrend.vue' //实时数据-实时趋势
|
|
|
|
|
|
import harmonicSpectrum from './tabs/components/harmonicSpectrum.vue' //实时数据-谐波频谱子页面
|
|
|
|
|
|
import recordWoves from './tabs/components/recordwoves.vue' //实时数据-实时录波子页面
|
|
|
|
|
|
import offLineDataImport from './offLineDataImport/index.vue'
|
2024-07-03 19:31:43 +08:00
|
|
|
|
import Event from './tabs/event.vue'
|
2024-07-22 10:35:01 +08:00
|
|
|
|
import { useRouter } from 'vue-router'
|
2024-07-03 19:31:43 +08:00
|
|
|
|
import { defineConfig, loadEnv } from 'vite'
|
|
|
|
|
|
import type { UserConfig, ConfigEnv } from 'vite'
|
2024-07-22 10:35:01 +08:00
|
|
|
|
import { Platform, TrendCharts, DataLine, ArrowLeft } from '@element-plus/icons-vue'
|
2024-07-23 17:28:31 +08:00
|
|
|
|
import analysisList from './analysisList/index.vue'
|
2024-01-11 08:54:09 +08:00
|
|
|
|
defineOptions({
|
|
|
|
|
|
name: 'govern/device/control'
|
|
|
|
|
|
})
|
|
|
|
|
|
const pageHeight = mainHeight(20)
|
|
|
|
|
|
const loading = ref(true)
|
|
|
|
|
|
const tableLoading = ref(false)
|
|
|
|
|
|
const getGroupLoading = ref(false)
|
|
|
|
|
|
const deviceData = ref<any>(null)
|
|
|
|
|
|
const dataSet = ref('')
|
|
|
|
|
|
const devTypeOptions = ref([])
|
|
|
|
|
|
const devModelOptions = ref([])
|
|
|
|
|
|
const tableData = ref<any[]>([])
|
2024-01-29 16:30:24 +08:00
|
|
|
|
const tableHeight = mainHeight(330).height
|
2024-01-11 08:54:09 +08:00
|
|
|
|
const mangePopup = ref()
|
|
|
|
|
|
const datePickerRef = ref()
|
|
|
|
|
|
const formInline = reactive({
|
|
|
|
|
|
searchValue: '',
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
pageSize: 30,
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
startTime: '',
|
|
|
|
|
|
endTime: '',
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
lineId: ''
|
|
|
|
|
|
})
|
2024-02-01 16:19:28 +08:00
|
|
|
|
const detail = ref<any>(null)
|
2024-07-22 10:35:01 +08:00
|
|
|
|
//是否显示实时数据默认内容
|
|
|
|
|
|
const realTimeFlag = ref(true)
|
|
|
|
|
|
//实时数据子菜单
|
|
|
|
|
|
const sonTab = ref()
|
|
|
|
|
|
//实时录波
|
|
|
|
|
|
const handleRecordWaves = () => {
|
|
|
|
|
|
realTimeFlag.value = false
|
|
|
|
|
|
sonTab.value = 0
|
2024-07-31 10:42:04 +08:00
|
|
|
|
window.clearInterval(timer.value)
|
2024-07-22 10:35:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
//实时趋势
|
2024-07-31 10:42:04 +08:00
|
|
|
|
const realTrendRef = ref()
|
2024-07-22 10:35:01 +08:00
|
|
|
|
const handleTrend = () => {
|
|
|
|
|
|
realTimeFlag.value = false
|
|
|
|
|
|
sonTab.value = 1
|
2024-07-31 10:42:04 +08:00
|
|
|
|
realTrendRef.value && realTrendRef.value.open({ devId: deviceId.value, lineId: lineId.value })
|
|
|
|
|
|
window.clearInterval(timer.value)
|
2024-07-22 10:35:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
//谐波频谱
|
2024-07-23 17:28:31 +08:00
|
|
|
|
const harmonicSpectrumRef = ref()
|
2024-07-22 10:35:01 +08:00
|
|
|
|
const handleHarmonicSpectrum = () => {
|
|
|
|
|
|
realTimeFlag.value = false
|
|
|
|
|
|
sonTab.value = 2
|
2024-08-01 15:01:32 +08:00
|
|
|
|
harmonicSpectrumRef.value &&
|
|
|
|
|
|
harmonicSpectrumRef.value.getHarmonicSpectrumParams({ devId: deviceId.value, lineId: lineId.value })
|
2024-07-31 10:42:04 +08:00
|
|
|
|
window.clearInterval(timer.value)
|
2024-07-22 10:35:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
//返回
|
|
|
|
|
|
const handleReturn = () => {
|
|
|
|
|
|
realTimeFlag.value = true
|
|
|
|
|
|
sonTab.value = null
|
2024-08-01 15:01:32 +08:00
|
|
|
|
handleClick()
|
2024-07-22 10:35:01 +08:00
|
|
|
|
}
|
2024-01-11 13:42:54 +08:00
|
|
|
|
const getDeviceDataTrend = (e: any) => {
|
2024-02-01 16:19:28 +08:00
|
|
|
|
detail.value = {
|
2024-08-08 15:58:26 +08:00
|
|
|
|
devId: deviceId.value,
|
|
|
|
|
|
lineId: lineId.value,
|
2024-02-01 16:19:28 +08:00
|
|
|
|
...e
|
|
|
|
|
|
}
|
2024-01-29 14:57:49 +08:00
|
|
|
|
}
|
2024-01-11 08:54:09 +08:00
|
|
|
|
const pageChange = (e: number) => {
|
|
|
|
|
|
formInline.pageNum = e
|
|
|
|
|
|
handleClick()
|
|
|
|
|
|
}
|
|
|
|
|
|
const handleSizeChange = (val: number) => {
|
|
|
|
|
|
formInline.pageNum = 1
|
|
|
|
|
|
formInline.pageSize = val
|
|
|
|
|
|
handleClick()
|
|
|
|
|
|
}
|
2024-07-22 10:35:01 +08:00
|
|
|
|
const { push, options, currentRoute } = useRouter()
|
|
|
|
|
|
//设备补招
|
|
|
|
|
|
const handleaddDevice = () => {
|
|
|
|
|
|
push({
|
|
|
|
|
|
path: '/supplementaryRecruitment',
|
|
|
|
|
|
query: {
|
|
|
|
|
|
id: '1111'
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-07-03 19:31:43 +08:00
|
|
|
|
//树节点点击事件
|
2024-07-22 10:35:01 +08:00
|
|
|
|
const deviceId: any = ref('')
|
|
|
|
|
|
const lineId: any = ref('')
|
2024-06-27 09:39:53 +08:00
|
|
|
|
const nodeClick = async (e: anyObj) => {
|
2024-08-02 15:59:35 +08:00
|
|
|
|
deviceId.value = e?.pid
|
|
|
|
|
|
lineId.value = e?.id
|
2024-01-29 14:57:49 +08:00
|
|
|
|
if (!e) {
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2024-01-11 08:54:09 +08:00
|
|
|
|
if (e.level == 3) {
|
|
|
|
|
|
loading.value = true
|
2024-06-27 09:39:53 +08:00
|
|
|
|
formInline.lineId = e.id
|
|
|
|
|
|
await getDeviceData(e.pid, 'history', e.id).then((res: any) => {
|
2024-01-11 08:54:09 +08:00
|
|
|
|
deviceData.value = res.data
|
2024-06-27 09:39:53 +08:00
|
|
|
|
if (!res.data.dataSetList) {
|
2024-01-11 08:54:09 +08:00
|
|
|
|
dataSet.value = ''
|
|
|
|
|
|
tableData.value = []
|
|
|
|
|
|
} else {
|
2024-06-27 09:39:53 +08:00
|
|
|
|
res.data.dataSetList.forEach((item: any) => {
|
2024-07-03 19:31:43 +08:00
|
|
|
|
//历史
|
2024-06-27 09:39:53 +08:00
|
|
|
|
if (item.type === 'history') {
|
|
|
|
|
|
item.id = item.id + '_history'
|
|
|
|
|
|
}
|
2024-07-03 19:31:43 +08:00
|
|
|
|
//趋势数据
|
2024-06-27 09:39:53 +08:00
|
|
|
|
if (item.type === 'trenddata') {
|
|
|
|
|
|
item.id = item.id + '_trenddata'
|
|
|
|
|
|
}
|
2024-07-03 19:31:43 +08:00
|
|
|
|
//实时数据
|
2024-06-27 09:39:53 +08:00
|
|
|
|
if (item.type === 'realtimedata') {
|
|
|
|
|
|
item.id = item.id + '_realtimedata'
|
|
|
|
|
|
}
|
2024-07-03 19:31:43 +08:00
|
|
|
|
//暂态事件
|
2024-06-27 09:39:53 +08:00
|
|
|
|
if (item.type === 'event') {
|
|
|
|
|
|
item.id = item.id + '_event'
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-01-11 08:54:09 +08:00
|
|
|
|
dataSet.value = res.data.dataSetList[0].id
|
|
|
|
|
|
handleClick()
|
|
|
|
|
|
}
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
})
|
2024-06-27 09:39:53 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
loading.value = false
|
2024-01-11 08:54:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-07-22 10:35:01 +08:00
|
|
|
|
const realTimeRef: any = ref()
|
2024-07-23 17:28:31 +08:00
|
|
|
|
const intRealTime = async (val: any) => {
|
2024-08-01 16:37:24 +08:00
|
|
|
|
await getTabsDataByType(val).then(res => {
|
2024-07-22 10:35:01 +08:00
|
|
|
|
realTimeRef.value && realTimeRef.value.getRealTimeData(res.data)
|
|
|
|
|
|
})
|
2024-08-01 16:37:24 +08:00
|
|
|
|
timer.value = window.setInterval(async () => {
|
|
|
|
|
|
await getTabsDataByType(val).then(res => {
|
2024-07-31 10:42:04 +08:00
|
|
|
|
realTimeRef.value && realTimeRef.value.getRealTimeData(res.data)
|
|
|
|
|
|
})
|
|
|
|
|
|
}, 20000)
|
2024-07-22 10:35:01 +08:00
|
|
|
|
}
|
2024-07-23 17:28:31 +08:00
|
|
|
|
//趋势数据组件
|
|
|
|
|
|
const trendRef: any = ref()
|
|
|
|
|
|
//暂态事件组件
|
|
|
|
|
|
const eventRef: any = ref()
|
2024-07-31 10:42:04 +08:00
|
|
|
|
const timer: any = ref()
|
2024-07-03 19:31:43 +08:00
|
|
|
|
//tab点击事件
|
2024-06-27 09:39:53 +08:00
|
|
|
|
const handleClick = async (tab?: any) => {
|
2024-08-02 15:50:03 +08:00
|
|
|
|
//点击tab时更新dataSet最新值
|
2024-08-08 15:38:59 +08:00
|
|
|
|
if (tab && tab.props && tab.props.name && dataSet.value != tab.props.name) {
|
|
|
|
|
|
dataSet.value = tab.props.name
|
2024-08-02 15:50:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-11 08:54:09 +08:00
|
|
|
|
tableLoading.value = true
|
2024-07-22 10:35:01 +08:00
|
|
|
|
//初始化点击tab隐藏实时录波、实时趋势、谐波频谱按钮
|
|
|
|
|
|
realTimeFlag.value = false
|
|
|
|
|
|
//初始化点击tab隐藏子页面
|
|
|
|
|
|
sonTab.value = null
|
2024-01-11 08:54:09 +08:00
|
|
|
|
if (tab) {
|
|
|
|
|
|
tableData.value = []
|
|
|
|
|
|
formInline.pageNum = 1
|
|
|
|
|
|
}
|
2024-07-31 10:42:04 +08:00
|
|
|
|
if (timer.value) {
|
|
|
|
|
|
window.clearInterval(timer.value)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-22 10:35:01 +08:00
|
|
|
|
// setTimeout(async () => {
|
|
|
|
|
|
//查询历史指标
|
2024-07-23 17:28:31 +08:00
|
|
|
|
if (dataSet.value.includes('_history')) {
|
|
|
|
|
|
formInline.startTime = datePickerRef.value && datePickerRef.value.timeValue[0]
|
|
|
|
|
|
formInline.endTime = datePickerRef.value && datePickerRef.value.timeValue[1]
|
2024-06-27 09:39:53 +08:00
|
|
|
|
formInline.id = dataSet.value.replace('_history', '')
|
|
|
|
|
|
await deviceHisData(formInline).then((res: any) => {
|
|
|
|
|
|
tableData.value = res.data.records
|
|
|
|
|
|
formInline.total = res.data.total
|
|
|
|
|
|
tableLoading.value = false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-07-22 10:35:01 +08:00
|
|
|
|
//查询趋势数据
|
2024-07-23 17:28:31 +08:00
|
|
|
|
if (dataSet.value.includes('_trenddata')) {
|
2024-07-22 10:35:01 +08:00
|
|
|
|
let obj = {
|
|
|
|
|
|
devId: deviceId.value, //e.id
|
|
|
|
|
|
lineId: lineId.value, //e.pid
|
|
|
|
|
|
type: 1,
|
|
|
|
|
|
list: [
|
|
|
|
|
|
{
|
|
|
|
|
|
lineId: lineId.value,
|
|
|
|
|
|
devId: dataSet.value.replace('_trenddata', '')
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
2024-07-23 17:28:31 +08:00
|
|
|
|
trendRef.value && trendRef.value.getTrendRequest(obj)
|
2024-06-27 09:39:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
//查询实时数据
|
2024-07-23 17:28:31 +08:00
|
|
|
|
if (dataSet.value.includes('_realtimedata')) {
|
2024-07-22 10:35:01 +08:00
|
|
|
|
//查询实时数据显示实时录波、实时趋势、谐波频谱
|
|
|
|
|
|
realTimeFlag.value = true
|
|
|
|
|
|
let obj = {
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
devId: deviceId.value, //e.id
|
|
|
|
|
|
lineId: lineId.value //e.pid
|
|
|
|
|
|
}
|
|
|
|
|
|
intRealTime(obj)
|
2024-07-31 10:42:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (!dataSet.value.includes('_realtimedata')) {
|
|
|
|
|
|
// if(timer.value){
|
|
|
|
|
|
// window.clearInterval(timer.value)
|
|
|
|
|
|
// }
|
2024-06-27 09:39:53 +08:00
|
|
|
|
}
|
2024-07-03 19:31:43 +08:00
|
|
|
|
//查询暂态事件
|
2024-07-23 17:28:31 +08:00
|
|
|
|
if (dataSet.value.includes('_event')) {
|
2024-07-22 10:35:01 +08:00
|
|
|
|
let obj = {
|
|
|
|
|
|
devId: deviceId.value, //e.id
|
|
|
|
|
|
lineId: lineId.value, //e.pid
|
|
|
|
|
|
type: 3,
|
|
|
|
|
|
list: [
|
|
|
|
|
|
{
|
|
|
|
|
|
lineId: lineId.value,
|
|
|
|
|
|
devId: dataSet.value.replace('_event', '')
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
2024-07-23 17:28:31 +08:00
|
|
|
|
//暂态事件表格请求参数
|
|
|
|
|
|
eventRef.value && eventRef.value.getTableParams(obj)
|
2024-07-22 10:35:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
//查询当前指标
|
2024-07-23 17:28:31 +08:00
|
|
|
|
if (!dataSet.value.includes('_')) {
|
2024-06-27 09:39:53 +08:00
|
|
|
|
formInline.id = dataSet.value
|
|
|
|
|
|
await deviceRtData(formInline).then((res: any) => {
|
|
|
|
|
|
tableData.value = res.data.records
|
|
|
|
|
|
formInline.total = res.data.total
|
|
|
|
|
|
tableLoading.value = false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-07-31 10:42:04 +08:00
|
|
|
|
|
2024-06-27 09:39:53 +08:00
|
|
|
|
// }, 100)
|
2024-01-11 08:54:09 +08:00
|
|
|
|
}
|
2024-07-23 17:28:31 +08:00
|
|
|
|
//模版下载
|
|
|
|
|
|
const handleDownLoadTemplate = () => {}
|
|
|
|
|
|
//解析列表
|
|
|
|
|
|
// const isAnalysisList = ref(false)
|
|
|
|
|
|
const analysisListRef = ref()
|
|
|
|
|
|
//打开解析列表
|
|
|
|
|
|
const handleAnalysisList = () => {
|
|
|
|
|
|
// isAnalysisList.value = true
|
|
|
|
|
|
analysisListRef.value && analysisListRef.value.open()
|
|
|
|
|
|
}
|
|
|
|
|
|
//返回
|
|
|
|
|
|
// const handleBackAnalysisList=()=>{
|
|
|
|
|
|
// isAnalysisList.value = false
|
|
|
|
|
|
// }
|
2024-07-22 10:35:01 +08:00
|
|
|
|
//离线数据导入
|
|
|
|
|
|
const offLineDataImportRef = ref()
|
|
|
|
|
|
const handleImport = () => {
|
2024-07-22 13:16:14 +08:00
|
|
|
|
//设备devId&监测点lineId带入组件
|
2024-07-23 17:28:31 +08:00
|
|
|
|
offLineDataImportRef.value && offLineDataImportRef.value.open(deviceId.value, lineId.value)
|
2024-07-22 10:35:01 +08:00
|
|
|
|
}
|
2024-01-11 08:54:09 +08:00
|
|
|
|
queryByCode('Device_Type').then(res => {
|
|
|
|
|
|
queryCsDictTree(res.data.id).then(res => {
|
|
|
|
|
|
devTypeOptions.value = res.data.map((item: any) => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
value: item.id,
|
|
|
|
|
|
label: item.name,
|
|
|
|
|
|
...item
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
queryByid(res.data.id).then(res => {
|
|
|
|
|
|
devModelOptions.value = res.data.map((item: any) => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
value: item.id,
|
|
|
|
|
|
label: item.name,
|
|
|
|
|
|
...item
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
const echoName = (value: any, arr: any[]) => {
|
2024-06-27 09:39:53 +08:00
|
|
|
|
return value ? arr.find(item => item.value == value).label : '/'
|
2024-01-11 08:54:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
const openGroup = () => {
|
|
|
|
|
|
if (!dataSet.value) {
|
|
|
|
|
|
return ElMessage.warning('暂无数据')
|
|
|
|
|
|
}
|
|
|
|
|
|
getGroupLoading.value = true
|
|
|
|
|
|
getGroup(dataSet.value).then((res: any) => {
|
|
|
|
|
|
const call = (data: any[]) => {
|
|
|
|
|
|
data.forEach(item => {
|
|
|
|
|
|
item.label = item.name
|
|
|
|
|
|
item.isShow = item.isShow == 1
|
|
|
|
|
|
if (item.children && item.children.length > 0) {
|
|
|
|
|
|
call(item.children)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
call(res.data)
|
|
|
|
|
|
getGroupLoading.value = false
|
|
|
|
|
|
mangePopup.value.open({
|
|
|
|
|
|
deviceData: deviceData.value,
|
|
|
|
|
|
dataSetName: deviceData.value.dataSetList.filter((item: any) => item.id == dataSet.value)[0]?.name,
|
|
|
|
|
|
dataSet: dataSet.value,
|
|
|
|
|
|
tree: res.data
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-07-22 10:35:01 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
() => dataSet.value,
|
|
|
|
|
|
(val: any, oldVal: any) => {
|
|
|
|
|
|
if (val) {
|
2024-08-02 15:36:43 +08:00
|
|
|
|
// handleClick()
|
2024-07-22 10:35:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-08-02 15:36:43 +08:00
|
|
|
|
)
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => tableData.value,
|
|
|
|
|
|
(val: any, oldVal: any) => {
|
|
|
|
|
|
}
|
2024-07-22 10:35:01 +08:00
|
|
|
|
)
|
2024-08-01 15:01:32 +08:00
|
|
|
|
onMounted(() => {})
|
2024-01-11 08:54:09 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
.device-control {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
|
|
&-right {
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
padding: 10px 10px 10px 0;
|
|
|
|
|
|
.el-descriptions__header {
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
margin-bottom: 7px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.content {
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
overflow: auto;
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
|
|
|
|
grid-template-rows: max-content;
|
|
|
|
|
|
grid-gap: 10px;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
|
|
.box-card {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
color: var(--el-color-white);
|
|
|
|
|
|
min-height: 150px;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
|
|
|
|
|
|
.el-card__header {
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
.clearfix {
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
height: 35px;
|
|
|
|
|
|
padding: 0 10px;
|
|
|
|
|
|
background: var(--el-color-primary);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.el-card__body {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
padding: 10px;
|
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
background-image: linear-gradient(var(--el-color-primary), var(--el-color-primary-light-3));
|
|
|
|
|
|
.box-card-content {
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-07-22 10:35:01 +08:00
|
|
|
|
|
|
|
|
|
|
.view_top_btn {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
}
|
2024-01-11 08:54:09 +08:00
|
|
|
|
</style>
|