增加设备节点当前值监控&当前值写入

This commit is contained in:
wu
2022-08-23 10:07:32 +08:00
parent 98b97af791
commit 5403b4699b
4 changed files with 572 additions and 363 deletions

View File

@@ -94,13 +94,31 @@ export default ({ service, request, serviceForMock, requestForMock, mock, faker,
url: url + '/Edge/DeviceData?data=__status' url: url + '/Edge/DeviceData?data=__status'
}) })
}, },
GET_DEVICE_POINT_VALUE(url, username, password, deviceName){ GET_DEVICE_POINT_VALUE(url, username, password, deviceName, data, type){
return request({ return request({
auth: { auth: {
username: username, username: username,
password: password password: password
}, },
url: url + '/Edge/BrowseDeviceDataNodes?data=' + deviceName data: {
'address':data
},
method: 'post',
url: url + '/'+ deviceName +'/Read'+ type +'32'
})
},
SET_DEVICE_POINT_VALUE(url, deviceName, data, type, value){
return request({
auth: {
username: 'admin',
password: process.env.VUE_APP_HSLSERVER_PASSWORD
},
data: {
address:data,
value:value
},
method: 'post',
url: url + '/'+ deviceName +'/Write'+ type +'32'
}) })
} }
}) })

File diff suppressed because it is too large Load Diff

View File

@@ -117,7 +117,6 @@ export default {
this.rules = rules this.rules = rules
this.deviceConfigureModelValue = assign(deviceConfigureModelValue, { '@ParentDeviceCode': '' }) this.deviceConfigureModelValue = assign(deviceConfigureModelValue, { '@ParentDeviceCode': '' })
//this.deviceConfigureModelValue = this.choosable === 'true' ? assign(deviceConfigureModelValue, { parent_device_code: '' }) : deviceConfigureModelValue //this.deviceConfigureModelValue = this.choosable === 'true' ? assign(deviceConfigureModelValue, { parent_device_code: '' }) : deviceConfigureModelValue
console.log(this.deviceConfigureModelValue)
this.deviceConfigureFormItem = deviceConfigureFormItemData[e] this.deviceConfigureFormItem = deviceConfigureFormItemData[e]
}, },
setDeviceDefaultFormItemValue (val) { setDeviceDefaultFormItemValue (val) {

View File

@@ -37,7 +37,7 @@
</el-tag> </el-tag>
<el-alert v-if="this.selectedServerData.updated === 't'" title="设备配置已更改,请在服务配置界面重启对应服务生效" type="warning" style="width:400px;display: inline-block;vertical-align: middle; margin-left: 5px;" :closable="false" /> <el-alert v-if="this.selectedServerData.updated === 't'" title="设备配置已更改,请在服务配置界面重启对应服务生效" type="warning" style="width:400px;display: inline-block;vertical-align: middle; margin-left: 5px;" :closable="false" />
</div> </div>
<device :server='server' @changeStatus='changeSelectedServerStatus' @changeServerConfig='changeSelectedServerConfig' /> <device ref="deviceTemplate" :server='server' @changeStatus='changeSelectedServerStatus' @changeServerConfig='changeSelectedServerConfig' />
</el-drawer> </el-drawer>
</d2-container> </d2-container>
@@ -381,6 +381,9 @@ export default {
}, },
closeDrawer () { closeDrawer () {
this.server = { id: 0, url: '', port: '' } this.server = { id: 0, url: '', port: '' }
if(this.$refs.deviceTemplate.timing){
this.$refs.deviceTemplate.clearTime()
}
}, },
changeSelectedServerStatus (status) { changeSelectedServerStatus (status) {
this.selectedServerData.status = status || 'offline' this.selectedServerData.status = status || 'offline'