diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js index b50c9b3..f3479b3 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/actions/nvr.js @@ -27,7 +27,17 @@ export function getNvr(query) { 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) { return (dispatch) => basicAction({ diff --git a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx index e27f6c7..abf2aea 100644 --- a/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx +++ b/code/VideoAccess-VCMP/web/client/src/sections/equipmentWarehouse/containers/nvr.jsx @@ -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 ( <> - + ); }, }, ]; - 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", }} > - + { + equipmentGetNvr(); + }} + /> @@ -233,7 +247,6 @@ console.log(equipmentWarehouseNvr);
console.log(values)} - // labelPosition='top' layout="horizontal" style={{ position: "relative", width: "100%", flex: 1 }} > @@ -250,8 +263,13 @@ console.log(equipmentWarehouseNvr); field="type1" placeholder="全部" > - 飞尚科技1 - 飞尚科技2 + {venderList.map((item) => { + return ( + + {item.name} + + ); + })} {}} > 搜素 @@ -378,20 +397,27 @@ console.log(equipmentWarehouseNvr); }} pagination={false} /> -
- 共{equipmentWarehouseNvr.total}个设备 - { - setPagination({limit:pageSize,page:currentPage-1}) - console.log(currentPage,pageSize); +
+ > + + 共{equipmentWarehouseNvr.total}个设备 + + { + setQuery({ limit: pageSize, page: currentPage - 1 }); + console.log(currentPage, pageSize); + }} + />
- {setup ? (