Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
b1389fab4e
@ -38,48 +38,48 @@
|
|||||||
<div class="cardLabel">实时预览</div>
|
<div class="cardLabel">实时预览</div>
|
||||||
<div class="overviewDataSection" ref="listContainer">
|
<div class="overviewDataSection" ref="listContainer">
|
||||||
<div class="overviewDataSectionItem">
|
<div class="overviewDataSectionItem">
|
||||||
<span class="realLeft">网侧A相电压:</span>
|
<span class="realLeft">机组运行状态:</span>
|
||||||
<span class="reafRight">{{ overviewData.iul1_690v }}</span>
|
<span class="reafRight">{{ realTimeDataState }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overviewDataSectionItem">
|
<div class="overviewDataSectionItem">
|
||||||
<span class="realLeft">网侧B相电压:</span>
|
<span class="realLeft">风速:</span>
|
||||||
<span class="reafRight">{{ overviewData.iul2_690v }}</span>
|
<span class="reafRight">{{ overviewData.iwindspeed }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overviewDataSectionItem">
|
<div class="overviewDataSectionItem">
|
||||||
<span class="realLeft">网侧C相电压:</span>
|
<span class="realLeft">风向:</span>
|
||||||
<span class="reafRight">{{ overviewData.iul3_690v }}</span>
|
<span class="reafRight">{{ overviewData.iwinddirection }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="overviewDataSectionItem">
|
||||||
|
<span class="realLeft">发电机转速:</span>
|
||||||
|
<span class="reafRight">{{ overviewData.igenspeed }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overviewDataSectionItem">
|
<div class="overviewDataSectionItem">
|
||||||
<span class="realLeft">有功功率:</span>
|
<span class="realLeft">有功功率:</span>
|
||||||
<span class="reafRight">{{ overviewData.igenpower }}</span>
|
<span class="reafRight">{{ overviewData.igenpower }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="overviewDataSectionItem">
|
||||||
|
<span class="realLeft">给定有功功率:</span>
|
||||||
|
<span class="reafRight">{{ overviewData.iactivepowersetpointvalue }}</span>
|
||||||
|
</div>
|
||||||
<div class="overviewDataSectionItem">
|
<div class="overviewDataSectionItem">
|
||||||
<span class="realLeft">无功功率:</span>
|
<span class="realLeft">无功功率:</span>
|
||||||
<span class="reafRight">{{ overviewData.ireactivepower }}</span>
|
<span class="reafRight">{{ overviewData.ireactivepower }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overviewDataSectionItem">
|
<div class="overviewDataSectionItem">
|
||||||
<span class="realLeft">功率因素:</span>
|
<span class="realLeft">给定无功功率:</span>
|
||||||
<span class="reafRight">{{ overviewData.icosphi }}</span>
|
<span class="reafRight">{{ overviewData.ireactivepowersetpointvalue }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overviewDataSectionItem">
|
<div class="overviewDataSectionItem">
|
||||||
<span class="realLeft">主轴承温度A:</span>
|
<span class="realLeft">限电原因:</span>
|
||||||
<span class="reafRight">{{ overviewData.itemprotorbeara_1sec }}</span>
|
<span class="reafRight">{{ overviewData.powerlimitsource }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overviewDataSectionItem">
|
<div class="overviewDataSectionItem">
|
||||||
<span class="realLeft">主轴承温度B:</span>
|
<span class="realLeft">机舱位置:</span>
|
||||||
<span class="reafRight">{{ overviewData.itemprotorbeara_1sec }}</span>
|
<span class="reafRight">{{ overviewData.ivanedirection }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overviewDataSectionItem">
|
<div class="overviewDataSectionItem">
|
||||||
<span class="realLeft">总扭缆角度:</span>
|
<span class="realLeft">日发电量:</span>
|
||||||
<span class="reafRight">{{ overviewData.icabletwisttotal }}</span>
|
<span class="reafRight">{{ overviewData.ikwhthisday }}</span>
|
||||||
</div>
|
|
||||||
<div class="overviewDataSectionItem">
|
|
||||||
<span class="realLeft">发动机驱动侧轴承温度:</span>
|
|
||||||
<span class="reafRight">{{ overviewData.itempgenbearde_1sec }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="overviewDataSectionItem">
|
|
||||||
<span class="realLeft">发动机非驱动侧轴承温度:</span>
|
|
||||||
<span class="reafRight">{{ overviewData.itempgenbearnde_1sec }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="overviewDataBtn">
|
<div class="overviewDataBtn">
|
||||||
@ -326,17 +326,17 @@ let timer: any = null
|
|||||||
let myTable = ref<TableInstance>()
|
let myTable = ref<TableInstance>()
|
||||||
|
|
||||||
const overviewData = reactive({
|
const overviewData = reactive({
|
||||||
iul1_690v: '-',
|
// iturbineoperationmode: '-',
|
||||||
iul2_690v: '-',
|
iwindspeed: '-',
|
||||||
iul3_690v: '-',
|
iwinddirection: '-',
|
||||||
|
igenspeed: '-',
|
||||||
igenpower: '-',
|
igenpower: '-',
|
||||||
|
iactivepowersetpointvalue: '-',
|
||||||
ireactivepower: '-',
|
ireactivepower: '-',
|
||||||
icosphi: '-',
|
ireactivepowersetpointvalue: '-',
|
||||||
itemprotorbeara_1sec: '-',
|
powerlimitsource: '-',
|
||||||
itemprotorbearb_1sec: '-',
|
ivanedirection: '-',
|
||||||
icabletwisttotal: '-',
|
ikwhthisday: '-',
|
||||||
itempgenbearde_1sec: '-',
|
|
||||||
itempgenbearnde_1sec: '-',
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const realTimeDataForSingle = ref<any>({
|
const realTimeDataForSingle = ref<any>({
|
||||||
@ -1008,7 +1008,6 @@ const createRealTimeData = async () => {
|
|||||||
{ type138: [], type140: [], type199: [] },
|
{ type138: [], type140: [], type199: [] },
|
||||||
]
|
]
|
||||||
modelList.forEach((item: any) => {
|
modelList.forEach((item: any) => {
|
||||||
|
|
||||||
const realVal = realData[item.attributeCode.toLowerCase()]
|
const realVal = realData[item.attributeCode.toLowerCase()]
|
||||||
let val = getCutDecimalsValue(realVal)
|
let val = getCutDecimalsValue(realVal)
|
||||||
if (enumStore.keys.includes(item.attributeCode)) {
|
if (enumStore.keys.includes(item.attributeCode)) {
|
||||||
@ -1018,8 +1017,12 @@ const createRealTimeData = async () => {
|
|||||||
realTimeDataForSingle.value[item.attributeCode.toLowerCase()] = val === '-' ? val : val
|
realTimeDataForSingle.value[item.attributeCode.toLowerCase()] = val === '-' ? val : val
|
||||||
}
|
}
|
||||||
if (overviewDatakeys.includes(item.attributeCode.toLowerCase())) {
|
if (overviewDatakeys.includes(item.attributeCode.toLowerCase())) {
|
||||||
|
if (enumStore.keys.includes(item.attributeCode)) {
|
||||||
|
overviewData[item.attributeCode.toLowerCase() as keyof typeof overviewData] = val as string
|
||||||
|
} else {
|
||||||
overviewData[item.attributeCode.toLowerCase() as keyof typeof overviewData] = val === '-' ? val : val + item.unit
|
overviewData[item.attributeCode.toLowerCase() as keyof typeof overviewData] = val === '-' ? val : val + item.unit
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const showData = {
|
const showData = {
|
||||||
name: item.attributeName,
|
name: item.attributeName,
|
||||||
value: val === '-' ? val : val + item.unit,
|
value: val === '-' ? val : val + item.unit,
|
||||||
@ -1374,19 +1377,11 @@ const sendManualCommand = (type: 1 | 0) => {
|
|||||||
const getAlarmList = () => {
|
const getAlarmList = () => {
|
||||||
const start = dayjs().startOf('day').toDate().getTime()
|
const start = dayjs().startOf('day').toDate().getTime()
|
||||||
const end = dayjs().endOf('day').toDate().getTime()
|
const end = dayjs().endOf('day').toDate().getTime()
|
||||||
console.log({
|
|
||||||
startTime: start,
|
|
||||||
endTime: end,
|
|
||||||
deviceCode: [route.query.deviceCode],
|
|
||||||
},'----------------------------------');
|
|
||||||
|
|
||||||
getAlarmListReq({
|
getAlarmListReq({
|
||||||
startTime: start,
|
startTime: start,
|
||||||
endTime: end,
|
endTime: end,
|
||||||
deviceCode: [route.query.deviceCode],
|
deviceCode: [route.query.deviceCode],
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res,'------------------------');
|
|
||||||
|
|
||||||
if (res.rows) {
|
if (res.rows) {
|
||||||
tableData.value = res.rows.map((item: any) => {
|
tableData.value = res.rows.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
|
@ -191,7 +191,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog v-model="realDataLineChartVisible" title="实时曲线" @close="closeLineChart">
|
<el-dialog v-model="realDataLineChartVisible" title="实时曲线" @close="closeLineChart">
|
||||||
<RealDataChart :visible="realDataLineChartVisible" :id="clickRowId"></RealDataChart>
|
<RealDataChart ref="realDataChartRef" :visible="realDataLineChartVisible" :id="clickRowId"></RealDataChart>
|
||||||
|
<template #header>
|
||||||
|
<div>
|
||||||
|
<span style="font-size: 18px">实时曲线</span>
|
||||||
|
<el-button class="saveBtn" @click="saveLineChart" type="primary" plain>保存</el-button>
|
||||||
|
<el-button v-if="linePause" class="continueBtn" @click="continueLineChart" type="primary" plain>继续</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -203,7 +210,7 @@ import { getAirBlowerListReq, getBelongLineListReq } from '/@/api/backend/airBlo
|
|||||||
import { CircleCheck, CircleClose, Loading, Crop, Download } from '@element-plus/icons-vue'
|
import { CircleCheck, CircleClose, Loading, Crop, Download } from '@element-plus/icons-vue'
|
||||||
import { ElMessage, TableInstance, ElPopconfirm } from 'element-plus'
|
import { ElMessage, TableInstance, ElPopconfirm } from 'element-plus'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import { getRealTimeState, getCutDecimalsValue } from './utils'
|
import { getRealTimeState, getCutDecimalsValue, getEnumToValue } from './utils'
|
||||||
import { sendCommandReq } from '/@/api/backend/control/request'
|
import { sendCommandReq } from '/@/api/backend/control/request'
|
||||||
import { adminBaseRoutePath } from '/@/router/static/adminBase'
|
import { adminBaseRoutePath } from '/@/router/static/adminBase'
|
||||||
import { getRealValueListReq } from '/@/api/backend/deviceModel/request'
|
import { getRealValueListReq } from '/@/api/backend/deviceModel/request'
|
||||||
@ -380,6 +387,7 @@ const defaultColumn: TableColumnType[] = [
|
|||||||
prop: 'name',
|
prop: 'name',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
custom: 'default',
|
custom: 'default',
|
||||||
|
width: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '实时曲线',
|
label: '实时曲线',
|
||||||
@ -399,6 +407,7 @@ const defaultColumn: TableColumnType[] = [
|
|||||||
prop: 'iturbineoperationmode',
|
prop: 'iturbineoperationmode',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
custom: 'default',
|
custom: 'default',
|
||||||
|
width: 100,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
const dynamicColumn: TableColumnType[] = [
|
const dynamicColumn: TableColumnType[] = [
|
||||||
@ -493,7 +502,7 @@ const dynamicColumn: TableColumnType[] = [
|
|||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '总发电量 (万kWh)',
|
label: '总发电量 (kWh)',
|
||||||
prop: 'ikwhoverall',
|
prop: 'ikwhoverall',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
custom: 'header',
|
custom: 'header',
|
||||||
@ -547,7 +556,8 @@ const getTableData = () => {
|
|||||||
const data = airBlowerIdList.map((id) => {
|
const data = airBlowerIdList.map((id) => {
|
||||||
const realData: any = {}
|
const realData: any = {}
|
||||||
Object.keys(res.data[id]).forEach((key) => {
|
Object.keys(res.data[id]).forEach((key) => {
|
||||||
realData[key] = getCutDecimalsValue(res.data[id][key])
|
const cutVal = getCutDecimalsValue(res.data[id][key])
|
||||||
|
realData[key] = getEnumToValue(key, cutVal)
|
||||||
})
|
})
|
||||||
const state = getRealTimeState(res.data[id])
|
const state = getRealTimeState(res.data[id])
|
||||||
return {
|
return {
|
||||||
@ -565,7 +575,6 @@ const getTableData = () => {
|
|||||||
|
|
||||||
if (airBlowerSelect.belongLine === '全部' && airBlowerSelect.iturbineoperationmode === 987654321) {
|
if (airBlowerSelect.belongLine === '全部' && airBlowerSelect.iturbineoperationmode === 987654321) {
|
||||||
tableData.value = data
|
tableData.value = data
|
||||||
console.log(tableData.value)
|
|
||||||
} else {
|
} else {
|
||||||
const irn = tableData.value.map((item) => item.irn)
|
const irn = tableData.value.map((item) => item.irn)
|
||||||
const result: TableDataObjType[] = []
|
const result: TableDataObjType[] = []
|
||||||
@ -616,21 +625,23 @@ const selectTable = (selected: TableDataObjType[]) => {
|
|||||||
|
|
||||||
const autoUpdate = ref(true)
|
const autoUpdate = ref(true)
|
||||||
const autoUpdateInterval = ref<any>(null)
|
const autoUpdateInterval = ref<any>(null)
|
||||||
watch(autoUpdate, (newVal: boolean) => {
|
watch(
|
||||||
|
() => autoUpdate.value,
|
||||||
|
(newVal: boolean) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
if (autoUpdateInterval.value) return
|
if (autoUpdateInterval.value) return
|
||||||
ElMessage.success('开启自动刷新')
|
|
||||||
autoUpdateInterval.value = setInterval(() => {
|
autoUpdateInterval.value = setInterval(() => {
|
||||||
getTableData()
|
getTableData()
|
||||||
}, 2000)
|
}, 2000)
|
||||||
} else {
|
} else {
|
||||||
if (realDataLineChartVisible.value) {
|
|
||||||
ElMessage.warning('关闭自动刷新')
|
|
||||||
}
|
|
||||||
clearInterval(autoUpdateInterval.value)
|
clearInterval(autoUpdateInterval.value)
|
||||||
autoUpdateInterval.value = null
|
autoUpdateInterval.value = null
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const openWindTurbine = (row: TableDataObjType) => {
|
const openWindTurbine = (row: TableDataObjType) => {
|
||||||
if (!router.hasRoute('windTurbine')) {
|
if (!router.hasRoute('windTurbine')) {
|
||||||
@ -758,16 +769,52 @@ const downFun = () => {
|
|||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const realDataChartRef = ref()
|
||||||
const clickRowId = ref('')
|
const clickRowId = ref('')
|
||||||
const realDataLineChartVisible = ref(false)
|
const realDataLineChartVisible = ref(false)
|
||||||
const openLineChart = (row: TableDataObjType) => {
|
const openLineChart = (row: TableDataObjType) => {
|
||||||
clickRowId.value = row.irn
|
clickRowId.value = row.irn
|
||||||
realDataLineChartVisible.value = true
|
realDataLineChartVisible.value = true
|
||||||
autoUpdate.value = false
|
autoUpdate.value = false
|
||||||
|
linePause.value = false
|
||||||
}
|
}
|
||||||
const closeLineChart = () => {
|
const closeLineChart = () => {
|
||||||
autoUpdate.value = true
|
autoUpdate.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const linePause = ref(false)
|
||||||
|
const saveLineChart = () => {
|
||||||
|
const data = realDataChartRef.value?.saveChart()
|
||||||
|
linePause.value = true
|
||||||
|
const info = 'deviceCode:' + clickRowId.value + '\n'
|
||||||
|
let title = 'TimeStamp;'
|
||||||
|
let columns = ''
|
||||||
|
data.time.forEach((item: any, index: number) => {
|
||||||
|
columns += item
|
||||||
|
data.chartData.forEach((item: any) => {
|
||||||
|
if (index === 0) {
|
||||||
|
title += `${item.id};`
|
||||||
|
}
|
||||||
|
const val = item.data[index]
|
||||||
|
columns += `;${val}`
|
||||||
|
})
|
||||||
|
columns += '\n'
|
||||||
|
})
|
||||||
|
let str = info + title + '\n' + columns
|
||||||
|
let uri = 'data:text/plain;charset=utf-8,' + encodeURIComponent(str)
|
||||||
|
let link = document.createElement('a')
|
||||||
|
link.href = uri
|
||||||
|
link.download = clickRowId.value + 'ChartData' + '.txt'
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
}
|
||||||
|
|
||||||
|
const continueLineChart = () => {
|
||||||
|
realDataChartRef.value?.continueChart()
|
||||||
|
linePause.value = false
|
||||||
|
}
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
autoUpdateInterval.value && clearInterval(autoUpdateInterval.value)
|
autoUpdateInterval.value && clearInterval(autoUpdateInterval.value)
|
||||||
autoUpdateInterval.value = null
|
autoUpdateInterval.value = null
|
||||||
@ -890,4 +937,8 @@ getBlongLineList()
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.saveBtn {
|
||||||
|
margin-left: 164px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -4,10 +4,16 @@
|
|||||||
<el-col :span="8" class="leftPart">
|
<el-col :span="8" class="leftPart">
|
||||||
<div class="leftHeader">
|
<div class="leftHeader">
|
||||||
<el-button type="primary" @click="addPoint">添加测点</el-button>
|
<el-button type="primary" @click="addPoint">添加测点</el-button>
|
||||||
|
<span>显示区间:</span>
|
||||||
|
<el-select v-model="showTimeInterval">
|
||||||
|
<el-option label="5分钟" :value="300"></el-option>
|
||||||
|
<el-option label="10分钟" :value="600"></el-option>
|
||||||
|
<el-option label="15分钟" :value="900"></el-option>
|
||||||
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="leftMain">
|
<div class="leftMain">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-checkbox-group v-model="selectList">
|
<el-checkbox-group v-model="selectList" @change="changeCheck">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-for="item in realDataList"
|
v-for="item in realDataList"
|
||||||
:key="item.prop"
|
:key="item.prop"
|
||||||
@ -42,13 +48,14 @@ import { ref, computed, watch, onMounted, onUnmounted } from 'vue'
|
|||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import SelectPoint from '/@/views/backend/equipment/airBlower/selectPoint.vue'
|
import SelectPoint from '/@/views/backend/equipment/airBlower/selectPoint.vue'
|
||||||
import { getRealValueListReq } from '/@/api/backend/deviceModel/request'
|
import { getRealValueListReq } from '/@/api/backend/deviceModel/request'
|
||||||
import { dayjs } from 'element-plus'
|
import { dayjs, ElMessage } from 'element-plus'
|
||||||
|
import { getCutDecimalsValue } from './utils'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{ id: string; visible: boolean }>(), {
|
const props = withDefaults(defineProps<{ id: string; visible: boolean }>(), {
|
||||||
id: '',
|
id: '',
|
||||||
visible: false,
|
visible: false,
|
||||||
})
|
})
|
||||||
|
const showTimeInterval = ref(300)
|
||||||
//#region
|
//#region
|
||||||
const defaultList = [
|
const defaultList = [
|
||||||
{
|
{
|
||||||
@ -109,18 +116,28 @@ const defaultList = [
|
|||||||
]
|
]
|
||||||
//#endregion
|
//#endregion
|
||||||
const selectList = ref([])
|
const selectList = ref([])
|
||||||
watch(
|
const changeCheck = () => {
|
||||||
() => selectList.value,
|
|
||||||
() => {
|
|
||||||
if (!timer && selectList.value[0]) {
|
if (!timer && selectList.value[0]) {
|
||||||
createTimer()
|
createTimer()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectList.value.length === 0) {
|
if (selectList.value.length === 0) {
|
||||||
clearTimer()
|
clearTimer()
|
||||||
chartInstance && chartInstance.clear()
|
chartInstance && chartInstance.clear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
// watch(
|
||||||
|
// () => selectList.value,
|
||||||
|
// () => {
|
||||||
|
// if (!timer && selectList.value[0]) {
|
||||||
|
// createTimer()
|
||||||
|
// }
|
||||||
|
// if (selectList.value.length === 0) {
|
||||||
|
// clearTimer()
|
||||||
|
// chartInstance && chartInstance.clear()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// )
|
||||||
const realDataList = ref<any[]>(JSON.parse(JSON.stringify(defaultList)))
|
const realDataList = ref<any[]>(JSON.parse(JSON.stringify(defaultList)))
|
||||||
|
|
||||||
const chartRef = ref()
|
const chartRef = ref()
|
||||||
@ -153,7 +170,7 @@ const getRandomDarkColor = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const createChartData = (data: { [k: string]: number }, time: string) => {
|
const createChartData = (data: { [k: string]: number }, time: string) => {
|
||||||
if (realDataXAxis.length > 120) {
|
if (realDataXAxis.length > showTimeInterval.value) {
|
||||||
realDataXAxis.shift()
|
realDataXAxis.shift()
|
||||||
realDataSeries.forEach((item: any) => {
|
realDataSeries.forEach((item: any) => {
|
||||||
item.data.shift()
|
item.data.shift()
|
||||||
@ -183,16 +200,17 @@ const createChartData = (data: { [k: string]: number }, time: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const seriesData = attrCode.map((item) => {
|
const seriesData = attrCode.map((item) => {
|
||||||
|
const curVal = getCutDecimalsValue(data[item], 2)
|
||||||
if (lastSeriesId.includes(item)) {
|
if (lastSeriesId.includes(item)) {
|
||||||
const cur = realDataSeries.find((val: any) => val.id === item)
|
const cur = realDataSeries.find((val: any) => val.id === item)
|
||||||
cur.data.push(data[item])
|
cur.data.push(curVal)
|
||||||
return cur
|
return cur
|
||||||
} else {
|
} else {
|
||||||
const info = realDataList.value.find((val) => val.prop === item)
|
const info = realDataList.value.find((val) => val.prop === item)
|
||||||
const list = realDataSeries?.[0]?.data ?? []
|
const list = realDataSeries?.[0]?.data ?? []
|
||||||
const len = list.length
|
const len = list.length
|
||||||
const fillData = new Array(len).fill('')
|
const fillData = new Array(len).fill('')
|
||||||
fillData.push(data[item])
|
fillData.push(curVal)
|
||||||
return {
|
return {
|
||||||
id: item,
|
id: item,
|
||||||
name: info.name + info.unit,
|
name: info.name + info.unit,
|
||||||
@ -343,6 +361,8 @@ const saveSelectPoint = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
realDataList.value = selectList
|
realDataList.value = selectList
|
||||||
|
selectPointVisible.value = false
|
||||||
|
ElMessage.success('添加成功')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let timer: any = null
|
let timer: any = null
|
||||||
@ -357,6 +377,29 @@ const clearTimer = () => {
|
|||||||
realDataSeries = []
|
realDataSeries = []
|
||||||
realDataXAxis = []
|
realDataXAxis = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pauseState = ref(false)
|
||||||
|
const saveChart = () => {
|
||||||
|
timer && clearInterval(timer)
|
||||||
|
pauseState.value = true
|
||||||
|
return {
|
||||||
|
time: realDataXAxis,
|
||||||
|
chartData: realDataSeries,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const continueChart = () => {
|
||||||
|
pauseState.value = false
|
||||||
|
const fillVal = new Array(5).fill('')
|
||||||
|
realDataXAxis.push(...fillVal)
|
||||||
|
realDataSeries.forEach((item: any) => {
|
||||||
|
item.data.push(...fillVal)
|
||||||
|
})
|
||||||
|
createTimer()
|
||||||
|
}
|
||||||
|
defineExpose({
|
||||||
|
saveChart,
|
||||||
|
continueChart,
|
||||||
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (selectList.value.length > 0) {
|
if (selectList.value.length > 0) {
|
||||||
createTimer()
|
createTimer()
|
||||||
@ -389,7 +432,19 @@ watch(
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
border-right: 1px solid #edf2fa;
|
border-right: 1px solid #edf2fa;
|
||||||
.leftHeader {
|
.leftHeader {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
span {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
.el-select {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
:deep(.el-select__wrapper) {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.leftMain {
|
.leftMain {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -418,4 +473,11 @@ watch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.selectPointDialogFooter {
|
||||||
|
text-align: center;
|
||||||
|
.el-button {
|
||||||
|
width: 120px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
import { useEnumStore } from '/@/stores/enums'
|
||||||
|
|
||||||
|
const enumStore = useEnumStore()
|
||||||
|
|
||||||
export const getRealTimeState = (data: any) => {
|
export const getRealTimeState = (data: any) => {
|
||||||
if (data.iturbineoperationmode) {
|
if (data.iturbineoperationmode) {
|
||||||
if (data.iturbineoperationmode > 1 && data.iturbineoperationmode < 6) {
|
if (data.iturbineoperationmode > 1 && data.iturbineoperationmode < 6) {
|
||||||
@ -20,3 +24,15 @@ export const getCutDecimalsValue = (data: number, num = 3) => {
|
|||||||
const n = Math.pow(10, num)
|
const n = Math.pow(10, num)
|
||||||
return data === 0 ? 0 : data ? (data % 1 === 0 ? data : Math.floor(data * n) / n) : '-'
|
return data === 0 ? 0 : data ? (data % 1 === 0 ? data : Math.floor(data * n) / n) : '-'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getEnumToValue = (key: string, value: any) => {
|
||||||
|
const enumData: any = {}
|
||||||
|
enumStore.keys.forEach(item => {
|
||||||
|
enumData[item.toLowerCase()] = enumStore.data[item]
|
||||||
|
})
|
||||||
|
if (enumData[key]) {
|
||||||
|
return enumData[key]?.[value] ?? value
|
||||||
|
} else {
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user