一级口门摄像头去掉移动摄像头
parent
1227588182
commit
ae7627b1be
|
|
@ -52,9 +52,6 @@ export const firstLevelDoorInfoCameraGetBatchPlayUrl = declareRequest(
|
|||
"firstLevelDoorInfoCameraLoading",
|
||||
`Post > @/primeport/`,
|
||||
);
|
||||
export const firstLevelDoorInfoMovingCameraList = declareRequest(
|
||||
`Get > /primeport/`,
|
||||
);
|
||||
export const firstLevelDoorInfoFixedCameraList = declareRequest(
|
||||
`Get > /primeport/`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -16,10 +16,6 @@ import useTable from "zy-react-library/hooks/useTable";
|
|||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_FIRST_LEVEL_DOOR_INFO } from "~/enumerate/namespace";
|
||||
|
||||
const CAMERA_TYPE_ENUM = [
|
||||
{ name: "移动摄像头", bianma: "0" },
|
||||
{ name: "固定摄像头", bianma: "1" },
|
||||
];
|
||||
const IS_ONLINE_ENUM = [
|
||||
{ name: "否", bianma: "0" },
|
||||
{ name: "是", bianma: "1" },
|
||||
|
|
@ -35,8 +31,6 @@ function List(props) {
|
|||
const [batchPlayModalVisible, setBatchPlayModalVisible] = useState(false);
|
||||
const [mapModalVisible, setMapModalVisible] = useState(false);
|
||||
const [location, setLocation] = useState({ longitude: "", latitude: "" });
|
||||
const [playBackModalVisible, setPlayBackModalVisible] = useState(false);
|
||||
const [playBackUrl, setPlayBackUrl] = useState("");
|
||||
|
||||
const query = useGetUrlQuery();
|
||||
const [form] = Form.useForm();
|
||||
|
|
@ -80,7 +74,6 @@ function List(props) {
|
|||
onFinish={getData}
|
||||
options={[
|
||||
{ name: "todo1", label: "视频名称" },
|
||||
{ name: "todo2", label: "视频类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: CAMERA_TYPE_ENUM },
|
||||
{ name: "todo3", label: "是否在线", render: FORM_ITEM_RENDER_ENUM.SELECT, items: IS_ONLINE_ENUM },
|
||||
]}
|
||||
/>
|
||||
|
|
@ -161,15 +154,6 @@ function List(props) {
|
|||
>
|
||||
定位
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setPlayBackModalVisible(true);
|
||||
setPlayBackUrl(record.playBackUrl);
|
||||
}}
|
||||
>
|
||||
回放
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
|
|
@ -255,21 +239,11 @@ function List(props) {
|
|||
type="cesium"
|
||||
/>
|
||||
)}
|
||||
{playBackModalVisible && (
|
||||
<PlayBackModal
|
||||
url={playBackUrl}
|
||||
onClose={() => {
|
||||
setPlayBackModalVisible(false);
|
||||
setPlayBackUrl("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModalComponent = (props) => {
|
||||
const [selectMovingCameraModalVisible, setSelectMovingCameraModalVisible] = useState(false);
|
||||
const [selectFixedCameraModalVisible, setSelectFixedCameraModalVisible] = useState(false);
|
||||
const [form] = Form.useForm();
|
||||
|
||||
|
|
@ -311,31 +285,9 @@ const AddModalComponent = (props) => {
|
|||
span={24}
|
||||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
values={{
|
||||
todo1: "0",
|
||||
}}
|
||||
options={[
|
||||
{ name: "todo1", label: "视频类型", render: FORM_ITEM_RENDER_ENUM.RADIO, items: CAMERA_TYPE_ENUM },
|
||||
{
|
||||
label: "视频监控信息",
|
||||
dependencies: ["todo1"],
|
||||
hidden: formValues => !(formValues.todo1 === "0"),
|
||||
required: false,
|
||||
render: (
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setSelectMovingCameraModalVisible(true);
|
||||
}}
|
||||
>
|
||||
选择
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "视频选择",
|
||||
dependencies: ["todo1"],
|
||||
hidden: formValues => !(formValues.todo1 === "1"),
|
||||
required: false,
|
||||
render: (
|
||||
<Button
|
||||
|
|
@ -349,30 +301,9 @@ const AddModalComponent = (props) => {
|
|||
),
|
||||
},
|
||||
{ name: "todo2", label: "视频名称", componentProps: { disabled: true } },
|
||||
{
|
||||
name: "todo3",
|
||||
label: "播放地址",
|
||||
componentProps: { disabled: true },
|
||||
dependencies: ["todo1"],
|
||||
hidden: formValues => !(formValues.todo1 === "0"),
|
||||
},
|
||||
{ name: "todo4", label: "摄像头编号", componentProps: { disabled: true } },
|
||||
]}
|
||||
/>
|
||||
{
|
||||
selectMovingCameraModalVisible && (
|
||||
<SelectMovingCameraModal
|
||||
onCancel={() => {
|
||||
setSelectMovingCameraModalVisible(false);
|
||||
}}
|
||||
onSubmit={(values) => {
|
||||
form.setFieldValue("todo2", values.todo2);
|
||||
form.setFieldValue("todo3", values.todo3);
|
||||
form.setFieldValue("todo4", values.todo4);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
{
|
||||
selectFixedCameraModalVisible && (
|
||||
<SelectFixedCameraModal
|
||||
|
|
@ -390,100 +321,6 @@ const AddModalComponent = (props) => {
|
|||
);
|
||||
};
|
||||
|
||||
const SelectMovingCameraModalComponent = (props) => {
|
||||
const [playModalVisible, setPlayModalVisible] = useState(false);
|
||||
const [playUrl, setPlayUrl] = useState("");
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["firstLevelDoorInfoMovingCameraList"], {
|
||||
form,
|
||||
useStorageQueryCriteria: false,
|
||||
});
|
||||
|
||||
const onGetPlayUrl = async (id) => {
|
||||
const { data } = await props["firstLevelDoorInfoCameraGetPlayUrl"]({ id });
|
||||
setPlayModalVisible(true);
|
||||
setPlayUrl(data);
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open
|
||||
onCancel={props.onCancel}
|
||||
title="选择移动摄像头"
|
||||
maskClosable={false}
|
||||
width={1200}
|
||||
footer={[
|
||||
<Button key="cancel" onClick={props.onCancel}>取消</Button>,
|
||||
]}
|
||||
>
|
||||
<Search
|
||||
labelCol={{ span: 8 }}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
options={[
|
||||
{ name: "todo1", label: "视频名称" },
|
||||
{ name: "todo2", label: "所属相关方", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [] },
|
||||
{ name: "todo3", label: "使用单位" },
|
||||
{ name: "todo4", label: "负责人" },
|
||||
]}
|
||||
/>
|
||||
<Table
|
||||
options={false}
|
||||
disabledResizer={true}
|
||||
columns={[
|
||||
{ dataIndex: "todo1", title: "所属相关方" },
|
||||
{ dataIndex: "todo2", title: "所属单位" },
|
||||
{ dataIndex: "todo3", title: "视频型号" },
|
||||
{ dataIndex: "todo4", title: "视频名称" },
|
||||
{ dataIndex: "todo5", title: "播放地址" },
|
||||
{ dataIndex: "todo6", title: "摄像头编号" },
|
||||
{ dataIndex: "todo7", title: "负责人" },
|
||||
{ dataIndex: "todo8", title: "手机号" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 120,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
onGetPlayUrl(record.id);
|
||||
}}
|
||||
>
|
||||
播放
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.onSubmit(record);
|
||||
props.onCancel();
|
||||
}}
|
||||
>
|
||||
选择
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
{
|
||||
playModalVisible && (
|
||||
<Video
|
||||
onCancel={() => {
|
||||
setPlayModalVisible(false);
|
||||
setPlayUrl("");
|
||||
}}
|
||||
visible={playModalVisible}
|
||||
source={playUrl}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
const SelectFixedCameraModalComponent = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["firstLevelDoorInfoFixedCameraList"], {
|
||||
|
|
@ -567,9 +404,7 @@ const InfoModalComponent = (props) => {
|
|||
bordered
|
||||
styles={{ label: { width: 200 } }}
|
||||
items={[
|
||||
{ label: "视频类型", children: getLabelName({ list: CAMERA_TYPE_ENUM, status: info.todo1 }) },
|
||||
{ label: "视频名称", children: info.todo2 },
|
||||
...(info.todo1 === "0" ? [{ label: "播放地址", children: info.todo3 }] : []),
|
||||
{ label: "摄像头编号", children: info.todo3 },
|
||||
]}
|
||||
/>
|
||||
|
|
@ -609,33 +444,7 @@ const BatchPlayModalComponent = (props) => {
|
|||
);
|
||||
};
|
||||
|
||||
const PlayBackModal = (props) => {
|
||||
return (
|
||||
<Modal
|
||||
open
|
||||
onCancel={props.onCancel}
|
||||
title="回放"
|
||||
maskClosable={false}
|
||||
width={1200}
|
||||
footer={[
|
||||
<Button key="cancel" onClick={props.onCancel}>取消</Button>,
|
||||
]}
|
||||
>
|
||||
<iframe
|
||||
sandbox=""
|
||||
src={props.url}
|
||||
width="100%"
|
||||
height="500"
|
||||
allowFullScreen
|
||||
allow="autoplay; fullscreen;microphone"
|
||||
style="position: relative; border: none"
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
const AddModal = Connect([NS_FIRST_LEVEL_DOOR_INFO], true)(AddModalComponent);
|
||||
const SelectMovingCameraModal = Connect([NS_FIRST_LEVEL_DOOR_INFO], true)(SelectMovingCameraModalComponent);
|
||||
const SelectFixedCameraModal = Connect([NS_FIRST_LEVEL_DOOR_INFO], true)(SelectFixedCameraModalComponent);
|
||||
const InfoModal = Connect([NS_FIRST_LEVEL_DOOR_INFO], true)(InfoModalComponent);
|
||||
const BatchPlayModal = Connect([NS_FIRST_LEVEL_DOOR_INFO], true)(BatchPlayModalComponent);
|
||||
|
|
|
|||
Loading…
Reference in New Issue