feat(map): port XiaoFang对接接口

master
LiuJiaNan 2026-07-21 09:39:41 +08:00
parent 226b0a7350
commit 48f768bdc6
5 changed files with 75 additions and 144 deletions

View File

@ -58,5 +58,9 @@ export const getCorpInfoCorpUserStatisticPage = declareRequest(
); );
export const getCorpInfoListAll = declareRequest( export const getCorpInfoListAll = declareRequest(
"biFullLoading", "biFullLoading",
"Get > /basicInfo/corpInfo/listAll", "Post > @/basicInfo/corpInfo/corpListAll",
);
export const getFirePointDeviceList = declareRequest(
"xiaoFangFirePointDeviceListLoading",
"Post > @/fireCheck/firePoint/deviceList",
); );

View File

@ -19,6 +19,7 @@ function PersonnelStatsPanel(props) {
const [isVisible, setIsVisible] = useState(false); const [isVisible, setIsVisible] = useState(false);
const loadStatistics = async (enterpriseType) => { const loadStatistics = async (enterpriseType) => {
setIsVisible(false);
const { data } = await props.getCorpInfoCorpUserStatisticPage({ const { data } = await props.getCorpInfoCorpUserStatisticPage({
portArea, portArea,
enterpriseType, enterpriseType,
@ -31,7 +32,6 @@ function PersonnelStatsPanel(props) {
if (index === activeTab) if (index === activeTab)
return; return;
setIsVisible(false);
setActiveTab(index); setActiveTab(index);
loadStatistics(index === 0 ? 2 : 3); loadStatistics(index === 0 ? 2 : 3);
}; };

View File

@ -1,89 +1,33 @@
import { Button, Form, Input, Select, Space } from "antd"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { useContext, useState } from "react"; import { Button, Form, Input, Space, Spin } from "antd";
import { useContext, useEffect, useState } from "react";
import SeamlessScroll from "zy-react-library/components/SeamlessScroll"; import SeamlessScroll from "zy-react-library/components/SeamlessScroll";
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
import { NS_BI } from "~/enumerate/namespace";
import Title from "~/pages/Container/Map/components/Content/port/Title"; import Title from "~/pages/Container/Map/components/Content/port/Title";
import { Context } from "~/pages/Container/Map/js/context"; import { Context } from "~/pages/Container/Map/js/context";
import "./index.less"; import "./index.less";
const { Option } = Select; const XiaoFang = (props) => {
const { portArea } = useContext(Context);
const XiaoFang = () => {
const { currentPort, portArea, currentBranchOffice } = useContext(Context);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [deviceTypeList, setDeviceTypeList] = useState([ const [block2List, setBlock2List] = useState([]);
{ name: "地下消防栓栓体", bianma: "dxxfsst" }, const [isVisible, setIsVisible] = useState(true);
{ name: "红色灭火器", bianma: "b9561bbc6243bfac6ebe0397a62f55" },
{ name: "灭火毯", bianma: "mgt" },
{ name: "并盖", bianma: "jg001" },
{ name: "消防枪头", bianma: "xfqt001" },
{ name: "强化水灭火器", bianma: "qhsmhq001" },
{ name: "灭火器托架", bianma: "mhqtj001" },
{ name: "消防箱", bianma: "xfx001" },
{ name: "干粉灭火器", bianma: "xfsb001" },
{ name: "二氧化碳灭火器", bianma: "ryhrmhq01" },
{ name: "消防栓", bianma: "243bfac6ebe0397a62f55" },
{ name: "水基型灭火器", bianma: "sjxmhq01" },
{ name: "消防水带", bianma: "xfsd01" },
{ name: "水枪", bianma: "shuiq" },
{ name: "消防栓箱体", bianma: "xfxxt" },
{ name: "灭火器箱", bianma: "mhqx01" },
{ name: "消防桶", bianma: "xft01" },
{ name: "消防锹", bianma: "xgq01" },
{ name: "消防斧", bianma: "xff01" },
{ name: "消防钩", bianma: "xfg01" },
{ name: "水枪、水带接口", bianma: "sdsddj" },
{ name: "消防二分水器", bianma: "scrfsq" },
{ name: "消防栓扳手", bianma: "xfsbs" },
{ name: "强光照明灯", bianma: "qgzmd" },
{ name: "铁铤", bianma: "tx" },
{ name: "消防头盔", bianma: "xftk" },
{ name: "消防员灭火防护服", bianma: "xfymhf" },
{ name: "消防手套", bianma: "xfst" },
{ name: "消防安全腰带、消防腰带、斧套", bianma: "xfanyd" },
{ name: "消防员灭火防护靴", bianma: "xfymhhx" },
{ name: "消防轻型安全绳", bianma: "xfqxaqs" },
{ name: "消防过滤式综合防毒面具", bianma: "xfglszhfdmj" },
{ name: "多功能水枪", bianma: "dgnsq" },
{ name: "消防呼吸面罩", bianma: "xfhxmz" },
{ name: "微型消防站柜子", bianma: "wxxfzgz" },
{ name: "七氟丙烷灭火器", bianma: "qfbwmhq" },
{ name: "水泵接合器", bianma: "38" },
{ name: "消防器材箱", bianma: "xfsx" },
{ name: "消防砂", bianma: "xfs" },
{ name: "泡沫枪", bianma: "poameqiang" },
{ name: "移动消防水炮", bianma: "yidongxiaofangshuipao" },
{ name: "移动泡沫炮", bianma: "yidongpaomenpao" },
]);
const [block2List, setBlock2List] = useState([
{ FIRE_DEVICE_TYPE_NAME: "干粉灭火器", FIRE_POINT_NAME: "浴池男更衣室楼梯", COUNT: 3 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "综合楼一楼东", COUNT: 2 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "三中队二层警容镜旁", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "一中队二层西", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "二中队二层楼道东", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "一中队二层东", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "三中队二层更衣室门前", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "三中队车库器材室门前", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "三中队一层车库楼梯口东侧", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "三中队一层车库楼梯口东侧", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "三中队燃料间", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "二中队二层楼道西", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "二中队老楼车库", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "三中队三层楼道", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "一中队车棚东南角", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "一中队厨房门南侧", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "一中队一层东", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "二中队一层车库东", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "一中队一层西", COUNT: 1 },
{ FIRE_DEVICE_TYPE_NAME: "灭火器箱", FIRE_POINT_NAME: "二中队三层楼道西", COUNT: 1 },
]);
const handleReset = () => { const getData = async (values) => {
form.resetFields(); setIsVisible(false);
form.submit(); const { data } = await props.getFirePointDeviceList({ portArea, ...values });
setBlock2List(data);
setIsVisible(true);
}; };
const handleQuery = (values) => { useEffect(() => {
console.log(values); getData();
}, []);
const onReset = () => {
form.resetFields();
form.submit();
}; };
return ( return (
@ -91,23 +35,44 @@ const XiaoFang = () => {
<div className="block1"> <div className="block1">
<Title title="消防设备查询" /> <Title title="消防设备查询" />
<div className="content"> <div className="content">
<Form form={form} labelCol={{ span: 8 }} onFinish={handleQuery}> <Form form={form} labelCol={{ span: 8 }} onFinish={getData} styles={{ label: { color: "#fff" } }}>
<Form.Item label="消防设备类型" name="FIRE_DEVICE_TYPE_ID"> <Form.Item label="消防设备类型" name="fireDeviceType">
<Select placeholder="请选择消防设备类型" classNames={{ root: "xiaofang-select" }}> <DictionarySelect
{deviceTypeList.map(item => ( placeholder="消防设备类型"
<Option key={item.bianma} value={item.bianma}> classNames={{ root: "xiaofang-select" }}
{item.name} styles={{
</Option> root: {
))} color: "#fff",
</Select> backgroundColor: "rgba(2, 30, 81, 0.85)",
borderColor: "rgba(2, 30, 81, 1)",
},
placeholder: {
color: "#fff",
},
suffix: {
color: "#fff",
},
}}
dictValue="fire_device_type"
/>
</Form.Item> </Form.Item>
<Form.Item label="关键字" name="KEYWORDS"> <Form.Item label="关键字" name="vagueKey">
<Input placeholder="请输入消防点位关键字" classNames={{ input: "xiaofang-input" }} /> <Input
placeholder="请输入消防点位关键字"
classNames={{ input: "xiaofang-input" }}
styles={{
root: {
color: "#fff",
backgroundColor: "rgba(2, 30, 81, 0.85)",
borderColor: "rgba(2, 30, 81, 1)",
},
}}
/>
</Form.Item> </Form.Item>
<Form.Item label=" " colon={false}> <Form.Item label=" " colon={false}>
<div className="button"> <div className="button">
<Space> <Space>
<Button onClick={handleReset}>重置</Button> <Button onClick={onReset}>重置</Button>
<Button type="primary" onClick={form.submit}>查询</Button> <Button type="primary" onClick={form.submit}>查询</Button>
</Space> </Space>
</div> </div>
@ -126,21 +91,19 @@ const XiaoFang = () => {
<div className="td">数量</div> <div className="td">数量</div>
</div> </div>
<div className="scroll"> <div className="scroll">
<Spin spinning={props.bi.xiaoFangFirePointDeviceListLoading}>
{isVisible && (
<SeamlessScroll list={block2List} step={0.5}> <SeamlessScroll list={block2List} step={0.5}>
{block2List.map((item, index) => ( {block2List.map((item, index) => (
<div key={index} className="tr"> <div key={index} className="tr">
<div className="td"> <div className="td">{item.firePointName}</div>
{item.FIRE_POINT_NAME} <div className="td">{item.fireDeviceTypeName}</div>
</div> <div className="td">{item.deviceCount}</div>
<div className="td">
{item.FIRE_DEVICE_TYPE_NAME}
</div>
<div className="td">
{item.COUNT}
</div>
</div> </div>
))} ))}
</SeamlessScroll> </SeamlessScroll>
)}
</Spin>
</div> </div>
</div> </div>
</div> </div>
@ -149,4 +112,4 @@ const XiaoFang = () => {
); );
}; };
export default XiaoFang; export default Connect([NS_BI], true)(XiaoFang);

View File

@ -16,47 +16,11 @@
text-align: center; text-align: center;
} }
.@{ant-prefix}-form-item .@{ant-prefix}-form-item-label > label {
color: #fff;
}
.xiaofang-input { .xiaofang-input {
&.@{ant-prefix}-input-outlined {
background-color: rgba(2, 30, 81, 0.85);
border-color: rgba(2, 30, 81, 1);
color: #fff;
&::placeholder { &::placeholder {
color: #fff; color: #fff;
} }
} }
&.@{ant-prefix}-select-outlined:not(&.@{ant-prefix}-select-customize-input) &.@{ant-prefix}-select-selector {
background-color: rgba(2, 30, 81, 0.85);
border-color: rgba(2, 30, 81, 1);
color: #fff;
}
}
.xiaofang-select {
.@{ant-prefix}-select-selection-placeholder {
color: #fff;
}
.@{ant-prefix}-select-arrow {
color: #fff;
}
}
.@{ant-prefix}-select-single.@{ant-prefix}-select-open .@{ant-prefix}-select-selection-item {
color: #fff;
}
.@{ant-prefix}-select-outlined:not(.@{ant-prefix}-select-customize-input) .@{ant-prefix}-select-selector {
background-color: rgba(2, 30, 81, 0.85);
border-color: rgba(2, 30, 81, 1);
color: #fff;
}
} }
} }

View File

@ -130,7 +130,7 @@ export default function useMapMethods(viewerRef, request) {
// 添加分公司点 // 添加分公司点
const addBranchOfficePoint = async (portArea = 1, pointInfo = null) => { const addBranchOfficePoint = async (portArea = 1, pointInfo = null) => {
const { data } = await request.getCorpInfoListAll({ portArea, inType: [0, 1, 6] }); const { data } = await request.getCorpInfoListAll({ eqPortArea: portArea, inType: [0, 1, 2, 6] });
mitt.emit(changeCoverMaskVisibleMittKey, true); mitt.emit(changeCoverMaskVisibleMittKey, true);
let branchOfficePoint = []; let branchOfficePoint = [];
if (!pointInfo) { if (!pointInfo) {