中英文切换
This commit is contained in:
@@ -57,12 +57,6 @@ const { Text, Title } = Typography;
|
||||
const { RangePicker } = DatePicker;
|
||||
const FormItem = Form.Item;
|
||||
|
||||
// 优先级数字映射 1高 2中 3低
|
||||
const priorityConfig = {
|
||||
ERROR: { label: '高', color: '#ff4d4f', bg: '#fff1f0', border: '#ff4d4f' },
|
||||
WARNING: { label: '中', color: '#faad14', bg: '#fff7e6', border: '#faad14' },
|
||||
INFO: { label: '低', color: '#52c41a', bg: '#f6ffed', border: '#52c41a' }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -104,9 +98,9 @@ const WorkOrderPage = () => {
|
||||
|
||||
// 优先级选项
|
||||
const priorityOptions = [
|
||||
{ value: 1, label: '高' },
|
||||
{ value: 2, label: '中' },
|
||||
{ value: 3, label: '低' }
|
||||
{ value: 1, label: t('workOrder.high') },
|
||||
{ value: 2, label: t('workOrder.medium') },
|
||||
{ value: 3, label: t('workOrder.low') }
|
||||
];
|
||||
const orderStatusConfig = {
|
||||
1: { label: t('constants.pending'), textColor: '#1890ff' },
|
||||
@@ -129,6 +123,13 @@ const WorkOrderPage = () => {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
// 优先级数字映射 1高 2中 3低
|
||||
const priorityConfig = {
|
||||
ERROR: { label: t('workOrder.high'), color: '#ff4d4f', bg: '#fff1f0', border: '#ff4d4f' },
|
||||
WARNING: { label: t('workOrder.medium'), color: '#faad14', bg: '#fff7e6', border: '#faad14' },
|
||||
INFO: { label: t('workOrder.low'), color: '#52c41a', bg: '#f6ffed', border: '#52c41a' }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -239,14 +240,14 @@ const WorkOrderPage = () => {
|
||||
};
|
||||
const res = await dispatchWorkOrder(params);
|
||||
if (res.code === 200) {
|
||||
messageApi.success('工单派单成功');
|
||||
messageApi.success(t('workOrder.fixed2DispatchOrderFixed2SuccessFixed2'));
|
||||
setDispatchUserModalVisible(false);
|
||||
dispatchForm.resetFields();
|
||||
} else {
|
||||
messageApi.error(res.msg || '派单失败');
|
||||
}
|
||||
} catch (err) {
|
||||
messageApi.error('派单请求异常');
|
||||
messageApi.error(t('workOrder.fixed2DispatchAbnormalFixed2'));
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
@@ -417,7 +418,7 @@ const WorkOrderPage = () => {
|
||||
|
||||
const stats = [
|
||||
{
|
||||
title: '今日新增工单',
|
||||
title: t('workOrder.fixed2TodayRecordingsFixed2AddNew'),
|
||||
value: orderStat.todayAdd,
|
||||
subValue: orderStat.todayAddDiff,
|
||||
subText: '较昨日',
|
||||
@@ -425,7 +426,7 @@ const WorkOrderPage = () => {
|
||||
bg: '#e6f7ff'
|
||||
},
|
||||
{
|
||||
title: '待处理工单',
|
||||
title: t('workOrder.pendingOrders'),
|
||||
value: orderStat.pending,
|
||||
subValue: orderStat.pendingHigh,
|
||||
subText: '高优先级',
|
||||
@@ -433,7 +434,7 @@ const WorkOrderPage = () => {
|
||||
bg: '#fff1f0'
|
||||
},
|
||||
{
|
||||
title: '执行中工单',
|
||||
title: t('workOrder.fixed2InProgress'),
|
||||
value: orderStat.running,
|
||||
subValue: `${orderStat.finishRate}%`,
|
||||
subText: '按时率',
|
||||
@@ -441,7 +442,7 @@ const WorkOrderPage = () => {
|
||||
bg: '#f6ffed'
|
||||
},
|
||||
{
|
||||
title: '已完成工单',
|
||||
title: t('workOrder.completedOrders'),
|
||||
value: orderStat.finishedMonth,
|
||||
subValue: '',
|
||||
subText: '本月累计',
|
||||
@@ -449,7 +450,7 @@ const WorkOrderPage = () => {
|
||||
bg: '#f6ffed'
|
||||
},
|
||||
{
|
||||
title: '平均处理时长',
|
||||
title: t('workOrder.handle'),
|
||||
value: orderStat.avgHandleHour,
|
||||
unit: '小时',
|
||||
subValue: orderStat.avgDiff,
|
||||
@@ -458,7 +459,7 @@ const WorkOrderPage = () => {
|
||||
bg: '#e6f7ff'
|
||||
},
|
||||
{
|
||||
title: 'AI建议生成',
|
||||
title: t('workOrder.fixed2Ai'),
|
||||
value: orderStat.aiCreate,
|
||||
unit: '单',
|
||||
subValue: '',
|
||||
@@ -511,7 +512,7 @@ const WorkOrderPage = () => {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
messageApi.error('获取工单列表失败');
|
||||
messageApi.error(t('workOrder.listFixed2Fixed2FailedFixed2'));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -588,7 +589,7 @@ const WorkOrderPage = () => {
|
||||
};
|
||||
// 打开完成工单弹窗
|
||||
const openCompleteModal = () => {
|
||||
if (!selectedRowKey) return messageApi.warning('请先选择工单');
|
||||
if (!selectedRowKey) return messageApi.warning(t('workOrder.s3'));
|
||||
completeForm.setFieldsValue({
|
||||
id: currentDetail?.id,
|
||||
orderNo: currentDetail?.orderNo,
|
||||
@@ -640,12 +641,12 @@ const WorkOrderPage = () => {
|
||||
// 4. 请求方法 completeWorkOrder 必须修改:传 formData,删除 headers 的 Content-Type
|
||||
await completeWorkOrder(formData);
|
||||
|
||||
messageApi.success('工单已完成');
|
||||
messageApi.success(t('workOrder.completedFixed2'));
|
||||
setCompleteModalVisible(false);
|
||||
getWorkOrderList();
|
||||
getWorkOrderDetail(selectedRowKey);
|
||||
} catch (err) {
|
||||
messageApi.error('工单完成失败');
|
||||
messageApi.error(t('workOrder.completeFailFixed2'));
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
@@ -659,7 +660,7 @@ const WorkOrderPage = () => {
|
||||
setCurrentDetail(res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
messageApi.error('获取工单详情失败');
|
||||
messageApi.error(t('workOrder.detailFixed2Fixed2FailedFixed2'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -676,7 +677,7 @@ const WorkOrderPage = () => {
|
||||
|
||||
// 打开修改工单弹窗
|
||||
const openEditModal = () => {
|
||||
if (!selectedRowKey) return messageApi.warning('请先选择一条工单');
|
||||
if (!selectedRowKey) return messageApi.warning(t('workOrder.s7'));
|
||||
const levelText = levelNum2Text[currentDetail?.priorityLevel]; //数字转字符串
|
||||
form.setFieldsValue({
|
||||
orderTitle: currentDetail?.orderTitle,
|
||||
@@ -700,7 +701,7 @@ const WorkOrderPage = () => {
|
||||
orderIds: [selectedRowKey]
|
||||
});
|
||||
} else {
|
||||
return messageApi.warning('请先选择一条工单');
|
||||
return messageApi.warning(t('workOrder.s7'));
|
||||
}
|
||||
|
||||
setDispatchModalVisible(true);
|
||||
@@ -719,12 +720,12 @@ const WorkOrderPage = () => {
|
||||
taskDescription: values.taskDescription,
|
||||
};
|
||||
await updateWorkOrder(params);
|
||||
messageApi.success('修改工单成功');
|
||||
messageApi.success(t('workOrder.fixed2ModifyOrderFixed2SuccessFixed2'));
|
||||
setEditModalVisible(false);
|
||||
getWorkOrderList();
|
||||
getWorkOrderDetail(selectedRowKey);
|
||||
} catch (error) {
|
||||
messageApi.error('修改工单失败');
|
||||
messageApi.error(t('workOrder.fixed2ModifyOrderFixed2FailedFixed2'));
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
@@ -742,7 +743,7 @@ const WorkOrderPage = () => {
|
||||
};
|
||||
const res = await startWorkOrder(params);
|
||||
if (res.code == 200) {
|
||||
messageApi.success('工单执行成功');
|
||||
messageApi.success(t('workOrder.executeSuccessFixed2'));
|
||||
setDispatchModalVisible(false);
|
||||
setSelectedRowKeys([]); // 清空选中
|
||||
getWorkOrderList();
|
||||
@@ -751,26 +752,26 @@ const WorkOrderPage = () => {
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
messageApi.error('工单执行失败');
|
||||
messageApi.error(t('workOrder.executeFailFixed2'));
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
// 挂起工单
|
||||
const handleSuspend = async () => {
|
||||
if (!selectedRowKey) return messageApi.warning('请选择工单');
|
||||
if (!selectedRowKey) return messageApi.warning(t('workOrder.pleaseSelectOrder'));
|
||||
try {
|
||||
await suspendWorkOrder(selectedRowKey);
|
||||
messageApi.success('工单已挂起');
|
||||
messageApi.success(t('workOrder.suspendedFixed2'));
|
||||
getWorkOrderList();
|
||||
} catch (e) {
|
||||
messageApi.error('挂起失败');
|
||||
messageApi.error(t('workOrder.fixed2SuspendFixed2FailedFixed2'));
|
||||
}
|
||||
};
|
||||
|
||||
// 删除单行
|
||||
const handleDelete = async (record) => {
|
||||
if (!record?.id) return messageApi.warning('无效工单');
|
||||
if (!record?.id) return messageApi.warning(t('workOrder.invalidOrder'));
|
||||
try {
|
||||
await deleteWorkOrder(record.id);
|
||||
messageApi.success(t('common.deleteSuccess'));
|
||||
@@ -784,7 +785,7 @@ const WorkOrderPage = () => {
|
||||
// 批量删除
|
||||
// 批量删除 - 传给后端 id数组
|
||||
const handleBatchDelete = async () => {
|
||||
if (selectedRowKeys.length === 0) return messageApi.warning('请选择要删除的工单');
|
||||
if (selectedRowKeys.length === 0) return messageApi.warning(t('workOrder.fixed2PleaseSelectDelete'));
|
||||
|
||||
try {
|
||||
await deleteWorkOrder(selectedRowKeys);
|
||||
@@ -792,7 +793,7 @@ const WorkOrderPage = () => {
|
||||
setSelectedRowKeys([]); // 清空选中
|
||||
getWorkOrderList(); // 刷新列表
|
||||
} catch (e) {
|
||||
messageApi.error('批量删除失败');
|
||||
messageApi.error(t('workOrder.batchDeleteFail'));
|
||||
console.error(e);
|
||||
}
|
||||
};
|
||||
@@ -821,7 +822,7 @@ const WorkOrderPage = () => {
|
||||
|
||||
// 表格列
|
||||
const columns = [
|
||||
{ title: '工单编号', dataIndex: 'orderNo', key: 'orderNo', width: 150 },
|
||||
{ title: t('workOrder.orderNo'), dataIndex: 'orderNo', key: 'orderNo', width: 150 },
|
||||
{ title: t('workOrder.orderTitle'), dataIndex: 'orderTitle', key: 'orderTitle', width: 200, ellipsis: true },
|
||||
{
|
||||
title: t('workOrder.source'),
|
||||
@@ -848,7 +849,7 @@ const WorkOrderPage = () => {
|
||||
</Tag>
|
||||
)
|
||||
},
|
||||
{ title: '设备', dataIndex: 'deviceId', key: 'deviceId', width: 160, ellipsis: true },
|
||||
{ title: t('devices.device'), dataIndex: 'deviceId', key: 'deviceId', width: 160, ellipsis: true },
|
||||
{ title: t('common.createTime'), dataIndex: 'createTime', key: 'createTime', width: 160 },
|
||||
{
|
||||
title: t('roles.status'),
|
||||
@@ -872,9 +873,7 @@ const WorkOrderPage = () => {
|
||||
<Button type="link" size="small" icon={<EyeOutlined />} onClick={() => handleRowSelect(record)}>{t('common.view')}</Button>
|
||||
<Button type="link" size="small" icon={<EditOutlined />} onClick={() => { handleRowSelect(record); openEditModal(); }}>{t('workOrder.modify')}</Button>
|
||||
<Popconfirm title={t('common.confirmDelete')} onConfirm={() => handleDelete(record)}>
|
||||
<Button type="link" size="small" danger icon={<DeleteOutlined />}>
|
||||
删除
|
||||
</Button>
|
||||
<Button type="link" size="small" danger icon={<DeleteOutlined />}>{t('common.delete')}</Button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
)
|
||||
@@ -906,9 +905,9 @@ const WorkOrderPage = () => {
|
||||
|
||||
{/* 顶部标题和页签 */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 8 }}>
|
||||
<Title level={4} style={{ margin: '0 32px 0 0' }}>工单任务管理</Title>
|
||||
<Title level={4} style={{ margin: '0 32px 0 0' }}>{t('workOrder.fixed2WorkOrders')}</Title>
|
||||
<Tabs activeKey={activeTab} onChange={setActiveTab} items={[
|
||||
{ key: '1', label: '工单总览' },
|
||||
{ key: '1', label: t('workOrder.s49') },
|
||||
]} tabBarStyle={{ marginBottom: 0 }} />
|
||||
</div>
|
||||
|
||||
@@ -953,7 +952,7 @@ const WorkOrderPage = () => {
|
||||
<Select style={{ width: 120 }} size="small" options={errorLevelOptions} allowClear />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="timeRange" label="时间范围">
|
||||
<Form.Item name="timeRange" label={t('common.timeRange')}>
|
||||
<RangePicker style={{ width: 320 }} size="small" />
|
||||
</Form.Item>
|
||||
|
||||
@@ -961,8 +960,8 @@ const WorkOrderPage = () => {
|
||||
<Select style={{ width: 120 }} size="small" options={statusOptions} allowClear />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="keyword" label="关键词">
|
||||
<Input placeholder="请输入工单编号/标题" prefix={<SearchOutlined />} size="small" />
|
||||
<Form.Item name="keyword" label={t('workOrder.keyword')}>
|
||||
<Input placeholder={t('workOrder.fixed2PleaseEnterFixed2OrderNo')} prefix={<SearchOutlined />} size="small" />
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Space>
|
||||
@@ -980,7 +979,7 @@ const WorkOrderPage = () => {
|
||||
bordered={false}
|
||||
title={
|
||||
<Space size={8}>
|
||||
<Text strong style={{ fontSize: 15, color: '#1D2129' }}>工单列表</Text>
|
||||
<Text strong style={{ fontSize: 15, color: '#1D2129' }}>{t('workOrder.listFixed2')}</Text>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>(共 {workOrderTotal} 条)</Text>
|
||||
{selectedRowKeys.length > 0 && (
|
||||
<>
|
||||
@@ -988,9 +987,7 @@ const WorkOrderPage = () => {
|
||||
title={`确定删除已选中的 ${selectedRowKeys.length} 条工单吗?`}
|
||||
onConfirm={handleBatchDelete}
|
||||
>
|
||||
<Button size="small" danger icon={<DeleteOutlined />}>
|
||||
批量删除
|
||||
</Button>
|
||||
<Button size="small" danger icon={<DeleteOutlined />}>{t('common.batchDelete')}</Button>
|
||||
</Popconfirm>
|
||||
<Button
|
||||
type="primary"
|
||||
@@ -1040,7 +1037,7 @@ const WorkOrderPage = () => {
|
||||
|
||||
<Row gutter={[12, 12]}>
|
||||
<Col xs={24} md={9}>
|
||||
<Card bordered={false} title={<Text strong style={{ fontSize: 14 }}>工单状态分布</Text>} style={{ ...cardStyle, height: 380 }}>
|
||||
<Card bordered={false} title={<Text strong style={{ fontSize: 14 }}>{t('workOrder.fixed2OrderStatus')}</Text>} style={{ ...cardStyle, height: 380 }}>
|
||||
<div style={{ height: 300, position: 'relative' }}>
|
||||
<Pie
|
||||
data={pieData}
|
||||
@@ -1054,7 +1051,7 @@ const WorkOrderPage = () => {
|
||||
height={260}
|
||||
/>
|
||||
<div style={{ position: 'absolute', top: '45%', left: '50%', textAlign: 'center', transform: 'translate(-50%, -50%)' }}>
|
||||
<div style={{ fontSize: 12, color: '#86909C' }}>总数</div>
|
||||
<div style={{ fontSize: 12, color: '#86909C' }}>{t('workOrder.s5')}</div>
|
||||
<div style={{ fontSize: 28, fontWeight: 800, color: '#1D2129' }}>{workOrderTotal}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1063,14 +1060,13 @@ const WorkOrderPage = () => {
|
||||
<Col xs={24} md={15}>
|
||||
<Card
|
||||
bordered={false}
|
||||
title={<Text strong style={{ fontSize: 14 }}>任务排班 / 日历视图</Text>}
|
||||
title={<Text strong style={{ fontSize: 14 }}>{t('workOrder.fixed2TaskSuspended2')}</Text>}
|
||||
extra={
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => setScheduleModalVisible(true)}
|
||||
>
|
||||
更多 <ChevronRight size={14} />
|
||||
>{t('common.more')}<ChevronRight size={14} />
|
||||
</Button>
|
||||
}
|
||||
style={{ ...cardStyle, height: 380 }}
|
||||
@@ -1170,10 +1166,10 @@ const WorkOrderPage = () => {
|
||||
rowKey="id"
|
||||
size="small"
|
||||
columns={[
|
||||
{ title: '工单编号', dataIndex: 'orderNo', width: 260 },
|
||||
{ title: t('workOrder.orderNo'), dataIndex: 'orderNo', width: 260 },
|
||||
{ title: t('workOrder.orderTitle'), dataIndex: 'orderTitle', ellipsis: true },
|
||||
{
|
||||
title: '计划执行时间',
|
||||
title: t('workOrder.executionTimeFixed2'),
|
||||
dataIndex: 'planStartTime',
|
||||
render: t => dayjs(t).format('YYYY-MM-DD HH:mm')
|
||||
},
|
||||
@@ -1212,8 +1208,8 @@ const WorkOrderPage = () => {
|
||||
<Col xs={24} xl={9}>
|
||||
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '20px' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }}>
|
||||
<Text strong style={{ fontSize: 16, color: '#1D2129' }}>工单详情</Text>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>工单编号: <span style={{ color: '#4E5969', fontWeight: 600 }}>{currentDetail?.orderNo || '--'}</span></Text>
|
||||
<Text strong style={{ fontSize: 16, color: '#1D2129' }}>{t('workOrder.detailFixed2')}</Text>
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>{t('workOrder.fixed2OrderNo')}<span style={{ color: '#4E5969', fontWeight: 600 }}>{currentDetail?.orderNo || '--'}</span></Text>
|
||||
</div>
|
||||
|
||||
<div style={{ marginBottom: 8 }}>
|
||||
@@ -1228,35 +1224,35 @@ const WorkOrderPage = () => {
|
||||
|
||||
<Row gutter={[16, 16]} style={{ background: '#f8fafc', padding: 16, borderRadius: 12, marginBottom: 20 }}>
|
||||
<Col span={12}>
|
||||
<span style={{ fontSize: 12 }}>来源:</span>
|
||||
<span style={{ fontSize: 12 }}>{t('workOrder.fixed2Source')}</span>
|
||||
<span style={{ fontSize: 12, fontWeight: 500 }}>{sourceTypeMap[currentDetail?.sourceType] || '--'}</span>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span style={{ fontSize: 12 }}>工单类型:</span>
|
||||
<span style={{ fontSize: 12 }}>{t('workOrder.fixed2OrderType')}</span>
|
||||
<span style={{ fontSize: 12, fontWeight: 500 }}>{getWorkOrderTypeText(currentDetail?.orderType)}</span>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<span style={{ fontSize: 12 }}>执行开始时间:</span>
|
||||
<span style={{ fontSize: 12 }}>{t('workOrder.fixed2ExecutionStartTime')}</span>
|
||||
<span style={{ fontSize: 12, fontWeight: 500 }}>
|
||||
{currentDetail?.actualStartTime || '--'}
|
||||
</span>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<span style={{ fontSize: 12 }}>关联设备:</span>
|
||||
<span style={{ fontSize: 12 }}>{t('workOrder.fixed2RelatedDevice')}</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 }}>{t('workOrder.fixed2RelatedArea')}</span>
|
||||
<span style={{ fontSize: 12, fontWeight: 500 }}>{currentDetail?.siteName || '无'}</span>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<span style={{ fontSize: 12 }}>当前状态:</span>
|
||||
<span style={{ fontSize: 12 }}>{t('workOrder.fixed2CurrentStatus')}</span>
|
||||
<Tag color="blue" style={{ borderRadius: 4, fontWeight: 600, border: 'none', background: '#E8F3FF', color: '#165DFF' }}>
|
||||
{orderStatusConfig[currentDetail?.orderStatus]?.label || '--'}
|
||||
</Tag>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<span style={{ fontSize: 12 }}>任务描述:</span>
|
||||
<span style={{ fontSize: 12 }}>{t('workOrder.fixed2TaskDescription')}</span>
|
||||
<div style={{ fontSize: 12, color: '#4E5969', marginTop: 4, lineHeight: 1.6 }}>
|
||||
{getRelatedAlarmInfo(currentDetail?.alarmId)}
|
||||
|
||||
@@ -1269,7 +1265,7 @@ const WorkOrderPage = () => {
|
||||
(currentDetail?.videoUrl && currentDetail.videoUrl.length > 0)
|
||||
) && (
|
||||
<Col span={24}>
|
||||
<div style={{ fontSize: 12, marginBottom: 8 }}>附件素材:</div>
|
||||
<div style={{ fontSize: 12, marginBottom: 8 }}>{t('workOrder.fixed2Attachments')}</div>
|
||||
<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
|
||||
{/* 图片预览组,支持点击放大 */}
|
||||
{currentDetail?.imgUrl?.length > 0 && (
|
||||
@@ -1431,9 +1427,7 @@ const WorkOrderPage = () => {
|
||||
onClick={openExecuteModal}
|
||||
style={{ borderRadius: 8, height: 36, fontWeight: 600 }}
|
||||
icon={<PlayCircleFilled />}
|
||||
>
|
||||
执行工单
|
||||
</Button>
|
||||
>{t('workOrder.execute')}</Button>
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<Button icon={<EditOutlined />} block onClick={openEditModal} style={{ borderRadius: 8, height: 36, fontWeight: 600 }}>{t('workOrder.modify')}</Button>
|
||||
@@ -1524,16 +1518,14 @@ const WorkOrderPage = () => {
|
||||
</Col>
|
||||
<Col span={11}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 12 }}>
|
||||
<div style={{ fontSize: 12, fontWeight: 700, color: '#1D2129' }}>关联告警列表 <Text type="secondary" style={{ fontSize: 11, fontWeight: 400 }}>(近 3 条)</Text></div>
|
||||
<div style={{ fontSize: 12, fontWeight: 700, color: '#1D2129' }}>{t('workOrder.relatedAlertList')}<Text type="secondary" style={{ fontSize: 11, fontWeight: 400 }}>(近 3 条)</Text></div>
|
||||
{weekAlarmList.length > 3 && (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
style={{ fontSize: 11, padding: 0 }}
|
||||
onClick={() => setAlarmAllModalVisible(true)}
|
||||
>
|
||||
查看全部
|
||||
</Button>
|
||||
>{t('common.viewAll')}</Button>
|
||||
)} </div>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
|
||||
{latestThreeAlarm.length === 0 ? (
|
||||
@@ -1610,8 +1602,8 @@ const WorkOrderPage = () => {
|
||||
<Select options={errorLevelOptions} allowClear />
|
||||
</Form.Item>
|
||||
</FormItem>
|
||||
<FormItem name="taskDescription" label={t('workOrder.taskDescription')} rules={[{ required: true, message: '请输入任务描述' }]}>
|
||||
<Input.TextArea rows={4} placeholder="请输入任务描述" />
|
||||
<FormItem name="taskDescription" label={t('workOrder.taskDescription')} rules={[{ required: true, message: t('workOrder.pleaseInputTaskDesc') }]}>
|
||||
<Input.TextArea rows={4} placeholder={t('workOrder.pleaseInputTaskDesc')} />
|
||||
</FormItem>
|
||||
<FormItem style={{ textAlign: 'right', marginBottom: 0 }}>
|
||||
<Button onClick={() => setEditModalVisible(false)}>{t('common.cancel')}</Button>
|
||||
@@ -1629,10 +1621,10 @@ const WorkOrderPage = () => {
|
||||
width={520}
|
||||
>
|
||||
<Form form={dispatchForm} layout="vertical" onFinish={submitDispatchWorkOrder}>
|
||||
<FormItem name="id" label="工单ID" hidden>
|
||||
<FormItem name="id" label={t('workOrder.id')} hidden>
|
||||
<Input />
|
||||
</FormItem>
|
||||
<FormItem label="待派单工单">
|
||||
<FormItem label={t('workOrder.dispatch2')}>
|
||||
<div style={{
|
||||
padding: 8,
|
||||
background: '#f8fafc',
|
||||
@@ -1650,7 +1642,7 @@ const WorkOrderPage = () => {
|
||||
rules={[{ required: true, message: t('workOrder.pleaseSelectDispatcher') }]}
|
||||
>
|
||||
<Select
|
||||
placeholder="请选择人员"
|
||||
placeholder={t('workOrder.pleaseSelectPerson')}
|
||||
showSearch
|
||||
style={{ width: '100%' }}
|
||||
optionFilterProp="label"
|
||||
@@ -1674,8 +1666,8 @@ const WorkOrderPage = () => {
|
||||
{/* 执行工单弹窗 */}
|
||||
<Modal title={t('workOrder.executeOrder')} open={dispatchModalVisible} onCancel={() => setDispatchModalVisible(false)} footer={null} width={550}>
|
||||
<Form form={form} layout="vertical" onFinish={submitExecute}>
|
||||
<FormItem name="orderIds" label="工单ID" hidden><Input /></FormItem>
|
||||
<FormItem label="选中工单">
|
||||
<FormItem name="orderIds" label={t('workOrder.id')} hidden><Input /></FormItem>
|
||||
<FormItem label={t('workOrder.s32')}>
|
||||
<div style={{
|
||||
padding: 8,
|
||||
background: '#f8fafc',
|
||||
@@ -1702,7 +1694,7 @@ const WorkOrderPage = () => {
|
||||
>
|
||||
{/*<Select
|
||||
style={{ width: "80%", marginBottom: 8 }}
|
||||
placeholder="请选择设备"
|
||||
placeholder={t('workOrder.selectDeviceFixed2')}
|
||||
value={selectedDevice?.device_sn || selectedDevice?.serialNumber}
|
||||
onChange={handleDeviceChange}
|
||||
size="small"
|
||||
@@ -1719,7 +1711,7 @@ const WorkOrderPage = () => {
|
||||
/>*/}
|
||||
|
||||
<Select
|
||||
placeholder="请选择执行设备"
|
||||
placeholder={t('devices.selectExecuteDevice')}
|
||||
showSearch
|
||||
style={{ width: "100%" }}
|
||||
// 自定义筛选逻辑:输入文字匹配别名、序列号、无人机呼号
|
||||
@@ -1765,7 +1757,7 @@ const WorkOrderPage = () => {
|
||||
<DatePicker
|
||||
showTime
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择执行开始时间"
|
||||
placeholder={t('workOrder.fixed2PleaseSelectFixed2ExecutionStartTimeFixed2')}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</FormItem>*/}
|
||||
@@ -1780,13 +1772,13 @@ const WorkOrderPage = () => {
|
||||
<Modal title={t('workOrder.completeOrder')} open={completeModalVisible} onCancel={() => setCompleteModalVisible(false)} footer={null} width={500}>
|
||||
<Form form={completeForm} layout="vertical" onFinish={submitComplete}>
|
||||
<Form.Item name="id" hidden><Input /></Form.Item>
|
||||
<Form.Item name="orderNo" label="工单编号"><Input disabled /></Form.Item>
|
||||
<Form.Item name="handleResult" label={t('alerts.handleResult')} rules={[{ required: true, message: '请输入处理结果' }]}>
|
||||
<Select placeholder="请选择处理结果">
|
||||
<Option value="已处理完成">已处理完成</Option><Option value="已修复">已修复</Option><Option value="无需处理">无需处理</Option><Option value="问题已闭环">问题已闭环</Option>
|
||||
<Form.Item name="orderNo" label={t('workOrder.orderNo')}><Input disabled /></Form.Item>
|
||||
<Form.Item name="handleResult" label={t('alerts.handleResult')} rules={[{ required: true, message: t('workOrder.fixed2PleaseEnterFixed2HandleResultFixed2') }]}>
|
||||
<Select placeholder={t('alerts.pleaseSelectHandleResult')}>
|
||||
<Option value="已处理完成">{t('workOrder.fixed2HandledFixed2CompleteFixed2')}</Option><Option value="已修复">{t('workOrder.s22')}</Option><Option value="无需处理">{t('workOrder.handleFixed2')}</Option><Option value="问题已闭环">{t('workOrder.s24')}</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item name="handleRemark" label={t('alerts.handleRemark')}><Input.TextArea rows={4} placeholder="请填写处理详情、备注信息" /></Form.Item>
|
||||
<Form.Item name="handleRemark" label={t('alerts.handleRemark')}><Input.TextArea rows={4} placeholder={t('workOrder.handleFixed2DetailRemarkFixed2InfoFixed2')} /></Form.Item>
|
||||
<Form.Item style={{ textAlign: 'right', marginBottom: 0 }}>
|
||||
<Button onClick={() => setCompleteModalVisible(false)}>{t('common.cancel')}</Button>
|
||||
<Button type="primary" htmlType="submit" style={{ marginLeft: 8 }}>{t('workOrder.confirmComplete')}</Button>
|
||||
@@ -1811,12 +1803,12 @@ const WorkOrderPage = () => {
|
||||
})()}
|
||||
columns={[
|
||||
{
|
||||
title: '告警编号',
|
||||
title: t('alerts.alarmNo'),
|
||||
dataIndex: 'alarmNo',
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
title: '告警标题',
|
||||
title: t('alerts.alarmTitle'),
|
||||
dataIndex: 'alarmTitle',
|
||||
ellipsis: true
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user