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