|
|
|
@ -1,8 +1,8 @@
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
import React, { useState, useRef } from 'react';
|
|
|
|
import { Input, Select, Button, Checkbox, Tag } from 'antd';
|
|
|
|
import { Input, Select, Button, Checkbox, Tag } from 'antd';
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
EditOutlined,
|
|
|
|
EditOutlined,
|
|
|
|
VideoCameraOutlined,
|
|
|
|
VideoCameraOutlined,
|
|
|
|
SendOutlined,
|
|
|
|
SendOutlined,
|
|
|
|
ClockCircleOutlined,
|
|
|
|
ClockCircleOutlined,
|
|
|
|
LeftOutlined,
|
|
|
|
LeftOutlined,
|
|
|
|
@ -13,16 +13,23 @@ import {
|
|
|
|
import StandardTable from '@/components/StandardTable';
|
|
|
|
import StandardTable from '@/components/StandardTable';
|
|
|
|
import styles from './EventNotification.less';
|
|
|
|
import styles from './EventNotification.less';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import iconAcc1 from '@/assets/business_Emergency/iconAcc1.svg';
|
|
|
|
|
|
|
|
import iconAcc2 from '@/assets/business_Emergency/iconAcc2.svg';
|
|
|
|
|
|
|
|
import iconAcc3 from '@/assets/business_Emergency/iconAcc3.svg';
|
|
|
|
|
|
|
|
import testVideo from './testVideo.mp4';
|
|
|
|
|
|
|
|
|
|
|
|
const { TextArea } = Input;
|
|
|
|
const { TextArea } = Input;
|
|
|
|
const { Option } = Select;
|
|
|
|
const { Option } = Select;
|
|
|
|
|
|
|
|
|
|
|
|
const EventNotification = () => {
|
|
|
|
const EventNotification = () => {
|
|
|
|
const [eventTitle, setEventTitle] = useState('');
|
|
|
|
const [eventTitle, setEventTitle] = useState('');
|
|
|
|
const [eventType, setEventType] = useState('');
|
|
|
|
const [eventType, setEventType] = useState(undefined);
|
|
|
|
const [eventLevel, setEventLevel] = useState('');
|
|
|
|
const [eventLevel, setEventLevel] = useState(undefined);
|
|
|
|
const [eventDescription, setEventDescription] = useState('');
|
|
|
|
const [eventDescription, setEventDescription] = useState('');
|
|
|
|
const [location, setLocation] = useState('');
|
|
|
|
const [location, setLocation] = useState('');
|
|
|
|
const [videoRecord, setVideoRecord] = useState('');
|
|
|
|
const [videoRecord, setVideoRecord] = useState('');
|
|
|
|
|
|
|
|
const [videoPlaying, setVideoPlaying] = useState(false);
|
|
|
|
|
|
|
|
const videoRef = useRef(null);
|
|
|
|
const [pushTargets, setPushTargets] = useState({
|
|
|
|
const [pushTargets, setPushTargets] = useState({
|
|
|
|
'director-li': false,
|
|
|
|
'director-li': false,
|
|
|
|
'captain-zhang': true,
|
|
|
|
'captain-zhang': true,
|
|
|
|
@ -185,6 +192,31 @@ const EventNotification = () => {
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 视频播放控制
|
|
|
|
|
|
|
|
const handlePlayPause = () => {
|
|
|
|
|
|
|
|
if (videoRef.current) {
|
|
|
|
|
|
|
|
if (videoPlaying) {
|
|
|
|
|
|
|
|
videoRef.current.pause();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
videoRef.current.play();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
setVideoPlaying(!videoPlaying);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleVideoLoaded = () => {
|
|
|
|
|
|
|
|
if (videoRef.current) {
|
|
|
|
|
|
|
|
// 视频加载完成后可以设置默认行为
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handlePlayLiveVideo = () => {
|
|
|
|
|
|
|
|
if (videoRef.current) {
|
|
|
|
|
|
|
|
videoRef.current.play();
|
|
|
|
|
|
|
|
setVideoPlaying(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={styles.containerSJTZ}>
|
|
|
|
<div className={styles.containerSJTZ}>
|
|
|
|
{/* A块:顶部区域,高度60%,背景透明 */}
|
|
|
|
{/* A块:顶部区域,高度60%,背景透明 */}
|
|
|
|
@ -192,21 +224,21 @@ const EventNotification = () => {
|
|
|
|
{/* a块:事件信息编辑 */}
|
|
|
|
{/* a块:事件信息编辑 */}
|
|
|
|
<div className={styles.blockA_a}>
|
|
|
|
<div className={styles.blockA_a}>
|
|
|
|
<div className={styles.cardHeader}>
|
|
|
|
<div className={styles.cardHeader}>
|
|
|
|
<EditOutlined className={styles.headerIcon} />
|
|
|
|
<img src={iconAcc1} alt="icon" style={{ width: '16px', height: '16px' }} />
|
|
|
|
<span className={styles.headerText}>事件信息编辑</span>
|
|
|
|
<span className={styles.headerText}>事件信息编辑</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.cardContent}>
|
|
|
|
<div className={styles.cardContent}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<label className={styles.label}>事件标题</label>
|
|
|
|
<label className={styles.label}>事件标题</label>
|
|
|
|
<Input
|
|
|
|
<Input
|
|
|
|
placeholder="请输入事件标题"
|
|
|
|
placeholder="请输入事件标题"
|
|
|
|
value={eventTitle}
|
|
|
|
value={eventTitle}
|
|
|
|
onChange={(e) => setEventTitle(e.target.value)}
|
|
|
|
onChange={(e) => setEventTitle(e.target.value)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<label className={styles.label}>事件类型</label>
|
|
|
|
<label className={styles.label}>事件类型</label>
|
|
|
|
<Select
|
|
|
|
<Select
|
|
|
|
placeholder="请选择事件类型"
|
|
|
|
placeholder="请选择事件类型"
|
|
|
|
value={eventType}
|
|
|
|
value={eventType}
|
|
|
|
onChange={setEventType}
|
|
|
|
onChange={setEventType}
|
|
|
|
@ -220,7 +252,7 @@ const EventNotification = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<label className={styles.label}>事件级别</label>
|
|
|
|
<label className={styles.label}>事件级别</label>
|
|
|
|
<Select
|
|
|
|
<Select
|
|
|
|
placeholder="请选择事件级别"
|
|
|
|
placeholder="请选择事件级别"
|
|
|
|
value={eventLevel}
|
|
|
|
value={eventLevel}
|
|
|
|
onChange={setEventLevel}
|
|
|
|
onChange={setEventLevel}
|
|
|
|
@ -233,7 +265,7 @@ const EventNotification = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<label className={styles.label}>事件描述</label>
|
|
|
|
<label className={styles.label}>事件描述</label>
|
|
|
|
<TextArea
|
|
|
|
<TextArea
|
|
|
|
placeholder="请详细描述事件情况..."
|
|
|
|
placeholder="请详细描述事件情况..."
|
|
|
|
rows={4}
|
|
|
|
rows={4}
|
|
|
|
value={eventDescription}
|
|
|
|
value={eventDescription}
|
|
|
|
@ -249,14 +281,14 @@ const EventNotification = () => {
|
|
|
|
{/* b块:视频核实 */}
|
|
|
|
{/* b块:视频核实 */}
|
|
|
|
<div className={styles.blockA_b}>
|
|
|
|
<div className={styles.blockA_b}>
|
|
|
|
<div className={styles.cardHeader}>
|
|
|
|
<div className={styles.cardHeader}>
|
|
|
|
<VideoCameraOutlined className={styles.headerIcon} />
|
|
|
|
<img src={iconAcc2} alt="icon" style={{ width: '16px', height: '16px' }} />
|
|
|
|
<span className={styles.headerText}>视频核实</span>
|
|
|
|
<span className={styles.headerText}>视频核实</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.cardContent}>
|
|
|
|
<div className={styles.cardContent}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<label className={styles.label}>事发地点</label>
|
|
|
|
<label className={styles.label}>事发地点</label>
|
|
|
|
<Input
|
|
|
|
<Input
|
|
|
|
placeholder="请输入事发地点"
|
|
|
|
placeholder="请输入事发地点"
|
|
|
|
value={location}
|
|
|
|
value={location}
|
|
|
|
onChange={(e) => setLocation(e.target.value)}
|
|
|
|
onChange={(e) => setLocation(e.target.value)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
@ -265,26 +297,51 @@ const EventNotification = () => {
|
|
|
|
<label className={styles.label}>视频监控画面</label>
|
|
|
|
<label className={styles.label}>视频监控画面</label>
|
|
|
|
<div className={styles.videoContainer}>
|
|
|
|
<div className={styles.videoContainer}>
|
|
|
|
<div className={styles.videoPlaceholder}>
|
|
|
|
<div className={styles.videoPlaceholder}>
|
|
|
|
{/* 视频占位图 */}
|
|
|
|
{/* 视频播放器 */}
|
|
|
|
<div className={styles.videoImage}>
|
|
|
|
<video
|
|
|
|
<div className={styles.cityscape}></div>
|
|
|
|
ref={videoRef}
|
|
|
|
</div>
|
|
|
|
className={styles.videoPlayer}
|
|
|
|
|
|
|
|
controls={false}
|
|
|
|
|
|
|
|
onPlay={() => setVideoPlaying(true)}
|
|
|
|
|
|
|
|
onPause={() => setVideoPlaying(false)}
|
|
|
|
|
|
|
|
onLoadedMetadata={handleVideoLoaded}
|
|
|
|
|
|
|
|
preload="metadata"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{/* 使用本地测试视频 */}
|
|
|
|
|
|
|
|
<source
|
|
|
|
|
|
|
|
src={testVideo}
|
|
|
|
|
|
|
|
type="video/mp4"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
{/* 如果视频加载失败,显示提示 */}
|
|
|
|
|
|
|
|
您的浏览器不支持视频播放。
|
|
|
|
|
|
|
|
</video>
|
|
|
|
|
|
|
|
{/* 自定义播放控制栏 */}
|
|
|
|
<div className={styles.videoControls}>
|
|
|
|
<div className={styles.videoControls}>
|
|
|
|
<LeftOutlined className={styles.controlIcon} />
|
|
|
|
<LeftOutlined
|
|
|
|
<PlayCircleOutlined className={styles.controlIcon} />
|
|
|
|
className={styles.controlIcon}
|
|
|
|
|
|
|
|
onClick={() => videoRef.current && (videoRef.current.currentTime = Math.max(0, videoRef.current.currentTime - 5))}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<PlayCircleOutlined
|
|
|
|
|
|
|
|
className={styles.controlIcon}
|
|
|
|
|
|
|
|
onClick={handlePlayPause}
|
|
|
|
|
|
|
|
style={{ fontSize: '24px' }}
|
|
|
|
|
|
|
|
/>
|
|
|
|
<InfoCircleOutlined className={styles.controlIcon} />
|
|
|
|
<InfoCircleOutlined className={styles.controlIcon} />
|
|
|
|
<RightOutlined className={styles.controlIcon} />
|
|
|
|
<RightOutlined
|
|
|
|
|
|
|
|
className={styles.controlIcon}
|
|
|
|
|
|
|
|
onClick={() => videoRef.current && (videoRef.current.currentTime = Math.min(videoRef.current.duration, videoRef.current.currentTime + 5))}
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.videoButtons}>
|
|
|
|
<div className={styles.videoButtons}>
|
|
|
|
<Button type="primary">搜索监控点</Button>
|
|
|
|
<Button type="primary">搜索监控点</Button>
|
|
|
|
<Button type="primary">播放实时画面</Button>
|
|
|
|
<Button type="primary" onClick={handlePlayLiveVideo}>播放实时画面</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<label className={styles.label}>视频核实记录</label>
|
|
|
|
<label className={styles.label}>视频核实记录</label>
|
|
|
|
<TextArea
|
|
|
|
<TextArea
|
|
|
|
placeholder="记录视频核实情况..."
|
|
|
|
placeholder="记录视频核实情况..."
|
|
|
|
rows={3}
|
|
|
|
rows={3}
|
|
|
|
value={videoRecord}
|
|
|
|
value={videoRecord}
|
|
|
|
@ -304,19 +361,19 @@ const EventNotification = () => {
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<label className={styles.label}>推送对象</label>
|
|
|
|
<label className={styles.label}>推送对象</label>
|
|
|
|
<div className={styles.checkboxGroup}>
|
|
|
|
<div className={styles.checkboxGroup}>
|
|
|
|
<Checkbox
|
|
|
|
<Checkbox
|
|
|
|
checked={pushTargets['director-li']}
|
|
|
|
checked={pushTargets['director-li']}
|
|
|
|
onChange={(e) => handlePushTargetChange('director-li', e.target.checked)}
|
|
|
|
onChange={(e) => handlePushTargetChange('director-li', e.target.checked)}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
现场指挥中心-李主任
|
|
|
|
现场指挥中心-李主任
|
|
|
|
</Checkbox>
|
|
|
|
</Checkbox>
|
|
|
|
<Checkbox
|
|
|
|
<Checkbox
|
|
|
|
checked={pushTargets['captain-zhang']}
|
|
|
|
checked={pushTargets['captain-zhang']}
|
|
|
|
onChange={(e) => handlePushTargetChange('captain-zhang', e.target.checked)}
|
|
|
|
onChange={(e) => handlePushTargetChange('captain-zhang', e.target.checked)}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
消防救援队-张队长
|
|
|
|
消防救援队-张队长
|
|
|
|
</Checkbox>
|
|
|
|
</Checkbox>
|
|
|
|
<Checkbox
|
|
|
|
<Checkbox
|
|
|
|
checked={pushTargets['professor-wang']}
|
|
|
|
checked={pushTargets['professor-wang']}
|
|
|
|
onChange={(e) => handlePushTargetChange('professor-wang', e.target.checked)}
|
|
|
|
onChange={(e) => handlePushTargetChange('professor-wang', e.target.checked)}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
@ -326,7 +383,7 @@ const EventNotification = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<label className={styles.label}>事件类型</label>
|
|
|
|
<label className={styles.label}>事件类型</label>
|
|
|
|
<Select
|
|
|
|
<Select
|
|
|
|
placeholder="选择应急预案"
|
|
|
|
placeholder="选择应急预案"
|
|
|
|
suffixIcon={<RightOutlined />}
|
|
|
|
suffixIcon={<RightOutlined />}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
@ -337,13 +394,13 @@ const EventNotification = () => {
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<div className={styles.formItem}>
|
|
|
|
<label className={styles.label}>推送方式</label>
|
|
|
|
<label className={styles.label}>推送方式</label>
|
|
|
|
<div className={styles.checkboxGroupHorizontal}>
|
|
|
|
<div className={styles.checkboxGroupHorizontal}>
|
|
|
|
<Checkbox
|
|
|
|
<Checkbox
|
|
|
|
checked={pushMethod['sms']}
|
|
|
|
checked={pushMethod['sms']}
|
|
|
|
onChange={(e) => handlePushMethodChange('sms', e.target.checked)}
|
|
|
|
onChange={(e) => handlePushMethodChange('sms', e.target.checked)}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
短信
|
|
|
|
短信
|
|
|
|
</Checkbox>
|
|
|
|
</Checkbox>
|
|
|
|
<Checkbox
|
|
|
|
<Checkbox
|
|
|
|
checked={pushMethod['email']}
|
|
|
|
checked={pushMethod['email']}
|
|
|
|
onChange={(e) => handlePushMethodChange('email', e.target.checked)}
|
|
|
|
onChange={(e) => handlePushMethodChange('email', e.target.checked)}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|