| | |
| | | Tool.setThemeMode(themeMode); |
| | | Http.setNotify(notify); |
| | | Http.setMapContainer(player.mapContainer); |
| | | // websocket = new WebSocketClient('/ws/map/websocket'); |
| | | websocket = new WebSocketClient('/ws/map/websocket'); |
| | | |
| | | await Http.fetchMapData(); |
| | | websocket.connect(); |
| | | websocket.onMessage = (data) => { |
| | | console.log("ws", data); |
| | | |
| | | // Tool.updateMapStatusInRealTime(data, () => curFloorRef.current, setCurSPrite); |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | player.adaptScreen(); |
| | | notify.info('Welcome to Rcs'); |
| | | notify.info(translate('page.map.welcome')); |
| | | }, 200) |
| | | |
| | | // websocket.connect(); |
| | | // websocket.onMessage = (data) => { |
| | | // Tool.updateMapStatusInRealTime(data, () => curFloorRef.current, setCurSPrite); |
| | | // } |
| | | |
| | | } |
| | | initialize(); |
| | | |
| | |
| | | break |
| | | case MAP_MODE.SETTINGS_MODE: |
| | | player.hideGridLines(); |
| | | player.showStarryBackground(); // 0x2f68ac |
| | | // player.showStarryBackground(); // 0x2f68ac |
| | | |
| | | player.activateMapMultiSelect((selectedSprites, restartFn) => { |
| | | setBatchSprites(selectedSprites); |
| | |
| | | sx={{ |
| | | display: 'flex', |
| | | alignItems: 'center', |
| | | backgroundColor: '#f5f5f5', |
| | | color: '#000', |
| | | backgroundColor: theme.palette.background.default, |
| | | color: theme.palette.text.primary, |
| | | padding: '0 16px', |
| | | height: '64px', |
| | | flexShrink: 0, // keep height |
| | | zIndex: 200, |
| | | boxShadow: theme.shadows[1], |
| | | }} |
| | | > |
| | | <TextField |
| | |
| | | placeholder="搜索..." |
| | | sx={{ |
| | | width: '200px', |
| | | backgroundColor: '#fff', |
| | | backgroundColor: theme.palette.background.paper, |
| | | borderRadius: 1, |
| | | }} |
| | | /> |
| | |
| | | color="primary" |
| | | sx={{ mr: 2 }} |
| | | > |
| | | 停止RCS运转 |
| | | {translate('page.map.action.startup')} |
| | | </Button> |
| | | <Button variant="contained" color="primary"> |
| | | 系统报告 |
| | | {translate('page.map.action.monitor')} |
| | | </Button> |
| | | </> |
| | | )} |
| | |
| | | <Button |
| | | variant="contained" |
| | | color="primary" |
| | | sx={{ mr: 1 }} |
| | | onClick={() => setDeviceVisible(!deviceVisible)} |
| | | > |
| | | {translate('page.map.devices.title')} |
| | |
| | | size="small" |
| | | sx={{ |
| | | ml: 2, |
| | | backgroundColor: '#fff', |
| | | backgroundColor: theme.palette.background.paper, |
| | | color: theme.palette.text.primary, |
| | | borderRadius: 1, |
| | | }} |
| | | > |
| | | <MenuItem value={MAP_MODE.OBSERVER_MODE}>监控模式</MenuItem> |
| | | <MenuItem value={MAP_MODE.MOVABLE_MODE}>编辑模式</MenuItem> |
| | | <MenuItem value={MAP_MODE.SETTINGS_MODE}>配置模式</MenuItem> |
| | | <MenuItem value={MAP_MODE.OBSERVER_MODE}>{translate('page.map.mode.observer')}</MenuItem> |
| | | <MenuItem value={MAP_MODE.MOVABLE_MODE}>{translate('page.map.mode.movable')}</MenuItem> |
| | | <MenuItem value={MAP_MODE.SETTINGS_MODE}>{translate('page.map.mode.settings')}</MenuItem> |
| | | </Select> |
| | | </Box> |
| | | {/* content */} |