Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 48 additions & 31 deletions apps/app-mobile/src/pages/todo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Empty, List, Tabs} from "antd-mobile";
import {Empty, List, Tag, Tabs} from "antd-mobile";
import React from "react";
import {done, list, notify, todo} from "@/api/record.ts";
import dayjs from "dayjs";
Expand Down Expand Up @@ -52,36 +52,53 @@ const TodoList: React.FC<TodoListProps> = ({type}) => {
<List
style={{'--border-top': 'none'}}
>
{records.map((record) => (
<List.Item
style={{
padding: 8,
}}
onClick={() => {
handleApproval(record.recordId);
}}
key={record.recordId}
prefix={(
<TextIcon text={record.workTitle}/>
)}
description={(
<>
<div>{record.nodeName} {record.workTitle}</div>
<div>实例编码:{record.processId}</div>
{/* 记录归属身份(留痕信息):列表本身不按身份过滤(issue #297) */}
<div>身份:{record.currentOperatorIdentity || '默认身份'}</div>
</>
)}
extra={
<div style={{display: "flex", flexDirection: "column", alignItems: "flex-end"}}>
<span>{dayjs(record.createTime).format("YYYY-MM-DD HH:mm:ss")}</span>
<span style={{marginTop: 4}}>{record.currentOperatorName}</span>
</div>
}
>
{record.title}
</List.Item>
))}
{records.map((record) => {
// 「谁 + 以什么身份」合并展示,避免单独一列「身份」语义不清。
// 待办/抄送/全部:展示待办归属人与归属身份(issue #288);
// 已办:优先展示实际办理人与办理身份(issue #306),历史数据回退到归属人。
// 列表本身不按身份过滤(issue #297),身份为空表示默认身份。
const isDone = type === 'done';
const operatorName = isDone
? (record.handleOperatorName || record.currentOperatorName)
: record.currentOperatorName;
const operatorIdentity = isDone
? (record.handleOperatorIdentity || record.currentOperatorIdentity)
: record.currentOperatorIdentity;
return (
<List.Item
style={{
padding: 8,
}}
onClick={() => {
handleApproval(record.recordId);
}}
key={record.recordId}
prefix={(
<TextIcon text={record.workTitle}/>
)}
description={(
<>
<div>{record.nodeName} {record.workTitle}</div>
<div>实例编码:{record.processId}</div>
</>
)}
extra={
<div style={{display: "flex", flexDirection: "column", alignItems: "flex-end"}}>
<span>{dayjs(record.createTime).format("YYYY-MM-DD HH:mm:ss")}</span>
<span style={{marginTop: 4}}>{operatorName}</span>
<Tag
style={{marginTop: 2}}
color={operatorIdentity ? 'primary' : 'default'}
>
{operatorIdentity || '默认身份'}
</Tag>
</div>
}
>
{record.title}
</List.Item>
);
})}
</List>
);
};
Expand Down
55 changes: 37 additions & 18 deletions apps/app-pc/src/pages/todo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { done, list, notify, todo } from "@/api/record.ts";
import { forceSync, forceSyncPermission, type ForceSyncResult } from "@/api/workflow.ts";
import { ApprovalPanelDrawer, FlowTitle, WorkflowSelectModal } from "@coding-flow/flow-pc-approval";
import { Table, type TableProps } from "@coding-flow/flow-pc-ui";
import { Button, message, Popconfirm, Space, Tabs, type TabsProps } from "antd";
import { Button, message, Popconfirm, Space, Tabs, Tag, type TabsProps } from "antd";
import dayjs from "dayjs";
import { EventBus, type ActionType } from "@coding-flow/flow-core";

Expand Down Expand Up @@ -53,72 +53,87 @@ const TodoPage: React.FC = () => {
{
dataIndex: 'recordId',
title: '编号',
width: 80,
},
{
dataIndex: 'processId',
title: '实例编码',
width: 210,
ellipsis: true,
},
{
dataIndex: 'title',
title: '流程名称',
width: 180,
ellipsis: true,
render: (value) => {
return <FlowTitle title={value} />
}
},
{
dataIndex: 'readTime',
title: '读取状态',
width: 90,
render: (value) => {
return value ? '已读' : '未读';
}
},
{
dataIndex: 'nodeName',
title: '节点名称',
width: 120,
ellipsis: true,
},
{
dataIndex: 'createTime',
title: '创建时间',
width: 170,
render: (text) => {
return dayjs(text).format('YYYY-MM-DD HH:mm:ss');
}
},
{
dataIndex: 'currentOperatorId',
title: '审批人',
title: '办理人',
hidden: true,
},
{
dataIndex: 'currentOperatorName',
title: '审批人',
render: (value, record) => {
// 已办记录展示「谁办的」(办理人,issue #306);历史数据没有办理人时回退到待办归属人。
return record.recordState ? (record.handleOperatorName || value) : value;
}
},
{
dataIndex: 'currentOperatorIdentity',
title: '身份',
render: (value, record) => {
// 已办记录优先展示「以什么身份办的」(issue #306),
// 历史数据与待办记录展示待办归属身份(issue #288),空表示默认身份。
// 列表本身不按身份过滤(issue #297),该列仅用于展示留痕信息。
const identity = record.recordState
title: '办理人',
width: 180,
render: (_, record) => {
// 「谁 + 以什么身份」合并展示,避免「审批人」「身份」两列各自取值的语义歧义。
// 待办/抄送/全部流程:展示待办归属人与归属身份(issue #288);
// 已办:优先展示实际办理人与办理身份(issue #306),历史数据没有办理人时回退到归属人。
// 列表本身不按身份过滤(issue #297),身份为空表示该人员未启用多身份,即默认身份。
const isDone = !!record.recordState;
const operatorName = isDone
? (record.handleOperatorName || record.currentOperatorName)
: record.currentOperatorName;
const operatorIdentity = isDone
? (record.handleOperatorIdentity || record.currentOperatorIdentity)
: record.currentOperatorIdentity;
return identity || '默认身份';
return (
<Space size={4}>
<span>{operatorName}</span>
<Tag color={operatorIdentity ? 'blue' : undefined}>
{operatorIdentity || '默认身份'}
</Tag>
</Space>
);
}
},
{
dataIndex: 'recordState',
title: '状态',
width: 80,
render: (text) => {
return text ? '已办' : '待办';
}
},
{
dataIndex: 'option',
title: '操作',
width: 90,
render: (_, record) => {
if (currentTab === 'todo') {
return (
Expand Down Expand Up @@ -182,6 +197,7 @@ const TodoPage: React.FC = () => {
children: (
<Table
rowKey={"recordId"}
scroll={{x: 1200}}
actionType={actionTodo}
columns={columns}
request={(request) => {
Expand All @@ -196,6 +212,7 @@ const TodoPage: React.FC = () => {
children: (
<Table
rowKey={"recordId"}
scroll={{x: 1200}}
actionType={actionDone}
columns={columns}
request={(request) => {
Expand All @@ -210,6 +227,7 @@ const TodoPage: React.FC = () => {
children: (
<Table
rowKey={"recordId"}
scroll={{x: 1200}}
actionType={actionNotify}
columns={columns}
request={(request) => {
Expand All @@ -224,6 +242,7 @@ const TodoPage: React.FC = () => {
children: (
<Table
rowKey={"recordId"}
scroll={{x: 1200}}
actionType={actionAll}
columns={columns}
request={(request) => {
Expand Down
Loading