Merge remote-tracking branch 'origin/main'

This commit is contained in:
huguanghan 2024-12-18 10:53:56 +08:00
commit 5f02115098
4 changed files with 29 additions and 16 deletions

View File

@ -180,9 +180,10 @@ export function queryfaultCodeDict(params: object = {}) {
})
}
export function getAllSubSystemReq() {
export function getAllSubSystemReq(params: { iotModelId: string }) {
return createAxios({
url: '/api/equipment/model/attribute/getAllSubsystem',
method: 'post'
method: 'post',
data: params
})
}

View File

@ -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
}

View File

@ -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: {
@ -227,7 +233,7 @@ const createChart = () => {
const nameMap: any = {}
realDataSeries.forEach((item: any) => {
const yAxisName = item.name.split(' ')[1]
if (nameMap[yAxisName] || nameMap[yAxisName]===0) {
if (nameMap[yAxisName] || nameMap[yAxisName] === 0) {
item.yAxisIndex = nameMap[yAxisName]
} else {
const len = Object.keys(nameMap).length

View File

@ -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,
})