Browse Source

表格设置完成

release_0.0.1
wenlele 3 years ago
parent
commit
7113aaf672
  1. 2
      code/VideoAccess-VCMP/web/.vscode/settings.json
  2. 138
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/setup.jsx
  3. 74
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx
  4. 136
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx

2
code/VideoAccess-VCMP/web/.vscode/settings.json

@ -1,4 +1,4 @@
// //
{ {
"editor.fontSize": 16, "editor.fontSize": 12,
} }

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

@ -8,65 +8,117 @@ import {
} from "@douyinfe/semi-ui"; } from "@douyinfe/semi-ui";
function Setup(props) { function Setup(props) {
const { dispatch, actions, user, loading, visible, close, editData } = props; const { dispatch, actions, user, loading, visible, close, SETUPS } = props;
const [checkeds, setCheckeds] = useState([]);
const [check, setCheck] = useState([]);
const checkboxcss = { width: "21%", height: 16, marginBottom: "20px" };
useEffect(() => {
//
const ISgetItem = localStorage.getItem(SETUPS);
setCheck(ISgetItem ? JSON.parse(ISgetItem):[]);
}, []);
return ( return (
<Modal <Modal
title="表格属性设置" title="表格属性设置"
visible={visible} visible={visible}
style={{ width: 580 }} style={{ width: 580 }}
onOk={() => { onOk={() => {
localStorage.setItem(SETUPS, JSON.stringify(checkeds));
close(); close();
}} }}
onCancel={() => { onCancel={() => {
close(); close();
}} }}
> >
<div <CheckboxGroup
style={{ style={{ width: "100%", fontSize: 14 }}
width: 529, key="primary1"
height: 121, direction="horizontal"
border: "1px solid #EAEAEA", defaultValue={check}
padding: "0px 5px", aria-label="表格属性设置"
borderRadius: 4, onChange={(checked) => {
setCheckeds(checked);
}} }}
> >
<div style={{ borderBottom: "1px solid #EAEAEA", fontSize: 14,marginLeft:"10px",padding: "8px 0px",}}> <div
设备信息 style={{
</div> width: 529,
<CheckboxGroup height: 121,
options={[ border: "1px solid #EAEAEA",
{ label: "设备厂家", value: "a" }, padding: "0px 5px",
{ label: "添加账号", value: "b" }, borderRadius: 4,
{ label: "通道数", value: "c" }, marginBottom: "20px",
{ label: "端口", value: "d" },
{ label: "设备状态", value: "e" },
{ label: "创建时间", value: "f" },
]}
style={{ width: "100%",fontSize: 14 }}
direction="horizontal"
defaultValue={["hotsoon"]}
// name={style}
onChange={(checked) => {
console.log(checked);
}} }}
/> >
</div> <div
<div style={{ width: 529, height: 92 ,borderRadius: 4,border: "1px solid #EAEAEA",}}> style={{
<div>项目信息</div> borderBottom: "1px solid #EAEAEA",
<CheckboxGroup marginLeft: "10px",
options={[ padding: "8px 0px",
{ label: "项目名称", value: "g" }, }}
{ label: "things名称", value: "h" }, >
{ label: "things数量", value: "i" }, 设备信息
]} </div>
style={{ width: "100%", }} <div style={{ padding: "15px 30px" }}>
direction="horizontal" <Checkbox value="a" style={checkboxcss}>
defaultValue={["hotsoon"]} 设备厂家
onChange={(checked) => { </Checkbox>
console.log(checked); <Checkbox value="b" style={checkboxcss}>
添加账号
</Checkbox>
<Checkbox value="c" style={checkboxcss}>
通道数
</Checkbox>
<Checkbox value="d" style={checkboxcss}>
端口
</Checkbox>
<Checkbox value="e" style={checkboxcss}>
设备状态
</Checkbox>
<Checkbox value="f" style={checkboxcss}>
创建时间
</Checkbox>
</div>
</div>
<div
style={{
width: 529,
height: 92,
border: "1px solid #EAEAEA",
padding: "0px 5px",
borderRadius: 4,
}} }}
/> >
</div> <div
style={{
borderBottom: "1px solid #EAEAEA",
marginLeft: "10px",
padding: "8px 0px",
}}
>
项目信息
</div>
<div style={{ padding: "15px 30px" }}>
<Checkbox value="g" style={checkboxcss}>
项目名称
</Checkbox>
<Checkbox value="h" style={checkboxcss}>
things名称
</Checkbox>
<Checkbox value="i" style={checkboxcss}>
things数量
</Checkbox>
</div>
</div>
</CheckboxGroup>
</Modal> </Modal>
); );
} }

74
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/components/sideSheet.jsx

@ -0,0 +1,74 @@
import React, { useState, useEffect } from "react";
import { SideSheet, Tabs, TabPane } from "@douyinfe/semi-ui";
function SideSheets(props) {
const { dispatch, actions, user, loading, visible, close, SETUPS } = props;
const [checkeds, setCheckeds] = useState([]);
const [check, setCheck] = useState([]);
const list = [
{ name: "1111", a: "a", b: "B", c: "C", d: "C" },
{ name: "2222", a: "a", b: "B", c: "C", d: "C" },
{ name: "3333", a: "a", b: "B", c: "C", d: "C" },
{ name: "4444", a: "a", b: "B", c: "C", d: "C" },
];
const styles = {
width: 180,
textAlign: "center",
background: "#FFFFFF",
padding: "12px 17px",
margin: "30px 0 0 10px",
lineHeight: "20px",
};
useEffect(() => {}, []);
return (
<SideSheet
visible={visible}
title="智慧设备NVR"
style={{ background: "#F9FBFF" }}
size="large"
onCancel={() => {
close();
}}
>
<Tabs type="line">
<TabPane tab="项目信息" itemKey="1">
{list.map((item) => {
return (
<div
key={item.name}
style={{
display: "inline-block",
width: 200,
margin: "12px 8px",
}}
>
<div
style={{
lineHeight: "32px",
background: "#1859C1",
borderRadius: 3,
textAlign: "center",
}}
>
{item.name}
</div>
<div style={styles}>{item.a}</div>
<div style={styles}>{item.b}</div>
<div style={styles}>{item.c}</div>
<div style={styles}>{item.d}</div>
</div>
);
})}
</TabPane>
<TabPane tab="设备信息" itemKey="2">
快速起步
</TabPane>
</Tabs>
</SideSheet>
);
}
export default SideSheets;

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

