|
@ -7,7 +7,8 @@ import moment from 'moment' |
|
|
const Network = props => { |
|
|
const Network = props => { |
|
|
const { dispatch, actions, user, clientHeight, thingId, deviceListAlarms, devicesCardStatusList, project, token,thingStatus } = props |
|
|
const { dispatch, actions, user, clientHeight, thingId, deviceListAlarms, devicesCardStatusList, project, token,thingStatus } = props |
|
|
const { analysis } = actions |
|
|
const { analysis } = actions |
|
|
const form = useRef() //表单
|
|
|
// const form = useRef() //表单
|
|
|
|
|
|
const [form] = Form.useForm(); |
|
|
const [deployData, setDeployData] = useState([]) |
|
|
const [deployData, setDeployData] = useState([]) |
|
|
const [deviceData, setDeviceData] = useState([]) |
|
|
const [deviceData, setDeviceData] = useState([]) |
|
|
const [deviceMetasDeployed, setDeviceMetasDeployed] = useState([]) |
|
|
const [deviceMetasDeployed, setDeviceMetasDeployed] = useState([]) |
|
@ -26,6 +27,7 @@ const Network = props => { |
|
|
const [controlId,setControlId]=useState('') |
|
|
const [controlId,setControlId]=useState('') |
|
|
const [id,setId]=useState('')//设计设备的id
|
|
|
const [id,setId]=useState('')//设计设备的id
|
|
|
const [param,setParam]=useState('')//开与关
|
|
|
const [param,setParam]=useState('')//开与关
|
|
|
|
|
|
const [text,setText]=useState('') |
|
|
const DeviceTypes = { |
|
|
const DeviceTypes = { |
|
|
'DTU': 'DTU', |
|
|
'DTU': 'DTU', |
|
|
'gateway': '网关', |
|
|
'gateway': '网关', |
|
@ -267,7 +269,8 @@ const Network = props => { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const res= await dispatch(analysis.invokeCapability(values,token)) |
|
|
const res= await dispatch(analysis.invokeCapability(values,token)) |
|
|
setStatus(res?.payload?.data?.data?.info?.includes('离线')?false:true) |
|
|
setStatus(res?.payload?.data?.data?.data?.info?.includes('离线')?false:true) |
|
|
|
|
|
form.setFieldValue('status', res?.payload?.data?.data?.data?.info) |
|
|
} |
|
|
} |
|
|
const columns = [ |
|
|
const columns = [ |
|
|
{ |
|
|
{ |
|
@ -406,18 +409,24 @@ const Network = props => { |
|
|
dataSource={lastData}></Table> |
|
|
dataSource={lastData}></Table> |
|
|
<Modal |
|
|
<Modal |
|
|
title='开关' |
|
|
title='开关' |
|
|
|
|
|
footer={[ <Button key="back" onClick={()=>{setModalVis(false)}}> |
|
|
|
|
|
取消 |
|
|
|
|
|
</Button>, |
|
|
|
|
|
<Button key="submit" type="primary" disabled={!status} onClick={okHandler}> |
|
|
|
|
|
下发指令 |
|
|
|
|
|
</Button>]} |
|
|
visible={modalVis} |
|
|
visible={modalVis} |
|
|
onCancel={()=>{setModalVis(false)}} |
|
|
|
|
|
// sensorId={sensorId}
|
|
|
// sensorId={sensorId}
|
|
|
onOk={okHandler} |
|
|
|
|
|
okText='升级' |
|
|
okText='升级' |
|
|
> |
|
|
> |
|
|
<Form> |
|
|
<Form |
|
|
|
|
|
form={form} |
|
|
|
|
|
> |
|
|
<Form.Item label='状态' name='status'> |
|
|
<Form.Item label='状态' name='status'> |
|
|
<Input disabled /> |
|
|
<Input disabled /> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
<Form.Item label='开关' name='open'> |
|
|
<Form.Item label='开关' name='open'> |
|
|
<Switch disabled={status} onChange={switchChange}></Switch> |
|
|
<Switch disabled={!status} onChange={switchChange}></Switch> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
</Form> |
|
|
</Form> |
|
|
</Modal> |
|
|
</Modal> |
|
|