联调修改
This commit is contained in:
@@ -30,6 +30,7 @@ import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import OverLimitDetails from '@/components/cockpit/overLimitStatistics/components/overLimitDetails.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { totalLimitStatisticsData } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
@@ -45,6 +46,8 @@ const headerHeight = ref(57)
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const echartList = ref({})
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
@@ -67,46 +70,98 @@ const fullscreen = computed(() => {
|
||||
return false
|
||||
}
|
||||
})
|
||||
const echartList = ref({
|
||||
title: {
|
||||
text: '指标越限占比'
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
// name: '(区域)',
|
||||
data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
|
||||
},
|
||||
const initEcharts = () => {
|
||||
totalLimitStatisticsData({
|
||||
searchBeginTime: tableStore.table.params.searchBeginTime,
|
||||
searchEndTime: tableStore.table.params.searchEndTime
|
||||
}).then((res: any) => {
|
||||
const dataArray = [res.data.flicker, res.data.uharm, res.data.iharm, res.data.voltageDev, res.data.ubalance]
|
||||
echartList.value = {
|
||||
title: {
|
||||
text: '指标越限占比'
|
||||
},
|
||||
|
||||
yAxis: {
|
||||
name: '%', // 给X轴加单位
|
||||
interval: 20
|
||||
},
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
// name: '暂降次数',
|
||||
type: 'bar',
|
||||
name: '越限占比',
|
||||
data: [0, 45, 22, 0, 70],
|
||||
barMaxWidth: 30
|
||||
xAxis: {
|
||||
// name: '(区域)',
|
||||
data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
|
||||
},
|
||||
|
||||
// label: {
|
||||
// show: true,
|
||||
// position: 'top',
|
||||
// textStyle: {
|
||||
// //数值样式
|
||||
// color: '#000'
|
||||
// },
|
||||
// fontSize: 12
|
||||
// }
|
||||
yAxis: {
|
||||
name: '%', // 给X轴加单位
|
||||
interval: 20
|
||||
},
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
// name: '暂降次数',
|
||||
type: 'bar',
|
||||
name: '越限占比',
|
||||
data: dataArray,
|
||||
barMaxWidth: 30
|
||||
|
||||
// label: {
|
||||
// show: true,
|
||||
// position: 'top',
|
||||
// textStyle: {
|
||||
// //数值样式
|
||||
// color: '#000'
|
||||
// },
|
||||
// fontSize: 12
|
||||
// }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// echartList.value.options.series[0].data = dataArray
|
||||
})
|
||||
}
|
||||
|
||||
// const echartList: any = ref({
|
||||
// title: {
|
||||
// text: '指标越限占比'
|
||||
// },
|
||||
|
||||
// xAxis: {
|
||||
// // name: '(区域)',
|
||||
// data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
|
||||
// },
|
||||
|
||||
// yAxis: {
|
||||
// name: '%', // 给X轴加单位
|
||||
// interval: 20
|
||||
// },
|
||||
// grid: {
|
||||
// left: '10px',
|
||||
// right: '20px'
|
||||
// },
|
||||
// options: {
|
||||
// series: [
|
||||
// {
|
||||
// // name: '暂降次数',
|
||||
// type: 'bar',
|
||||
// name: '越限占比',
|
||||
// data: [],
|
||||
// barMaxWidth: 30
|
||||
|
||||
// // label: {
|
||||
// // show: true,
|
||||
// // position: 'top',
|
||||
// // textStyle: {
|
||||
// // //数值样式
|
||||
// // color: '#000'
|
||||
// // },
|
||||
// // fontSize: 12
|
||||
// // }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// })
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/harmonic-boot/totalLimitStatistics/list',
|
||||
@@ -192,9 +247,9 @@ const tableStore: any = new TableStore({
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
@@ -219,17 +274,20 @@ const cellClickEvent = ({ row, column }: any) => {
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
initEcharts()
|
||||
})
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
initEcharts()
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
initEcharts()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
|
||||
Reference in New Issue
Block a user