Browse Source

Merge branch 'dev_trial' of https://gitea.free-sun.vip/free-sun/FS-IOT into dev_trial

release_0.0.2
巴林闲侠 3 years ago
parent
commit
e9e4b42060
  1. 150
      code/VideoAccess-VCMP/web/client/src/layout/components/header/index.jsx
  2. 26
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx
  3. 5
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx
  4. 3
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx
  5. 3
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx
  6. 10
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx
  7. 2
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx
  8. 9
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

150
code/VideoAccess-VCMP/web/client/src/layout/components/header/index.jsx

@ -4,84 +4,92 @@ import { connect } from "react-redux";
import { Nav, Avatar, Dropdown } from "@douyinfe/semi-ui";
const Header = (props) => {
const { dispatch, history, user, actions, socket } = props;
const { dispatch, history, user, actions, socket } = props;
return (
<>
<Nav
mode={"horizontal"}
onClick={({ itemKey }) => {
if (itemKey == "logout") {
dispatch(actions.auth.logout(user));
const iotAuth = document.getElementById('iotAuth').contentWindow;
iotAuth.postMessage({ action: 'logout' }, '*');
if (socket) {
socket.disconnect();
}
history.push(`/signin`);
}
}}
style={{
height: 60,
minWidth: 520,
background: "url(/assets/images/background/header.png)",
backgroundSize: "100% 100%",
color: "white",
}}
header={{
logo: (
<img
src="/assets/images/background/logo.png"
style={{ display: "inline-block", width: 280, height: 52 }}
/>
),
text: "",
}}
footer={
<Nav.Sub
itemKey={"user"}
text={
<div
style={{
marginLeft: 20,
display: "inline-block",
color: "white",
}}
>
return (
<>
<Nav
mode={"horizontal"}
onClick={({ itemKey }) => {
if (itemKey == "logout") {
dispatch(actions.auth.logout(user));
const iotAuth = document.getElementById('iotAuth').contentWindow;
iotAuth.postMessage({ action: 'logout' }, '*');
if (socket) {
socket.disconnect();
}
history.push(`/signin`);
}
}}
style={{
height: 60,
minWidth: 520,
background: "url(/assets/images/background/header.png)",
backgroundSize: "100% 100%",
color: "white",
}}
header={{
logo: (
<img
src="/assets/images/background/notice.png"
style={{
display: "inline-block",
width: 18,
height: 18,
position: "relative",
top: 6,
left: -10,
}}
src="/assets/images/background/logo.png"
style={{ display: "inline-block", width: 280, height: 52 }}
/>
),
text: "",
}}
footer={
<Nav.Sub
itemKey={"user"}
text={
<div
style={{
marginLeft: 20,
display: "inline-block",
color: "white",
}}
>
<img
src="/assets/images/background/notice.png"
style={{
display: "inline-block",
width: 18,
height: 18,
position: "relative",
top: 6,
left: -10,
}}
/>
<Avatar size="small" color="light-blue" style={{ margin: 4 }}>
<img src="/assets/images/avatar/6.png" />
</Avatar>
{user && user.displayName}
</div>
}
>
<Nav.Item itemKey={"logout"} text={"退出"} />
</Nav.Sub>
}
/>
</>
);
<Avatar size="small" color="light-blue" style={{marginRight:4}}>
<img src="/assets/images/avatar/6.png" />
</Avatar>
<div style={{
display: "inline-block", position: "relative",
top: 10,
left: 4,
marginRight: 4,
}}>
<div>你好</div>
<div>{user && user.displayName}</div>
</div>
</div>
}
>
<Nav.Item itemKey={"logout"} text={"退出"} />
</Nav.Sub>
}
/>
</>
);
};
function mapStateToProps (state) {
const { global, auth, webSocket } = state;
return {
actions: global.actions,
user: auth.user,
socket: webSocket.socket,
};
const { global, auth, webSocket } = state;
return {
actions: global.actions,
user: auth.user,
socket: webSocket.socket,
};
}
export default connect(mapStateToProps)(Header);

26
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cameraModal.jsx

