Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
39eacb4076
@ -8,43 +8,10 @@
|
||||
<el-checkbox-group v-model="checkList">
|
||||
<el-checkbox v-model:value=item.measPointCode v-model:label=item.measPointName />
|
||||
</el-checkbox-group>
|
||||
|
||||
</div>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="transferLeft">
|
||||
<el-main class="mainPart">
|
||||
<el-table class="tablePart"
|
||||
ref="RealtableRef"
|
||||
:data="modalTbleData"
|
||||
@selectionChange="selectTable"
|
||||
:row-key="getRowKey">
|
||||
<!– <el-table-column type="selection" width="55" :reserve-selection="true"/>–>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="porder" label="序号" width="60" />
|
||||
<el-table-column prop="attributeCode" sortable label="名称" />
|
||||
<el-table-column prop="attributeName" sortable label="描述" />
|
||||
</el-table>
|
||||
<div class="mainFooter" style="display: flex; justify-content: left">
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="currentPageSize"
|
||||
:total="pageTotal"
|
||||
:page-sizes="pagePagination"
|
||||
background
|
||||
:pager-count="7"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="prev, pager, next, jumper,sizes,total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</el-main>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>-->
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="sureBtn">保存</el-button>
|
||||
@ -96,6 +63,24 @@ const deviceData = ref(
|
||||
children: []
|
||||
}]
|
||||
)
|
||||
const attributesDefault:any = [
|
||||
'iTemp1GearOil_1sec',
|
||||
'iTempGearBearDE_1sec',
|
||||
'iTempGearBearNDE_1sec',
|
||||
'iTempGenStatorU_1sec',
|
||||
'iTempGenStatorV_1sec',
|
||||
'iTempGenStatorW_1sec',
|
||||
'iBlade1TempMotor_1sec',
|
||||
'iBlade2TempMotor_1sec',
|
||||
'iBlade3TempMotor_1sec',
|
||||
'iTempOutdoor_1sec',
|
||||
'iTempNacelle_1sec',
|
||||
'iTempCabinetNacelle_1sec',
|
||||
'iTempHub_1sec',
|
||||
'iTempTowerBase_1sec',
|
||||
'iTempCabinetTowerBase_1sec'
|
||||
]
|
||||
|
||||
const defaultExpandedKeys = ref([0]);
|
||||
const SelectdeviceId=ref()
|
||||
const equipTreeRef = ref()
|
||||
@ -105,15 +90,15 @@ const deviceQuery = (data: any) => {
|
||||
nextTick(() => {
|
||||
SelectdeviceId.value=res.data[0]?.id
|
||||
equipTreeRef.value?.setCurrentKey(deviceData.value[0].children[0].id!, true)
|
||||
getChartData({deviceId:SelectdeviceId.value,attributes:[]})
|
||||
getChartData({deviceId:res.data[0]?.id,attributes:attributesDefault})
|
||||
})
|
||||
})
|
||||
}
|
||||
const handleNodeClick = (data: any) => {
|
||||
debugger
|
||||
SelectdeviceId.value=data.id
|
||||
state.charts.temperatureChart.clear()
|
||||
getChartData({id:SelectdeviceId.value,attributes:[]})
|
||||
console.log(JSON.stringify({deviceId:SelectdeviceId.value,attributes:attributesDefault}))
|
||||
getChartData({deviceId:SelectdeviceId.value,attributes:attributesDefault})
|
||||
}
|
||||
|
||||
const state: {
|
||||
@ -135,7 +120,9 @@ const temperatureData:any ={
|
||||
limit1High: [],
|
||||
limit1Low: [],
|
||||
limit2High: [],
|
||||
limit2Low: []
|
||||
limit2Low: [],
|
||||
limit1Enable:[],
|
||||
limit2Enable:[]
|
||||
}
|
||||
const inittemperatureChar = () => {
|
||||
const temperatureChart = state.charts.temperatureChart ?? echarts.init(temperatureChartRef.value as unknown as HTMLElement)
|
||||
@ -147,7 +134,8 @@ const inittemperatureChar = () => {
|
||||
bottom: 10,
|
||||
left: 25,
|
||||
containLabel: true,
|
||||
borderColor:'transparent',
|
||||
borderColor:'#ffffff',
|
||||
borderWidth: 1,
|
||||
backgroundColor:'rgba(254,55,49,0.20)'
|
||||
},
|
||||
xAxis: {
|
||||
@ -182,6 +170,7 @@ const inittemperatureChar = () => {
|
||||
yAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
inverse: true,
|
||||
z: 10,
|
||||
axisLine: {
|
||||
show: true,
|
||||
@ -281,11 +270,6 @@ const inittemperatureChar = () => {
|
||||
state.charts.temperatureChart = temperatureChart
|
||||
}
|
||||
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(20)
|
||||
const pageTotal = ref(0)
|
||||
const pagePagination = ref([20, 50, 100])
|
||||
const modalTbleData=ref<any[]>([])
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
@ -309,44 +293,15 @@ const variableList = () =>{
|
||||
measPointCode: item.measPointCode
|
||||
}
|
||||
})
|
||||
// selectcheck.value=res.data.map((item) => {
|
||||
// return item.measPointCode
|
||||
// })
|
||||
checkList.value=attributesDefault
|
||||
/* checkList.value=res.data.map((item) => {
|
||||
return item.measPointCode
|
||||
})*/
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
const queryListData = reactive({
|
||||
pageSize: 20,
|
||||
pageNum: 1,
|
||||
iotModelId: '',
|
||||
attributeType: '138'
|
||||
})
|
||||
|
||||
|
||||
const modelAttributeList=(data: any) =>{
|
||||
getModelAttributeList(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
modalTbleData.value = res.rows
|
||||
pageTotal.value = res.total;
|
||||
|
||||
} else {
|
||||
ElMessage.error({
|
||||
message: res.msg,
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleSizeChange = (val: number) => {
|
||||
queryListData.pageSize = val
|
||||
modelAttributeList(queryListData)
|
||||
}
|
||||
const handleCurrentChange = (val: number) => {
|
||||
queryListData.pageNum = val
|
||||
modelAttributeList(queryListData)
|
||||
}
|
||||
const handleClose = (done: () => void) => {
|
||||
visible.value = false
|
||||
}
|
||||
@ -359,7 +314,7 @@ const sureBtn = () => {
|
||||
|
||||
let attributesCode:any[]=[]
|
||||
const getChartData = (data: any) => {
|
||||
//console.log(JSON.stringify(data))
|
||||
console.log(JSON.stringify(data))
|
||||
getTemperatureLimitByDeviceId(data).then((res) => {
|
||||
if (res.code=='200') {
|
||||
temperatureData.name=[]
|
||||
@ -368,18 +323,24 @@ const getChartData = (data: any) => {
|
||||
temperatureData.limit1Low=[]
|
||||
temperatureData.limit2High=[]
|
||||
temperatureData.limit2Low=[]
|
||||
temperatureData.limit1Enable=[]
|
||||
temperatureData.limit2Enable=[]
|
||||
attributesCode=[]
|
||||
res.data.forEach((item,index) => {
|
||||
temperatureData.name.push(item.measPointName)
|
||||
attributesCode.push(item.measPointCode)
|
||||
if(item.limit1Enable){
|
||||
temperatureData.limit1High.push(item.limit1High)
|
||||
temperatureData.limit1Low.push(item.limit1Low)
|
||||
}
|
||||
if(item.limit2Enable){
|
||||
temperatureData.limit2High.push(item.limit2High)
|
||||
temperatureData.limit2Low.push(item.limit2Low)
|
||||
}
|
||||
temperatureData.limit1High.push(item.limit1High)
|
||||
temperatureData.limit1Low.push(item.limit1Low)
|
||||
temperatureData.limit2High.push(item.limit2High)
|
||||
temperatureData.limit2Low.push(item.limit2Low)
|
||||
temperatureData.limit1Enable.push(item.limit1Enable)
|
||||
temperatureData.limit2Enable.push(item.limit2Enable)
|
||||
//if(item.limit1Enable){
|
||||
|
||||
//}
|
||||
//if(item.limit2Enable){
|
||||
|
||||
//}
|
||||
})
|
||||
console.log(JSON.stringify([{deviceId:SelectdeviceId.value,attributes:attributesCode}]))
|
||||
if(!data.attributes.length){
|
||||
@ -413,27 +374,34 @@ const getTemperaData = (data:any) => {
|
||||
const limit1Low = temperatureData.limit1Low
|
||||
const limit2High = temperatureData.limit2High
|
||||
const limit2Low = temperatureData.limit2Low
|
||||
const limit1Enable=temperatureData.limit1Enable
|
||||
const limit2Enable=temperatureData.limit2Enable
|
||||
inittemperatureChar()
|
||||
seriesStyle(values, limit1High, limit1Low, limit2High, limit2Low)
|
||||
seriesStyle(values, limit1High, limit1Low, limit2High, limit2Low,limit1Enable,limit2Enable)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const seriesStyle= (values, limit1High, limit1Low, limit2High, limit2Low) =>{
|
||||
const seriesStyle= (values, limit1High, limit1Low, limit2High, limit2Low,limit1Enable,limit2Enable) =>{
|
||||
const option = state.charts.temperatureChart.getOption();
|
||||
const series = option?.series?.[0];
|
||||
values.forEach((item,index) => {
|
||||
if (Number(item.value) > Number(limit1High[index]) || Number(item.value) < Number(limit1Low[index])) {
|
||||
//debugger
|
||||
item.itemStyle.color= 'red'
|
||||
series.data[index].itemStyle = { color: 'red' };
|
||||
} else if (Number(item.value) > Number(limit2High[index]) || Number(item.value) < Number(limit2Low[index])) {
|
||||
item.itemStyle.color= 'red'
|
||||
series.data[index].itemStyle = { color: 'red' };
|
||||
} else {
|
||||
item.itemStyle.color= '#0064AA'
|
||||
series.data[index].itemStyle = { color: '#0064AA' };
|
||||
}
|
||||
//if(limit1Enable[index]==true||limit2Enable[index]==true){
|
||||
if (Number(item.value) > Number(limit1High[index]) || Number(item.value) < Number(limit1Low[index])) {
|
||||
//debugger
|
||||
item.itemStyle.color= 'red'
|
||||
series.data[index].itemStyle = { color: 'red' };
|
||||
}
|
||||
/* else if (Number(item.value) > Number(limit2High[index]) || Number(item.value) < Number(limit2Low[index])) {
|
||||
item.itemStyle.color= 'red'
|
||||
series.data[index].itemStyle = { color: 'red' };
|
||||
} */
|
||||
else {
|
||||
item.itemStyle.color= '#0064AA'
|
||||
series.data[index].itemStyle = { color: '#0064AA' };
|
||||
}
|
||||
//}
|
||||
|
||||
})
|
||||
state.charts.temperatureChart.setOption(option);
|
||||
|
||||
@ -443,7 +411,7 @@ const autoUpdate = () => {
|
||||
if (!autoUpdateTimer) {
|
||||
autoUpdateTimer = setInterval(() => {
|
||||
if(!selectcheck.value.length){
|
||||
getChartData({deviceId:SelectdeviceId.value,attributes:[]})
|
||||
getChartData({deviceId:SelectdeviceId.value,attributes:attributesDefault})
|
||||
}else{
|
||||
getChartData({deviceId:SelectdeviceId.value,attributes:selectcheck.value})
|
||||
}
|
||||
@ -493,7 +461,7 @@ $paginationHeight: 32px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-left: 15px;
|
||||
width: 320px;
|
||||
width: 210px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user