| | |
| | | } |
| | | |
| | | // 设置设备属性 |
| | | async function setDeviceProps(sn, body) { |
| | | async function setDeviceProps(sn, workspaceId, body) { |
| | | try { |
| | | const { code, message: msg } = await putDeviceProps(sn, body); |
| | | console.log(code,messages) |
| | | if (code === 0) { |
| | | ElMessage({ |
| | | message: '设备属性设置成功!', |
| | | type: 'success', |
| | | }); |
| | | } |
| | | throw msg; |
| | | await putDeviceProps(sn, workspaceId, body).then(res => { |
| | | if (res.data.code === 0) { |
| | | ElMessage({ |
| | | message: '设备属性设置成功!', |
| | | type: 'success', |
| | | }); |
| | | } |
| | | }); |
| | | } catch (e) { |
| | | // ElMessage({ |
| | | // message: '设备属性设置失败', |
| | | // type: 'error', |
| | | // }); |
| | | return false; |
| | | } |
| | | } |