@ -4,20 +4,19 @@ import { Button, Form, Input, Row, Table } from "@douyinfe/semi-ui";
import "../style.less"; import "../style.less";
import NvrModal from "../components/nvrModal"; import NvrModal from "../components/nvrModal";
import Setup from "../components/setup"; import Setup from "../components/setup";
import SideSheets from "../components/sideSheet";
const NvrHeader = (props) => { const NvrHeader = (props) => {
const { dispatch, actions, user, loading } = props; const { dispatch, actions, user, loading } = props;
const [setup, setSetup] = useState(false); const [setup, setSetup] = useState(false);
const [sideSheet, setSideSheet] = useState(false);
const [setupp, setSetupp] = useState([]);
const SETUPS = "setups";
const screen = {
width: 193,
marginRight: 20,
marginBottom: 16,
color: "rgba(0, 0, 0, 0.65)",
};
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
render: (text, record, index) => { render: (text, record, index) => {
return index + 1; return index + 1;
}, },
@ -36,29 +35,19 @@ const NvrHeader = (props) => {
width: "10px", width: "10px",
height: "10px", height: "10px",
borderRadius: "50%", borderRadius: "50%",
display: "inline-block",marginRight:"10px" display: "inline-block",
}} /> marginRight: "10px",
}}
/>
{record.name} {record.name}
</div> </div>
); );
}, },
}, },
{
title: "设备厂家",
dataIndex: "size",
},
{ {
title: "SIP地址", title: "SIP地址",
dataIndex: "owner", dataIndex: "owner",
}, },
{
title: "端口号",
dataIndex: "updateTime",
},
{
title: "通道数",
dataIndex: "nameIconSrc",
},
{ {
title: "操作", title: "操作",
width: "20%", width: "20%",
@ -67,14 +56,96 @@ const NvrHeader = (props) => {
// console.log(row); // console.log(row);
return ( return (
<> <>
<Button theme="borderless"><NvrModal nvrData={row} modalName="revise" /></Button> <Button theme="borderless">
<Button theme="borderless">查看</Button> <NvrModal nvrData={row} modalName="revise" />
</Button>
<Button
theme="borderless"
onClick={() => {
setSideSheet(true);
}}
>
查看
</Button>
<Button theme="borderless">删除</Button> <Button theme="borderless">删除</Button>
</> </>
); );
}, },
}, },
]; ];
useEffect(() => {
attribute();
}, []);
//
function attribute() {
const arr = localStorage.getItem(SETUPS)
? JSON.parse(localStorage.getItem(SETUPS))
: [];
const column = [
{
title: "设备厂家",
dataIndex: "size",
key: "a",
},
{
title: "添加张账号",
dataIndex: "size",
key: "b",
},
{
title: "通道数",
dataIndex: "size",
key: "c",
},
{
title: "端口",
dataIndex: "size",
key: "d",
},
{
title: "设备状态",
dataIndex: "size",
key: "e",
},
{
title: "创建时间",
dataIndex: "size",
key: "f",
},
{
title: "项目名称",
dataIndex: "size",
key: "g",
},
{
title: "things名称",
dataIndex: "updateTime",
key: "h",
},
{
title: "things数量",
dataIndex: "updateTime",
key: "i",
},
];
for (let i = 0; i < arr.length; i++) {
let colum = column.filter((item) => {
return item.key === arr[i];
});
columns.splice(i + 2, 0, colum[0]);
}
setSetupp(columns);
}
const screen = {
width: 193,
marginRight: 20,
marginBottom: 16,
color: "rgba(0, 0, 0, 0.65)",
};
const data = [ const data = [
{ {
key: "1", key: "1",
@ -295,7 +366,7 @@ const NvrHeader = (props) => {
}} }}
> >
<img <img
src="../../../../assets/images/background/setup.png" src="/assets/images/background/setup.png"
alt="设置" alt="设置"
style={{ width: 18, height: 18 }} style={{ width: 18, height: 18 }}
/> />
@ -314,18 +385,22 @@ const NvrHeader = (props) => {
</div> </div>
</div> </div>
<Table <Table
columns={columns} columns={setupp}
dataSource={data} dataSource={data}
pagination={false} pagination={false}
bordered={false} bordered={false}
empty="暂无数据" empty="暂无数据"
style={{ padding: "0px 20px" }} style={{
padding: "0px 20px",
}}
/> />
{setup ? ( {setup ? (
<Setup <Setup
visible={true} visible={true}
SETUPS={SETUPS}
close={() => { close={() => {
setSetup(false); setSetup(false);
attribute();
// setEditData(null) // setEditData(null)
}} }}
// reportType={reportType} // reportType={reportType}
@ -334,6 +409,17 @@ const NvrHeader = (props) => {
) : ( ) : (
"" ""
)} )}
{sideSheet ? (
<SideSheets
visible={true}
close={() => {
setSideSheet(false);
}}
/>
) : (
[]
)}
</div> </div>
</> </>
); );

Loading…
Cancel
Save