Browse Source

表格属性

release_1.1.1
deartibers 2 years ago
parent
commit
fca2333459
  1. 2
      code/VideoAccess-VCMP/web/client/src/components/index.js
  2. 121
      code/VideoAccess-VCMP/web/client/src/components/setup.jsx
  3. 191
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx
  4. 32
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/camera.jsx
  5. 27
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
  6. 138
      code/VideoAccess-VCMP/web/client/src/sections/offline/components/setup.jsx
  7. 17
      code/VideoAccess-VCMP/web/client/src/sections/offline/containers/carrierpigeon.jsx
  8. 20
      code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx

2
code/VideoAccess-VCMP/web/client/src/components/index.js

@ -4,6 +4,7 @@ import Coming from './coming'
import ReminderBox from './reminderBox' import ReminderBox from './reminderBox'
import VideoPlay from './videoPlayer/videoPlay' import VideoPlay from './videoPlayer/videoPlay'
import VideoPlayModal from './videoPlayer/videoPlayModal' import VideoPlayModal from './videoPlayer/videoPlayModal'
import Setup from './setup'
export { export {
SimpleFileDownButton, SimpleFileDownButton,
@ -11,4 +12,5 @@ export {
ReminderBox, ReminderBox,
VideoPlay, VideoPlay,
VideoPlayModal, VideoPlayModal,
Setup
}; };

121
code/VideoAccess-VCMP/web/client/src/components/setup.jsx

@ -0,0 +1,121 @@
import React, { useState, useEffect } from "react";
import {
Modal,
CheckboxGroup,
Checkbox,
} from "@douyinfe/semi-ui";
function Setup(props) {
const {
close,
tableType,
tableList
} = props;
const [check, setCheck] = useState([]);
const checkboxcss = { width: "25%", height: 16, margin: "0 0 20px 0" };
useEffect(() => {
//
const checkItem = localStorage.getItem(tableType);
setCheck(checkItem?JSON.parse(checkItem) : [])
ischeck();
}, []);
function ischeck(value) {
if (check.length >= 8) {
if (check.includes(value)) {
return false;
} else {
return true;
}
}
}
return (
<Modal
title={
<div>
表格属性设置
<span
style={{
width: 50,
lineHeight: "19px",
display: "inline-block",
color: "white",
textAlign: "center",
marginLeft: 6,
background:
check.length == 8
? "rgba(40, 123, 255, 1)"
: "rgba(176, 176, 176, 1)",
}}
>
{check.length}/8
</span>
</div>
}
visible={true}
style={{ width: 600 }}
onOk={() => {
localStorage.setItem(tableType, JSON.stringify(check));
close();
}}
onCancel={() => {
close();
}}
>
<CheckboxGroup
style={{ width: "100%", fontSize: 14 }}
key="primary1"
direction="horizontal"
defaultValue={check}
aria-label="表格属性设置"
onChange={(check) => {
setCheck(check);
ischeck();
}}
>
{tableList.map((item,index)=>{
return(
<div
key={index}
style={{
width: 550,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
marginBottom: "20px",
}}
>
<div
style={{
borderBottom: "1px solid #EAEAEA",
marginLeft: "10px",
padding: "8px 0px",
}}
>
{item.title}
</div>
<div style={{ padding: "15px 12px", width: 530 }}>
{item.list.map((itm) => {
return (
<Checkbox
key={itm.value}
value={itm.value}
style={checkboxcss}
disabled={ischeck(itm.value)}
>
{itm.name}
</Checkbox>
);
})}
</div>
</div>
)})}
</CheckboxGroup>
</Modal>
);
}
export default Setup;

191
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx

@ -1,191 +0,0 @@
import React, { useState, useEffect } from "react";
import {
Modal,
CheckboxGroup,
Checkbox,
} from "@douyinfe/semi-ui";
function Setup(props) {
const {
visible,
close,
SETUPS,
CAMERAS,
cameraSetup,
} = props;
const [check, setCheck] = useState([]);
const checkboxcss = { width: "25%", height: 16, margin: "0 0 20px 0" };
useEffect(() => {
//
const nvrItem = localStorage.getItem(SETUPS);
const cameraItem = localStorage.getItem(CAMERAS);
if (cameraSetup) {
setCheck(cameraItem ? JSON.parse(cameraItem) : []);
} else {
setCheck(nvrItem ? JSON.parse(nvrItem) : []);
}
ischeck();
}, []);
const equipmentNVR = [
{ name: "设备厂家", value: "manufactor" },
{ name: "添加账号", value: "accountNumber" },
{ name: "通道数", value: "passageway" },
{ name: "端口", value: "port" },
{ name: "设备状态", value: "state" },
{ name: "创建时间", value: "time" },
];
const projectNVR = [
{ name: "项目名称", value: "name" },
{ name: "pcode", value: "pcode" },
{ name: "结构物", value: "structure" },
];
const equipmentCamera = [
{ name: "设备厂家", value: "manufactor" },
{ name: "接入类型", value: "type" },
{ name: "设备状态", value: "state" },
{ name: "云台支持", value: "support" },
{ name: "内存卡信息", value: "memoryCard" },
{ name: "设备创建时间", value: "time" },
{ name: "设备添加账号", value: "account" },
];
const projectCamera = [
{ name: "项目名称", value: "name" },
{ name: "pcode", value: "pcode" },
{ name: "结构物", value: "structure" },
{ name: "测点", value: "measuringPoint" },
{ name: "监测因素", value: "factor" },
];
function ischeck(value) {
if (check.length >= 8) {
if (check.includes(value)) {
return false;
} else {
return true;
}
}
}
return (
<Modal
title={
<div>
表格属性设置
<span
style={{
width: 50,
lineHeight: "19px",
display: "inline-block",
color: "white",
textAlign: "center",
marginLeft: 6,
background:
check.length == 8
? "rgba(40, 123, 255, 1)"
: "rgba(176, 176, 176, 1)",
}}
>
{check.length}/8
</span>
</div>
}
visible={visible}
style={{ width: 600 }}
onOk={() => {
cameraSetup
? localStorage.setItem(CAMERAS, JSON.stringify(check))
: localStorage.setItem(SETUPS, JSON.stringify(check));
close();
}}
onCancel={() => {
close();
}}
>
<CheckboxGroup
style={{ width: "100%", fontSize: 14 }}
key="primary1"
direction="horizontal"
defaultValue={check}
aria-label="表格属性设置"
onChange={(check) => {
setCheck(check);
ischeck();
}}
>
<div
style={{
width: 550,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
marginBottom: "20px",
}}
>
<div
style={{
borderBottom: "1px solid #EAEAEA",
marginLeft: "10px",
padding: "8px 0px",
}}
>
设备信息
</div>
<div style={{ padding: "15px 12px", width: 530 }}>
{(cameraSetup ? equipmentCamera : equipmentNVR).map((item) => {
return (
<Checkbox
key={item.value}
value={item.value}
style={checkboxcss}
disabled={ischeck(item.value)}
>
{item.name}
</Checkbox>
);
})}
</div>
</div>
<div
style={{
width: 550,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
}}
>
<div
style={{
borderBottom: "1px solid #EAEAEA",
marginLeft: "10px",
padding: "8px 0px",
}}
>
项目信息
</div>
<div style={{ padding: "15px 12px", width: 530 }}>
{(cameraSetup ? projectCamera : projectNVR).map((item) => {
return (
<Checkbox
key={item.value}
value={item.value}
style={checkboxcss}
disabled={ischeck(item.value)}
>
{item.name}
</Checkbox>
);
})}
</div>
</div>
</CheckboxGroup>
</Modal>
);
}
export default Setup;

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

@ -17,7 +17,7 @@ import { SimpleFileDownButton, VideoPlayModal } from "$components";
import "../style.less"; import "../style.less";
import CameraModal from "../components/cameraModal"; import CameraModal from "../components/cameraModal";
import RemarksModal from "../components/remarksModal"; import RemarksModal from "../components/remarksModal";
import Setup from "../components/setup"; import {Setup} from "$components";
import SideSheets from "../components/sideSheet"; import SideSheets from "../components/sideSheet";
import { skeletonScreen } from "../components/skeletonScreen"; import { skeletonScreen } from "../components/skeletonScreen";
import { accessType } from "./nvr"; import { accessType } from "./nvr";
@ -51,7 +51,30 @@ const CameraHeader = (props) => {
const page = useRef(query.page); const page = useRef(query.page);
const deviceClickb = useRef(true) const deviceClickb = useRef(true)
const CAMERAS = "cameras"; const CAMERAS = "cameras";
const tableList = [//
{
title:'设备信息',
list:[
{ name: "设备厂家", value: "manufactor" },
{ name: "接入类型", value: "type" },
{ name: "设备状态", value: "state" },
{ name: "云台支持", value: "support" },
{ name: "内存卡信息", value: "memoryCard" },
{ name: "设备创建时间", value: "time" },
{ name: "设备添加账号", value: "account" },
]
},
{
title:'项目信息',
list:[
{ name: "项目名称", value: "name" },
{ name: "pcode", value: "pcode" },
{ name: "结构物", value: "structure" },
{ name: "测点", value: "measuringPoint" },
{ name: "监测因素", value: "factor" },
]
},
];
useEffect(() => { useEffect(() => {
// //
let isAxyData = props.location.search let isAxyData = props.location.search
@ -771,9 +794,8 @@ const CameraHeader = (props) => {
{setup ? ( {setup ? (
<Setup <Setup
visible={true} tableType={CAMERAS}
CAMERAS={CAMERAS} tableList={tableList}
cameraSetup={cameraSetup}
close={() => { close={() => {
setSetup(false); setSetup(false);
attribute(venderList); attribute(venderList);

27
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

@ -5,7 +5,7 @@ import { Button, Form, Table, Pagination, Skeleton, Popconfirm, Popover, Tag, }
import "../style.less"; import "../style.less";
import { ApiTable } from "$utils"; import { ApiTable } from "$utils";
import NvrModal from "../components/nvrModal"; import NvrModal from "../components/nvrModal";
import Setup from "../components/setup"; import {Setup} from "$components";
import SideSheets from "../components/sideSheet"; import SideSheets from "../components/sideSheet";
import { skeletonScreen } from "../components/skeletonScreen"; import { skeletonScreen } from "../components/skeletonScreen";
import { ReminderBox } from "../../../components/index"; import { ReminderBox } from "../../../components/index";
@ -36,6 +36,27 @@ const NvrHeader = (props) => {
const SETUPS = "setups"; const SETUPS = "setups";
const USER = "user" + props.user.id const USER = "user" + props.user.id
const nvrRef = useRef(); // const nvrRef = useRef(); //
const tableList = [//
{
title:'设备信息',
list:[
{ name: "设备厂家", value: "manufactor" },
{ name: "添加账号", value: "accountNumber" },
{ name: "通道数", value: "passageway" },
{ name: "端口", value: "port" },
{ name: "设备状态", value: "state" },
{ name: "创建时间", value: "time" },
]
},
{
title:'项目信息',
list:[
{ name: "项目名称", value: "name" },
{ name: "pcode", value: "pcode" },
{ name: "结构物", value: "structure" },
]
},
];
useEffect(() => { useEffect(() => {
dispatch(actions.equipmentWarehouse.getVender()).then((res) => { dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
@ -575,8 +596,8 @@ const NvrHeader = (props) => {
{setup ? ( {setup ? (
<Setup <Setup
visible={true} tableType={SETUPS}
SETUPS={SETUPS} tableList={tableList}
close={() => { close={() => {
setSetup(false); setSetup(false);
attribute(venderList); attribute(venderList);

138
code/VideoAccess-VCMP/web/client/src/sections/offline/components/setup.jsx

@ -1,138 +0,0 @@
import React, { useState, useEffect } from "react";
import {
Modal,
CheckboxGroup,
Checkbox,
} from "@douyinfe/semi-ui";
function Setup(props) {
const {
visible,
close,
CODE,//
PIGEON,//
pigeonSetup,
} = props;
const [check, setCheck] = useState([]);
const checkboxcss = { width: "25%", height: 16, margin: "0 0 20px 0" };
useEffect(() => {
//
const codeItem = localStorage.getItem(CODE);
const pigeonItem = localStorage.getItem(PIGEON);
if (pigeonSetup) {
setCheck(pigeonItem ? JSON.parse(pigeonItem) : []);
} else {
setCheck(codeItem ? JSON.parse(codeItem) : []);
}
ischeck();
}, []);
const equipmentCode = [//
{ name: "常规解决方案", value: "manufactor" },
{ name: "状态频率", value: "accountNumber" },
];
const equipmentCarrierpigeon = [//
{ name: "策略类型", value: "manufactor" },
{ name: "推送机制", value: "type" },
{ name: "监听设备数量", value: "state" },
{ name: "累计推送次数", value: "support" },
];
function ischeck(value) {
if (check.length >= 8) {
if (check.includes(value)) {
return false;
} else {
return true;
}
}
}
return (
<Modal
title={
<div>
表格属性设置
<span
style={{
width: 50,
lineHeight: "19px",
display: "inline-block",
color: "white",
textAlign: "center",
marginLeft: 6,
background:
check.length == 8
? "rgba(40, 123, 255, 1)"
: "rgba(176, 176, 176, 1)",
}}
>
{check.length}/8
</span>
</div>
}
visible={visible}
style={{ width: 600 }}
onOk={() => {
pigeonSetup
? localStorage.setItem(PIGEON, JSON.stringify(check))
: localStorage.setItem(CODE, JSON.stringify(check));
close();
}}
onCancel={() => {
close();
}}
>
<CheckboxGroup
style={{ width: "100%", fontSize: 14 }}
key="primary1"
direction="horizontal"
defaultValue={check}
aria-label="表格属性设置"
onChange={(check) => {
setCheck(check);
ischeck();
}}
>
<div
style={{
width: 550,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
marginBottom: "20px",
}}
>
<div
style={{
borderBottom: "1px solid #EAEAEA",
marginLeft: "10px",
padding: "8px 0px",
}}
>
{pigeonSetup?'推送信息':'状态码信息'}
</div>
<div style={{ padding: "15px 12px", width: 530 }}>
{(pigeonSetup ? equipmentCarrierpigeon : equipmentCode).map((item) => {
return (
<Checkbox
key={item.value}
value={item.value}
style={checkboxcss}
disabled={ischeck(item.value)}
>
{item.name}
</Checkbox>
);
})}
</div>
</div>
</CheckboxGroup>
</Modal>
);
}
export default Setup;

17
code/VideoAccess-VCMP/web/client/src/sections/offline/containers/carrierpigeon.jsx

@ -4,7 +4,7 @@ import moment from "moment";
import { Button, Form, Table, Pagination, Skeleton, Popconfirm, Popover, Tag, } from "@douyinfe/semi-ui"; import { Button, Form, Table, Pagination, Skeleton, Popconfirm, Popover, Tag, } from "@douyinfe/semi-ui";
import "../style.less"; import "../style.less";
import { ApiTable } from "$utils"; import { ApiTable } from "$utils";
import Setup from "../components/setup"; import {Setup} from "$components";
// import SideSheets from "../components/sideSheet"; // import SideSheets from "../components/sideSheet";
// import { skeletonScreen } from "../components/skeletonScreen"; // import { skeletonScreen } from "../components/skeletonScreen";
// import { ReminderBox } from "../../../components/index"; // import { ReminderBox } from "../../../components/index";
@ -34,7 +34,15 @@ const Carrierpigeon = (props) => {
const PIGEON = "pigeon"; const PIGEON = "pigeon";
const USER = "user" + props.user.id const USER = "user" + props.user.id
const nvrRef = useRef(); // const nvrRef = useRef(); //
const tableList = [//
{
title:'状态码信息',
list:[
{ name: "常规解决方案", value: "manufactor" },
{ name: "状态频率", value: "accountNumber" },
]
},
];
useEffect(() => { useEffect(() => {
dispatch(actions.equipmentWarehouse.getVender()).then((res) => { dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
setvenderList(res.payload.data); setvenderList(res.payload.data);
@ -535,9 +543,8 @@ const Carrierpigeon = (props) => {
{setup ? ( {setup ? (
<Setup <Setup
visible={true} tableType={PIGEON}
pigeonSetup={true} tableList={tableList}
PIGEON={PIGEON}
close={() => { close={() => {
setSetup(false); setSetup(false);
attribute(venderList); attribute(venderList);

20
code/VideoAccess-VCMP/web/client/src/sections/offline/containers/statuscode.jsx

@ -3,8 +3,8 @@ import { connect } from "react-redux";
import moment from "moment"; import moment from "moment";
import { Button, Form, Table, Pagination, Skeleton, Popconfirm, Popover, Tag, } from "@douyinfe/semi-ui"; import { Button, Form, Table, Pagination, Skeleton, Popconfirm, Popover, Tag, } from "@douyinfe/semi-ui";
import "../style.less"; import "../style.less";
import { ApiTable } from "$utils"; import {Setup} from "$components";
import Setup from "../components/setup";
// import SideSheets from "../components/sideSheet"; // import SideSheets from "../components/sideSheet";
// import { skeletonScreen } from "../components/skeletonScreen"; // import { skeletonScreen } from "../components/skeletonScreen";
// import { ReminderBox } from "../../../components/index"; // import { ReminderBox } from "../../../components/index";
@ -34,7 +34,15 @@ const Statuscode = (props) => {
const CODE = "code"; const CODE = "code";
const USER = "user" + props.user.id const USER = "user" + props.user.id
const nvrRef = useRef(); // const nvrRef = useRef(); //
const tableList = [//
{
title:'状态码信息',
list:[
{ name: "常规解决方案", value: "manufactor" },
{ name: "状态频率", value: "accountNumber" },
]
},
];
useEffect(() => { useEffect(() => {
dispatch(actions.equipmentWarehouse.getVender()).then((res) => { dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
setvenderList(res.payload.data); setvenderList(res.payload.data);
@ -443,7 +451,7 @@ const Statuscode = (props) => {
> >
<div <div
style={{ style={{
width: 64, width: 84,
height: 22, height: 22,
fontSize: 16, fontSize: 16,
fontfAmily: "PingFangSC-Medium, PingFang SC", fontfAmily: "PingFangSC-Medium, PingFang SC",
@ -535,8 +543,8 @@ const Statuscode = (props) => {
{setup ? ( {setup ? (
<Setup <Setup
visible={true} tableType={CODE}
CODE={CODE} tableList={tableList}
close={() => { close={() => {
setSetup(false); setSetup(false);
attribute(venderList); attribute(venderList);

Loading…
Cancel
Save