Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
655361ccae
@ -341,6 +341,23 @@ const currentDayStatus = ref({
|
|||||||
})
|
})
|
||||||
const deviceCode = ref([])
|
const deviceCode = ref([])
|
||||||
const FanList = ref([])
|
const FanList = ref([])
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
const StatusListData = () => {
|
const StatusListData = () => {
|
||||||
getWindTurbineMatrixData().then((res) => {
|
getWindTurbineMatrixData().then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
@ -437,6 +454,7 @@ const StatusListData = () => {
|
|||||||
igenpower: item.attributeMap.igenpower,
|
igenpower: item.attributeMap.igenpower,
|
||||||
ikwhthisday: item.attributeMap.ikwhthisday,
|
ikwhthisday: item.attributeMap.ikwhthisday,
|
||||||
iturbineoperationmode: state,
|
iturbineoperationmode: state,
|
||||||
|
processedoperationmode: state,
|
||||||
locked: item.attributeMap.locked,
|
locked: item.attributeMap.locked,
|
||||||
irotorspeed: item.attributeMap.irotorspeed,
|
irotorspeed: item.attributeMap.irotorspeed,
|
||||||
},
|
},
|
||||||
|
@ -12,24 +12,24 @@
|
|||||||
<img :class="item.standard == true ? '' : 'wind-picture'" src="~assets/dashboard/biaogan.png" alt="" />
|
<img :class="item.standard == true ? '' : 'wind-picture'" src="~assets/dashboard/biaogan.png" alt="" />
|
||||||
</span>
|
</span>
|
||||||
<span class="fanlist-name"> {{ item.name }}</span>
|
<span class="fanlist-name"> {{ item.name }}</span>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 20" class="tag-panel is-primary" type="primary">并网</el-tag>
|
<el-tag v-if="item.attributeMap.processedoperationmode === 20" class="tag-panel is-primary" type="primary">并网</el-tag>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 11" class="tag-panel is-warning" type="primary">待机</el-tag>
|
<el-tag v-if="item.attributeMap.processedoperationmode === 11" class="tag-panel is-warning" type="primary">待机</el-tag>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 16" class="tag-panel is-success" type="primary">启动</el-tag>
|
<el-tag v-if="item.attributeMap.processedoperationmode === 16" class="tag-panel is-success" type="primary">启动</el-tag>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 10" class="tag-panel is-maintenance" type="primary"
|
<el-tag v-if="item.attributeMap.processedoperationmode === 10" class="tag-panel is-maintenance" type="primary"
|
||||||
>维护</el-tag
|
>维护</el-tag
|
||||||
>
|
>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 0" class="tag-panel is-offline" type="primary">离线</el-tag>
|
<el-tag v-if="item.attributeMap.processedoperationmode === 0" class="tag-panel is-offline" type="primary">离线</el-tag>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 8" class="tag-panel info" type="primary">限功率运行</el-tag>
|
<el-tag v-if="item.attributeMap.processedoperationmode === 8" class="tag-panel info" type="primary">限功率运行</el-tag>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 6" class="tag-panel is-danger" type="primary">正常停机</el-tag>
|
<el-tag v-if="item.attributeMap.processedoperationmode === 6" class="tag-panel is-danger" type="primary">正常停机</el-tag>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 1" class="tag-panel is-danger" type="primary"
|
<el-tag v-if="item.attributeMap.processedoperationmode === 1" class="tag-panel is-danger" type="primary"
|
||||||
>外部因素导致停机</el-tag
|
>外部因素导致停机</el-tag
|
||||||
>
|
>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 2" class="tag-panel is-danger" type="primary">停机</el-tag>
|
<el-tag v-if="item.attributeMap.processedoperationmode === 2" class="tag-panel is-danger" type="primary">停机</el-tag>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 1110" class="tag-panel is-info" type="primary">解缆状态</el-tag>
|
<el-tag v-if="item.attributeMap.processedoperationmode === 1110" class="tag-panel is-info" type="primary">解缆状态</el-tag>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 1111" class="tag-panel is-danger" type="primary"
|
<el-tag v-if="item.attributeMap.processedoperationmode === 1111" class="tag-panel is-danger" type="primary"
|
||||||
>电网故障停机</el-tag
|
>电网故障停机</el-tag
|
||||||
>
|
>
|
||||||
<el-tag v-if="item.attributeMap.iturbineoperationmode === 1112" class="tag-panel is-danger" type="primary"
|
<el-tag v-if="item.attributeMap.processedoperationmode === 1112" class="tag-panel is-danger" type="primary"
|
||||||
>安全链停机</el-tag
|
>安全链停机</el-tag
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@ -82,7 +82,7 @@
|
|||||||
class="control-btn"
|
class="control-btn"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="sendCommand('setTurbineFastStart')"
|
@click="sendCommand('setTurbineFastStart')"
|
||||||
v-if="realTimeData.iturbineoperationmode !== 16"
|
v-if="realTimeData.processedoperationmode !== 16"
|
||||||
>启动</el-button>
|
>启动</el-button>
|
||||||
<el-button @click="sendCommand('setTurbineStop')" v-else class="control-btn" type="primary">停机</el-button>
|
<el-button @click="sendCommand('setTurbineStop')" v-else class="control-btn" type="primary">停机</el-button>
|
||||||
<el-button @click="sendCommand('setTurbineResetStatusCode')" class="control-btn" type="primary">复位</el-button>
|
<el-button @click="sendCommand('setTurbineResetStatusCode')" class="control-btn" type="primary">复位</el-button>
|
||||||
@ -160,7 +160,7 @@ const contextMenuPos = ref({
|
|||||||
y: 0,
|
y: 0,
|
||||||
})
|
})
|
||||||
const realTimeData = ref<any>({
|
const realTimeData = ref<any>({
|
||||||
iturbineoperationmode: 1111,
|
processedoperationmode: 1111,
|
||||||
locked: 0,
|
locked: 0,
|
||||||
deviceId: '',
|
deviceId: '',
|
||||||
name:''
|
name:''
|
||||||
@ -168,7 +168,7 @@ const realTimeData = ref<any>({
|
|||||||
const windContextMenu = (event: any,curnodeData) => {
|
const windContextMenu = (event: any,curnodeData) => {
|
||||||
contextMenuPos.value.x = event.pageX
|
contextMenuPos.value.x = event.pageX
|
||||||
contextMenuPos.value.y = event.pageY
|
contextMenuPos.value.y = event.pageY
|
||||||
realTimeData.value.iturbineoperationmode=curnodeData.attributeMap.iturbineoperationmode
|
realTimeData.value.processedoperationmode=curnodeData.attributeMap.processedoperationmode
|
||||||
realTimeData.value.locked=curnodeData.attributeMap.locked
|
realTimeData.value.locked=curnodeData.attributeMap.locked
|
||||||
realTimeData.value.deviceId=curnodeData.irn
|
realTimeData.value.deviceId=curnodeData.irn
|
||||||
realTimeData.value.name=curnodeData.name
|
realTimeData.value.name=curnodeData.name
|
||||||
|
@ -29,12 +29,12 @@
|
|||||||
<span>日期</span>
|
<span>日期</span>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="searchData.date"
|
v-model="searchData.date"
|
||||||
type="monthrange"
|
type="daterange"
|
||||||
unlink-panels
|
unlink-panels
|
||||||
start-placeholder="开始时间"
|
start-placeholder="开始时间"
|
||||||
end-placeholder="结束时间"
|
end-placeholder="结束时间"
|
||||||
format="YYYY-MM"
|
format="YYYY-MM-DD"
|
||||||
date-format="YYYY/MM"
|
date-format="YYYY/MM/DD"
|
||||||
:shortcuts="shortcuts"
|
:shortcuts="shortcuts"
|
||||||
@change="getListForAirBlower"
|
@change="getListForAirBlower"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
@ -273,7 +273,7 @@ const getTreeDataList = () => {
|
|||||||
|
|
||||||
const searchData = reactive<{ fileName: ''; date: Date[] }>({
|
const searchData = reactive<{ fileName: ''; date: Date[] }>({
|
||||||
fileName: '',
|
fileName: '',
|
||||||
date: [dayjs().toDate(), dayjs().toDate()],
|
date: [dayjs().startOf('month').toDate(), dayjs().toDate()],
|
||||||
})
|
})
|
||||||
const shortcuts = [
|
const shortcuts = [
|
||||||
{
|
{
|
||||||
@ -287,15 +287,15 @@ const shortcuts = [
|
|||||||
{
|
{
|
||||||
text: '上月',
|
text: '上月',
|
||||||
value: () => {
|
value: () => {
|
||||||
const start = dayjs().subtract(1, 'month').toDate()
|
const start = dayjs().subtract(1, 'month').startOf('month').toDate()
|
||||||
const end = dayjs().subtract(1, 'month').toDate()
|
const end = dayjs().subtract(1, 'month').endOf('month').toDate()
|
||||||
return [start, end]
|
return [start, end]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '近三月',
|
text: '近三月',
|
||||||
value: () => {
|
value: () => {
|
||||||
const start = dayjs().subtract(2, 'month').toDate()
|
const start = dayjs().subtract(2, 'month').startOf('month').toDate()
|
||||||
const end = dayjs().toDate()
|
const end = dayjs().toDate()
|
||||||
return [start, end]
|
return [start, end]
|
||||||
},
|
},
|
||||||
@ -325,8 +325,8 @@ const changePageSetting = () => {}
|
|||||||
const getListForAirBlower = () => {
|
const getListForAirBlower = () => {
|
||||||
const data = {
|
const data = {
|
||||||
deviceCode: curTreeData.value.code,
|
deviceCode: curTreeData.value.code,
|
||||||
startTime: dayjs(searchData.date[0]).format('YYYY-MM'),
|
startTime: dayjs(searchData.date[0]).format('YYYY-MM-DD'),
|
||||||
endTime: dayjs(searchData.date[1]).format('YYYY-MM'),
|
endTime: dayjs(searchData.date[1]).format('YYYY-MM-DD'),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activeName.value === 'malFunction') {
|
if (activeName.value === 'malFunction') {
|
||||||
|
@ -99,8 +99,10 @@
|
|||||||
<el-table-column fixed="right" label="操作" min-width="80" align="center">
|
<el-table-column fixed="right" label="操作" min-width="80" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="tableOperate">
|
<div class="tableOperate">
|
||||||
<a @click="openlinkPoint(scope.row)">测点</a>
|
<template v-if="scope.row.protocol !== 79">
|
||||||
<a>|</a>
|
<a @click="openlinkPoint(scope.row)">测点</a>
|
||||||
|
<a>|</a>
|
||||||
|
</template>
|
||||||
<a @click="editLinkList(scope.row)">编辑</a>
|
<a @click="editLinkList(scope.row)">编辑</a>
|
||||||
<a>|</a>
|
<a>|</a>
|
||||||
<el-popconfirm title="确定删除么?" @confirm="delLinkList(scope.row)">
|
<el-popconfirm title="确定删除么?" @confirm="delLinkList(scope.row)">
|
||||||
@ -383,8 +385,8 @@ const getNodeList = () => {
|
|||||||
originTreeData = res.data!
|
originTreeData = res.data!
|
||||||
clickTreeData.value = res.data![0]
|
clickTreeData.value = res.data![0]
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
nodeTreeRef.value?.setCurrentKey(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!)
|
getLinkData((route.query?.treeKey as string) ?? res.data![0].id!)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg ?? '查询失败')
|
ElMessage.error(res.msg ?? '查询失败')
|
||||||
@ -504,7 +506,7 @@ const paginationOptions = reactive({
|
|||||||
pageSizes: [20, 50, 100],
|
pageSizes: [20, 50, 100],
|
||||||
})
|
})
|
||||||
|
|
||||||
const changePage = ()=>{
|
const changePage = () => {
|
||||||
getLinkData(clickTreeData.value!.id!)
|
getLinkData(clickTreeData.value!.id!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,7 +536,7 @@ const protocolList = [
|
|||||||
{ label: 'MODBUSTCP从 *', value: 17 },
|
{ label: 'MODBUSTCP从 *', value: 17 },
|
||||||
{ label: 'MODBUS', value: 80 },
|
{ label: 'MODBUS', value: 80 },
|
||||||
{ label: 'ADS', value: 81 },
|
{ label: 'ADS', value: 81 },
|
||||||
|
{ label: '故障日志', value: 79 },
|
||||||
]
|
]
|
||||||
|
|
||||||
const protocolPartVisible = ref(false)
|
const protocolPartVisible = ref(false)
|
||||||
@ -566,7 +568,7 @@ const openlinkPoint = (data: linkType) => {
|
|||||||
protocol: data.protocol,
|
protocol: data.protocol,
|
||||||
id: data.id,
|
id: data.id,
|
||||||
prevPath: route.path,
|
prevPath: route.path,
|
||||||
treeKey:clickTreeData.value?.id
|
treeKey: clickTreeData.value?.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1126,6 +1126,59 @@ const formColumnList: formColumnType[] = [
|
|||||||
otherOption: [],
|
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 currentFormColumn = computed(() => {
|
||||||
const data = formColumnList.find((item) => item.protocol === props.protocol)!
|
const data = formColumnList.find((item) => item.protocol === props.protocol)!
|
||||||
|
@ -110,6 +110,8 @@ export type otherOptionType = {
|
|||||||
parity?: number
|
parity?: number
|
||||||
stop?: number
|
stop?: number
|
||||||
timeout?: number
|
timeout?: number
|
||||||
|
ftpHost?: string | number
|
||||||
|
deviceCode?: string | number
|
||||||
}
|
}
|
||||||
export type protocolFormType = netWorkOptionType & timeOutOptionType & otherOptionType
|
export type protocolFormType = netWorkOptionType & timeOutOptionType & otherOptionType
|
||||||
|
|
||||||
@ -130,7 +132,7 @@ type paramsType = {
|
|||||||
export type formColumnType = {
|
export type formColumnType = {
|
||||||
protocol: number
|
protocol: number
|
||||||
label: string
|
label: string
|
||||||
cardTitle: ['网络设置', '超时设置']
|
cardTitle: ['网络设置', '超时设置'] | ['参数设置']
|
||||||
params: {
|
params: {
|
||||||
netWorkOption: paramsType[]
|
netWorkOption: paramsType[]
|
||||||
timeOutOption: paramsType[]
|
timeOutOption: paramsType[]
|
||||||
|
@ -8,6 +8,12 @@
|
|||||||
<el-option v-for="v in statAnalysisSelectOptions.deviceId" :key="v.value" :label="v.label" :value="v.value"></el-option>
|
<el-option v-for="v in statAnalysisSelectOptions.deviceId" :key="v.value" :label="v.label" :value="v.value"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="selectPart">
|
||||||
|
<span>风速来源</span>
|
||||||
|
<el-select v-model="statAnalysisSpeedSource" placeholder="请选择风速来源" class="statAnalysisSelect">
|
||||||
|
<el-option v-for="v in statAnalysisSelectOptions.speedSource" :key="v.value" :label="v.label" :value="v.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="topRight">
|
<div class="topRight">
|
||||||
<el-button type="primary" :loading="isLoading" @click="statAnalysisOperate()">{{ t('statAnalysis.search') }}</el-button>
|
<el-button type="primary" :loading="isLoading" @click="statAnalysisOperate()">{{ t('statAnalysis.search') }}</el-button>
|
||||||
@ -29,17 +35,7 @@
|
|||||||
:shortcuts="shortcuts"
|
:shortcuts="shortcuts"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="selectPart">
|
|
||||||
<span>风速来源</span>
|
|
||||||
<el-select v-model="statAnalysisSpeedSource" placeholder="请选择风速来源" class="statAnalysisSelect">
|
|
||||||
<el-option
|
|
||||||
v-for="v in statAnalysisSelectOptions.speedSource"
|
|
||||||
:key="v.value"
|
|
||||||
:label="v.label"
|
|
||||||
:value="v.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div class="selectPart">
|
<div class="selectPart">
|
||||||
<span>{{ t('statAnalysis.madeinfatory') }}</span>
|
<span>{{ t('statAnalysis.madeinfatory') }}</span>
|
||||||
<el-select
|
<el-select
|
||||||
@ -56,6 +52,10 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="selectPart">
|
||||||
|
<span> 显示曲线 </span>
|
||||||
|
<el-switch v-model="AvgWindSpeedSwitch" @change="changeUpdateAvgWindSpeed"></el-switch>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -75,7 +75,8 @@ import * as echarts from 'echarts'
|
|||||||
import { getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
|
import { getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
const AvgWindSpeedSwitch = ref(false)
|
||||||
|
const chartType = ref('scatter') // 默认散点图
|
||||||
const statAnalysisFatory = ref('')
|
const statAnalysisFatory = ref('')
|
||||||
const statAnalysisFatoryList: any = ref([])
|
const statAnalysisFatoryList: any = ref([])
|
||||||
const statAnalysisSpeedSource = ref('AvgWindSpeed_10min')
|
const statAnalysisSpeedSource = ref('AvgWindSpeed_10min')
|
||||||
@ -88,6 +89,28 @@ const statAnalysisSelectOptions: any = reactive({
|
|||||||
deviceId: [],
|
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 getFormattedDate = (offset: number) => {
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
date.setDate(date.getDate() + offset)
|
date.setDate(date.getDate() + offset)
|
||||||
@ -330,19 +353,12 @@ const statAnalysisOperate = () => {
|
|||||||
const seriesData = iGenPower.map((item: any, index: number) => {
|
const seriesData = iGenPower.map((item: any, index: number) => {
|
||||||
return [getCutDecimalsValue(iWindSpeed[index], 2), getCutDecimalsValue(item, 2)]
|
return [getCutDecimalsValue(iWindSpeed[index], 2), getCutDecimalsValue(item, 2)]
|
||||||
})
|
})
|
||||||
seriesData.sort((a: any, b: any) => {
|
// seriesData.sort((a: any, b: any) => {
|
||||||
return a[0] - b[0]
|
// return a[0] - b[0]
|
||||||
})
|
// })
|
||||||
|
seriesDataInit.value = seriesData
|
||||||
const series = {
|
calculateData.value = calculateAverages(seriesDataInit.value)
|
||||||
type: 'scatter',
|
updateChart()
|
||||||
data: seriesData,
|
|
||||||
name: '实际值',
|
|
||||||
symbolSize: 5,
|
|
||||||
symbol: 'circle',
|
|
||||||
}
|
|
||||||
option.series.push(series)
|
|
||||||
option.legend.data.push('实际值')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (resData1.length) {
|
if (resData1.length) {
|
||||||
@ -360,9 +376,11 @@ const statAnalysisOperate = () => {
|
|||||||
option.series.push(series)
|
option.series.push(series)
|
||||||
option.legend.data.push('理论值')
|
option.legend.data.push('理论值')
|
||||||
}
|
}
|
||||||
|
console.log('🚀 ~ .then ~ option.legend.data:', option.legend.data)
|
||||||
chart.value.setOption(option)
|
chart.value.setOption(option)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
console.log(error)
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
ElMessage.warning(error)
|
ElMessage.warning(error)
|
||||||
})
|
})
|
||||||
@ -393,6 +411,34 @@ const statAnalysisExport = () => {
|
|||||||
document.body.removeChild(a)
|
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
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.contain {
|
.contain {
|
||||||
|
Loading…
Reference in New Issue
Block a user