实时数据:测点选择子系统类型顺序调整,查询添加物模型
This commit is contained in:
parent
7cc5f90068
commit
f4131c40af
@ -184,7 +184,7 @@
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="selectPointVisible" title="选择测点" width="1000">
|
||||
<SelectPoint ref="selectPointDialogRef" :defaultAttr="defaultAttr" :visible="selectPointVisible"></SelectPoint>
|
||||
<SelectPoint ref="selectPointDialogRef" :defaultAttr="defaultAttr" :visible="selectPointVisible" :iot-model-id="selectPointModelId"></SelectPoint>
|
||||
<template #footer>
|
||||
<div class="selectPointDialogFooter">
|
||||
<el-button type="primary" @click="saveSelectPoint">保存</el-button>
|
||||
@ -197,6 +197,7 @@
|
||||
ref="realDataChartRef"
|
||||
:visible="realDataLineChartVisible"
|
||||
:id="clickRow!.irn"
|
||||
:iot-model-id="selectPointModelId"
|
||||
@clearChart="() => (linePause = false)"
|
||||
></RealDataChart>
|
||||
<template #header>
|
||||
@ -695,6 +696,9 @@ const defaultAttr = computed(() => {
|
||||
}
|
||||
})
|
||||
})
|
||||
const selectPointModelId = computed(()=>{
|
||||
return tableData.value[0]?.iotModelId ?? ''
|
||||
})
|
||||
const openMeasure = () => {
|
||||
selectPointVisible.value = true
|
||||
}
|
||||
|
@ -33,7 +33,12 @@
|
||||
</el-row>
|
||||
</div>
|
||||
<el-dialog v-model="selectPointVisible" title="选择测点" width="1000">
|
||||
<SelectPoint ref="selectPointRef" :visible="selectPointVisible" :default-attr="selectPointAttr"></SelectPoint>
|
||||
<SelectPoint
|
||||
ref="selectPointRef"
|
||||
:visible="selectPointVisible"
|
||||
:default-attr="selectPointAttr"
|
||||
:iot-model-id="props.iotModelId"
|
||||
></SelectPoint>
|
||||
<template #footer>
|
||||
<div class="selectPointDialogFooter">
|
||||
<el-button type="primary" @click="saveSelectPoint">保存</el-button>
|
||||
@ -51,9 +56,10 @@ import { getRealValueListReq } from '/@/api/backend/deviceModel/request'
|
||||
import { dayjs, ElMessage } from 'element-plus'
|
||||
import { getCutDecimalsValue } from './utils'
|
||||
const emits = defineEmits(['clearChart'])
|
||||
const props = withDefaults(defineProps<{ id: string; visible: boolean }>(), {
|
||||
const props = withDefaults(defineProps<{ id: string; visible: boolean; iotModelId: string }>(), {
|
||||
id: '',
|
||||
visible: false,
|
||||
iotModelId: '',
|
||||
})
|
||||
const showTimeInterval = ref(300)
|
||||
//#region
|
||||
@ -204,7 +210,7 @@ const createChartData = (data: { [k: string]: number }, time: string) => {
|
||||
fillData.push(curVal)
|
||||
return {
|
||||
id: item,
|
||||
name: info.name +' '+ (info?.unit ?? ''),
|
||||
name: info.name + ' ' + (info?.unit ?? ''),
|
||||
type: 'line',
|
||||
barWidth: 20,
|
||||
itemStyle: {
|
||||
@ -226,16 +232,16 @@ const createChart = () => {
|
||||
if (chartInstance && realDataXAxis.length > 1) {
|
||||
const nameMap: any = {}
|
||||
realDataSeries.forEach((item: any) => {
|
||||
const yAxisName = item.name.split(' ')[1]
|
||||
if (nameMap[yAxisName] || nameMap[yAxisName]===0) {
|
||||
const yAxisName = item.name.split(' ')[1]
|
||||
if (nameMap[yAxisName] || nameMap[yAxisName] === 0) {
|
||||
item.yAxisIndex = nameMap[yAxisName]
|
||||
} else {
|
||||
const len = Object.keys(nameMap).length
|
||||
item.yAxisIndex = len
|
||||
nameMap[yAxisName] = len
|
||||
nameMap[yAxisName] = len
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const nameMapKeys = Object.keys(nameMap)
|
||||
if (realDataSeries.length >= 4 && nameMapKeys.length === 4) {
|
||||
selectPointNum.value = realDataSeries.length
|
||||
|
@ -88,11 +88,13 @@ import { Top, Bottom, Close } from '@element-plus/icons-vue'
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
defaultAttr: { attributeCode: string; attributeName: string }[]
|
||||
visible: boolean
|
||||
visible: boolean,
|
||||
iotModelId:string
|
||||
}>(),
|
||||
{
|
||||
defaultAttr: () => [],
|
||||
visible: false,
|
||||
iotModelId:''
|
||||
}
|
||||
)
|
||||
|
||||
@ -109,16 +111,16 @@ const subSystemVal = ref('')
|
||||
const subSystemList = ref()
|
||||
|
||||
const getAllSubSystem = () => {
|
||||
getAllSubSystemReq().then((res) => {
|
||||
getAllSubSystemReq({iotModelId:props.iotModelId}).then((res) => {
|
||||
const data = res.data
|
||||
.filter((item: any) => item)
|
||||
.map((item:any) => {
|
||||
.map((item: any) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
}
|
||||
})
|
||||
subSystemList.value = [...data, { label: '全部', value: ' ' }]
|
||||
subSystemList.value = [{ label: '全部', value: ' ' }, ...data]
|
||||
})
|
||||
}
|
||||
|
||||
@ -195,11 +197,11 @@ const getTableData = (customData = {}) => {
|
||||
inputVal[searchType.value] = searchInfo.value
|
||||
|
||||
getModelAttributeListReq({
|
||||
iotModelId: '',
|
||||
iotModelId: props.iotModelId,
|
||||
// attributeType: radioActiveName.value,
|
||||
pageNum: pageSetting.current,
|
||||
pageSize: pageSetting.pageSize,
|
||||
subSystem: (!subSystemVal.value || subSystemVal.value === ' ') ? null : subSystemVal.value,
|
||||
subSystem: !subSystemVal.value || subSystemVal.value === ' ' ? null : subSystemVal.value,
|
||||
...inputVal,
|
||||
...customData,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user