| | |
| | | CloseOutlined |
| | | } from '@ant-design/icons'; |
| | | import * as Utils from '../utils' |
| | | import { values } from 'lodash'; |
| | | |
| | | const renderTitle = (title, uuid) => ( |
| | | <> |
| | |
| | | |
| | | const MapSearch = (props) => { |
| | | const intl = useIntl(); |
| | | const { curSprite : curSensor, setCurSPrite: setCurSensor } = props; |
| | | |
| | | const sensorTypeSelectOptions = Utils.sensorTypeSelectOptions(intl); |
| | | |
| | |
| | | const [sensorList, setSensorList] = React.useState([]); |
| | | const [curSensorUuid, setCurSensorUuid] = React.useState(null); |
| | | const [curSensorLabel, setCurSensorLabel] = React.useState(null); |
| | | const [curSensor, setCurSensor] = React.useState(null); |
| | | |
| | | useEffect(() => { |
| | | setSensorList([]); |
| | |
| | | }, [curSensorType]) |
| | | |
| | | React.useEffect(() => { |
| | | console.log(curSensorUuid); |
| | | setCurSensor(Utils.findSpriteByUuid(curSensorUuid)); |
| | | }, [curSensorUuid]) |
| | | |
| | | React.useEffect(() => { |
| | | console.log(curSensor); |
| | | }, [curSensor]) |
| | | |
| | | return ( |
| | | <> |
| | |
| | | onChange={(value) => { |
| | | setCurSensorLabel(value); |
| | | if (!value) { |
| | | console.log(1); |
| | | setCurSensorUuid(null); |
| | | setCurSensorLabel(null); |
| | | setCurSensor(null); |
| | |
| | | const mapRef = React.useRef(); |
| | | const contentRef = React.useRef(); |
| | | |
| | | const [curSprite, setCurSPrite] = React.useState(null); |
| | | const [model, setModel] = React.useState(() => MapModel.OBSERVER_MODEL); |
| | | const [deviceVisible, setDeviceVisible] = React.useState(false); |
| | | const [settingsVisible, setSettingsVisible] = React.useState(false); |
| | |
| | | // setSpriteBySettings(null); |
| | | } |
| | | |
| | | React.useEffect(() => { |
| | | console.log(curSprite); |
| | | }, curSprite); |
| | | |
| | | return ( |
| | | <> |
| | | <Layout className={styles.layout}> |
| | |
| | | <Row style={{ height: '100%' }}> |
| | | <Col className={styles.headerCol} span={12} style={{}}> |
| | | <MapSearch |
| | | |
| | | curSprite={curSprite} |
| | | setCurSPrite={setCurSPrite} |
| | | /> |
| | | <span> |
| | | {curSprite?.data?.uuid} |
| | | </span> |
| | | </Col> |
| | | {/* 3C40C6 */} |
| | | <Col span={12} style={{ backgroundColor: '#4a69bd' }}> |