封闭区域管理
parent
ec90ba5831
commit
990964f067
|
|
@ -44,7 +44,7 @@
|
|||
`/primeport/container/supervision/firstLevelDoor/importAndExportPortInfo/vehiclesViolation/vehicleBlacklist/list`
|
||||
|
||||
#### 封闭区域管理
|
||||
- 封闭区域管理/封闭区域管理
|
||||
- 封闭区域管理/封闭区域管理 ##
|
||||
`/primeport/container/supervision/enclosedArea/areaAndEntrance/enclosedArea/list`
|
||||
- 封闭区域管理/封闭区域口门管理
|
||||
`/primeport/container/supervision/enclosedArea/areaAndEntrance/enclosedAreaDoor/list`
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
|||
|
||||
export const enclosedAreaList = declareRequest(
|
||||
"enclosedAreaLoading",
|
||||
`Post > @/primeport/`,
|
||||
`Get > /primeport/closedArea/getCountByHgAuthArea`,
|
||||
);
|
||||
export const enclosedAreaDetailList = declareRequest(
|
||||
"enclosedAreaLoading",
|
||||
`Post > @/primeport/`,
|
||||
`Post > @/primeport/closedArea/list`,
|
||||
);
|
||||
export const enclosedAreaDetailListTree = declareRequest(
|
||||
"enclosedAreaLoading",
|
||||
|
|
@ -14,21 +14,17 @@ export const enclosedAreaDetailListTree = declareRequest(
|
|||
);
|
||||
export const enclosedAreaDetailDelete = declareRequest(
|
||||
"enclosedAreaLoading",
|
||||
`Post > @/primeport/`,
|
||||
`Delete > @/primeport/closedArea/{id}`,
|
||||
);
|
||||
export const enclosedAreaDetailAdd = declareRequest(
|
||||
"enclosedAreaLoading",
|
||||
`Post > @/primeport/`,
|
||||
`Post > @/primeport/closedArea/save`,
|
||||
);
|
||||
export const enclosedAreaDetailUpdate = declareRequest(
|
||||
"enclosedAreaLoading",
|
||||
`Post > @/primeport/`,
|
||||
`Put > @/primeport/closedArea/edit`,
|
||||
);
|
||||
export const enclosedAreaDetailInfo = declareRequest(
|
||||
"enclosedAreaLoading",
|
||||
`Post > @/primeport/`,
|
||||
);
|
||||
export const enclosedAreaDetailSaveElectronicFence = declareRequest(
|
||||
"enclosedAreaLoading",
|
||||
`Post > @/primeport/`,
|
||||
`Get > /primeport/closedArea/{id}`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import useUrlState from "@ahooksjs/use-url-state";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { Button, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
|
|
@ -19,11 +19,12 @@ function DetailList(props) {
|
|||
const [addModalVisible, setAddModalVisible] = useState(false);
|
||||
const [electronicFenceModalVisible, setElectronicFenceModalVisible] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [currentInfo, setCurrentInfo] = useState({});
|
||||
|
||||
const query = useGetUrlQuery();
|
||||
const [urlState, setUrlState] = useUrlState({
|
||||
parentId: query.id,
|
||||
parentName: query.name,
|
||||
parentId: 0,
|
||||
parentName: "",
|
||||
backParentIds: [],
|
||||
backParentNames: [],
|
||||
}, {
|
||||
|
|
@ -36,11 +37,11 @@ function DetailList(props) {
|
|||
},
|
||||
});
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const [form] = Search.useForm();
|
||||
|
||||
const { tableProps, getData } = useTable(props["enclosedAreaDetailList"], {
|
||||
form,
|
||||
params: { parentId: urlState.parentId },
|
||||
params: { parentId: urlState.parentId, closedArea: query.hgAuthArea },
|
||||
manual: true,
|
||||
});
|
||||
|
||||
|
|
@ -62,8 +63,14 @@ function DetailList(props) {
|
|||
});
|
||||
};
|
||||
|
||||
const onUpdateElectronicFence = async (id) => {
|
||||
const { data } = await props["enclosedAreaDetailInfo"]({ id });
|
||||
setCurrentInfo(data);
|
||||
setElectronicFenceModalVisible(true);
|
||||
};
|
||||
|
||||
const onSaveElectronicFence = async (value) => {
|
||||
const { success } = await props["enclosedAreaDetailSaveElectronicFence"]({ id: currentId, value });
|
||||
const { success } = await props["enclosedAreaDetailUpdate"]({ id: currentId, ...currentInfo, location: value });
|
||||
if (success) {
|
||||
message.success("保存成功");
|
||||
setElectronicFenceModalVisible(false);
|
||||
|
|
@ -76,7 +83,7 @@ function DetailList(props) {
|
|||
<Page headerTitle="查看">
|
||||
<Search
|
||||
options={[
|
||||
{ name: "todo1", label: "区域名称" },
|
||||
{ name: "closedAreaName", label: "区域名称" },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
|
|
@ -96,7 +103,7 @@ function DetailList(props) {
|
|||
</Button>
|
||||
)}
|
||||
{
|
||||
urlState.parentId !== query.id && (
|
||||
urlState.parentId !== 0 && (
|
||||
<Button
|
||||
icon={<BackIcon />}
|
||||
onClick={() => {
|
||||
|
|
@ -105,6 +112,10 @@ function DetailList(props) {
|
|||
parentName: urlState.backParentNames.at(-1),
|
||||
backParentIds: urlState.backParentIds.slice(0, -1),
|
||||
backParentNames: urlState.backParentNames.slice(0, -1),
|
||||
closedAreaType: urlState.backParentIds.at(-1) === "0" ? undefined : urlState.closedAreaType,
|
||||
closedAreaTypeName: urlState.backParentIds.at(-1) === "0" ? undefined : urlState.closedAreaTypeName,
|
||||
jurisdictionalCorpId: urlState.backParentIds.at(-1) === "0" ? undefined : urlState.jurisdictionalCorpId,
|
||||
jurisdictionalCorpName: urlState.backParentIds.at(-1) === "0" ? undefined : urlState.jurisdictionalCorpName,
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
|
@ -115,23 +126,31 @@ function DetailList(props) {
|
|||
</Space>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "区域名称", dataIndex: "todo1", render: (_, record) => (
|
||||
{
|
||||
title: "区域名称",
|
||||
dataIndex: "closedAreaName",
|
||||
render: (_, record) => (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setUrlState({
|
||||
parentId: record.id,
|
||||
parentName: record.todo1,
|
||||
parentName: record.closedAreaName,
|
||||
backParentIds: [...urlState.backParentIds, urlState.parentId],
|
||||
backParentNames: [...urlState.backParentNames, urlState.parentName],
|
||||
closedAreaType: record.closedAreaType,
|
||||
closedAreaTypeName: record.closedAreaTypeName,
|
||||
jurisdictionalCorpId: record.jurisdictionalCorpId,
|
||||
jurisdictionalCorpName: record.jurisdictionalCorpName,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{record.todo1}
|
||||
{record.closedAreaName}
|
||||
</Button>
|
||||
) },
|
||||
{ title: "管辖公司", dataIndex: "todo2" },
|
||||
{ title: "区域类型", dataIndex: "todo3" },
|
||||
),
|
||||
},
|
||||
{ title: "管辖公司", dataIndex: "jurisdictionalCorpName" },
|
||||
{ title: "区域类型", dataIndex: "closedAreaTypeName" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
|
|
@ -152,8 +171,7 @@ function DetailList(props) {
|
|||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setCurrentId(record.id);
|
||||
setElectronicFenceModalVisible(true);
|
||||
onUpdateElectronicFence(record.id);
|
||||
}}
|
||||
>
|
||||
电子围栏
|
||||
|
|
@ -179,8 +197,8 @@ function DetailList(props) {
|
|||
addModalVisible && (
|
||||
<AddModal
|
||||
id={currentId}
|
||||
parentId={urlState.parentId}
|
||||
parentName={urlState.parentName}
|
||||
urlState={urlState}
|
||||
query={query}
|
||||
onCancel={() => {
|
||||
setAddModalVisible(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -199,6 +217,7 @@ function DetailList(props) {
|
|||
}}
|
||||
onOk={onSaveElectronicFence}
|
||||
disabled={props.entrance === "enterprise"}
|
||||
position={currentInfo.location}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
@ -207,7 +226,7 @@ function DetailList(props) {
|
|||
}
|
||||
|
||||
const AddModalComponent = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
const [form] = FormBuilder.useForm();
|
||||
|
||||
const getData = async () => {
|
||||
const { data } = await props["enclosedAreaDetailInfo"]({ id: props.id });
|
||||
|
|
@ -215,14 +234,24 @@ const AddModalComponent = (props) => {
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
props.id && getData();
|
||||
if (props.id) {
|
||||
getData();
|
||||
}
|
||||
else {
|
||||
form.setFieldValue("closedAreaType", props.urlState.closedAreaType);
|
||||
form.setFieldValue("closedAreaTypeName", props.urlState.closedAreaTypeName);
|
||||
form.setFieldValue("jurisdictionalCorpId", props.urlState.jurisdictionalCorpId);
|
||||
form.setFieldValue("jurisdictionalCorpName", props.urlState.jurisdictionalCorpName);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
const { success } = await props[props.id ? "enclosedAreaDetailUpdate" : "enclosedAreaDetailAdd"]({
|
||||
...values,
|
||||
id: props.id,
|
||||
parentId: props.parentId,
|
||||
parentId: props.urlState.parentId,
|
||||
hgAuthArea: props.query.hgAuthArea,
|
||||
hgAuthAreaName: props.query.hgAuthAreaName,
|
||||
});
|
||||
if (success) {
|
||||
message.success("操作成功");
|
||||
|
|
@ -245,13 +274,41 @@ const AddModalComponent = (props) => {
|
|||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
span={24}
|
||||
labelCol={{ span: 8 }}
|
||||
labelCol={{ span: 10 }}
|
||||
loading={props.enclosedArea.enclosedAreaLoading}
|
||||
options={[
|
||||
{ name: "parentName", label: "上级区域名称", required: false, render: <Tag color="blue">{props.parentName || "无"}</Tag> },
|
||||
{ name: "todo1", label: "区域名称" },
|
||||
{ name: "todo2", label: "区域类型", render: (<DictionarySelectTree dictValue="ENCLOSED_AREA_TYPE" />) },
|
||||
{ name: "todo3", label: "管辖公司", render: (<DepartmentSelectTree searchType="inType" params={{ enterpriseType: [2] }} />) },
|
||||
{
|
||||
name: "parentName",
|
||||
label: "上级区域名称",
|
||||
required: false,
|
||||
render: <Tag color="blue">{props.urlState.parentName || "无"}</Tag>,
|
||||
},
|
||||
{ name: "closedAreaName", label: "区域名称" },
|
||||
{
|
||||
name: "closedAreaType",
|
||||
label: "区域类型",
|
||||
render: (
|
||||
<DictionarySelectTree
|
||||
disabled={props.urlState.closedAreaType}
|
||||
dictValue="ENCLOSED_AREA_TYPE"
|
||||
onGetLabel={label => form.setFieldValue("closedAreaTypeName", label)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{ name: "closedAreaTypeName", label: "区域类型名称", onlyForLabel: true },
|
||||
{
|
||||
name: "jurisdictionalCorpId",
|
||||
label: "管辖公司",
|
||||
render: (
|
||||
<DepartmentSelectTree
|
||||
searchType="inType"
|
||||
params={{ enterpriseType: [2] }}
|
||||
disabled={props.urlState.jurisdictionalCorpId}
|
||||
onGetLabel={label => form.setFieldValue("jurisdictionalCorpName", label)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{ name: "jurisdictionalCorpName", label: "管辖公司名称", onlyForLabel: true },
|
||||
]}
|
||||
form={form}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ function List(props) {
|
|||
<Page isShowAllAction={false}>
|
||||
<Table
|
||||
columns={[
|
||||
{ title: "港区名称", dataIndex: "todo1" },
|
||||
{ title: "区域数", dataIndex: "todo2" },
|
||||
{ title: "管辖单位数", dataIndex: "todo3" },
|
||||
{ title: "港区名称", dataIndex: "hgAuthAreaName" },
|
||||
{ title: "区域数", dataIndex: "totalAreaCount" },
|
||||
{ title: "管辖单位数", dataIndex: "totalCorpCount" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 100,
|
||||
|
|
@ -24,7 +24,7 @@ function List(props) {
|
|||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./detailList?id=${record.id}&name=${record.name}`);
|
||||
props.history.push(`./detailList?hgAuthArea=${record.hgAuthArea}&hgAuthAreaName=${record.hgAuthAreaName}`);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
|
|
|
|||
Loading…
Reference in New Issue