1、修改四个新增编辑页面的底部返回、取消按钮为固定到到底部

2、修改删除提示语
3、优化消防救援队名称判重逻辑
master
shenzhidan 2026-03-04 09:35:23 +08:00
parent 3293769b9d
commit 2823fc5ecc
12 changed files with 97 additions and 102 deletions

View File

@ -280,10 +280,20 @@ function Add(props) {
return (
<Page
loading={loading || uploadFileLoading || deleteFileLoading || getFileLoading}
isShowFooter={false}
headerTitle={pageTitle}
customActionButtons={(
<Space size={16}>
<Button onClick={() => props.history.goBack()}>
取消
</Button>
<Button type="primary" htmlType="submit" form="control-room-form" loading={submitting}>
提交
</Button>
</Space>
)}
>
<Form
id="control-room-form"
form={form}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
@ -503,7 +513,7 @@ function Add(props) {
/>
</Form.Item>
</div>
{devices.length > 1 && (
{index !== 0 && (
<Button type="primary" danger onClick={() => removeDevice(device.key)}>
删除
</Button>
@ -583,7 +593,7 @@ function Add(props) {
</Col>
<Col span={12}>
<div style={{ textAlign: 'right', paddingTop: 30 }}>
{persons.length > 1 && (
{index !== 0 && (
<Button type="primary" danger onClick={() => removePerson(person.key)}>
删除
</Button>
@ -595,16 +605,6 @@ function Add(props) {
))}
</Card>
<Form.Item wrapperCol={{ span: 24 }} style={{ textAlign: "center", marginTop: 24 }}>
<Space size={16}>
<Button onClick={() => props.history.goBack()}>
取消
</Button>
<Button type="primary" htmlType="submit" loading={submitting}>
提交
</Button>
</Space>
</Form.Item>
</Form>
<MapSelector

View File

@ -121,8 +121,7 @@ function List(props) {
const onDelete = (id) => {
Modal.confirm({
title: "确认删除",
content: "删除后不可恢复,确认继续?",
title: "确认要删除吗?",
okText: "确认",
cancelText: "取消",
okButtonProps: { danger: true, loading: deleting },

View File

@ -163,8 +163,12 @@ function View(props) {
return (
<Page
loading={loading || dictLoading || getFileLoading}
isShowFooter={false}
headerTitle={pageTitle}
customActionButtons={(
<Button onClick={() => props.history.goBack()}>
返回
</Button>
)}
>
{detail && (
<div>
@ -238,11 +242,6 @@ function View(props) {
/>
</Card>
<div style={{ textAlign: "center", marginTop: 24 }}>
<Button onClick={() => props.history.goBack()}>
返回
</Button>
</div>
</div>
)}
</Page>

View File

@ -214,10 +214,20 @@ function Add(props) {
return (
<Page
loading={loading || uploadFileLoading || deleteFileLoading || getFileLoading}
isShowFooter={false}
headerTitle={pageTitle}
customActionButtons={(
<Space size={16}>
<Button onClick={() => props.history.goBack()}>
取消
</Button>
<Button type="primary" htmlType="submit" form="pump-room-form" loading={submitting}>
提交
</Button>
</Space>
)}
>
<Form
id="pump-room-form"
form={form}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
@ -468,7 +478,7 @@ function Add(props) {
/>
</Form.Item>
</div>
{devices.length > 1 && (
{index !== 0 && (
<Button
type="primary"
danger
@ -485,16 +495,6 @@ function Add(props) {
))}
</Card>
<Form.Item wrapperCol={{ span: 24 }} style={{ textAlign: "center", marginTop: 24 }}>
<Space size={16}>
<Button onClick={() => props.history.goBack()}>
取消
</Button>
<Button type="primary" htmlType="submit" loading={submitting}>
提交
</Button>
</Space>
</Form.Item>
</Form>
<MapSelector

View File

@ -114,8 +114,7 @@ function List(props) {
const onDelete = (id) => {
Modal.confirm({
title: "确认删除",
content: "删除后不可恢复,确认继续?",
title: "确认要删除吗?",
okText: "确认",
cancelText: "取消",
okButtonProps: { danger: true, loading: deleting },

View File

@ -2,6 +2,7 @@ import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Card, Descriptions, message, Table } from "antd";
import { useEffect, useState } from "react";
import PreviewImg from "zy-react-library/components/PreviewImg";
import Page from "zy-react-library/components/Page";
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
import useDictionary from "zy-react-library/hooks/useDictionary";
@ -9,7 +10,6 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import { getFileUrl } from "zy-react-library/utils";
import { NS_PUMP_ROOM } from "~/enumerate/namespace";
import PreviewImg from "zy-react-library/components/PreviewImg";
function View(props) {
const query = useGetUrlQuery();
@ -54,12 +54,13 @@ function View(props) {
fetchDict();
}, []);
// 获取状态显示文本
const getStatusLabel = () => {
if (!detail)
if (!detail) {
return "-";
if (detail.roomStatusName)
}
if (detail.roomStatusName) {
return detail.roomStatusName;
}
const match = statusDict.find(item => item.dictValue === detail.pumpRoomStatus);
return match?.dictLabel || detail.pumpRoomStatus || "-";
};
@ -68,8 +69,6 @@ function View(props) {
setLoading(true);
try {
const { data } = await props["pumpRoomDetail"]({ id: query.id });
// 获取图片文件
const roomKey = data.roomId || data.pumpRoomId || data.id;
if (roomKey) {
const files = await getFile({
@ -78,7 +77,6 @@ function View(props) {
});
data.roomImages = normalizeFiles(files);
}
setDetail(data);
}
catch (error) {
@ -93,7 +91,6 @@ function View(props) {
query.id && getData();
}, [query.id]);
// 设备表格列定义
const deviceColumns = [
{
title: "序号",
@ -148,12 +145,16 @@ function View(props) {
return (
<Page
loading={loading || getFileLoading}
isShowFooter={false}
headerTitle={pageTitle}
customActionButtons={(
<Button onClick={() => props.history.goBack()}>
返回
</Button>
)}
>
{detail && (
<div>
<Card title="基本信息" bordered={false} style={{ boxShadow: 'none' }}>
<Card title="基本信息" bordered={false} style={{ boxShadow: "none" }}>
<Descriptions
bordered
column={2}
@ -191,10 +192,7 @@ function View(props) {
{
label: "消防泵房图片",
children: detail.roomImages && detail.roomImages.length > 0
? (
<PreviewImg files={detail.roomImages} />
)
? <PreviewImg files={detail.roomImages} />
: "-",
span: 2,
},
@ -202,7 +200,7 @@ function View(props) {
/>
</Card>
<Card title="设备信息" style={{ marginTop: 24, boxShadow: 'none' }} bordered={false}>
<Card title="设备信息" style={{ marginTop: 24, boxShadow: "none" }} bordered={false}>
<Table
bordered
columns={deviceColumns}
@ -212,12 +210,6 @@ function View(props) {
locale={{ emptyText: "暂无设备信息" }}
/>
</Card>
<div style={{ textAlign: "center", marginTop: 24 }}>
<Button onClick={() => props.history.goBack()}>
返回
</Button>
</div>
</div>
)}
</Page>

View File

@ -56,6 +56,17 @@ function Add(props) {
}
};
const handleTeamNameChange = () => {
if (form.getFieldError("teamName").length > 0) {
form.setFields([
{
name: "teamName",
errors: [],
},
]);
}
};
// 消防队员列表
const createEmptyMember = () => ({
key: `${Date.now()}-${Math.random()}`,
@ -199,10 +210,20 @@ function Add(props) {
return (
<Page
loading={loading}
isShowFooter={false}
headerTitle={pageTitle}
customActionButtons={(
<Space size={16}>
<Button onClick={() => props.history.goBack()}>
取消
</Button>
<Button type="primary" htmlType="submit" form="rescue-team-form" loading={submitting}>
提交
</Button>
</Space>
)}
>
<Form
id="rescue-team-form"
form={form}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
@ -230,6 +251,7 @@ function Add(props) {
>
<Input
placeholder="请输入救援队名称"
onChange={handleTeamNameChange}
onBlur={e => {
form.setFieldValue("teamName", e.target.value?.trim());
}}
@ -436,16 +458,6 @@ function Add(props) {
))}
</Card>
<Form.Item wrapperCol={{ span: 24 }} style={{ textAlign: "center", marginTop: 24 }}>
<Space size={16}>
<Button onClick={() => props.history.goBack()}>
取消
</Button>
<Button type="primary" htmlType="submit" loading={submitting}>
提交
</Button>
</Space>
</Form.Item>
</Form>
</Page>
);

View File

@ -95,8 +95,7 @@ function List(props) {
const onDelete = (id) => {
Modal.confirm({
title: "确认删除",
content: "删除后不可恢复,确认继续?",
title: "确认要删除吗?",
okText: "确认",
cancelText: "取消",
okButtonProps: { danger: true, loading: deleting },

View File

@ -30,11 +30,10 @@ function View(props) {
query.id && getData();
}, []);
// 队员表格列定义
const memberColumns = [
{
title: "序号",
width: 10,
width: 80,
align: "center",
render: (_, __, index) => index + 1,
},
@ -57,12 +56,16 @@ function View(props) {
return (
<Page
loading={loading}
isShowFooter={false}
headerTitle={pageTitle}
customActionButtons={(
<Button onClick={() => props.history.goBack()}>
返回
</Button>
)}
>
{detail && (
<div>
<Card title="基本信息" bordered={false}>
<Card title="基本信息" bordered={false} style={{ boxShadow: "none" }}>
<Descriptions
bordered
column={2}
@ -114,7 +117,7 @@ function View(props) {
/>
</Card>
<Card title="队员信息" style={{ marginTop: 24 }} bordered={false}>
<Card title="队员信息" style={{ marginTop: 24, boxShadow: "none" }} bordered={false}>
<Table
bordered
columns={memberColumns}
@ -124,12 +127,6 @@ function View(props) {
locale={{ emptyText: "暂无队员信息" }}
/>
</Card>
<div style={{ textAlign: "center", marginTop: 24 }}>
<Button onClick={() => props.history.goBack()}>
返回
</Button>
</div>
</div>
)}
</Page>

View File

@ -69,10 +69,20 @@ function Add(props) {
return (
<Page
loading={loading}
isShowFooter={false}
headerTitle={pageTitle}
customActionButtons={(
<Space size={16}>
<Button onClick={() => props.history.goBack()}>
取消
</Button>
<Button type="primary" htmlType="submit" form="water-source-form" loading={submitting}>
提交
</Button>
</Space>
)}
>
<Form
id="water-source-form"
form={form}
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
@ -272,16 +282,6 @@ function Add(props) {
</Row>
</Card>
<Form.Item wrapperCol={{ span: 24 }} style={{ textAlign: "center", marginTop: 24 }}>
<Space size={16}>
<Button onClick={() => props.history.goBack()}>
取消
</Button>
<Button type="primary" htmlType="submit" loading={submitting}>
提交
</Button>
</Space>
</Form.Item>
</Form>
<MapSelector

View File

@ -129,8 +129,7 @@ function List(props) {
const onDelete = (id) => {
Modal.confirm({
title: "确认删除",
content: "删除后不可恢复,确认继续?",
title: "确认要删除吗?",
okText: "确认",
cancelText: "取消",
okButtonProps: { danger: true, loading: deleting },

View File

@ -48,8 +48,9 @@ function View(props) {
}, []);
const getStatusLabel = (status) => {
if (!status)
if (!status) {
return "-";
}
const match = statusDict.find(item => item.dictValue === status);
return match?.dictLabel || status;
};
@ -57,12 +58,16 @@ function View(props) {
return (
<Page
loading={loading}
isShowFooter={false}
headerTitle={pageTitle}
customActionButtons={(
<Button onClick={() => props.history.goBack()}>
返回
</Button>
)}
>
{detail && (
<div>
<Card title="基本信息" bordered={false} style={{ boxShadow: 'none' }}>
<Card title="基本信息" bordered={false} style={{ boxShadow: "none" }}>
<Descriptions
bordered
column={2}
@ -128,12 +133,6 @@ function View(props) {
]}
/>
</Card>
<div style={{ textAlign: "center", marginTop: 24 }}>
<Button onClick={() => props.history.goBack()}>
返回
</Button>
</div>
</div>
)}
</Page>