|
@ -2,484 +2,483 @@ import React, { useState, useRef, useEffect, useImperativeHandle } from "react"; |
|
|
import { connect } from "react-redux"; |
|
|
import { connect } from "react-redux"; |
|
|
import { Form, Row, Col } from "@douyinfe/semi-ui"; |
|
|
import { Form, Row, Col } from "@douyinfe/semi-ui"; |
|
|
import "./cameraModal.less"; |
|
|
import "./cameraModal.less"; |
|
|
function fluoriteCamera({ cRef, CameraKind, CameraAbility, cameraData }) { |
|
|
function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) { |
|
|
const { TextArea } = Form; |
|
|
const { TextArea } = Form; |
|
|
const form = useRef(); |
|
|
const form = useRef(); |
|
|
const [cloud, setcloud] = useState(""); //云台支持 |
|
|
const [cloud, setcloud] = useState(""); //云台支持 |
|
|
const [voice, setvoice] = useState(""); //语音支持 |
|
|
const [voice, setvoice] = useState(""); //语音支持 |
|
|
const [switching, setSwitching] = useState(""); //高清切换 |
|
|
const [switching, setSwitching] = useState(""); //高清切换 |
|
|
const [memoryList, setMemoryList] = useState([ |
|
|
const [memoryList, setMemoryList] = useState([ |
|
|
{ |
|
|
{ |
|
|
id: 1, |
|
|
id: 1, |
|
|
value: "8g", |
|
|
value: "8g", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 2, |
|
|
id: 2, |
|
|
value: "16g", |
|
|
value: "16g", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 3, |
|
|
id: 3, |
|
|
value: "32g", |
|
|
value: "32g", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 4, |
|
|
id: 4, |
|
|
value: "64g", |
|
|
value: "64g", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 5, |
|
|
id: 5, |
|
|
value: "128g", |
|
|
value: "128g", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 6, |
|
|
id: 6, |
|
|
value: "256g", |
|
|
value: "256g", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: 7, |
|
|
id: 7, |
|
|
value: ">256g", |
|
|
value: ">256g", |
|
|
}, |
|
|
}, |
|
|
]); //内存卡列表 |
|
|
]); //内存卡列表 |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
setcloud(cameraData.cloudControl || ""); |
|
|
setcloud(cameraData.cloudControl || ""); |
|
|
setvoice(cameraData.voice || ""); |
|
|
setvoice(cameraData.voice || ""); |
|
|
setSwitching(cameraData.highDefinition || ""); |
|
|
setSwitching(cameraData.highDefinition || ""); |
|
|
}, []); |
|
|
}, []); |
|
|
function handleLocation() { |
|
|
function handleLocation () { |
|
|
//高德经纬度 |
|
|
//高德经纬度 |
|
|
window.open("https://lbs.amap.com/tools/picker", "_blank"); |
|
|
window.open("https://lbs.amap.com/tools/picker", "_blank"); |
|
|
} |
|
|
|
|
|
function positionForm(val) { |
|
|
|
|
|
//安装位置校验 |
|
|
|
|
|
let zz = /^(-?\d+)(\.\d+)?$/; |
|
|
|
|
|
if (!val) { |
|
|
|
|
|
return "请输入或拾取高德经纬度坐标"; |
|
|
|
|
|
} else if (val.split(",").length != 2) { |
|
|
|
|
|
return "请输入格式为116.354169,39.835452的经纬度坐标"; |
|
|
|
|
|
} else if (!zz.test(val.split(",")[0])) { |
|
|
|
|
|
return "只能填写数字"; |
|
|
|
|
|
} else if (!zz.test(val.split(",")[1])) { |
|
|
|
|
|
return "只能填写数字"; |
|
|
|
|
|
} else { |
|
|
|
|
|
return ""; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
function positionForm (val) { |
|
|
useImperativeHandle(cRef, () => ({ |
|
|
//安装位置校验 |
|
|
//传给父组件方法 |
|
|
let zz = /^(-?\d+)(\.\d+)?$/; |
|
|
//子组件暴露给父组件的方法 |
|
|
if (!val) { |
|
|
fluoriteCameraForm: form.current.validate, |
|
|
return "请输入或拾取高德经纬度坐标"; |
|
|
resetFluoriteCamera: form.current.reset, |
|
|
} else if (val.split(",").length != 2) { |
|
|
toempty: empty, |
|
|
return "请输入格式为116.354169,39.835452的经纬度坐标"; |
|
|
})); |
|
|
} else if (!zz.test(val.split(",")[0])) { |
|
|
function empty() { |
|
|
return "只能填写数字"; |
|
|
setcloud(""); |
|
|
} else if (!zz.test(val.split(",")[1])) { |
|
|
setvoice(""); |
|
|
return "只能填写数字"; |
|
|
setSwitching(""); |
|
|
} else { |
|
|
} |
|
|
return ""; |
|
|
return ( |
|
|
} |
|
|
<> |
|
|
} |
|
|
<Form |
|
|
useImperativeHandle(cRef, () => ({ |
|
|
labelPosition="left" |
|
|
//传给父组件方法 |
|
|
labelAlign="left" |
|
|
//子组件暴露给父组件的方法 |
|
|
labelWidth="115px" |
|
|
fluoriteCameraForm: form.current.validate, |
|
|
onValueChange={(values) => console.log(values)} |
|
|
resetFluoriteCamera: form.current.reset, |
|
|
initValues={{ |
|
|
toempty: empty, |
|
|
name: cameraData ? cameraData.name : "", |
|
|
})); |
|
|
highDefinition: cameraData ? cameraData.highDefinition : "", |
|
|
function empty () { |
|
|
memoryCard: cameraData ? cameraData.memoryCard : "", |
|
|
setcloud(""); |
|
|
position: cameraData.longitude |
|
|
setvoice(""); |
|
|
? `${cameraData.longitude},${cameraData.latitude}` |
|
|
setSwitching(""); |
|
|
: "", |
|
|
} |
|
|
kindId: cameraData ? cameraData.kindId : "", |
|
|
return ( |
|
|
abilityId: cameraData |
|
|
<> |
|
|
? cameraData.cameraAbilities |
|
|
<Form |
|
|
? cameraData.cameraAbilities.map((item) => item.id) |
|
|
labelPosition="left" |
|
|
: "" |
|
|
labelAlign="left" |
|
|
: "", |
|
|
labelWidth="115px" |
|
|
cloudControl: cameraData ? cameraData.cloudControl : "", |
|
|
onValueChange={(values) => console.log(values)} |
|
|
voice: cameraData ? cameraData.voice : "", |
|
|
initValues={{ |
|
|
serialNo: cameraData ? cameraData.serialNo : "", |
|
|
name: cameraData.name || "", |
|
|
rtmp: cameraData ? cameraData.rtmp : "", |
|
|
highDefinition: cameraData.highDefinition || "", |
|
|
}} |
|
|
memoryCard: cameraData.memoryCard || "", |
|
|
getFormApi={(formApi) => (form.current = formApi)} |
|
|
position: cameraData.longitude |
|
|
> |
|
|
? `${cameraData.longitude},${cameraData.latitude}` |
|
|
<Row> |
|
|
: "", |
|
|
<Col span={12}> |
|
|
kindId: cameraData.kindId || "", |
|
|
{/* 设备名称 */} |
|
|
abilityId: cameraData.cameraAbilities |
|
|
<Form.Input |
|
|
? cameraData.cameraAbilities.map((item) => item.id) |
|
|
field="name" |
|
|
: "" |
|
|
label="设备名称:" |
|
|
, |
|
|
placeholder="请输入设备名称、常用项目或位置定义" |
|
|
cloudControl: cameraData.cloudControl || "", |
|
|
style={{ width: 307 }} |
|
|
voice: cameraData.voice || "", |
|
|
rules={[{ required: true, message: "请输入设备名称" }]} |
|
|
serialNo: cameraData.serialNo || "", |
|
|
/> |
|
|
rtmp: cameraData.rtmp || "", |
|
|
{/* 高清切换 */} |
|
|
|
|
|
<Form.RadioGroup |
|
|
|
|
|
label="高清切换:" |
|
|
|
|
|
field="highDefinition" |
|
|
|
|
|
type="pureCard" |
|
|
|
|
|
direction="horizontal" |
|
|
|
|
|
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }} |
|
|
|
|
|
rules={[{ required: true, message: "请选择高清切换" }]} |
|
|
|
|
|
onChange={(checked) => { |
|
|
|
|
|
if (checked.target.value == true) { |
|
|
|
|
|
setSwitching(true); |
|
|
|
|
|
} else { |
|
|
|
|
|
setSwitching(false); |
|
|
|
|
|
} |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<Form.Radio |
|
|
|
|
|
value={true} |
|
|
|
|
|
style={{ |
|
|
|
|
|
width: 58, |
|
|
|
|
|
height: 30, |
|
|
|
|
|
padding: 0, |
|
|
|
|
|
margin: 0, |
|
|
|
|
|
background: "#F9F9F9", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<div |
|
|
|
|
|
className="switching" |
|
|
|
|
|
style={{ |
|
|
|
|
|
width: 58, |
|
|
|
|
|
height: 30, |
|
|
|
|
|
textAlign: "center", |
|
|
|
|
|
lineHeight: "30px", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
支持 |
|
|
|
|
|
</div> |
|
|
|
|
|
{switching == true ? ( |
|
|
|
|
|
<div |
|
|
|
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
|
|
|
> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/background/formchoose.png" |
|
|
|
|
|
alt="1" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
) : ( |
|
|
|
|
|
"" |
|
|
|
|
|
)} |
|
|
|
|
|
</Form.Radio> |
|
|
|
|
|
<Form.Radio |
|
|
|
|
|
value={false} |
|
|
|
|
|
style={{ |
|
|
|
|
|
width: 58, |
|
|
|
|
|
height: 30, |
|
|
|
|
|
padding: 0, |
|
|
|
|
|
margin: 0, |
|
|
|
|
|
marginLeft: 18, |
|
|
|
|
|
background: "#F9F9F9", |
|
|
|
|
|
}} |
|
|
}} |
|
|
> |
|
|
getFormApi={(formApi) => (form.current = formApi)} |
|
|
<div |
|
|
|
|
|
className="switching" |
|
|
|
|
|
style={{ |
|
|
|
|
|
width: 58, |
|
|
|
|
|
height: 30, |
|
|
|
|
|
textAlign: "center", |
|
|
|
|
|
lineHeight: "30px", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
不支持 |
|
|
|
|
|
</div> |
|
|
|
|
|
{switching == false && switching !== "" ? ( |
|
|
|
|
|
<div |
|
|
|
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
|
|
|
> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/background/formchoose.png" |
|
|
|
|
|
alt="1" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
) : ( |
|
|
|
|
|
"" |
|
|
|
|
|
)} |
|
|
|
|
|
</Form.Radio> |
|
|
|
|
|
</Form.RadioGroup> |
|
|
|
|
|
{/* 内存 */} |
|
|
|
|
|
<Form.Select |
|
|
|
|
|
label="内存:" |
|
|
|
|
|
field="memoryCard" |
|
|
|
|
|
placeholder="未安装" |
|
|
|
|
|
style={{ width: 307 }} |
|
|
|
|
|
> |
|
|
> |
|
|
{memoryList.map((item, index) => ( |
|
|
<Row> |
|
|
<Form.Select.Option key={index} value={item.value}> |
|
|
<Col span={12}> |
|
|
{item.value} |
|
|
{/* 设备名称 */} |
|
|
</Form.Select.Option> |
|
|
<Form.Input |
|
|
))} |
|
|
field="name" |
|
|
</Form.Select> |
|
|
label="设备名称:" |
|
|
{/* 安装位置 */} |
|
|
placeholder="请输入设备名称、常用项目或位置定义" |
|
|
<div style={{ display: "flex" }}> |
|
|
style={{ width: 307 }} |
|
|
<Form.Input |
|
|
rules={[{ required: true, message: "请输入设备名称" }]} |
|
|
field="position" |
|
|
/> |
|
|
label="安装位置:" |
|
|
{/* 高清切换 */} |
|
|
placeholder="请输入或拾取高德经纬度坐标" |
|
|
<Form.RadioGroup |
|
|
style={{ width: 270 }} |
|
|
label="高清切换:" |
|
|
validate={positionForm} |
|
|
field="highDefinition" |
|
|
rules={[ |
|
|
type="pureCard" |
|
|
{ required: true, message: "请输入或拾取高德经纬度坐标" }, |
|
|
direction="horizontal" |
|
|
]} |
|
|
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }} |
|
|
/> |
|
|
rules={[{ required: true, message: "请选择高清切换" }]} |
|
|
<div |
|
|
onChange={(checked) => { |
|
|
style={{ |
|
|
if (checked.target.value == true) { |
|
|
width: 32, |
|
|
setSwitching(true); |
|
|
height: 32, |
|
|
} else { |
|
|
background: "#1859C1", |
|
|
setSwitching(false); |
|
|
marginLeft: 4, |
|
|
} |
|
|
display: "flex", |
|
|
}} |
|
|
justifyContent: "center", |
|
|
> |
|
|
alignItems: "center", |
|
|
<Form.Radio |
|
|
cursor: "pointer", |
|
|
value={true} |
|
|
marginTop: 12, |
|
|
style={{ |
|
|
borderRadius: 3 + "px", |
|
|
width: 58, |
|
|
}} |
|
|
height: 30, |
|
|
onClick={handleLocation} |
|
|
padding: 0, |
|
|
> |
|
|
margin: 0, |
|
|
<img |
|
|
background: "#F9F9F9", |
|
|
src="../../../assets/images/background/location.png" |
|
|
}} |
|
|
width={16} |
|
|
> |
|
|
height={20} |
|
|
<div |
|
|
/> |
|
|
className="switching" |
|
|
</div> |
|
|
style={{ |
|
|
</div> |
|
|
width: 58, |
|
|
{/* 设备类型 */} |
|
|
height: 30, |
|
|
|
|
|
textAlign: "center", |
|
|
|
|
|
lineHeight: "30px", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
支持 |
|
|
|
|
|
</div> |
|
|
|
|
|
{switching == true ? ( |
|
|
|
|
|
<div |
|
|
|
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
|
|
|
> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/background/formchoose.png" |
|
|
|
|
|
alt="1" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
) : ( |
|
|
|
|
|
"" |
|
|
|
|
|
)} |
|
|
|
|
|
</Form.Radio> |
|
|
|
|
|
<Form.Radio |
|
|
|
|
|
value={false} |
|
|
|
|
|
style={{ |
|
|
|
|
|
width: 58, |
|
|
|
|
|
height: 30, |
|
|
|
|
|
padding: 0, |
|
|
|
|
|
margin: 0, |
|
|
|
|
|
marginLeft: 18, |
|
|
|
|
|
background: "#F9F9F9", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<div |
|
|
|
|
|
className="switching" |
|
|
|
|
|
style={{ |
|
|
|
|
|
width: 58, |
|
|
|
|
|
height: 30, |
|
|
|
|
|
textAlign: "center", |
|
|
|
|
|
lineHeight: "30px", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
不支持 |
|
|
|
|
|
</div> |
|
|
|
|
|
{switching == false && switching !== "" ? ( |
|
|
|
|
|
<div |
|
|
|
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
|
|
|
> |
|
|
|
|
|
<img |
|
|
|
|
|
src="/assets/images/background/formchoose.png" |
|
|
|
|
|
alt="1" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
) : ( |
|
|
|
|
|
"" |
|
|
|
|
|
)} |
|
|
|
|
|
</Form.Radio> |
|
|
|
|
|
</Form.RadioGroup> |
|
|
|
|
|
{/* 内存 */} |
|
|
|
|
|
<Form.Select |
|
|
|
|
|
label="内存:" |
|
|
|
|
|
field="memoryCard" |
|
|
|
|
|
placeholder="未安装" |
|
|
|
|
|
style={{ width: 307 }} |
|
|
|
|
|
> |
|
|
|
|
|
{memoryList.map((item, index) => ( |
|
|
|
|
|
<Form.Select.Option key={index} value={item.value}> |
|
|
|
|
|
{item.value} |
|
|
|
|
|
</Form.Select.Option> |
|
|
|
|
|
))} |
|
|
|
|
|
</Form.Select> |
|
|
|
|
|
{/* 安装位置 */} |
|
|
|
|
|
<div style={{ display: "flex" }}> |
|
|
|
|
|
<Form.Input |
|
|
|
|
|
field="position" |
|
|
|
|
|
label="安装位置:" |
|
|
|
|
|
placeholder="请输入或拾取高德经纬度坐标" |
|
|
|
|
|
style={{ width: 270 }} |
|
|
|
|
|
validate={positionForm} |
|
|
|
|
|
rules={[ |
|
|
|
|
|
{ required: true, message: "请输入或拾取高德经纬度坐标" }, |
|
|
|
|
|
]} |
|
|
|
|
|
/> |
|
|
|
|
|
<div |
|
|
|
|
|
style={{ |
|
|
|
|
|
width: 32, |
|
|
|
|
|
height: 32, |
|
|
|
|
|
background: "#1859C1", |
|
|
|
|
|
marginLeft: 4, |
|
|
|
|
|
display: "flex", |
|
|
|
|
|
justifyContent: "center", |
|
|
|
|
|
alignItems: "center", |
|
|
|
|
|
cursor: "pointer", |
|
|
|
|
|
marginTop: 12, |
|
|
|
|
|
borderRadius: 3 + "px", |
|
|
|
|
|
}} |
|
|
|
|
|
onClick={handleLocation} |
|
|
|
|
|
> |
|
|
|
|
|
<img |
|
|
|
|
|
src="../../../assets/images/background/location.png" |
|
|
|
|
|
width={16} |
|
|
|
|
|
height={20} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
{/* 设备类型 */} |
|
|
|
|
|
|
|
|
<Form.Select |
|
|
<Form.Select |
|
|
label="设备类型:" |
|
|
label="设备类型:" |
|
|
field="kindId" |
|
|
field="kindId" |
|
|
placeholder="请选择摄像头类型" |
|
|
placeholder="请选择摄像头类型" |
|
|
style={{ width: 180 }} |
|
|
style={{ width: 180 }} |
|
|
rules={[{ required: true, message: "请选择摄像头类型" }]} |
|
|
rules={[{ required: true, message: "请选择摄像头类型" }]} |
|
|
> |
|
|
> |
|
|
{CameraKind.map((item, index) => ( |
|
|
{CameraKind.map((item, index) => ( |
|
|
<Form.Select.Option key={index} value={item.id}> |
|
|
<Form.Select.Option key={index} value={item.id}> |
|
|
{item.kind} |
|
|
{item.kind} |
|
|
</Form.Select.Option> |
|
|
</Form.Select.Option> |
|
|
))} |
|
|
))} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
|
|
|
|
|
|
<Form.Select |
|
|
<Form.Select |
|
|
label="设备能力:" |
|
|
label="设备能力:" |
|
|
multiple |
|
|
multiple |
|
|
maxTagCount={1} |
|
|
maxTagCount={1} |
|
|
field="abilityId" |
|
|
field="abilityId" |
|
|
placeholder="请选择能力" |
|
|
placeholder="请选择能力" |
|
|
style={{ width: 180 }} |
|
|
style={{ width: 180 }} |
|
|
rules={[{ required: true, message: "请选择能力" }]} |
|
|
rules={[{ required: true, message: "请选择能力" }]} |
|
|
> |
|
|
> |
|
|
{CameraAbility.map((item, index) => ( |
|
|
{CameraAbility.map((item, index) => ( |
|
|
<Form.Select.Option key={index} value={item.id}> |
|
|
<Form.Select.Option key={index} value={item.id}> |
|
|
{item.ability} |
|
|
{item.ability} |
|
|
</Form.Select.Option> |
|
|
</Form.Select.Option> |
|
|
))} |
|
|
))} |
|
|
</Form.Select> |
|
|
</Form.Select> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span={12}> |
|
|
<Col span={12}> |
|
|
{/* 云台支持 */} |
|
|
{/* 云台支持 */} |
|
|
<Form.RadioGroup |
|
|
<Form.RadioGroup |
|
|
label="云台支持:" |
|
|
label="云台支持:" |
|
|
field="cloudControl" |
|
|
field="cloudControl" |
|
|
type="pureCard" |
|
|
type="pureCard" |
|
|
direction="horizontal" |
|
|
direction="horizontal" |
|
|
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }} |
|
|
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }} |
|
|
rules={[{ required: true, message: "请选择云台支持" }]} |
|
|
rules={[{ required: true, message: "请选择云台支持" }]} |
|
|
onChange={(checked) => { |
|
|
onChange={(checked) => { |
|
|
if (checked.target.value == true) { |
|
|
if (checked.target.value == true) { |
|
|
setcloud(true); |
|
|
setcloud(true); |
|
|
} else { |
|
|
} else { |
|
|
setcloud(false); |
|
|
setcloud(false); |
|
|
} |
|
|
} |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<Form.Radio |
|
|
<Form.Radio |
|
|
value={true} |
|
|
value={true} |
|
|
style={{ |
|
|
style={{ |
|
|
width: 58, |
|
|
width: 58, |
|
|
height: 30, |
|
|
height: 30, |
|
|
padding: 0, |
|
|
padding: 0, |
|
|
margin: 0, |
|
|
margin: 0, |
|
|
background: "#F9F9F9", |
|
|
background: "#F9F9F9", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<div |
|
|
<div |
|
|
className="cloud" |
|
|
className="cloud" |
|
|
style={{ |
|
|
style={{ |
|
|
width: 58, |
|
|
width: 58, |
|
|
height: 30, |
|
|
height: 30, |
|
|
textAlign: "center", |
|
|
textAlign: "center", |
|
|
lineHeight: "30px", |
|
|
lineHeight: "30px", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
支持 |
|
|
支持 |
|
|
</div> |
|
|
</div> |
|
|
{cloud == true ? ( |
|
|
{cloud == true ? ( |
|
|
<div |
|
|
<div |
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
> |
|
|
> |
|
|
<img |
|
|
<img |
|
|
src="/assets/images/background/formchoose.png" |
|
|
src="/assets/images/background/formchoose.png" |
|
|
alt="1" |
|
|
alt="1" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
) : ( |
|
|
) : ( |
|
|
"" |
|
|
"" |
|
|
)} |
|
|
)} |
|
|
</Form.Radio> |
|
|
</Form.Radio> |
|
|
<Form.Radio |
|
|
<Form.Radio |
|
|
value={false} |
|
|
value={false} |
|
|
style={{ |
|
|
style={{ |
|
|
width: 58, |
|
|
width: 58, |
|
|
height: 30, |
|
|
height: 30, |
|
|
padding: 0, |
|
|
padding: 0, |
|
|
margin: 0, |
|
|
margin: 0, |
|
|
marginLeft: 18, |
|
|
marginLeft: 18, |
|
|
background: "#F9F9F9", |
|
|
background: "#F9F9F9", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<div |
|
|
<div |
|
|
className="cloud" |
|
|
className="cloud" |
|
|
style={{ |
|
|
style={{ |
|
|
width: 58, |
|
|
width: 58, |
|
|
height: 30, |
|
|
height: 30, |
|
|
textAlign: "center", |
|
|
textAlign: "center", |
|
|
lineHeight: "30px", |
|
|
lineHeight: "30px", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
不支持 |
|
|
不支持 |
|
|
</div> |
|
|
</div> |
|
|
{cloud == false && cloud !== "" ? ( |
|
|
{cloud == false && cloud !== "" ? ( |
|
|
<div |
|
|
<div |
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
> |
|
|
> |
|
|
<img |
|
|
<img |
|
|
src="/assets/images/background/formchoose.png" |
|
|
src="/assets/images/background/formchoose.png" |
|
|
alt="1" |
|
|
alt="1" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
) : ( |
|
|
) : ( |
|
|
"" |
|
|
"" |
|
|
)} |
|
|
)} |
|
|
</Form.Radio> |
|
|
</Form.Radio> |
|
|
</Form.RadioGroup> |
|
|
</Form.RadioGroup> |
|
|
{/* 语音支持 */} |
|
|
{/* 语音支持 */} |
|
|
<Form.RadioGroup |
|
|
<Form.RadioGroup |
|
|
// labelWidth= '76px' |
|
|
// labelWidth= '76px' |
|
|
label="语音支持:" |
|
|
label="语音支持:" |
|
|
field="voice" |
|
|
field="voice" |
|
|
type="pureCard" |
|
|
type="pureCard" |
|
|
direction="horizontal" |
|
|
direction="horizontal" |
|
|
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }} |
|
|
style={{ padding: 0, paddingTop: 1, paddingBottom: 1 }} |
|
|
onChange={(checked) => { |
|
|
onChange={(checked) => { |
|
|
if (checked.target.value == true) { |
|
|
if (checked.target.value == true) { |
|
|
setvoice(true); |
|
|
setvoice(true); |
|
|
} else { |
|
|
} else { |
|
|
setvoice(false); |
|
|
setvoice(false); |
|
|
} |
|
|
} |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<Form.Radio |
|
|
<Form.Radio |
|
|
value={true} |
|
|
value={true} |
|
|
style={{ |
|
|
style={{ |
|
|
width: 58, |
|
|
width: 58, |
|
|
height: 30, |
|
|
height: 30, |
|
|
padding: 0, |
|
|
padding: 0, |
|
|
margin: 0, |
|
|
margin: 0, |
|
|
background: "#F9F9F9", |
|
|
background: "#F9F9F9", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<div |
|
|
<div |
|
|
className="voice" |
|
|
className="voice" |
|
|
style={{ |
|
|
style={{ |
|
|
width: 58, |
|
|
width: 58, |
|
|
height: 30, |
|
|
height: 30, |
|
|
textAlign: "center", |
|
|
textAlign: "center", |
|
|
lineHeight: "30px", |
|
|
lineHeight: "30px", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
支持 |
|
|
支持 |
|
|
</div> |
|
|
</div> |
|
|
{voice == true ? ( |
|
|
{voice == true ? ( |
|
|
<div |
|
|
<div |
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
> |
|
|
> |
|
|
<img |
|
|
<img |
|
|
src="/assets/images/background/formchoose.png" |
|
|
src="/assets/images/background/formchoose.png" |
|
|
alt="1" |
|
|
alt="1" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
) : ( |
|
|
) : ( |
|
|
"" |
|
|
"" |
|
|
)} |
|
|
)} |
|
|
</Form.Radio> |
|
|
</Form.Radio> |
|
|
<Form.Radio |
|
|
<Form.Radio |
|
|
value={false} |
|
|
value={false} |
|
|
style={{ |
|
|
style={{ |
|
|
width: 58, |
|
|
width: 58, |
|
|
height: 30, |
|
|
height: 30, |
|
|
padding: 0, |
|
|
padding: 0, |
|
|
margin: 0, |
|
|
margin: 0, |
|
|
marginLeft: 18, |
|
|
marginLeft: 18, |
|
|
background: "#F9F9F9", |
|
|
background: "#F9F9F9", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<div |
|
|
<div |
|
|
className="voice" |
|
|
className="voice" |
|
|
style={{ |
|
|
style={{ |
|
|
width: 58, |
|
|
width: 58, |
|
|
height: 30, |
|
|
height: 30, |
|
|
textAlign: "center", |
|
|
textAlign: "center", |
|
|
lineHeight: "30px", |
|
|
lineHeight: "30px", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
不支持 |
|
|
不支持 |
|
|
</div> |
|
|
</div> |
|
|
{voice == false && voice !== "" ? ( |
|
|
{voice == false && voice !== "" ? ( |
|
|
<div |
|
|
<div |
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
style={{ position: "absolute", top: "-2px", right: "-1px" }} |
|
|
> |
|
|
> |
|
|
<img |
|
|
<img |
|
|
src="/assets/images/background/formchoose.png" |
|
|
src="/assets/images/background/formchoose.png" |
|
|
alt="1" |
|
|
alt="1" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
) : ( |
|
|
) : ( |
|
|
"" |
|
|
"" |
|
|
)} |
|
|
)} |
|
|
</Form.Radio> |
|
|
</Form.Radio> |
|
|
</Form.RadioGroup> |
|
|
</Form.RadioGroup> |
|
|
{/* 设备名称 */} |
|
|
{/* 设备名称 */} |
|
|
<Form.Input |
|
|
<Form.Input |
|
|
field="serialNo" |
|
|
field="serialNo" |
|
|
label="设备序列号:" |
|
|
label="设备序列号:" |
|
|
placeholder="请输入设备序列号" |
|
|
placeholder="请输入设备序列号" |
|
|
style={{ width: 307 }} |
|
|
style={{ width: 307 }} |
|
|
rules={[{ required: true, message: "请输入设备序列号" }]} |
|
|
rules={[{ required: true, message: "请输入设备序列号" }]} |
|
|
/> |
|
|
/> |
|
|
{/* RTMP地址接入 */} |
|
|
{/* RTMP地址接入 */} |
|
|
<TextArea |
|
|
<TextArea |
|
|
style={{ width: 320, height: 90 }} |
|
|
style={{ width: 320, height: 90 }} |
|
|
field="rtmp" |
|
|
field="rtmp" |
|
|
label="RTMP地址接入:" |
|
|
label="RTMP地址接入:" |
|
|
placeholder="请输入RTMP地址接入" |
|
|
placeholder="请输入RTMP地址接入" |
|
|
rules={[{ required: true, message: "请输入RTMP地址接入" }]} |
|
|
rules={[{ required: true, message: "请输入RTMP地址接入" }]} |
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
</Row> |
|
|
</Row> |
|
|
</Form> |
|
|
</Form> |
|
|
</> |
|
|
</> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
function mapStateToProps(state) { |
|
|
function mapStateToProps (state) { |
|
|
const { auth, global, members } = state; |
|
|
const { auth, global, members } = state; |
|
|
return { |
|
|
return { |
|
|
loading: members.isRequesting, |
|
|
loading: members.isRequesting, |
|
|
user: auth.user, |
|
|
user: auth.user, |
|
|
actions: global.actions, |
|
|
actions: global.actions, |
|
|
members: members.data, |
|
|
members: members.data, |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(fluoriteCamera); |
|
|
export default connect(mapStateToProps)(fluoriteCamera); |
|
|