|
@@ -131,6 +131,9 @@ import { Button, Input, Select, Checkbox, Tabs, Modal, Dropdown, Popover, messag
|
|
|
import type { MenuProps } from 'antd';
|
|
import type { MenuProps } from 'antd';
|
|
|
import { toast } from 'sonner';
|
|
import { toast } from 'sonner';
|
|
|
import { workflowDesignApi, WorkflowDesignVO } from '../api/WorkflowDesign';
|
|
import { workflowDesignApi, WorkflowDesignVO } from '../api/WorkflowDesign';
|
|
|
|
|
+import { userApi } from '../api/user';
|
|
|
|
|
+import { UserVO } from '../types';
|
|
|
|
|
+import { segregationPointApi, SegregationPointVO } from '../api/spm';
|
|
|
|
|
|
|
|
// 节点配置
|
|
// 节点配置
|
|
|
const nodeConfigs = [
|
|
const nodeConfigs = [
|
|
@@ -600,6 +603,13 @@ export default function ProcessDesigner() {
|
|
|
// 存储工作流详情(name、description等)
|
|
// 存储工作流详情(name、description等)
|
|
|
const [workflowDetail, setWorkflowDetail] = useState<WorkflowDesignVO | null>(null);
|
|
const [workflowDetail, setWorkflowDetail] = useState<WorkflowDesignVO | null>(null);
|
|
|
const [loadingDetail, setLoadingDetail] = useState(false);
|
|
const [loadingDetail, setLoadingDetail] = useState(false);
|
|
|
|
|
+
|
|
|
|
|
+ // 角色用户列表
|
|
|
|
|
+ const [drawerUsers, setDrawerUsers] = useState<UserVO[]>([]); // 负责人(jtdrawer)
|
|
|
|
|
+ const [lockerUsers, setLockerUsers] = useState<UserVO[]>([]); // 上锁人(jtlocker)
|
|
|
|
|
+ const [colockerUsers, setColockerUsers] = useState<UserVO[]>([]); // 共锁人(jtcolocker)
|
|
|
|
|
+ // 隔离点列表
|
|
|
|
|
+ const [isolationPoints, setIsolationPoints] = useState<SegregationPointVO[]>([]);
|
|
|
|
|
|
|
|
const loadNodeCache = useCallback((nodeId: string) => {
|
|
const loadNodeCache = useCallback((nodeId: string) => {
|
|
|
try {
|
|
try {
|
|
@@ -624,6 +634,37 @@ export default function ProcessDesigner() {
|
|
|
console.log('Edges 状态更新:', edges.length, edges);
|
|
console.log('Edges 状态更新:', edges.length, edges);
|
|
|
}, [edges]);
|
|
}, [edges]);
|
|
|
|
|
|
|
|
|
|
+ // 加载角色用户列表和隔离点列表
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ const loadRoleUsers = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 并行加载三种角色的用户
|
|
|
|
|
+ const [drawerRes, lockerRes, colockerRes] = await Promise.all([
|
|
|
|
|
+ userApi.getRoleUser('jtdrawer'),
|
|
|
|
|
+ userApi.getRoleUser('jtlocker'),
|
|
|
|
|
+ userApi.getRoleUser('jtcolocker'),
|
|
|
|
|
+ ]);
|
|
|
|
|
+ setDrawerUsers(drawerRes || []);
|
|
|
|
|
+ setLockerUsers(lockerRes || []);
|
|
|
|
|
+ setColockerUsers(colockerRes || []);
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('加载角色用户失败:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const loadIsolationPoints = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await segregationPointApi.getIsIsolationPointPage({ pageNo: 1, pageSize: -1 });
|
|
|
|
|
+ setIsolationPoints(res.list || []);
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('加载隔离点列表失败:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ loadRoleUsers();
|
|
|
|
|
+ loadIsolationPoints();
|
|
|
|
|
+ }, []);
|
|
|
|
|
+
|
|
|
// 节点配置状态
|
|
// 节点配置状态
|
|
|
const [nodeConfig, setNodeConfig] = useState({
|
|
const [nodeConfig, setNodeConfig] = useState({
|
|
|
nodeName: '',
|
|
nodeName: '',
|
|
@@ -1938,9 +1979,9 @@ export default function ProcessDesigner() {
|
|
|
className="w-full [&_.ant-select-selector]:!rounded-lg [&_.ant-select-selector]:!h-10"
|
|
className="w-full [&_.ant-select-selector]:!rounded-lg [&_.ant-select-selector]:!h-10"
|
|
|
allowClear
|
|
allowClear
|
|
|
>
|
|
>
|
|
|
- <Select.Option value="user1">张三</Select.Option>
|
|
|
|
|
- <Select.Option value="user2">李四</Select.Option>
|
|
|
|
|
- <Select.Option value="user3">王五</Select.Option>
|
|
|
|
|
|
|
+ {drawerUsers.map(user => (
|
|
|
|
|
+ <Select.Option key={user.id} value={user.id}>{user.nickname || user.username}</Select.Option>
|
|
|
|
|
+ ))}
|
|
|
</Select>
|
|
</Select>
|
|
|
<p className="text-xs text-gray-500 mt-1.5 leading-relaxed">
|
|
<p className="text-xs text-gray-500 mt-1.5 leading-relaxed">
|
|
|
对该任务或步骤节点进行处理的人员,若不选则需要在创建作业时进行选择。
|
|
对该任务或步骤节点进行处理的人员,若不选则需要在创建作业时进行选择。
|
|
@@ -1963,9 +2004,9 @@ export default function ProcessDesigner() {
|
|
|
className="w-full [&_.ant-select-selector]:!rounded-lg [&_.ant-select-selector]:!h-10"
|
|
className="w-full [&_.ant-select-selector]:!rounded-lg [&_.ant-select-selector]:!h-10"
|
|
|
allowClear
|
|
allowClear
|
|
|
>
|
|
>
|
|
|
- <Select.Option value="user1">张三</Select.Option>
|
|
|
|
|
- <Select.Option value="user2">李四</Select.Option>
|
|
|
|
|
- <Select.Option value="user3">王五</Select.Option>
|
|
|
|
|
|
|
+ {drawerUsers.map(user => (
|
|
|
|
|
+ <Select.Option key={user.id} value={user.id}>{user.nickname || user.username}</Select.Option>
|
|
|
|
|
+ ))}
|
|
|
</Select>
|
|
</Select>
|
|
|
<p className="text-xs text-gray-500 mt-1.5 leading-relaxed">
|
|
<p className="text-xs text-gray-500 mt-1.5 leading-relaxed">
|
|
|
对该任务或步骤节点进行处理的人员,若不选则需要在创建作业时进行选择。
|
|
对该任务或步骤节点进行处理的人员,若不选则需要在创建作业时进行选择。
|
|
@@ -1988,9 +2029,9 @@ export default function ProcessDesigner() {
|
|
|
className="w-full [&_.ant-select-selector]:!rounded-lg [&_.ant-select-selector]:!h-10"
|
|
className="w-full [&_.ant-select-selector]:!rounded-lg [&_.ant-select-selector]:!h-10"
|
|
|
allowClear
|
|
allowClear
|
|
|
>
|
|
>
|
|
|
- <Select.Option value="user1">张三</Select.Option>
|
|
|
|
|
- <Select.Option value="user2">李四</Select.Option>
|
|
|
|
|
- <Select.Option value="user3">王五</Select.Option>
|
|
|
|
|
|
|
+ {drawerUsers.map(user => (
|
|
|
|
|
+ <Select.Option key={user.id} value={user.id}>{user.nickname || user.username}</Select.Option>
|
|
|
|
|
+ ))}
|
|
|
</Select>
|
|
</Select>
|
|
|
<p className="text-xs text-gray-500 mt-1.5 leading-relaxed">
|
|
<p className="text-xs text-gray-500 mt-1.5 leading-relaxed">
|
|
|
对该任务或步骤节点进行处理的人员,若不选则需要在创建作业时进行选择
|
|
对该任务或步骤节点进行处理的人员,若不选则需要在创建作业时进行选择
|
|
@@ -2145,11 +2186,9 @@ export default function ProcessDesigner() {
|
|
|
allowClear
|
|
allowClear
|
|
|
disabled={selectedNode.data?.type === 'releaseIsolation'}
|
|
disabled={selectedNode.data?.type === 'releaseIsolation'}
|
|
|
>
|
|
>
|
|
|
- <Select.Option value="point1">点位1</Select.Option>
|
|
|
|
|
- <Select.Option value="point2">点位2</Select.Option>
|
|
|
|
|
- <Select.Option value="point3">点位3</Select.Option>
|
|
|
|
|
- <Select.Option value="point4">点位4</Select.Option>
|
|
|
|
|
- <Select.Option value="point5">点位5</Select.Option>
|
|
|
|
|
|
|
+ {isolationPoints.map((point, index) => (
|
|
|
|
|
+ <Select.Option key={point.pointId || `point-${index}`} value={point.pointId}>{point.pointName}</Select.Option>
|
|
|
|
|
+ ))}
|
|
|
</Select>
|
|
</Select>
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
@@ -2170,9 +2209,9 @@ export default function ProcessDesigner() {
|
|
|
allowClear
|
|
allowClear
|
|
|
disabled={selectedNode.data?.type === 'releaseIsolation'}
|
|
disabled={selectedNode.data?.type === 'releaseIsolation'}
|
|
|
>
|
|
>
|
|
|
- <Select.Option value="user1">张三</Select.Option>
|
|
|
|
|
- <Select.Option value="user2">李四</Select.Option>
|
|
|
|
|
- <Select.Option value="user3">王五</Select.Option>
|
|
|
|
|
|
|
+ {drawerUsers.map(user => (
|
|
|
|
|
+ <Select.Option key={user.id} value={user.id}>{user.nickname || user.username}</Select.Option>
|
|
|
|
|
+ ))}
|
|
|
</Select>
|
|
</Select>
|
|
|
<p className="text-xs text-gray-500 mt-1.5 leading-relaxed">
|
|
<p className="text-xs text-gray-500 mt-1.5 leading-relaxed">
|
|
|
对该任务或步骤节点进行处理的人员,若不选则需要在创建作业时进行选择。
|
|
对该任务或步骤节点进行处理的人员,若不选则需要在创建作业时进行选择。
|
|
@@ -2197,9 +2236,9 @@ export default function ProcessDesigner() {
|
|
|
allowClear
|
|
allowClear
|
|
|
disabled={selectedNode.data?.type === 'releaseIsolation'}
|
|
disabled={selectedNode.data?.type === 'releaseIsolation'}
|
|
|
>
|
|
>
|
|
|
- <Select.Option value="user1">张三</Select.Option>
|
|
|
|
|
- <Select.Option value="user2">李四</Select.Option>
|
|
|
|
|
- <Select.Option value="user3">王五</Select.Option>
|
|
|
|
|
|
|
+ {lockerUsers.map(user => (
|
|
|
|
|
+ <Select.Option key={user.id} value={user.id}>{user.nickname || user.username}</Select.Option>
|
|
|
|
|
+ ))}
|
|
|
</Select>
|
|
</Select>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
@@ -2217,9 +2256,9 @@ export default function ProcessDesigner() {
|
|
|
allowClear
|
|
allowClear
|
|
|
disabled={selectedNode.data?.type === 'releaseIsolation'}
|
|
disabled={selectedNode.data?.type === 'releaseIsolation'}
|
|
|
>
|
|
>
|
|
|
- <Select.Option value="user1">张三</Select.Option>
|
|
|
|
|
- <Select.Option value="user2">李四</Select.Option>
|
|
|
|
|
- <Select.Option value="user3">王五</Select.Option>
|
|
|
|
|
|
|
+ {colockerUsers.map(user => (
|
|
|
|
|
+ <Select.Option key={user.id} value={user.id}>{user.nickname || user.username}</Select.Option>
|
|
|
|
|
+ ))}
|
|
|
</Select>
|
|
</Select>
|
|
|
</div>
|
|
</div>
|
|
|
</>
|
|
</>
|