This commit is contained in:
geting 2025-01-16 16:35:09 +08:00
parent 5b7dacc425
commit dcef9c818f
2 changed files with 32 additions and 5 deletions

View File

@ -121,6 +121,7 @@ import { DArrowRight, Plus, Delete, Close } from '@element-plus/icons-vue'
import MeasurementPage from './analysisAttributes.vue'
import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request'
import { getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
import { getParamList } from '/@/api/backend/SystemParam/request'
import * as echarts from 'echarts'
const { t } = useI18n()
@ -299,7 +300,17 @@ const statAnalysisSelectOptions: any = reactive({
const customName = reactive([statAnalysisSelect.attributes + '1'])
const chart: any = ref(null)
const curveColors = ref([])
onMounted(() => {
getParamList().then((res: any) => {
if (res.code == 200 && res.data) {
res.data.forEach((item: any) => {
if (item.paramName == 'curveColor') {
curveColors.value = item.paramValueJson
}
})
}
})
if (chartContainer.value) {
chart.value = markRaw(echarts.init(chartContainer.value))
}
@ -576,6 +587,9 @@ const historyDataReq = (promises: any) => {
data: yData.map((value: any) => ({
value: getCutDecimalsValue(value, 2),
})),
itemStyle: {
color: curveColors.value[index % curveColors.value.length],
},
smooth: true,
symbolSize: 5,
symbol: 'circle',

View File

@ -187,7 +187,7 @@ import { DArrowRight, Plus, Crop, Notebook, Delete, Close } from '@element-plus/
import * as echarts from 'echarts'
import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request'
import { getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
import { stat } from 'fs'
import { getParamList } from '/@/api/backend/SystemParam/request'
const { t } = useI18n()
const highSpeed = ref(false)
const statAnalysisInterval = ref('1h')
@ -270,13 +270,21 @@ const option: any = {
},
],
}
const curveColors = ref([])
const chart: any = ref(null)
onMounted(() => {
if (chartContainer.value) {
chart.value = markRaw(echarts.init(chartContainer.value))
}
getParamList().then((res: any) => {
if (res.code == 200 && res.data) {
res.data.forEach((item: any) => {
if (item.paramName == 'curveColor') {
curveColors.value = item.paramValueJson
}
})
}
})
queryWindTurbines().then((res) => {
submitParams.selectedLeft = [tableDataLeft.value[0]]
getCompleteData().then((attrRes: any) => {
@ -578,13 +586,13 @@ const handleRes = (res: any, selectAllDevices: any) => {
lowSpeedExoprtData.value = []
const deviceIdKeys = Object.keys(resData)
if (deviceIdKeys.length) {
selectAllDevices.forEach((item: any) => {
selectAllDevices.forEach((item: any, selectAllDevicesIndex: number) => {
if (!resData[item.irn]) {
ElMessage.info(`${item.name}没有数据`)
return
}
const deviceName = item.name
Object.keys(resData[item.irn]).forEach((val) => {
Object.keys(resData[item.irn]).forEach((val, irnIndex: number) => {
const attRow = submitParams.multipleSelection.filter((value: any) => value.attributeCode === val)
const attName = attRow[0]['attributeName']
const unit = attRow[0]['unit']
@ -627,6 +635,8 @@ const handleRes = (res: any, selectAllDevices: any) => {
ElMessage.info(`${deviceName + attName}数据为空`)
return
}
console.log(selectAllDevicesIndex)
console.log(irnIndex)
const seriesData = {
name: deviceName + attName,
type: 'line',
@ -634,6 +644,9 @@ const handleRes = (res: any, selectAllDevices: any) => {
value: getCutDecimalsValue(value, 2),
unit: unit, //
})),
itemStyle: {
color: curveColors.value[((selectAllDevicesIndex + 1) * (irnIndex + 1) - 1) % curveColors.value.length],
},
smooth: true,
symbolSize: 5,
symbol: 'circle',