import React from 'react'
import { Box, AutoRollComponent } from '$components';
import moment from 'moment'
import { getName, getPhone } from '$utils';
import TimeComponent, { formatSeconds } from './time';
import { typeParam_data } from '../constants/index'
import './style.less'
function BasicInfo(props) {
const { info: { alarmInfo, rescueInfo }, routes: { routes } } = props;
const getContent = () => {
return
{routes?.steps?.map((s, index) => (index + 1) + '.' + s?.instruction).map(x => {
return
{x}
})}
}
let name = '', phone = ''
if (rescueInfo?.leaderContactPhone) {
let str = rescueInfo?.leaderContactPhone.replace(/\s*/g, "");
name = str.substring(0, str.length - 11)
phone = str.substring(str.length - 11, str.length)
}
return
{alarmInfo?.createTime && }
{ props.endEvent() }}>结束案件
负责人
{getName(name)}
事件时间
{moment(alarmInfo?.createTime).format('YYYY-MM-DD HH:mm:ss')}
联系方式
{getPhone(phone)}
危险等级
{alarmInfo?.level}
{alarmInfo?.typeParam &&
{typeParam_data[alarmInfo?.type]?.name}
{alarmInfo?.typeParam}
}
{
alarmInfo?.type == '火灾扑救' &&
}
案件地点
{alarmInfo?.location}
路线规划 {routes?.time && `(${formatSeconds(routes?.time, true)})`}
3}
content={getContent()}
divHeight={100}
divId={`fire-left-bottom${alarmInfo?.id}`}
/>
}
export default BasicInfo;