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