@ -32,7 +32,7 @@ function cameraModal (props) {
const cascadeRef = useRef();
const nvrRef = useRef();
const [isloading, setloading] = useState(false); //loading
const [loadingTip, setloadingTip] = useState("测试进行中..."); //loading tip
const [loadingTip, setloadingTip] = useState("测试中..."); //loading tip
const [okText, setokText] = useState("确定"); //oktext
const [cancelText, setcancelText] = useState("取消"); //text
@ -239,18 +239,18 @@ function cameraModal (props) {
var duration = moment.duration(after.diff(front))._data.milliseconds;
if (res.success) {
setTimeout(() => {
setloadingTip("校验成功");
setloadingTip("测试完成");
setTimeout(() => {
setloading(false);
setloadingTip("测试进行中...");
setloadingTip("测试中...");
}, 800);
}, duration > 2000 ? 0 : 2000 - duration)
} else {
setTimeout(() => {
setloadingTip("校验失败");
setloadingTip("测试失败");
setTimeout(() => {
setloading(false);
setloadingTip("测试进行中...");
setloadingTip("测试中...");
}, 800);
}, duration > 2000 ? 0 : 2000 - duration)
}
@ -277,18 +277,18 @@ function cameraModal (props) {
var duration = moment.duration(after.diff(front))._data.milliseconds;
if (res.success) {
setTimeout(() => {
setloadingTip("校验成功");
setloadingTip("测试完成");
setTimeout(() => {
setloading(false);
setloadingTip("测试进行中...");
setloadingTip("测试中...");
}, 800);
}, duration > 2000 ? 0 : 2000 - duration)
} else {
setTimeout(() => {
setloadingTip("校验失败");
setloadingTip("测试失败");
setTimeout(() => {
setloading(false);
setloadingTip("测试进行中...");
setloadingTip("测试中...");
}, 800);
}, duration > 2000 ? 0 : 2000 - duration)
}
@ -314,18 +314,18 @@ function cameraModal (props) {
var duration = moment.duration(after.diff(front))._data.milliseconds;
if (res.success) {
setTimeout(() => {
setloadingTip("校验成功");
setloadingTip("测试完成");
setTimeout(() => {
setloading(false);
setloadingTip("测试进行中...");
setloadingTip("测试中...");
}, 800);
}, duration > 2000 ? 0 : 2000 - duration)
} else {
setTimeout(() => {
setloadingTip("校验失败");
setloadingTip("测试失败");
setTimeout(() => {
setloading(false);
setloadingTip("测试进行中...");
setloadingTip("测试中...");
}, 800);
}, duration > 2000 ? 0 : 2000 - duration)
}

5
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/cascadeCamera.jsx

@ -71,8 +71,9 @@ function cascadeCamera ({ dRef, dispatch, actions, cameraData ,parentCamera}) {
<Form.Input
field="externalDomain"
label="外域名称:"
initValue={cameraData.externalDomain || ""} v
placeholder="请输入外域名称"
maxLength="36"
initValue={cameraData.externalDomain || ""}
placeholder="请输入外域 名称,例如“xxx市级平台”"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入外域名称" }]}
/>

3
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/fluoriteCamera.jsx

@ -107,6 +107,7 @@ function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) {
<Form.Input
field="name"
label="设备名称:"
maxLength="36"
placeholder="请输入设备名称、常用项目或位置定义"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入设备名称" }]}
@ -215,6 +216,7 @@ function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) {
<Form.Input
field="position"
label="安装位置:"
maxLength="39"
placeholder="请输入或拾取高德经纬度坐标"
style={{ width: 270 }}
validate={positionForm}
@ -462,6 +464,7 @@ function fluoriteCamera ({ cRef, CameraKind, CameraAbility, cameraData }) {
style={{ width: 320, height: 90 }}
field="rtmp"
label="RTMP地址接入:"
maxLength="100"
placeholder="请输入RTMP地址接入"
rules={[{ required: true, message: "请输入RTMP地址接入" }]}
/>

3
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/ipcCamera.jsx

@ -110,6 +110,7 @@ function ipcCamera({
<Form.Input
field="name"
label="设备名称:"
maxLength="36"
placeholder="请输入设备名称、常用项目或位置定义"
style={{ width: 307 }}
rules={[{ required: true, message: "请输入设备名称" }]}
@ -142,6 +143,7 @@ function ipcCamera({
<Form.Input
field="position"
label="安装位置:"
maxLength="39"
placeholder="请输入或拾取高德经纬度坐标"
style={{ width: 270 }}
validate={positionForm}
@ -377,6 +379,7 @@ function ipcCamera({
<Form.Input
field="serialNo"
label="设备编号接入:"
maxLength="39"
placeholder="请输入设备编号"
style={{ width: 307 }}
/>

10
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrCamera.jsx

@ -26,7 +26,7 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }
const [isAllChoose, setIsAllChoose] = useState(false); //
const [equipmentNum, setEquipmentNum] = useState(""); //nvr
const [isloading, setloading] = useState(false); //loading
const [loadingTip, setloadingTip] = useState("正在接入视频流..."); //loading tip
const [loadingTip, setloadingTip] = useState("获取中..."); //loading tip
const [step, setstep] = useState("none");
const [stepp, setstepp] = useState("none");
@ -79,12 +79,12 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }
setNvrCheckList([data[0].id]);
if (res.success) {
setTimeout(() => {
setloadingTip("接入完成");
setloadingTip("获取完成");
setTimeout(() => {
setstep("none");
setloading(false);
setstepp("block");
setloadingTip("正在接入视频流...");
setloadingTip("获取中...");
}, 800);
}, 800)
}
@ -176,12 +176,12 @@ function nvrCamera ({ dispatch, actions, nvrRef, cameraData, addNvr, nvrNumber }
setIsAllChoose(true);
if (res.success) {
setTimeout(() => {
setloadingTip("接入完成");
setloadingTip("获取完成");
setTimeout(() => {
setstep("none");
setloading(false);
setstepp("block");
setloadingTip("正在接入视频流...");
setloadingTip("获取中...");
}, 800);
}, 800)
}

2
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/nvrModal.jsx

@ -186,7 +186,7 @@ function nvrModal(props) {
field="name"
label="设备名称:"
initValue={nvrData.name || ""}
placeholder="请输入设备名称、常用项目或位置定义"
placeholder="请输入设备名称"
style={{ width: 421 }}
rules={[
{

9
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx

@ -524,6 +524,7 @@ const CameraHeader = (props) => {
<Form.Input
label="设备搜索:"
field="keyword"
maxLength="36"
placeholder="请输入设备名称"
labelPosition="left"
style={screen}
@ -563,13 +564,15 @@ const CameraHeader = (props) => {
<Form.Select
label="状态查询:"
labelPosition="left"
field="type2"
field="state"
style={screen}
placeholder="全部"
showClear
>
<Form.Select.Option value="yes">在线</Form.Select.Option>
<Form.Select.Option value="no">离线</Form.Select.Option>
<Form.Select.Option value="ON">在线</Form.Select.Option>
<Form.Select.Option value="OFF">离线</Form.Select.Option>
<Form.Select.Option value="UNKONW">未知</Form.Select.Option>
<Form.Select.Option value="DISABLED">禁用</Form.Select.Option>
</Form.Select>
{/* <Form.Select
label="关联项目:"

Loading…
Cancel
Save