import { Button, makeStyles } from '@material-ui/core'; import { Email } from '@material-ui/icons'; import React from 'react'; import { useDispatch } from 'react-redux'; import config from '../../../../config'; import { bxstr, drpRealGet, skRealGet } from '../../../../models/_/real'; import { strNumber } from '../../../../utils/tools'; import { InfoPopNames } from '../../InfoPops'; const useStyles = makeStyles({ root: { padding: '1.5rem 0.75rem 0.75rem 0.75rem', color: 'rgb(224, 246, 247)', fontSize: '0.9rem', lineHeight: '1.8rem', }, titleDate: { fontSize: '1.2rem', margin: '0.2rem', color: '#00deff', }, number: { color: '#ffd220', fontSize: '1.2rem', margin: '0.2rem', }, sttype: { color: '#92f0ff', }, stname: { fontWeight: 'bold', fontSize: '1rem', margin: '0.25rem', cursor: 'pointer' }, grid: { display: 'flex', justifyContent: 'space-around', marginBottom: '1rem', textAlign: 'center', '& .value': { fontSize: '1.8rem', color: '#6fe9fd', lineHeight: '2rem' }, '& .key': { fontSize: '0.8rem', color: '#aaa', }, }, action: { textAlign: 'right', color: '#fff', } }) export default function OverallContent({ data }) { const classes = useStyles(); const dispatch = useDispatch(); const { drpInfo, skInfo, tm1, tm2, } = data || {}; const { h24, h1, h3, h6 } = drpInfo || {}; const _showRecord = (record, poptype) => { if (record) { const { lgtd, lttd } = record; if (lgtd && lttd) { dispatch.runtime.setFeaturePop({ type: poptype, properties: record, coordinates: [lgtd, lttd] }); dispatch.runtime.setCameraTarget({ center: [lgtd, lttd], zoom: 13, pitch: 30,//config.poiPitch, }); } } } const showRecord = (obj) => { if (!obj) { return; } const { type,stcd } = obj; if (type === 'sk') { skRealGet(obj.stcd).then((record) => { _showRecord(record, InfoPopNames.RealSkPop) }) } else { const obj = { 'Q9123':{ "stcd": "Q9123", "stnm": "下白米", "adcd": null, "wscd": null, "importancy": 0, "lgtd": 115.1217, "lttd": 30.8992, "elev": null, "hasRz": false, "type": "qx", "today": 17.8, "h1": 7.2, "h3": 14.3, "h6": 22.7, "h12": 24.2, "h24": 45.2, "h48": 123.5, "tm": "2025-06-08T03:00:00.000Z", "state": 1, "warning": 0 }, } _showRecord(obj[stcd], InfoPopNames.RealDrpPop) // drpRealGet(obj).then((record) => { // _showRecord(data, InfoPopNames.RealDrpPop) // }); } } const doBx = () => { bxstr().then((data) => { dispatch.runtime.setInfoDlg({ layerId: 'OverallSmtp', properties: { txt: data } }) }); } return (