Browse Source

解决冲突

release_0.0.1
wenlele 3 years ago
parent
commit
870afbcd47
  1. 12
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js
  2. 94
      code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx
  3. 3
      code/VideoAccess-VCMP/web/client/src/utils/webapi.js

12
code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js

@ -27,7 +27,17 @@ export function getNvr(query) {
reducer: { name: "equipmentWarehouseNvr" }, reducer: { name: "equipmentWarehouseNvr" },
}); });
} }
export function delNvr(orgId) {
return (dispatch) =>
basicAction({
type: "del",
dispatch: dispatch,
actionType: "DEL_NVR",
url: `${ApiTable.delNvr.replace("{nvrId}", orgId)}`,
msg: { option: "删除NVR" },
reducer: { name: "" },
});
}
export function addchangeNvr(data) { export function addchangeNvr(data) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({

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

@ -12,16 +12,26 @@ const NvrHeader = (props) => {
const [setup, setSetup] = useState(false); const [setup, setSetup] = useState(false);
const [sideSheet, setSideSheet] = useState(false); const [sideSheet, setSideSheet] = useState(false);
const [setupp, setSetupp] = useState([]); const [setupp, setSetupp] = useState([]);
const [pagination, setPagination] = useState({limit:10,page:0}); const [venderList, setvenderList] = useState([]); //
const [query, setQuery] = useState({ limit: 10, page: 0 });
const SETUPS = "setups"; const SETUPS = "setups";
const [venderList,setvenderList] =useState([]);
useEffect(() => {
dispatch(actions.equipmentWarehouse.getVender()).then((res) => {
setvenderList(res.payload.data);
});
//
localStorage.setItem(SETUPS, JSON.stringify(["a", "c", "d", "e"]));
attribute();
}, []);
useEffect(() => { useEffect(() => {
dispatch(actions.equipmentWarehouse.getVender()).then(res => { equipmentGetNvr();
setvenderList(res.payload.data) }, [query]);
})
}, [])
function equipmentGetNvr() {
dispatch(equipmentWarehouse.getNvr(query));
}
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
@ -63,7 +73,11 @@ const NvrHeader = (props) => {
return ( return (
<> <>
<Button theme="borderless"> <Button theme="borderless">
<NvrModal nvrData={row} modalName="revise" venderList={venderList}/> <NvrModal
nvrData={row}
modalName="revise"
venderList={venderList}
/>
</Button> </Button>
<Button <Button
theme="borderless" theme="borderless"
@ -73,22 +87,16 @@ const NvrHeader = (props) => {
> >
查看 查看
</Button> </Button>
<Button theme="borderless">删除</Button> <Button theme="borderless" onClick={()=>{
dispatch(equipmentWarehouse.delNvr(row.id));
equipmentGetNvr();
}}>删除</Button>
</> </>
); );
}, },
}, },
]; ];
useEffect(() => {
localStorage.setItem(SETUPS, JSON.stringify(["a", "c", "d", "e"]));
dispatch(equipmentWarehouse.getNvr(pagination));
}, [pagination]);
console.log(equipmentWarehouseNvr);
useEffect(() => {
attribute();
}, []);
// //
function attribute() { function attribute() {
const arr = localStorage.getItem(SETUPS) const arr = localStorage.getItem(SETUPS)
@ -204,7 +212,13 @@ console.log(equipmentWarehouseNvr);
cursor: "pointer", cursor: "pointer",
}} }}
> >
<NvrModal modalName="add" venderList={venderList} /> <NvrModal
modalName="add"
venderList={venderList}
close={() => {
equipmentGetNvr();
}}
/>
</div> </div>
</div> </div>
</div> </div>
@ -233,7 +247,6 @@ console.log(equipmentWarehouseNvr);
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
<Form <Form
onSubmit={(values) => console.log(values)} onSubmit={(values) => console.log(values)}
// labelPosition='top'
layout="horizontal" layout="horizontal"
style={{ position: "relative", width: "100%", flex: 1 }} style={{ position: "relative", width: "100%", flex: 1 }}
> >
@ -250,8 +263,13 @@ console.log(equipmentWarehouseNvr);
field="type1" field="type1"
placeholder="全部" placeholder="全部"
> >
<Form.Select.Option value="f1">飞尚科技1</Form.Select.Option> {venderList.map((item) => {
<Form.Select.Option value="f2">飞尚科技2</Form.Select.Option> return (
<Form.Select.Option key={item.id} value={item.id}>
{item.name}
</Form.Select.Option>
);
})}
</Form.Select> </Form.Select>
<Form.Select <Form.Select
label="状态查询:" label="状态查询:"
@ -292,6 +310,7 @@ console.log(equipmentWarehouseNvr);
marginBottom: 20, marginBottom: 20,
marginRight: 20, marginRight: 20,
}} }}
onClick={() => {}}
> >
搜素 搜素
</Button> </Button>
@ -378,20 +397,27 @@ console.log(equipmentWarehouseNvr);
}} }}
pagination={false} pagination={false}
/> />
<div style={{display: "flex", justifyContent:"flex-end",padding:"20px 20px"}}> <div
<span style={{lineHeight:"30px"}}>{equipmentWarehouseNvr.total}个设备</span> style={{
<Pagination display: "flex",
className="22" justifyContent: "flex-end",
total={equipmentWarehouseNvr.total} padding: "20px 20px",
showSizeChanger
pageSizeOpts={[10, 20, 30,40 ]}
onChange={(currentPage,pageSize)=>{
setPagination({limit:pageSize,page:currentPage-1})
console.log(currentPage,pageSize);
}} }}
/> >
<span style={{ lineHeight: "30px" }}>
{equipmentWarehouseNvr.total}个设备
</span>
<Pagination
className="22"
total={equipmentWarehouseNvr.total}
showSizeChanger
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
console.log(currentPage, pageSize);
}}
/>
</div> </div>
{setup ? ( {setup ? (
<Setup <Setup

3
code/VideoAccess-VCMP/web/client/src/utils/webapi.js

@ -11,7 +11,8 @@ export const ApiTable = {
getNvr:'nvr', getNvr:'nvr',
getVender:'vender', getVender:'vender',
nvr:'nvr' nvr:'nvr',
delNvr:'nvr/{nvrId}',
}; };
export const RouteTable = { export const RouteTable = {

Loading…
Cancel
Save