-
测点
-
|
+
+ 测点
+ |
+
编辑
|
@@ -383,8 +385,8 @@ const getNodeList = () => {
originTreeData = res.data!
clickTreeData.value = res.data![0]
nextTick(() => {
- nodeTreeRef.value?.setCurrentKey(route.query?.treeKey as string ?? res.data![0].id)
- getLinkData(route.query?.treeKey as string ?? res.data![0].id!)
+ nodeTreeRef.value?.setCurrentKey((route.query?.treeKey as string) ?? res.data![0].id)
+ getLinkData((route.query?.treeKey as string) ?? res.data![0].id!)
})
} else {
ElMessage.error(res.msg ?? '查询失败')
@@ -504,7 +506,7 @@ const paginationOptions = reactive({
pageSizes: [20, 50, 100],
})
-const changePage = ()=>{
+const changePage = () => {
getLinkData(clickTreeData.value!.id!)
}
@@ -534,7 +536,7 @@ const protocolList = [
{ label: 'MODBUSTCP从 *', value: 17 },
{ label: 'MODBUS', value: 80 },
{ label: 'ADS', value: 81 },
-
+ { label: '故障日志', value: 79 },
]
const protocolPartVisible = ref(false)
@@ -566,7 +568,7 @@ const openlinkPoint = (data: linkType) => {
protocol: data.protocol,
id: data.id,
prevPath: route.path,
- treeKey:clickTreeData.value?.id
+ treeKey: clickTreeData.value?.id,
},
})
}
diff --git a/ui/dasadmin/src/views/backend/node/protocol.vue b/ui/dasadmin/src/views/backend/node/protocol.vue
index 6f9b3be1..a9423e26 100644
--- a/ui/dasadmin/src/views/backend/node/protocol.vue
+++ b/ui/dasadmin/src/views/backend/node/protocol.vue
@@ -1126,6 +1126,59 @@ const formColumnList: formColumnType[] = [
otherOption: [],
},
},
+ {
+ protocol: 79,
+ label: '故障日志',
+ cardTitle:['参数设置'],
+ params: {
+ netWorkOption: [
+ {
+ key: 'rootDir',
+ data: {
+ label: 'FTP路径',
+ type: 'input',
+ value: '',
+ singleRow: true,
+ },
+ },
+ {
+ key: 'ftpUser',
+ data: {
+ label: 'FTP账号',
+ type: 'input',
+ value: '',
+ },
+ },
+ {
+ key: 'ftpPassword',
+ data: {
+ label: 'FTP密码',
+ type: 'password',
+ value: '',
+ },
+ },
+ {
+ key: 'ftpHost',
+ data: {
+ label: 'FTP地址',
+ type: 'input',
+ value: '',
+ },
+ },
+ {
+ key: 'deviceCode',
+ data: {
+ label: '风机编码',
+ type: 'input',
+ value: '',
+ },
+ },
+ ],
+ timeOutOption: [],
+ otherOption: [],
+ },
+
+ },
]
const currentFormColumn = computed(() => {
const data = formColumnList.find((item) => item.protocol === props.protocol)!
diff --git a/ui/dasadmin/src/views/backend/node/type.ts b/ui/dasadmin/src/views/backend/node/type.ts
index 0fdeb6c8..786b92c7 100644
--- a/ui/dasadmin/src/views/backend/node/type.ts
+++ b/ui/dasadmin/src/views/backend/node/type.ts
@@ -110,6 +110,8 @@ export type otherOptionType = {
parity?: number
stop?: number
timeout?: number
+ ftpHost?: string | number
+ deviceCode?: string | number
}
export type protocolFormType = netWorkOptionType & timeOutOptionType & otherOptionType
@@ -130,7 +132,7 @@ type paramsType = {
export type formColumnType = {
protocol: number
label: string
- cardTitle: ['网络设置', '超时设置']
+ cardTitle: ['网络设置', '超时设置'] | ['参数设置']
params: {
netWorkOption: paramsType[]
timeOutOption: paramsType[]
diff --git a/ui/dasadmin/src/views/backend/statAnalysis/powerCurveAnalysis.vue b/ui/dasadmin/src/views/backend/statAnalysis/powerCurveAnalysis.vue
index 7f7709cb..3c2fdfe5 100644
--- a/ui/dasadmin/src/views/backend/statAnalysis/powerCurveAnalysis.vue
+++ b/ui/dasadmin/src/views/backend/statAnalysis/powerCurveAnalysis.vue
@@ -8,6 +8,12 @@
+
+ 风速来源
+
+
+
+
{{ t('statAnalysis.search') }}
@@ -29,17 +35,7 @@
:shortcuts="shortcuts"
/>
-
- 风速来源
-
-
-
-
+
{{ t('statAnalysis.madeinfatory') }}
+
+ 显示曲线
+
+
@@ -75,7 +75,8 @@ import * as echarts from 'echarts'
import { getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
const { t } = useI18n()
-
+const AvgWindSpeedSwitch = ref(false)
+const chartType = ref('scatter') // 默认散点图
const statAnalysisFatory = ref('')
const statAnalysisFatoryList: any = ref([])
const statAnalysisSpeedSource = ref('AvgWindSpeed_10min')
@@ -88,6 +89,28 @@ const statAnalysisSelectOptions: any = reactive({
deviceId: [],
})
+const changeUpdateAvgWindSpeed = (val: any) => {
+ chartType.value = val ? 'line' : 'scatter'
+ updateChart()
+}
+
+const seriesDataInit = ref([])
+const calculateData: any = ref([])
+const updateChart = () => {
+ const series = {
+ type: chartType.value,
+ data: chartType.value === 'scatter' ? seriesDataInit.value : calculateData.value,
+ name: '实际值',
+ symbolSize: 5,
+ symbol: 'circle',
+ }
+ option.series[0] = series
+ if (!option.legend.data.includes('实际值')) {
+ option.legend.data.push('实际值')
+ }
+ chart.value.setOption(option)
+}
+
const getFormattedDate = (offset: number) => {
const date = new Date()
date.setDate(date.getDate() + offset)
@@ -330,19 +353,12 @@ const statAnalysisOperate = () => {
const seriesData = iGenPower.map((item: any, index: number) => {
return [getCutDecimalsValue(iWindSpeed[index], 2), getCutDecimalsValue(item, 2)]
})
- seriesData.sort((a: any, b: any) => {
- return a[0] - b[0]
- })
-
- const series = {
- type: 'scatter',
- data: seriesData,
- name: '实际值',
- symbolSize: 5,
- symbol: 'circle',
- }
- option.series.push(series)
- option.legend.data.push('实际值')
+ // seriesData.sort((a: any, b: any) => {
+ // return a[0] - b[0]
+ // })
+ seriesDataInit.value = seriesData
+ calculateData.value = calculateAverages(seriesDataInit.value)
+ updateChart()
}
}
if (resData1.length) {
@@ -360,9 +376,11 @@ const statAnalysisOperate = () => {
option.series.push(series)
option.legend.data.push('理论值')
}
+ console.log('🚀 ~ .then ~ option.legend.data:', option.legend.data)
chart.value.setOption(option)
})
.catch((error) => {
+ console.log(error)
isLoading.value = false
ElMessage.warning(error)
})
@@ -393,6 +411,34 @@ const statAnalysisExport = () => {
document.body.removeChild(a)
})
}
+
+const calculateAverages = (data: any) => {
+ let maxWindSpeed = Math.max(...data.map((item: any) => item[0]))
+ let interval = 5 // 每5m/s一个区间
+ let result = []
+
+ for (let windSpeed = 0; windSpeed <= maxWindSpeed; windSpeed += interval) {
+ let sumPower = 0
+ let count = 0
+
+ for (let i = 0; i < data.length; i++) {
+ let currentWindSpeed = data[i][0]
+ let currentPower = data[i][1]
+
+ if (currentWindSpeed >= windSpeed && currentWindSpeed < windSpeed + interval) {
+ sumPower += currentPower
+ count++
+ }
+ }
+
+ if (count > 0) {
+ let averagePower = sumPower / count
+ result.push([windSpeed + interval, averagePower])
+ }
+ }
+
+ return result
+}