|
@@ -254,16 +254,17 @@ export default function ExecutorDashboard() {
|
|
|
return nodeList.map((node) => ({
|
|
return nodeList.map((node) => ({
|
|
|
...node,
|
|
...node,
|
|
|
// 映射字段以兼容表格显示
|
|
// 映射字段以兼容表格显示
|
|
|
- id: node.id,
|
|
|
|
|
- nodeId: node.id || node.uuid,
|
|
|
|
|
- orderNo: node.workId ? `#${node.workId}` : `#${node.id || ''}`,
|
|
|
|
|
- name: node.nodeName || node.description || '未知任务',
|
|
|
|
|
- currentNodeName: node.nodeName || '',
|
|
|
|
|
|
|
+ id: (typeof node.id === 'number' ? node.id : undefined) || (typeof node.nodeId === 'number' ? node.nodeId : undefined),
|
|
|
|
|
+ nodeId: node.nodeId || node.id || node.uuid,
|
|
|
|
|
+ orderNo: node.orderNo || (node.workId ? String(node.workId) : String(node.id || '')),
|
|
|
|
|
+ name: node.name || '未知任务',
|
|
|
|
|
+ currentNodeName: node.currentNodeName || node.nodeName || '',
|
|
|
|
|
+ currentNodeId: node.currentNodeId || node.nodeId,
|
|
|
approvalStatus: node.approvalStatus,
|
|
approvalStatus: node.approvalStatus,
|
|
|
taskStatus: node.approvalStatus,
|
|
taskStatus: node.approvalStatus,
|
|
|
status: node.approvalStatus,
|
|
status: node.approvalStatus,
|
|
|
- workTime: node.startTime,
|
|
|
|
|
- taskStartTime: node.startTime,
|
|
|
|
|
|
|
+ workTime: node.workTime || node.startTime,
|
|
|
|
|
+ startTime: node.startTime || (node.workTime ? String(node.workTime) : undefined), // 使用 workTime 作为开始时间(转换为字符串)
|
|
|
workerUserName: node.workerUserName || node.initiatorName || '',
|
|
workerUserName: node.workerUserName || node.initiatorName || '',
|
|
|
urgencyLevel: node.urgencyLevel !== undefined && node.urgencyLevel !== null ? node.urgencyLevel : '', // 从接口数据中获取(保留0值)
|
|
urgencyLevel: node.urgencyLevel !== undefined && node.urgencyLevel !== null ? node.urgencyLevel : '', // 从接口数据中获取(保留0值)
|
|
|
workType: node.workType !== undefined && node.workType !== null ? node.workType : '', // 从接口数据中获取(保留0值)
|
|
workType: node.workType !== undefined && node.workType !== null ? node.workType : '', // 从接口数据中获取(保留0值)
|
|
@@ -287,7 +288,7 @@ export default function ExecutorDashboard() {
|
|
|
if (statusStr === 'pending' || statusStr === '待执行' || statusStr === '待开始' || statusStr === '未开始' || statusStr === 'unaudited' || statusStr === '1') {
|
|
if (statusStr === 'pending' || statusStr === '待执行' || statusStr === '待开始' || statusStr === '未开始' || statusStr === 'unaudited' || statusStr === '1') {
|
|
|
return '待执行';
|
|
return '待执行';
|
|
|
}
|
|
}
|
|
|
- if (statusStr === '进行中' || statusStr === 'in_progress' || statusStr === '执行中' || statusStr === '2') {
|
|
|
|
|
|
|
+ if (statusStr === 'running' || statusStr === '进行中' || statusStr === 'in_progress' || statusStr === '执行中' || statusStr === '2') {
|
|
|
return '进行中';
|
|
return '进行中';
|
|
|
}
|
|
}
|
|
|
if (statusStr === 'completed' || statusStr === '已完成' || statusStr === 'approved' || statusStr === '已通过' || statusStr === '3') {
|
|
if (statusStr === 'completed' || statusStr === '已完成' || statusStr === 'approved' || statusStr === '已通过' || statusStr === '3') {
|
|
@@ -1336,13 +1337,23 @@ export default function ExecutorDashboard() {
|
|
|
key: 'orderNo',
|
|
key: 'orderNo',
|
|
|
width: 120,
|
|
width: 120,
|
|
|
render: (_: any, record: ExecutorNodeVO) => {
|
|
render: (_: any, record: ExecutorNodeVO) => {
|
|
|
- return record.workId ? String(record.workId) : String(record.id || '');
|
|
|
|
|
|
|
+ return record.orderNo || '-';
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '作业名称',
|
|
|
|
|
+ dataIndex: 'name',
|
|
|
|
|
+ key: 'name',
|
|
|
|
|
+ width: 200,
|
|
|
|
|
+ ellipsis: true,
|
|
|
|
|
+ render: (text: string) => {
|
|
|
|
|
+ return text || '-';
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '任务名称',
|
|
title: '任务名称',
|
|
|
- dataIndex: 'nodeName',
|
|
|
|
|
- key: 'nodeName',
|
|
|
|
|
|
|
+ dataIndex: 'currentNodeName',
|
|
|
|
|
+ key: 'currentNodeName',
|
|
|
width: 200,
|
|
width: 200,
|
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
|
render: (text: string, record: ExecutorNodeVO) => {
|
|
render: (text: string, record: ExecutorNodeVO) => {
|
|
@@ -1364,9 +1375,11 @@ export default function ExecutorDashboard() {
|
|
|
return { color: '#6b7280' }; // 一般:灰色
|
|
return { color: '#6b7280' }; // 一般:灰色
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const nodeName = text || record.currentNodeName || record.nodeName || record.description || '未知任务';
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<div>
|
|
<div>
|
|
|
- <div>{text || record.description || '未知任务'}</div>
|
|
|
|
|
|
|
+ <div>{nodeName}</div>
|
|
|
{urgencyValue !== undefined && urgencyValue !== null && urgencyValue !== '' && (
|
|
{urgencyValue !== undefined && urgencyValue !== null && urgencyValue !== '' && (
|
|
|
<div className="text-xs mt-1" style={getPriorityStyle(urgencyValue)}>
|
|
<div className="text-xs mt-1" style={getPriorityStyle(urgencyValue)}>
|
|
|
优先级:{priorityText}
|
|
优先级:{priorityText}
|
|
@@ -1389,15 +1402,25 @@ export default function ExecutorDashboard() {
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '开始时间',
|
|
title: '开始时间',
|
|
|
- dataIndex: 'startTime',
|
|
|
|
|
- key: 'startTime',
|
|
|
|
|
|
|
+ dataIndex: 'workTime',
|
|
|
|
|
+ key: 'workTime',
|
|
|
width: 180,
|
|
width: 180,
|
|
|
- render: (text: any) => {
|
|
|
|
|
- if (!text) return '-';
|
|
|
|
|
|
|
+ render: (text: any, record: ExecutorNodeVO) => {
|
|
|
|
|
+ const timeValue = text || record.workTime || record.startTime;
|
|
|
|
|
+ if (!timeValue) return '-';
|
|
|
try {
|
|
try {
|
|
|
- return formatDateWithFormat(text, 'YYYY-MM-DD HH:mm:ss');
|
|
|
|
|
|
|
+ // 如果是数字(时间戳),需要处理
|
|
|
|
|
+ if (typeof timeValue === 'number') {
|
|
|
|
|
+ // 如果是秒级时间戳,转换为毫秒
|
|
|
|
|
+ let timestamp = timeValue;
|
|
|
|
|
+ if (timestamp < 10000000000) {
|
|
|
|
|
+ timestamp = timestamp * 1000;
|
|
|
|
|
+ }
|
|
|
|
|
+ return formatDateWithFormat(timestamp, 'YYYY-MM-DD HH:mm:ss');
|
|
|
|
|
+ }
|
|
|
|
|
+ return formatDateWithFormat(timeValue, 'YYYY-MM-DD HH:mm:ss');
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- return String(text);
|
|
|
|
|
|
|
+ return String(timeValue);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|