|
|
@ -25,6 +25,7 @@ |
|
|
|
value: 'orgId', |
|
|
|
}" |
|
|
|
:tree-data="siteDataTree" |
|
|
|
:disabled="true" |
|
|
|
tree-node-filter-prop="orgName" /> |
|
|
|
</a-form-item> |
|
|
|
<a-form-item label="设备类型" name="deviceType"> |
|
|
@ -40,9 +41,9 @@ |
|
|
|
@change="selectDeviceType" |
|
|
|
placeholder="请选择设备类型" /> |
|
|
|
</a-form-item> |
|
|
|
<a-form-item label="设备名称" name="deviceId"> |
|
|
|
<a-form-item label="设备名称" name="deviceInfoCode"> |
|
|
|
<a-select |
|
|
|
v-model:value="infoObject.deviceId" |
|
|
|
v-model:value="infoObject.deviceInfoCode" |
|
|
|
:disabled="!(infoObject && infoObject.deviceType && infoObject.deviceType.length > 0)" |
|
|
|
style="width: 100%" |
|
|
|
:autoClearSearchValue="true" |
|
|
@ -50,7 +51,7 @@ |
|
|
|
@change="selectDevice" |
|
|
|
placeholder="请选择设备名称"> |
|
|
|
<template v-for="(item, index) in deviceNameTreeData" :key="index"> |
|
|
|
<a-select-option :value="item.id"> |
|
|
|
<a-select-option :value="item.deviceInfoCode"> |
|
|
|
{{ item.deviceName }} |
|
|
|
</a-select-option> |
|
|
|
</template> |
|
|
@ -64,7 +65,7 @@ |
|
|
|
allow-clear |
|
|
|
placeholder="请选择设备点位" |
|
|
|
style="width: 100%" |
|
|
|
:disabled="!infoObject?.deviceId" |
|
|
|
:disabled="!infoObject?.deviceInfoCode" |
|
|
|
:options="devicePointData" |
|
|
|
:filter-option="filterDevicePoint" /> |
|
|
|
</a-form-item> |
|
|
@ -118,6 +119,7 @@ |
|
|
|
<a-input |
|
|
|
style="width: 65px; margin-left: 6px" |
|
|
|
type="number" |
|
|
|
status="error" |
|
|
|
v-model:value="infoObject.alarmList[index - 1].num" /> |
|
|
|
<div |
|
|
|
style="width: 70px; align-items: center; cursor: pointer" |
|
|
@ -168,7 +170,7 @@ |
|
|
|
deviceType: [], |
|
|
|
devicePoint: null, |
|
|
|
valueType: null, |
|
|
|
deviceId: null, |
|
|
|
deviceInfoCode: null, |
|
|
|
enableRules: 0, |
|
|
|
alarmList: [{ logic: null, num: null, isDelete: 0 }], |
|
|
|
}); |
|
|
@ -188,7 +190,7 @@ |
|
|
|
let deviceNameTreeData = ref([]); |
|
|
|
//选择设备类型方法 |
|
|
|
const selectDeviceType = (value: any, selectedOptions: any) => { |
|
|
|
infoObject.value.deviceId = null; |
|
|
|
infoObject.value.deviceInfoCode = null; |
|
|
|
if (selectedOptions && selectedOptions.length > 0) { |
|
|
|
//获取该类型设备 |
|
|
|
getDevicePage({ |
|
|
@ -201,7 +203,7 @@ |
|
|
|
}; |
|
|
|
//选择设备方法 |
|
|
|
const selectDevice = () => { |
|
|
|
getDevicePoint({ id: infoObject.value.deviceId }); |
|
|
|
getDevicePoint({ deviceCode: infoObject.value.deviceInfoCode }); |
|
|
|
}; |
|
|
|
//获取设备列表 |
|
|
|
const getDevicePage = (value: any) => { |
|
|
@ -325,7 +327,7 @@ |
|
|
|
let selectDevice = ref([Number(infoObject.value.deviceType)]); |
|
|
|
findNodeById(deviceTypeTreeData.value, Number(infoObject.value.deviceType)); |
|
|
|
//获取设备点位 |
|
|
|
getDevicePoint({ id: infoObject.value.deviceId }); |
|
|
|
getDevicePoint({ deviceCode: infoObject.value.deviceInfoCode }); |
|
|
|
// 回显 选择设备类型 |
|
|
|
findParentIds( |
|
|
|
deviceTypeTreeData.value, |
|
|
@ -360,10 +362,11 @@ |
|
|
|
deviceType: [], |
|
|
|
devicePoint: null, |
|
|
|
valueType: null, |
|
|
|
deviceId: null, |
|
|
|
deviceInfoCode: null, |
|
|
|
enableRules: 0, |
|
|
|
alarmList: [{ logic: null, num: null, isDelete: 0 }], |
|
|
|
}; |
|
|
|
infoObject.value.site = orgId.value; |
|
|
|
} |
|
|
|
|
|
|
|
visible.value = !visible.value; |
|
|
@ -373,7 +376,7 @@ |
|
|
|
site: [{ required: true, message: '请选择站点', trigger: 'change' }], |
|
|
|
deviceType: [{ required: true, message: '请选择设备类型', trigger: 'change' }], |
|
|
|
enableRules: [{ required: true, message: '请选择启用规则', trigger: 'change' }], |
|
|
|
deviceId: [{ required: true, message: '请选择设备名称', trigger: 'change' }], |
|
|
|
deviceInfoCode: [{ required: true, message: '请选择设备名称', trigger: 'change' }], |
|
|
|
devicePoint: [{ required: true, message: '请选择设备点位', trigger: 'change' }], |
|
|
|
valueType: [{ required: true, message: '请选择取值类型', trigger: 'change' }], |
|
|
|
ruleType: [{ required: true, message: '请选择规则类型', trigger: 'change' }], |
|
|
@ -396,6 +399,7 @@ |
|
|
|
}; |
|
|
|
// 确认按钮 |
|
|
|
const btnClick = () => { |
|
|
|
infoObject.value.devicePoint = 1; |
|
|
|
infoObject.value.alarmList.forEach((item) => { |
|
|
|
if (item.logic === null || item.num === null) { |
|
|
|
return; |
|
|
@ -459,7 +463,7 @@ |
|
|
|
deviceType: [], |
|
|
|
devicePoint: null, |
|
|
|
valueType: null, |
|
|
|
deviceId: null, |
|
|
|
deviceInfoCode: null, |
|
|
|
enableRules: 0, |
|
|
|
alarmList: [{ logic: null, num: null, isDelete: 0 }], |
|
|
|
}; |
|
|
|