实时数据:测点选择子系统类型顺序调整,查询添加物模型

This commit is contained in:
高云鹏 2024-12-18 10:43:55 +08:00
parent 7cc5f90068
commit f4131c40af
3 changed files with 26 additions and 14 deletions

View File

@ -184,7 +184,7 @@
</el-row> </el-row>
</el-dialog> </el-dialog>
<el-dialog v-model="selectPointVisible" title="选择测点" width="1000"> <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> <template #footer>
<div class="selectPointDialogFooter"> <div class="selectPointDialogFooter">
<el-button type="primary" @click="saveSelectPoint">保存</el-button> <el-button type="primary" @click="saveSelectPoint">保存</el-button>
@ -197,6 +197,7 @@
ref="realDataChartRef" ref="realDataChartRef"
:visible="realDataLineChartVisible" :visible="realDataLineChartVisible"
:id="clickRow!.irn" :id="clickRow!.irn"
:iot-model-id="selectPointModelId"
@clearChart="() => (linePause = false)" @clearChart="() => (linePause = false)"
></RealDataChart> ></RealDataChart>
<template #header> <template #header>
@ -695,6 +696,9 @@ const defaultAttr = computed(() => {
} }
}) })
}) })
const selectPointModelId = computed(()=>{
return tableData.value[0]?.iotModelId ?? ''
})
const openMeasure = () => { const openMeasure = () => {
selectPointVisible.value = true selectPointVisible.value = true
} }

View File

@ -33,7 +33,12 @@
</el-row> </el-row>
</div> </div>
<el-dialog v-model="selectPointVisible" title="选择测点" width="1000"> <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> <template #footer>
<div class="selectPointDialogFooter"> <div class="selectPointDialogFooter">
<el-button type="primary" @click="saveSelectPoint">保存</el-button> <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 { dayjs, ElMessage } from 'element-plus'
import { getCutDecimalsValue } from './utils' import { getCutDecimalsValue } from './utils'
const emits = defineEmits(['clearChart']) const emits = defineEmits(['clearChart'])
const props = withDefaults(defineProps<{ id: string; visible: boolean }>(), { const props = withDefaults(defineProps<{ id: string; visible: boolean; iotModelId: string }>(), {
id: '', id: '',
visible: false, visible: false,
iotModelId: '',
}) })
const showTimeInterval = ref(300) const showTimeInterval = ref(300)
//#region //#region

View File

@ -88,11 +88,13 @@ import { Top, Bottom, Close } from '@element-plus/icons-vue'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
defaultAttr: { attributeCode: string; attributeName: string }[] defaultAttr: { attributeCode: string; attributeName: string }[]
visible: boolean visible: boolean,
iotModelId:string
}>(), }>(),
{ {
defaultAttr: () => [], defaultAttr: () => [],
visible: false, visible: false,
iotModelId:''
} }
) )
@ -109,7 +111,7 @@ const subSystemVal = ref('')
const subSystemList = ref() const subSystemList = ref()
const getAllSubSystem = () => { const getAllSubSystem = () => {
getAllSubSystemReq().then((res) => { getAllSubSystemReq({iotModelId:props.iotModelId}).then((res) => {
const data = res.data const data = res.data
.filter((item: any) => item) .filter((item: any) => item)
.map((item: any) => { .map((item: any) => {
@ -118,7 +120,7 @@ const getAllSubSystem = () => {
value: 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 inputVal[searchType.value] = searchInfo.value
getModelAttributeListReq({ getModelAttributeListReq({
iotModelId: '', iotModelId: props.iotModelId,
// attributeType: radioActiveName.value, // attributeType: radioActiveName.value,
pageNum: pageSetting.current, pageNum: pageSetting.current,
pageSize: pageSetting.pageSize, pageSize: pageSetting.pageSize,
subSystem: (!subSystemVal.value || subSystemVal.value === ' ') ? null : subSystemVal.value, subSystem: !subSystemVal.value || subSystemVal.value === ' ' ? null : subSystemVal.value,
...inputVal, ...inputVal,
...customData, ...customData,
}) })