样式和工单列表接口

This commit is contained in:
mmc
2026-05-15 15:39:28 +08:00
parent ae7368b3d0
commit bc48abc038
20 changed files with 251 additions and 93 deletions

View File

@@ -171,7 +171,7 @@ export default function AIDiagnosisPage() {
};
return (
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '16px 24px', boxSizing: 'border-box', overflowX: 'hidden' }}>
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '8px 0px', boxSizing: 'border-box', overflowX: 'hidden' }}>
<style>
{`
@@ -197,7 +197,7 @@ export default function AIDiagnosisPage() {
</style>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', paddingBottom: "16px" }}>
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(18px, 1.5vw, 24px)', fontWeight: 800, color: '#1D2129' }}>
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(18px, 1.5vw, 24px)', color: '#1D2129' }}>
AI 智能诊断与分析中心
</Typography.Title>
<Space>

View File

@@ -126,7 +126,7 @@ export default function CleanOptimizationPage() {
};
return (
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '16px 24px', boxSizing: 'border-box' }}>
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '12px 0px', boxSizing: 'border-box' }}>
<style>
{`
.compact-table .ant-table-thead > tr > th {
@@ -152,6 +152,7 @@ export default function CleanOptimizationPage() {
`}
</style>
<Row
gutter={[8, 8]}
style={{
@@ -275,7 +276,7 @@ export default function CleanOptimizationPage() {
{/* 标题与操作栏 */}
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }}>
<Space size={8}>
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(18px, 1.5vw, 24px)', fontWeight: 800 }}>清洗优化管理</Typography.Title>
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(18px, 1.5vw, 24px)', }}>清洗优化管理</Typography.Title>
<InfoCircleOutlined style={{ color: '#86909C' }} />
</Space>
<Space>

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Layout, Typography, Menu } from 'antd';
import { Layout, Typography, Menu, Tabs } from 'antd';
import { AimOutlined, AppstoreOutlined, SettingOutlined } from '@ant-design/icons';
import DeviceOverviewPage from '../components/devices/DeviceOverviewPage';
import DeviceStatusPage from '../components/devices/DeviceStatusPage';
@@ -96,21 +96,30 @@ export default function DeviceIndexPage() {
};
return (
<Layout style={{ minHeight: '100vh', background: '#fff', overflow: 'hidden', scrollbarWidth: "thin", scrollbarColor: '#ccc transparent' }}>
<Layout style={{ minHeight: '100vh', overflow: 'hidden', scrollbarWidth: "thin", scrollbarColor: '#ccc transparent' }}>
<div style={{ display: 'flex', paddingBottom: "4px" }}>
<div style={{ padding: '8px 12px 0', flexShrink: 0 }}>
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(14px, 1.2vw, 18px)' }}>装备控制</Typography.Title>
<Text type="secondary" style={{ fontSize: '12px' }}>装备总览、状态监控与参数配置</Text>
{/*<Text type="secondary" style={{ fontSize: '12px' }}>装备总览、状态监控与参数配置</Text>*/}
</div>
<Header style={{ flex: 1, background: '#fff', padding: 0, borderBottom: '1px solid #f0f0f0', height: 40, lineHeight: '40px' }}>
<Header style={{
flex: 1, padding: 0, background: 'transparent',
backgroundColor: 'transparent', borderBottom: '1px solid #f0f0f0', height: 40, lineHeight: '40px'
}}>
<Menu
mode="horizontal"
selectedKeys={[activeTab]}
onClick={({ key }) => setActiveTab(key)}
items={tabs}
style={{ border: 0, height: 40, lineHeight: '40px' }}
/>
style={{
border: '0',
height: 40,
lineHeight: '40px',
background: 'transparent', // 这里直接写,不需要 !important
backgroundColor: 'transparent' // 兼容更好
}} />
</Header>
</div>
@@ -118,7 +127,7 @@ export default function DeviceIndexPage() {
maxHeight: 'calc(100vh - 40px)',
overflowY: 'auto',
background: '#f5f7fa',
padding: '8px',
padding: '8px 0px',
scrollbarWidth: "thin"
}}>
{renderContent()}

View File

@@ -153,7 +153,7 @@ export default function StationDashboard() {
};
return (
<div style={{ background: '#f8fafc', padding: '8px', minHeight: '100vh', width: '100%', boxSizing: 'border-box' }}>
<div style={{ background: '#f8fafc', padding: '0px', minHeight: '100vh', width: '100%', boxSizing: 'border-box' }}>
<Row gutter={[8, 8]} style={{ margin: '0 4px 0px 4px' }}>
{[
{ title: '今日发电量', value: '4,752', unit: 'kWh', sub: '日目标 5,000 kWh', color: '#00B42A', bg: '#E8FFEA', icon: <ThunderboltOutlined /> },

View File

@@ -97,7 +97,7 @@ const RealTimeMonitorPage = () => {
];
return (
<div style={{ background: '#f8fafc', padding: '8px', minHeight: '100vh', width: '100%', boxSizing: 'border-box' }}>
<div style={{ background: '#f8fafc', padding: '8px 0px', minHeight: '100vh', width: '100%', boxSizing: 'border-box' }}>
<div style={{ marginBottom: 8 }}>
<Title level={4} style={{ margin: 0, fontSize: 'clamp(14px, 1.2vw, 18px)' }}>实时监控中心</Title>
<Text type="secondary" style={{ fontSize: '12px' }}>全方位实时掌握电站设备运行状态与发电表现</Text>

View File

@@ -116,7 +116,7 @@ export default function ReportCenterPage() {
};
return (
<div style={{ padding: '16px 24px', background: '#f5f7fa', minHeight: '100vh', boxSizing: 'border-box' }}>
<div style={{ padding: '4px 0px', background: '#f5f7fa', minHeight: '100vh', boxSizing: 'border-box' }}>
<style>
{`
.compact-table .ant-table-thead > tr > th {
@@ -153,17 +153,20 @@ export default function ReportCenterPage() {
}
`}
</style>
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 16 }}>
<Typography.Title level={4} style={{ margin: '0 32px 0 0', }}>报表中心</Typography.Title>
{/* 页面头部标签 */}
<Tabs activeKey={activeTab} onChange={setActiveTab} className="report-tabs">
<TabPane tab="报表总览" key="overview" />
<TabPane tab="发电报表" key="power" />
<TabPane tab="运维报表" key="operation" />
<TabPane tab="告警报表" key="alarm" />
<TabPane tab="AI分析报告" key="ai" />
</Tabs>
</div>
<Typography.Title level={4} style={{ margin: 0 }}>报表中心</Typography.Title>
{/* 页面头部标签 */}
<Tabs activeKey={activeTab} onChange={setActiveTab} className="report-tabs">
<TabPane tab="报表总览" key="overview" />
<TabPane tab="发电报表" key="power" />
<TabPane tab="运维报表" key="operation" />
<TabPane tab="告警报表" key="alarm" />
<TabPane tab="AI分析报告" key="ai" />
</Tabs>
<Row
gutter={[8, 8]}

View File

@@ -161,13 +161,13 @@ export default function SystemSettings() {
}
};
return (
<Layout style={{ minHeight: '100vh', background: '#fff', overflow: 'hidden' }}>
<Layout style={{ minHeight: '100vh', overflow: 'hidden' }}>
<div style={{ padding: '8px 12px 0' }}>
<div style={{ padding: '4px 0px 0' }}>
<Typography.Title level={4} style={{ margin: 0, fontSize: 'clamp(14px, 1.2vw, 18px)' }}>系统设置</Typography.Title>
<Text type="secondary" style={{ fontSize: '12px' }}>告警规则配置、用户角色、通知管理与系统参数设置</Text>
</div>
<Header style={{ background: '#fff', padding: 0, borderBottom: '1px solid #f0f0f0', position: 'sticky', top: 0, zIndex: 10, height: 40, lineHeight: '40px' }}>
<Header style={{ padding: 0, borderBottom: '1px solid #f0f0f0', position: 'sticky', top: 0, zIndex: 10, height: 40, lineHeight: '40px' }}>
<Menu
mode="horizontal"
selectedKeys={[activeTab]}

View File

@@ -67,7 +67,7 @@ export default function VideoMonitorPage() {
];
return (
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '16px 24px', boxSizing: 'border-box' }}>
<div style={{ background: '#f5f7fa', minHeight: '100vh', padding: '8px 0px', boxSizing: 'border-box' }}>
<style>
{`
.compact-table .ant-table-thead > tr > th {

View File

@@ -78,6 +78,8 @@ const WorkOrderPage = () => {
const [completeModalVisible, setCompleteModalVisible] = useState(false);
const [completeForm] = Form.useForm(); // 完成工单表单
const [messageApi, contextHolder] = message.useMessage();
// 统计数据(保留原模拟不变)
const stats = [
@@ -122,7 +124,7 @@ const WorkOrderPage = () => {
}
}
} catch (error) {
message.error('获取工单列表失败');
messageApi.error('获取工单列表失败');
} finally {
setLoading(false);
}
@@ -130,7 +132,7 @@ const WorkOrderPage = () => {
// 打开完成工单弹窗
const openCompleteModal = () => {
if (!selectedRowKey) return message.warning('请先选择工单');
if (!selectedRowKey) return messageApi.warning('请先选择工单');
completeForm.setFieldsValue({
id: currentDetail?.id,
orderNo: currentDetail?.orderNo,
@@ -151,13 +153,13 @@ const WorkOrderPage = () => {
};
await completeWorkOrder(params);
message.success('工单已完成');
messageApi.success('工单已完成');
setCompleteModalVisible(false);
// 刷新列表 + 详情
getWorkOrderList();
getWorkOrderDetail(selectedRowKey);
} catch (err) {
message.error('工单完成失败');
messageApi.error('工单完成失败');
console.error(err);
}
};
@@ -170,7 +172,7 @@ const WorkOrderPage = () => {
setCurrentDetail(res.data);
}
} catch (error) {
message.error('获取工单详情失败');
messageApi.error('获取工单详情失败');
}
};
@@ -184,13 +186,12 @@ const WorkOrderPage = () => {
// 打开修改工单弹窗
const openEditModal = () => {
if (!selectedRowKey) return message.warning('请先选择一条工单');
if (!selectedRowKey) return messageApi.warning('请先选择一条工单');
form.setFieldsValue({
title: currentDetail?.orderTitle,
content: currentDetail?.taskDescription,
priority: currentDetail?.priorityLevel,
type: currentDetail?.orderType,
remark: currentDetail?.remark
orderTitle: currentDetail?.orderTitle,
orderType: currentDetail?.orderType,
priorityLevel: currentDetail?.priorityLevel,
taskDescription: currentDetail?.taskDescription,
});
setEditModalVisible(true);
};
@@ -198,7 +199,7 @@ const WorkOrderPage = () => {
// 打开派发工单弹窗
// 打开派发工单弹窗
const openDispatchModal = () => {
if (!selectedRowKey) return message.warning('请先选择一条工单');
if (!selectedRowKey) return messageApi.warning('请先选择一条工单');
form.setFieldsValue({
orderId: selectedRowKey, // 自动回填工单ID
assigneeName: currentDetail?.assigneeName || '',
@@ -210,22 +211,54 @@ const WorkOrderPage = () => {
};
// 提交修改工单
// 提交修改工单(完整匹配后端参数)
const submitEdit = async (values) => {
try {
// 适配后端传参:id、title、content、priority、type、remark
await updateWorkOrder({
id: selectedRowKey,
orderTitle: values.title,
taskDescription: values.content,
priorityLevel: values.priority,
orderType: values.type,
remark: values.remark
});
message.success('修改工单成功');
// 拼接你给的所有工单参数(1:1 匹配)
const params = {
id: selectedRowKey, // 主键ID
orderNo: currentDetail?.orderNo, // 工单编号
orderTitle: values.orderTitle, // 工单标题
sourceType: currentDetail?.sourceType, // 来源(保持不变)
orderType: values.orderType, // 类型
priorityLevel: values.priorityLevel, // 优先级
deviceId: currentDetail?.deviceId, // 设备ID
deviceName: currentDetail?.deviceName, // 设备名称
deviceType: currentDetail?.deviceType,
siteId: currentDetail?.siteId,
siteName: currentDetail?.siteName,
orgId: currentDetail?.orgId,
assigneeId: currentDetail?.assigneeId,
assigneeName: currentDetail?.assigneeName,
collaboratorIds: currentDetail?.collaboratorIds,
collaboratorNames: currentDetail?.collaboratorNames,
planStartTime: currentDetail?.planStartTime,
planEndTime: currentDetail?.planEndTime,
deadlineTime: currentDetail?.deadlineTime,
actualStartTime: currentDetail?.actualStartTime,
actualEndTime: currentDetail?.actualEndTime,
orderStatus: currentDetail?.orderStatus,
alarmId: currentDetail?.alarmId,
alarmNo: currentDetail?.alarmNo,
taskDescription: values.taskDescription, // 任务描述
aiSuggestion: currentDetail?.aiSuggestion,
requiredEquipment: currentDetail?.requiredEquipment,
estimatedImpact: currentDetail?.estimatedImpact,
handleResult: currentDetail?.handleResult,
handleRemark: currentDetail?.handleRemark,
};
// 调用你提供的接口
await updateWorkOrder(params);
messageApi.success('修改工单成功');
setEditModalVisible(false);
// 刷新列表和详情
getWorkOrderList();
getWorkOrderDetail(selectedRowKey);
} catch (error) {
message.error('修改工单失败');
messageApi.error('修改工单失败');
console.error(error);
}
};
@@ -247,11 +280,11 @@ const WorkOrderPage = () => {
await dispatchWorkOrder(params);
message.success('工单派发成功');
messageApi.success('工单派发成功');
setDispatchModalVisible(false);
getWorkOrderList(); // 刷新列表
} catch (error) {
message.error('工单派发失败');
messageApi.error('工单派发失败');
console.error(error);
}
};
@@ -333,7 +366,8 @@ const WorkOrderPage = () => {
];
return (
<div style={{ padding: '16px 24px', background: '#f5f7fa', minHeight: '100vh', boxSizing: 'border-box' }}>
<div style={{ padding: '0px 0px', background: '#f5f7fa', minHeight: '100vh', boxSizing: 'border-box' }}>
{contextHolder}
<style>
{`
.compact-table .ant-table-thead > tr > th {
@@ -364,8 +398,8 @@ const WorkOrderPage = () => {
</style>
{/* 顶部标题和页签 */}
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 16 }}>
<Title level={4} style={{ margin: '0 32px 0 0', fontWeight: 800 }}>工单任务管理</Title>
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 8 }}>
<Title level={4} style={{ margin: '0 32px 0 0', }}>工单任务管理</Title>
<Tabs
activeKey={activeTab}
onChange={setActiveTab}
@@ -589,7 +623,7 @@ const WorkOrderPage = () => {
<div style={{ marginBottom: 24 }}>
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
<Title level={4} style={{ margin: 0, fontSize: 18, fontWeight: 800 }}>{currentDetail?.orderTitle || '暂无标题'}</Title>
<span level={4} style={{ margin: 0, fontSize: 18, fontWeight: 800 }}>{currentDetail?.orderTitle || '暂无标题'}</span>
{currentDetail?.priorityLevel && (
<Tag
style={{
@@ -607,19 +641,19 @@ const WorkOrderPage = () => {
</div>
<Row gutter={[16, 16]} style={{ background: '#f8fafc', padding: 16, borderRadius: 12, marginBottom: 20 }}>
<Col span={12}><Text type="secondary" style={{ fontSize: 12 }}>来源:</Text><Text style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.sourceType || '--'}</Text></Col>
<Col span={12}><Text type="secondary" style={{ fontSize: 12 }}>工单类型:</Text><Text style={{ fontSize: 12, fontWeight: 500 }}>{orderTypeConfig[currentDetail?.orderType] || '--'}</Text></Col>
<Col span={12}><Text type="secondary" style={{ fontSize: 12 }}>负责人:</Text><Text style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.assigneeName || '--'}</Text></Col>
<Col span={12}><Text type="secondary" style={{ fontSize: 12 }}>协同人员:</Text><Text style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.collaboratorNames || '无'}</Text></Col>
<Col span={24}><Text type="secondary" style={{ fontSize: 12 }}>计划时间:</Text><Text style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.planStartTime ? `${currentDetail.planStartTime} ~ ${currentDetail.planEndTime}` : '--'}</Text></Col>
<Col span={12}><Text type="secondary" style={{ fontSize: 12 }}>关联设备:</Text><Text style={{ fontSize: 12, color: '#165DFF', fontWeight: 600 }}>{currentDetail?.deviceName || '无'}</Text></Col>
<Col span={12}><Text type="secondary" style={{ fontSize: 12 }}>关联区域:</Text><Text style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.siteName || '无'}</Text></Col>
<Col span={12}><span style={{ fontSize: 12 }}>来源:</span><span style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.sourceType || '--'}</span></Col>
<Col span={12}><span style={{ fontSize: 12 }}>工单类型:</span><span style={{ fontSize: 12, fontWeight: 500 }}>{orderTypeConfig[currentDetail?.orderType] || '--'}</span></Col>
<Col span={12}><span style={{ fontSize: 12 }}>负责人:</span><span style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.assigneeName || '--'}</span></Col>
<Col span={12}><span style={{ fontSize: 12 }}>协同人员:</span><span style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.collaboratorNames || '无'}</span></Col>
<Col span={24}><span style={{ fontSize: 12 }}>计划时间:</span><span style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.planStartTime ? `${currentDetail.planStartTime} ~ ${currentDetail.planEndTime}` : '--'}</span></Col>
<Col span={12}><span style={{ fontSize: 12 }}>关联设备:</span><span style={{ fontSize: 12, color: '#165DFF', fontWeight: 600 }}>{currentDetail?.deviceName || '无'}</span></Col>
<Col span={12}><span style={{ fontSize: 12 }}>关联区域:</span><span style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.siteName || '无'}</span></Col>
<Col span={24}>
<Text type="secondary" style={{ fontSize: 12 }}>当前状态:</Text>
<span style={{ fontSize: 12 }}>当前状态:</span>
<Tag color="blue" style={{ borderRadius: 4, fontWeight: 600, border: 'none', background: '#E8F3FF', color: '#165DFF' }}>{orderStatusConfig[currentDetail?.orderStatus]?.label || '--'}</Tag>
</Col>
<Col span={24}>
<Text type="secondary" style={{ fontSize: 12 }}>任务描述:</Text>
<span style={{ fontSize: 12 }}>任务描述:</span>
<div style={{ fontSize: 12, color: '#4E5969', marginTop: 4, lineHeight: 1.6 }}>{currentDetail?.taskDescription || '暂无描述'}</div>
</Col>
</Row>
@@ -750,31 +784,57 @@ const WorkOrderPage = () => {
</Col>
</Row>
{/* 修改工单弹窗 */}
{/* 修改工单弹窗 */}
<Modal title="修改工单" open={editModalVisible} onCancel={() => setEditModalVisible(false)} footer={null} width={520}>
<Form form={form} layout="vertical" onFinish={submitEdit}>
<FormItem name="title" label="工单标题">
<FormItem
name="orderTitle"
label="工单标题"
rules={[{ required: true, message: '请输入工单标题' }]}
>
<Input placeholder="请输入工单标题" />
</FormItem>
<FormItem name="content" label="工单内容">
<Input.TextArea rows={4} placeholder="请输入工单内容" />
<FormItem
name="orderType"
label="工单类型"
rules={[{ required: true, message: '请选择工单类型' }]}
>
<Select placeholder="请选择工单类型">
<Option value={1}>巡检</Option>
<Option value={2}>检修</Option>
<Option value={3}>清洗</Option>
<Option value={4}>维修</Option>
<Option value={5}>运维</Option>
</Select>
</FormItem>
<FormItem name="priority" label="优先级">
<FormItem
name="priorityLevel"
label="优先级"
rules={[{ required: true, message: '请选择优先级' }]}
>
<Select placeholder="请选择优先级">
<Option value={1}>高</Option>
<Option value={2}>中</Option>
<Option value={3}>低</Option>
</Select>
</FormItem>
<FormItem name="type" label="工单类型">
<Input placeholder="请输入工单类型" />
</FormItem>
<FormItem name="remark" label="备注">
<Input.TextArea rows={2} placeholder="请输入备注" />
<FormItem
name="taskDescription"
label="任务描述"
rules={[{ required: true, message: '请输入任务描述' }]}
>
<Input.TextArea rows={4} placeholder="请输入任务描述" />
</FormItem>
<FormItem style={{ textAlign: 'right', marginBottom: 0 }}>
<Button onClick={() => setEditModalVisible(false)}>取消</Button>
<Button type="primary" htmlType="submit" style={{ marginLeft: 8 }}>确认修改</Button>
<Button type="primary" htmlType="submit" style={{ marginLeft: 8 }}>
确认修改
</Button>
</FormItem>
</Form>
</Modal>