Files
admin-govern/src/views/govern/device/control/tabs/components/waveFormAnalysis.vue

185 lines
5.0 KiB
Vue
Raw Normal View History

2024-12-30 10:07:26 +08:00
<!-- 暂态事件-波形分析组件 -->
2024-07-23 17:28:31 +08:00
<template>
2024-09-27 10:27:33 +08:00
<div class="home">
<div class="home_header">
2024-12-17 20:57:07 +08:00
<!-- <el-form-item label="值类型选择">
2024-12-25 10:53:07 +08:00
<el-select @change="changeView" v-model.trim="value" placeholder="请选择值类型">
<el-option
v-for="(item, index) in options"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
2024-07-23 17:28:31 +08:00
</el-select>
2024-12-17 20:57:07 +08:00
</el-form-item> -->
2024-12-25 10:53:07 +08:00
<el-radio-group v-model.trim="theTypeOfValue" @change="changeView">
2024-12-17 20:57:07 +08:00
<el-radio-button label="一次值" :value="1" />
<el-radio-button label="二次值" :value="2" />
</el-radio-group>
2024-12-25 10:53:07 +08:00
<el-button @click="handleBack" :icon="Back">返回</el-button>
2024-07-23 17:28:31 +08:00
</div>
2024-12-25 10:53:07 +08:00
<el-tabs class="home_body" type="border-card" v-model.trim="activeName1" @tab-click="handleClick"
v-loading="loading">
2024-12-19 10:16:08 +08:00
<el-tab-pane label="瞬时波形" name="ssbx" :style="'height:' + bxecharts + ';overflow-y: scroll;'">
2024-12-17 20:57:07 +08:00
<shushiboxi v-if="isWp && wp && activeName == 'ssbx' && showBoxi" :value="value" :boxoList="boxoList"
2024-12-19 10:16:08 +08:00
:parentHeight="parentHeight" :wp="wp">
2024-12-17 20:57:07 +08:00
</shushiboxi>
2024-07-31 10:42:04 +08:00
</el-tab-pane>
<el-tab-pane label="RMS波形" name="rmsbx" :style="'height:' + bxecharts + ';overflow-y: scroll;'">
2024-12-17 20:57:07 +08:00
<rmsboxi v-if="isWp && wp && activeName == 'rmsbx' && showBoxi" :value="value" :boxoList="boxoList"
2024-12-19 10:16:08 +08:00
:parentHeight="parentHeight" :wp="wp">
2024-12-17 20:57:07 +08:00
</rmsboxi>
2024-07-31 10:42:04 +08:00
</el-tab-pane>
2024-07-23 17:28:31 +08:00
</el-tabs>
</div>
</template>
<script lang="ts" setup>
2024-09-27 10:27:33 +08:00
import { ref, onMounted, reactive, defineExpose, watch, defineEmits } from 'vue'
2024-07-23 17:28:31 +08:00
import { VxeGridProps, VxeGridPropTypes } from 'vxe-table'
import { defaultAttribute } from '@/components/table/defaultAttribute'
2024-07-31 10:42:04 +08:00
import shushiboxi from '@/components/echarts/shushiboxi.vue'
import rmsboxi from '@/components/echarts/rmsboxi.vue'
2024-07-23 17:28:31 +08:00
import MyEchart from '@/components/echarts/MyEchart.vue'
import { Platform, TrendCharts, DataLine, Back } from '@element-plus/icons-vue'
2024-07-31 10:42:04 +08:00
import { mainHeight } from '@/utils/layout'
const props = defineProps(['wp'])
2024-07-23 17:28:31 +08:00
const searchForm = ref({
type: 0
})
2024-09-27 10:27:33 +08:00
const emit = defineEmits(['handleHideCharts'])
2024-12-19 10:16:08 +08:00
const parentHeight = ref(0)
2024-12-25 10:53:07 +08:00
const loading = ref(false)
2024-07-23 17:28:31 +08:00
const tableList: any = ref([])
2024-07-31 10:42:04 +08:00
for (let i = 0; i < 300; i++) {
2024-07-23 17:28:31 +08:00
tableList.value.push({
name: i + 1,
value: Math.floor(Math.random() * 101)
})
}
interface RowVO {
[key: string]: any
}
//谐波电压含有率
const gridOptions = ref<VxeGridProps<RowVO>>({
border: true,
showOverflow: true,
showHeader: false,
columns: [],
data: [],
columnConfig: {
resizable: true
},
align: 'center'
})
gridOptions.value = { ...defaultAttribute, ...gridOptions.value }
const yAxisUnit: any = ref('')
const echartsData1: any = ref([]),
echartsData2: any = ref([]),
echartsData3: any = ref([]),
barCharts1 = ref(),
barCharts2 = ref(),
barCharts3 = ref()
2024-07-31 10:42:04 +08:00
const view = ref(true)
const view2 = ref(false)
const showBoxi = ref(true)
2024-12-25 10:53:07 +08:00
const activeName1 = ref('ssbx')
2024-07-31 10:42:04 +08:00
const activeName = ref('ssbx')
const wp = ref({})
2024-12-25 10:53:07 +08:00
const theTypeOfValue = ref(1)
2024-09-27 10:27:33 +08:00
const value = ref(1)
2024-12-25 10:53:07 +08:00
2024-09-27 10:27:33 +08:00
2024-08-01 10:55:08 +08:00
const isWp = ref(false)
const boxoList: any = ref([])
const getWpData = (val: any, list: any) => {
2024-07-31 10:42:04 +08:00
wp.value = val
2024-08-01 10:55:08 +08:00
isWp.value = true
boxoList.value = list
2024-12-19 10:16:08 +08:00
console.log(wp.value, val, 'ggggghhhh')
2024-07-31 10:42:04 +08:00
}
const changeView = () => {
2024-08-01 10:55:08 +08:00
showBoxi.value = false
2024-12-25 10:53:07 +08:00
loading.value = true
2024-08-01 10:55:08 +08:00
setTimeout(() => {
2024-12-25 10:53:07 +08:00
value.value = theTypeOfValue.value
2024-08-01 10:55:08 +08:00
showBoxi.value = true
2024-12-25 10:53:07 +08:00
}, 500)
setTimeout(() => {
loading.value = false
}, 1500)
2024-07-31 10:42:04 +08:00
}
2024-12-19 10:16:08 +08:00
const bxecharts: any = ref(mainHeight(190).height as any)
2024-07-23 17:28:31 +08:00
const handleClick = (tab: any, event: any) => {
2024-12-25 10:53:07 +08:00
loading.value = true
setTimeout(() => {
activeName.value = tab.paneName
}, 500)
setTimeout(() => {
loading.value = false
}, 1500)
2024-07-23 17:28:31 +08:00
}
2024-09-27 10:27:33 +08:00
const handleBack = () => {
emit('handleHideCharts')
}
2024-12-25 10:53:07 +08:00
const setHeight = (h: any, vh: any) => {
2024-12-30 10:07:26 +08:00
if (h != false) {
parentHeight.value = h
}
2024-12-25 10:53:07 +08:00
setTimeout(() => {
bxecharts.value = mainHeight(vh).height
}, 100)
2024-12-19 10:16:08 +08:00
}
2024-12-17 20:57:07 +08:00
onMounted(() => { })
2024-12-19 10:16:08 +08:00
defineExpose({ getWpData, setHeight })
2024-07-23 17:28:31 +08:00
</script>
<style lang="scss" scoped>
2024-12-19 10:16:08 +08:00
// .tab_info {
// width: 100%;
// height: calc(100vh - 450px);
2024-09-29 18:15:54 +08:00
2024-12-19 10:16:08 +08:00
// // overflow: auto;
// // padding-bottom: 20px;
// .charts {
// width: 100%;
// margin-top: 10px;
// height: calc(100vh - 450px);
// }
// }
2024-09-25 16:31:45 +08:00
2024-09-27 10:27:33 +08:00
.home {
2024-07-23 17:28:31 +08:00
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
2024-09-29 18:15:54 +08:00
2024-09-27 10:27:33 +08:00
.home_header {
2024-12-19 10:16:08 +08:00
2024-09-27 10:27:33 +08:00
height: 50px;
display: flex;
align-items: center;
2024-10-15 15:31:36 +08:00
justify-content: space-between;
2024-09-29 18:15:54 +08:00
2024-08-01 10:55:08 +08:00
.el-select {
width: 200px !important;
}
2024-07-23 17:28:31 +08:00
}
2024-09-29 18:15:54 +08:00
2024-09-27 10:27:33 +08:00
.home_body {
// margin-top: 20px;
2024-08-01 10:55:08 +08:00
flex: 1;
2024-07-23 17:28:31 +08:00
}
}
</style>