Merge remote-tracking branch 'origin/main'

This commit is contained in:
houwei 2024-10-30 14:06:17 +08:00
commit f82b7d2d10
4 changed files with 460 additions and 444 deletions

View File

@ -31,12 +31,6 @@
<!--实时预览--> <!--实时预览-->
<div class="overview panelBg"> <div class="overview panelBg">
<el-text class="mx-1 homelabel">实时预览</el-text> <el-text class="mx-1 homelabel">实时预览</el-text>
<!-- <div class="radioItem">
<el-radio-group v-model="radioactiveName">
<el-radio value="1">模拟量</el-radio>
<el-radio value="2">状态量</el-radio>
</el-radio-group>
</div> -->
<el-row :gutter="10"> <el-row :gutter="10">
<div class="realScroll" ref="listContainer"> <div class="realScroll" ref="listContainer">
<div class="realPart"> <div class="realPart">
@ -95,7 +89,7 @@
<el-text class="mx-1 homelabel">功率趋势</el-text> <el-text class="mx-1 homelabel">功率趋势</el-text>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col class="lg-mb-20" :span="24"> <el-col class="lg-mb-20" :span="24">
<div class="power-chart" :ref="chartRefs.set"></div> <div class="power-chart" ref="powerChartRef"></div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -166,16 +160,16 @@
<div class="chartPart"> <div class="chartPart">
<div class="chartPart-item"> <div class="chartPart-item">
<div class="chartParm" :ref="chartRefs.set"></div> <div class="chartParm" ref="temperatureChartRef1"></div>
</div> </div>
<div class="chartPart-item"> <div class="chartPart-item">
<div class="chartParm" :ref="chartRefs.set"></div> <div class="chartParm" ref="temperatureChartRef2"></div>
</div> </div>
<div class="chartPart-item"> <div class="chartPart-item">
<div class="chartParm" :ref="chartRefs.set"></div> <div class="chartParm" ref="temperatureChartRef3"></div>
</div> </div>
<div class="chartPart-item item_bar"> <div class="chartPart-item item_bar">
<div class="frequencyChart" :ref="chartRefs.set"></div> <div class="frequencyChart" ref="frequencyChartRef"></div>
</div> </div>
</div> </div>
</div> </div>
@ -187,11 +181,6 @@
<div class="summarize panelBg"> <div class="summarize panelBg">
<div class="summarize-title"> <div class="summarize-title">
<el-text class="mx-1 homelabel">发电量概况</el-text> <el-text class="mx-1 homelabel">发电量概况</el-text>
<el-text class="mx-1" style="margin-bottom: 20px">
当日发电量
<span class="content-number" style="color: #0277b3">{{ realTimeDataForSingle.ikwhthisday }}</span>
kWh
</el-text>
</div> </div>
<el-row :gutter="5"> <el-row :gutter="5">
<el-col :span="6"> <el-col :span="6">
@ -201,7 +190,7 @@
</div> </div>
<div class="summarize-panel-base"> <div class="summarize-panel-base">
<div> <div>
<span class="content-number">{{ realTimeDataForSingle.dayGeneration }}</span> <span class="content-number">{{ realTimeDataForSingle.ikwhthisday }}</span>
</div> </div>
<div><span>kWh</span></div> <div><span>kWh</span></div>
<div><span>日发电量</span></div> <div><span>日发电量</span></div>
@ -258,14 +247,13 @@
<el-text class="mx-1 homelabel">发电量趋势</el-text> <el-text class="mx-1 homelabel">发电量趋势</el-text>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activeName" class="demo-tabs trend-tabs" @tab-click="tabhandleClick" ref="userTab"> <el-tabs v-model="trendChartType" class="demo-tabs trend-tabs" @tab-click="tabhandleClick" ref="userTab">
<el-tab-pane label="日" name="first"> <el-tab-pane label="日" name="day">
<div class="trend-chart" :ref="chartRefs.set"></div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="月" name="second"> <el-tab-pane label="月" name="month">
<div class="trend-chart" :ref="chartRefs.set"></div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div class="trend-chart" ref="trendChartRef"></div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -316,18 +304,18 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { nextTick, onActivated, onMounted, reactive, ref, computed, onBeforeMount, onUnmounted } from 'vue' import { nextTick, onActivated, onMounted, reactive, ref, computed, onBeforeMount, onUnmounted, VNode, VNodeRef } from 'vue'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { useTemplateRefsList, useEventListener } from '@vueuse/core' import { useEventListener } from '@vueuse/core'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { DArrowRight } from '@element-plus/icons-vue' import { DArrowRight } from '@element-plus/icons-vue'
import { getRealValueListReq, getRealValueRangeReq } from '/@/api/backend/deviceModel/request' import { getRealValueListReq, getRealValueRangeReq } from '/@/api/backend/deviceModel/request'
import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request' import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import VisualList from './visualList.vue'
import Overview from './overview.vue' import Overview from './overview.vue'
import { TableInstance } from 'element-plus' import { TableInstance } from 'element-plus'
import { dayjs } from 'element-plus' import { dayjs } from 'element-plus'
import { getRealTimeState } from '/@/views/backend/equipment/airBlower/utils'
const route = useRoute() const route = useRoute()
const d = new Date() const d = new Date()
@ -362,47 +350,33 @@ const realTimeDataForSingle = ref<any>({
ipitchangle: '', ipitchangle: '',
iwindspeed: '', iwindspeed: '',
}) })
const chartRefs = useTemplateRefsList<HTMLDivElement>()
const state: { const state: {
charts: any[] charts: { powerChart: any; temperatureChart1: any; temperatureChart2: any; temperatureChart3: any; frequencyChart: any; trendChart: any }
remark: string remark: string
workingTimeFormat: string workingTimeFormat: string
pauseWork: boolean pauseWork: boolean
} = reactive({ } = reactive({
charts: [], charts: { powerChart: null, temperatureChart1: null, temperatureChart2: null, temperatureChart3: null, frequencyChart: null, trendChart: null },
remark: 'dashboard.Loading', remark: 'dashboard.Loading',
workingTimeFormat: '', workingTimeFormat: '',
pauseWork: false, pauseWork: false,
}) })
const powerChartData = [
{ const powerChartRef = ref<VNodeRef>()
power: 12.6, const powerChartData: { time: any; values: any } = {
windSpeed: 56.3, time: {},
dataTime: '2024-10-17 00:00:00', values: {},
}, }
{
power: 10.6,
windSpeed: 16.3,
dataTime: '2024-10-17 00:05:00',
},
]
const initpowerChart = () => { const initpowerChart = () => {
const initpowerChart = echarts.init(chartRefs.value[0] as HTMLElement) const powerChart = state.charts.powerChart ?? echarts.init(powerChartRef.value as unknown as HTMLElement)
const xAxisdata: any[] = []
const powerData: any[] = []
const windSpeedData: any[] = []
powerChartData.forEach((item, index) => {
const dataTime = item.dataTime
const dataTimearr = dataTime.split(' ')
xAxisdata.push(dataTimearr[1])
powerData.push(item.power)
windSpeedData.push(item.windSpeed)
const option = { const option = {
grid: { grid: {
top: 50, top: 50,
right: 10, right: 23,
bottom: 20, bottom: 10,
left: 10, left: 18,
containLabel: true, containLabel: true,
}, },
tooltip: { tooltip: {
@ -427,7 +401,7 @@ const initpowerChart = () => {
textStyle: { textStyle: {
color: '#4E5969', color: '#4E5969',
}, },
interval: 0, interval: 'auto',
//rotate: 45 //rotate: 45
}, },
splitLine: { splitLine: {
@ -437,7 +411,7 @@ const initpowerChart = () => {
color: '#999999', color: '#999999',
}, },
}, },
data: xAxisdata, data: powerChartData.time.iTheoreticalPower,
}, },
yAxis: [ yAxis: [
{ {
@ -518,19 +492,19 @@ const initpowerChart = () => {
}, },
smooth: 0.6, smooth: 0.6,
symbol: 'none', symbol: 'none',
data: powerData, data: powerChartData.values?.iGenPower ?? [],
}, },
{ {
name: '理论有功功率', name: '理论有功功率',
type: 'line', type: 'line',
barWidth: 20, barWidth: 20,
itemStyle: { itemStyle: {
color: '#00a4ff', color: '#62bd25',
barBorderRadius: 2, barBorderRadius: 2,
}, },
smooth: 0.6, smooth: 0.6,
symbol: 'none', symbol: 'none',
data: powerData, data: powerChartData.values?.iTheoreticalPower ?? [],
}, },
{ {
name: '风速', name: '风速',
@ -550,46 +524,57 @@ const initpowerChart = () => {
} }
]) ])
},*/ },*/
data: windSpeedData, data: powerChartData.values?.iWindSpeed ?? [],
}, },
], ],
} }
initpowerChart.setOption(option) powerChart.setOption(option)
state.charts.push(initpowerChart) state.charts.powerChart = powerChart
})
} }
const TrendData = [ const TrendDataForDay = [
{ {
currentPeriod: 56.3, currentPeriod: 86.3,
samePeriod: 63.5, samePeriod: 63.5,
generationTime: '2024-10-01', generationTime: '2024-10-01',
}, },
{ {
currentPeriod: 66.3, currentPeriod: 86.3,
samePeriod: 73.5, samePeriod: 53.5,
generationTime: '2024-10-02', generationTime: '2024-10-02',
}, },
{ {
currentPeriod: 66.3, currentPeriod: 86.3,
samePeriod: 73.5, samePeriod: 43.5,
generationTime: '2024-10-03', generationTime: '2024-10-03',
}, },
] ]
const timeType = '日' const TrendDataForMonth = [
{
currentPeriod: 26.3,
samePeriod: 53.5,
generationTime: '2024-10-01',
},
{
currentPeriod: 36.3,
samePeriod: 53.5,
generationTime: '2024-10-02',
},
{
currentPeriod: 46.3,
samePeriod: 53.5,
generationTime: '2024-10-03',
},
]
const trendChartRef = ref<VNodeRef>()
const inittrendChart = (t: any, u: any) => { const inittrendChart = (type: 'day' | 'month' = 'day') => {
const currentPeriod: any = [] const currentPeriod: any =
const samePeriod: any = [] type === 'day' ? TrendDataForDay.map((item) => item.currentPeriod) : TrendDataForMonth.map((item) => item.currentPeriod)
const xAxisdata: any = [] const samePeriod: any = type === 'day' ? TrendDataForDay.map((item) => item.samePeriod) : TrendDataForMonth.map((item) => item.samePeriod)
TrendData.forEach((item, index) => { const xAxisdata: any = type === 'day' ? TrendDataForDay.map((item) => item.generationTime) : TrendDataForMonth.map((item) => item.generationTime)
const generationTime = item.generationTime const trendChart = state.charts?.trendChart ?? echarts.init(trendChartRef.value as unknown as HTMLElement)
const generationTimearr = generationTime.split('-')
xAxisdata.push(generationTimearr[2])
currentPeriod.push(item.currentPeriod)
samePeriod.push(item.samePeriod)
const inittrendChart = echarts.init(chartRefs.value[u] as HTMLElement)
const option = { const option = {
grid: { grid: {
top: 30, top: 30,
@ -689,9 +674,8 @@ const inittrendChart = (t: any, u: any) => {
}, },
], ],
} }
inittrendChart.setOption(option) trendChart.setOption(option)
state.charts.push(inittrendChart) state.charts.trendChart = trendChart
})
} }
const chartsData = [ const chartsData = [
{ {
@ -707,9 +691,15 @@ const chartsData = [
value: 56, value: 56,
}, },
] ]
const initChart = () => { const temperatureChartRef1 = ref<VNodeRef>()
chartsData.forEach((item, index) => { const temperatureChartRef2 = ref<VNodeRef>()
const initChart = echarts.init(chartRefs.value[index + 1] as HTMLElement) const temperatureChartRef3 = ref<VNodeRef>()
const initTemperatureChart = () => {
const temperatureChart1 = state.charts.temperatureChart1 ?? echarts.init(temperatureChartRef1.value as unknown as HTMLElement)
const temperatureChart2 = state.charts.temperatureChart2 ?? echarts.init(temperatureChartRef2.value as unknown as HTMLElement)
const temperatureChart3 = state.charts.temperatureChart3 ?? echarts.init(temperatureChartRef3.value as unknown as HTMLElement)
const options = []
for (let i = 0; i < chartsData.length; i++) {
const option = { const option = {
grid: { grid: {
top: 30, top: 30,
@ -728,8 +718,8 @@ const initChart = () => {
}, },
series: [ series: [
{ {
name: item.name, name: chartsData[i].name,
data: [item.value], data: [chartsData[i].value],
type: 'bar', type: 'bar',
label: { label: {
show: true, show: true,
@ -783,9 +773,14 @@ const initChart = () => {
}, },
}, },
} }
initChart.setOption(option) options.push(option)
state.charts.push(initChart) }
}) temperatureChart1.setOption(options[0])
state.charts.temperatureChart1 = temperatureChart1
temperatureChart2.setOption(options[1])
state.charts.temperatureChart2 = temperatureChart2
temperatureChart3.setOption(options[2])
state.charts.temperatureChart3 = temperatureChart3
} }
var frequencydata = [ var frequencydata = [
@ -839,13 +834,12 @@ var frequencydata = [
}, },
] ]
const initfrequencyChart = () => { const frequencyChartRef = ref()
const yAxisdata = [] const initFrequencyChart = () => {
const seriesdata = [] const frequencyChart = state.charts.frequencyChart ?? echarts.init(frequencyChartRef.value as unknown as HTMLElement)
frequencydata.forEach((item, index) => { const yAxisdata: any = frequencydata.map((item) => item.name)
yAxisdata.push(item.name) const seriesdata: any = frequencydata.map((item) => item.value)
seriesdata.push(item.value)
const initfrequencyChart = echarts.init(chartRefs.value[4] as HTMLElement)
const option = { const option = {
title: [ title: [
{ {
@ -919,16 +913,16 @@ const initfrequencyChart = () => {
}, },
animation: false, animation: false,
} }
initfrequencyChart.setOption(option) frequencyChart.setOption(option)
state.charts.push(initfrequencyChart) state.charts.frequencyChart = frequencyChart
})
} }
const echartsResize = () => { const echartsResize = () => {
nextTick(() => { nextTick(() => {
for (const key in state.charts) { const chartKeys = Object.keys(state.charts) as Array<keyof typeof state.charts>
chartKeys.forEach((key) => {
state.charts[key].resize() state.charts[key].resize()
} })
}) })
} }
onActivated(() => { onActivated(() => {
@ -999,22 +993,6 @@ const realTimeData = ref<any>({
iturbineoperationmode: 1111, iturbineoperationmode: 1111,
}) })
const getRealTimeState = (data: any) => {
if (data.attributeMap.iturbineoperationmode) {
if (data.attributeMap.iturbineoperationmode > 1 && data.attributeMap.iturbineoperationmode < 6) {
return 2
}
if (data.attributeMap.iturbineoperationmode === 21) {
return 20
}
return data.attributeMap.iturbineoperationmode
} else if (data.attributeMap.iyplevel === 10) {
return 1110
} else if (data.attributeMap.gridlostdetected === 1) {
return 1111
}
}
const realTimeDataState = computed(() => { const realTimeDataState = computed(() => {
switch (realTimeData.value.iturbineoperationmode) { switch (realTimeData.value.iturbineoperationmode) {
case 20: case 20:
@ -1039,6 +1017,8 @@ const realTimeDataState = computed(() => {
return '解缆状态' return '解缆状态'
case 1111: case 1111:
return '电网故障停机' return '电网故障停机'
case 1112:
return '安全链停机'
} }
}) })
@ -1060,11 +1040,12 @@ const getRealTimeData = () => {
const createRealTimeData = async () => { const createRealTimeData = async () => {
try { try {
const modelList: any = await getModelList() const modelList: any = await getModelList()
const realTimeData: any = await getRealTimeData() const realData: any = await getRealTimeData()
realTimeData.value.iturbineoperationmode = getRealTimeState(realData)
const overviewDatakeys: any = Object.keys(overviewData) const overviewDatakeys: any = Object.keys(overviewData)
const sigleDataKeys: any = Object.keys(realTimeDataForSingle.value) const sigleDataKeys: any = Object.keys(realTimeDataForSingle.value)
const dataFor138And139: { name: string; value: string }[] = [] const dataFor138And139: { name: string; value: string }[] = []
const dataFor140: { name: string; value: string }[] = [] const dataFor140: { name: string; value: string }[] = []
const realDataForSub: any = [ const realDataForSub: any = [
@ -1076,10 +1057,10 @@ const createRealTimeData = async () => {
{ type138: [], type140: [] }, { type138: [], type140: [] },
] ]
modelList.forEach((item: any) => { modelList.forEach((item: any) => {
const realVal = realTimeData[item.attributeCode.toLowerCase()] const realVal = realData[item.attributeCode.toLowerCase()]
const val = realVal === 0 ? 0 : realVal ? (realVal % 1 === 0 ? realVal : Math.floor(realVal * 1000) / 1000) : '-' const val = realVal === 0 ? 0 : realVal ? (realVal % 1 === 0 ? realVal : Math.floor(realVal * 1000) / 1000) : '-'
if (sigleDataKeys.includes(item.attributeCode.toLowerCase())) { if (sigleDataKeys.includes(item.attributeCode.toLowerCase())) {
realTimeDataForSingle.value[item.attributeCode.toLowerCase()] = val realTimeDataForSingle.value[item.attributeCode.toLowerCase()] = val === '-' ? val : val
} }
if ( if (
item.attributeCode.toLowerCase() === 'ipitchangle1' || item.attributeCode.toLowerCase() === 'ipitchangle1' ||
@ -1103,25 +1084,25 @@ const createRealTimeData = async () => {
} else if (item.attributeType === 140) { } else if (item.attributeType === 140) {
dataFor140.push(showData) dataFor140.push(showData)
} }
if (item.subSystem === '变桨系统' || item.subSystem === '轮毂系统') { if (item.subSystem === '变桨系统' || item.subSystem === '轮毂') {
if (item.attributeType === 138 || item.attributeType === 139) { if (item.attributeType === 138 || item.attributeType === 139) {
realDataForSub[0].type138.push(showData) realDataForSub[0].type138.push(showData)
} else if (item.attributeType === 140) { } else if (item.attributeType === 140) {
realDataForSub[0].type140.push(showData) realDataForSub[0].type140.push(showData)
} }
} else if (item.subSystem === '轴承系统' || item.subSystem === '传动链系统' || item.subSystem === '齿轮箱系统') { } else if (item.subSystem === '轴承' || item.subSystem === '传动链' || item.subSystem === '齿轮箱') {
if (item.attributeType === 138 || item.attributeType === 139) { if (item.attributeType === 138 || item.attributeType === 139) {
realDataForSub[1].type138.push(showData) realDataForSub[1].type138.push(showData)
} else if (item.attributeType === 140) { } else if (item.attributeType === 140) {
realDataForSub[1].type140.push(showData) realDataForSub[1].type140.push(showData)
} }
} else if (item.subSystem === '发电机系统') { } else if (item.subSystem === '发电机') {
if (item.attributeType === 138 || item.attributeType === 139) { if (item.attributeType === 138 || item.attributeType === 139) {
realDataForSub[2].type138.push(showData) realDataForSub[2].type138.push(showData)
} else if (item.attributeType === 140) { } else if (item.attributeType === 140) {
realDataForSub[2].type140.push(showData) realDataForSub[2].type140.push(showData)
} }
} else if (item.subSystem === '机舱系统') { } else if (item.subSystem === '机舱') {
if (item.attributeType === 138 || item.attributeType === 139) { if (item.attributeType === 138 || item.attributeType === 139) {
realDataForSub[3].type138.push(showData) realDataForSub[3].type138.push(showData)
} else if (item.attributeType === 140) { } else if (item.attributeType === 140) {
@ -1133,7 +1114,7 @@ const createRealTimeData = async () => {
} else if (item.attributeType === 140) { } else if (item.attributeType === 140) {
realDataForSub[4].type140.push(showData) realDataForSub[4].type140.push(showData)
} }
} else if (item.subSystem === '环境系统' || item.subSystem === '气象系统') { } else if (item.subSystem === '环境' || item.subSystem === '气象') {
if (item.attributeType === 138 || item.attributeType === 139) { if (item.attributeType === 138 || item.attributeType === 139) {
realDataForSub[5].type138.push(showData) realDataForSub[5].type138.push(showData)
} else if (item.attributeType === 140) { } else if (item.attributeType === 140) {
@ -1208,31 +1189,14 @@ const openSubSystem = (type: number) => {
visible.value = true visible.value = true
} }
onMounted(() => { const trendChartType = ref<'day' | 'month'>('day')
inittrendChart('日', '5') const tabhandleClick = () => {
initpowerChart() state.charts.trendChart.clear()
createScroll() nextTick(() => {
initChart() console.log(trendChartType.value)
initfrequencyChart()
useEventListener(window, 'resize', echartsResize) inittrendChart(trendChartType.value)
autoUpdate()
}) })
onBeforeMount(() => {
for (const key in state.charts) {
state.charts[key].dispose()
}
})
const activeName = ref('first')
const tabhandleClick = (tabName) => {
setTimeout(() => {
echartsResize()
}, 10)
debugger
if (tabName.props.label == '日') {
inittrendChart('日', '5')
} else if (tabName.props.label == '月') {
inittrendChart('月', '6')
}
} }
const overviewSlotData = reactive<{ visible: boolean; type: '138' | '140'; type138: any[]; type140: any[] }>({ const overviewSlotData = reactive<{ visible: boolean; type: '138' | '140'; type138: any[]; type140: any[] }>({
@ -1252,6 +1216,7 @@ const autoUpdate = () => {
} }
const getChartData = () => { const getChartData = () => {
return new Promise((resolve) => {
const data = { const data = {
startTime: new Date(new Date().toLocaleDateString()).getTime(), startTime: new Date(new Date().toLocaleDateString()).getTime(),
endTime: Date.now(), endTime: Date.now(),
@ -1261,15 +1226,57 @@ const getChartData = () => {
attributes: ['iGenPower', 'iTheoreticalPower', 'iWindSpeed'], attributes: ['iGenPower', 'iTheoreticalPower', 'iWindSpeed'],
}, },
], ],
interval: '1min', interval: '5m',
} }
getRealValueRangeReq(data).then((res) => { getRealValueRangeReq(data).then((res) => {
console.log(res) console.log(res)
if (res.success) {
const data = res.data[route.query.irn as string]
const rangeKeys = Object.keys(data)
const times: any = {}
const val: any = {}
rangeKeys.forEach((key) => {
times[key] = []
val[key] = []
data[key].times.forEach((item: number, index: number) => {
times[key].push(dayjs(item).format('YYYY-MM-DD HH:mm:ss'))
})
data[key].values.forEach((item: number) => {
val[key].push(item)
})
})
powerChartData.time = times
powerChartData.values = val
resolve(true)
}
})
}) })
} }
// getChartData()
onMounted(() => {
inittrendChart()
getChartData().then(() => {
initpowerChart()
})
createScroll()
initTemperatureChart()
initFrequencyChart()
useEventListener(window, 'resize', echartsResize)
autoUpdate()
})
// onBeforeMount(() => {
// const chartKeys = Object.keys(state.charts) as Array<keyof typeof state.charts>
// chartKeys.forEach((key) => {
// state.charts[key].dispose()
// })
// })
onUnmounted(() => { onUnmounted(() => {
autoUpdateTimer && clearInterval(autoUpdateTimer) autoUpdateTimer && clearInterval(autoUpdateTimer)
const chartKeys = Object.keys(state.charts) as Array<keyof typeof state.charts>
chartKeys.forEach((key) => {
state.charts[key].dispose()
})
}) })
</script> </script>
@ -1407,7 +1414,7 @@ onUnmounted(() => {
.el-button { .el-button {
width: 80px; width: 80px;
height: 40px; height: 40px;
background: #0064aa; // background: rgb(0,100,170);
border-radius: 6px; border-radius: 6px;
color: #ffffff; color: #ffffff;
border: none; border: none;

View File

@ -21,7 +21,7 @@
background background
:pager-count="7" :pager-count="7"
layout="prev, pager, next, jumper,sizes,total" layout="prev, pager, next, jumper,sizes,total"
@change="getcurrentPage" @size-change="sizeChangePage"
></el-pagination> ></el-pagination>
</div> </div>
</div> </div>
@ -49,7 +49,9 @@ const pageSetting = reactive({
pageSizes: [20, 50, 100], pageSizes: [20, 50, 100],
}) })
const getcurrentPage = () => {} const sizeChangePage = () => {
pageSetting.current = 1
}
watch( watch(
() => props.type, () => props.type,

View File

@ -128,8 +128,8 @@ import { useI18n } from 'vue-i18n'
import { getAirBlowerListReq, getBelongLineListReq, runAirBlowerReq } from '/@/api/backend/airBlower/request' import { getAirBlowerListReq, getBelongLineListReq, runAirBlowerReq } from '/@/api/backend/airBlower/request'
import { ElMessage, TableInstance } from 'element-plus' import { ElMessage, TableInstance } from 'element-plus'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
import { getRealTimeState } from './utils'
const router = useRouter() const router = useRouter()
const route = useRoute()
const { t } = useI18n() const { t } = useI18n()
@ -188,6 +188,10 @@ const airBlowerSelectOptions = reactive<{ [K in SelectTypeKeyUnionType]: { label
label: '电网故障停机', label: '电网故障停机',
value: 1111, value: 1111,
}, },
{
label: '安全链停机',
value: 1112,
},
], ],
belongLine: [], belongLine: [],
}) })
@ -198,13 +202,15 @@ const selectAirBlower = (type: SelectTypeKeyUnionType) => {
return return
} else if (airBlowerSelect.belongLine !== '全部' && airBlowerSelect.iturbineoperationmode !== 987654321) { } else if (airBlowerSelect.belongLine !== '全部' && airBlowerSelect.iturbineoperationmode !== 987654321) {
if (type === 'iturbineoperationmode' && airBlowerSelect.iturbineoperationmode === 2) { if (type === 'iturbineoperationmode' && airBlowerSelect.iturbineoperationmode === 2) {
const type1 = tableData.value.filter((item) => item.iturbineoperationmode === 1) const type1 = originTableData.value.filter((item) => item.iturbineoperationmode === 1)
const type6 = tableData.value.filter((item) => item.iturbineoperationmode === 6) const type6 = originTableData.value.filter((item) => item.iturbineoperationmode === 6)
const type2 = tableData.value.filter((item) => item.iturbineoperationmode === 2) const type2 = originTableData.value.filter((item) => item.iturbineoperationmode === 2)
tableData.value = [...type1, ...type6, ...type2] const typeAll = [...type1, ...type6, ...type2]
tableData.value = typeAll.filter((item) => item.belongLine === airBlowerSelect.belongLine)
return return
} }
tableData.value = tableData.value.filter((item) => item[type] === airBlowerSelect[type]) const resData = originTableData.value.filter((item) => item.iturbineoperationmode === airBlowerSelect.iturbineoperationmode)
tableData.value = resData.filter((item) => item.belongLine === airBlowerSelect.belongLine)
return return
} else { } else {
if (type === 'belongLine' && airBlowerSelect.belongLine === '全部') { if (type === 'belongLine' && airBlowerSelect.belongLine === '全部') {
@ -329,22 +335,6 @@ const tableColumn: TableColumnType[] = [
}, },
] ]
const getRealTimeState = (data: any) => {
if (data.attributeMap.iturbineoperationmode) {
if (data.attributeMap.iturbineoperationmode > 1 && data.attributeMap.iturbineoperationmode < 6) {
return 2
}
if (data.attributeMap.iturbineoperationmode === 21) {
return 20
}
return data.attributeMap.iturbineoperationmode
} else if (data.attributeMap.iyplevel === 10) {
return 1110
} else if (data.attributeMap.gridlostdetected === 1) {
return 1111
}
}
const tableRef = ref<TableInstance>() const tableRef = ref<TableInstance>()
const tableData = ref<TableDataObjType[]>([]) const tableData = ref<TableDataObjType[]>([])
const originTableData = ref<TableDataObjType[]>([]) const originTableData = ref<TableDataObjType[]>([])
@ -352,7 +342,7 @@ const getTableData = () => {
getAirBlowerListReq() getAirBlowerListReq()
.then((res) => { .then((res) => {
const data = res.data.map((item: any) => { const data = res.data.map((item: any) => {
const state = getRealTimeState(item) const state = getRealTimeState(item.attributeMap)
const ipitchangle = Math.min(item.attributeMap.ipitchangle1, item.attributeMap.ipitchangle2, item.attributeMap.ipitchangle3) const ipitchangle = Math.min(item.attributeMap.ipitchangle1, item.attributeMap.ipitchangle2, item.attributeMap.ipitchangle3)
const resVal: any = {} const resVal: any = {}
Object.keys(item.attributeMap).forEach((attrKey) => { Object.keys(item.attributeMap).forEach((attrKey) => {

View File

@ -0,0 +1,17 @@
export const getRealTimeState = (data: any) => {
if (data.iturbineoperationmode) {
if (data.iturbineoperationmode > 1 && data.iturbineoperationmode < 6) {
return 2
}
if (data.iturbineoperationmode === 21) {
return 20
}
return data.iturbineoperationmode
} else if (data.iyplevel === 10) {
return 1110
} else if (data.gridlostdetected === 1) {
return 1111
} else if (data.ibplevel === 200) {
return 1112
}
}