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. 84
      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" },
});
}
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({

84
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 (
<>
<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,21 +397,28 @@ console.log(equipmentWarehouseNvr);
}}
pagination={false}
/>
<div style={{display: "flex", justifyContent:"flex-end",padding:"20px 20px"}}>
<span style={{lineHeight:"30px"}}>{equipmentWarehouseNvr.total}个设备</span>
<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);
pageSizeOpts={[10, 20, 30, 40]}
onChange={(currentPage, pageSize) => {
setQuery({ limit: pageSize, page: currentPage - 1 });
console.log(currentPage, pageSize);
}}
/>
</div>
{setup ? (
<Setup
visible={true}

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

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

Loading…
Cancel
Save