@kmkf-fe-packages/kmkf-work-order-service-component 2.2.25 → 2.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,13 +18,15 @@ export declare const verifyHandle: (data: any, componentDtoList: Array<any>) =>
18
18
  success: boolean;
19
19
  message: string;
20
20
  };
21
- export declare const currentUserHasOperatorAuth: ({ currentUserKey, staffIds, operateDataPermission, handlerList, isAllStaff, assistantList, }: {
21
+ export declare const currentUserHasOperatorAuth: ({ isSuperAdmin, currentUserKey, staffIds, operateDataPermission, handlerList, isAllStaff, assistantList, userGroupList, }: {
22
+ isSuperAdmin?: boolean | undefined;
22
23
  currentUserKey: string;
23
24
  staffIds: Array<string>;
24
- operateDataPermission: 'HANDLE_DISTRIBUTE' | 'HANDLE_ALL';
25
+ operateDataPermission: 'HANDLE_DISTRIBUTE' | 'HANDLE_ALL' | 'ONLY_THE_SAME_USER_GROUP';
25
26
  handlerList: Array<{
26
27
  userKey: string;
27
28
  }>;
28
29
  isAllStaff: boolean;
29
30
  assistantList: Array<Assistant>;
31
+ userGroupList: Array<string>;
30
32
  }) => boolean;
@@ -1,4 +1,5 @@
1
1
  import { NodeType } from "../model/flowTemplateDetail/types";
2
+ import { intersection } from 'lodash';
2
3
  export var getTag = function getTag(item) {
3
4
  var tag = 'artificial'; // 人工节点
4
5
  // 先判断是什么节点类型 步骤/判断
@@ -58,21 +59,26 @@ export var verifyHandle = function verifyHandle(data, componentDtoList) {
58
59
  return res;
59
60
  };
60
61
  export var currentUserHasOperatorAuth = function currentUserHasOperatorAuth(_ref) {
61
- var currentUserKey = _ref.currentUserKey,
62
+ var _ref$isSuperAdmin = _ref.isSuperAdmin,
63
+ isSuperAdmin = _ref$isSuperAdmin === void 0 ? false : _ref$isSuperAdmin,
64
+ currentUserKey = _ref.currentUserKey,
62
65
  staffIds = _ref.staffIds,
63
66
  operateDataPermission = _ref.operateDataPermission,
64
67
  handlerList = _ref.handlerList,
65
68
  isAllStaff = _ref.isAllStaff,
66
- assistantList = _ref.assistantList;
67
- // 节点配置为组操作
68
- var groupCanOperate = operateDataPermission === 'HANDLE_ALL';
69
+ assistantList = _ref.assistantList,
70
+ _ref$userGroupList = _ref.userGroupList,
71
+ userGroupList = _ref$userGroupList === void 0 ? [] : _ref$userGroupList;
72
+ if (isSuperAdmin) {
73
+ return true;
74
+ }
69
75
  // handlerList为空数组是没有处理人,都可以处理
70
76
  if (Array.isArray(handlerList) && (handlerList === null || handlerList === void 0 ? void 0 : handlerList.length) === 0) {
71
77
  return true;
72
78
  }
73
79
 
74
80
  // 可以处理所有任务
75
- if (groupCanOperate) {
81
+ if (operateDataPermission === 'HANDLE_ALL') {
76
82
  // 判断是否是预备客服
77
83
  return isAllStaff || ( // 全部
78
84
  staffIds === null || staffIds === void 0 ? void 0 : staffIds.includes(currentUserKey)) ||
@@ -82,6 +88,16 @@ export var currentUserHasOperatorAuth = function currentUserHasOperatorAuth(_ref
82
88
  }) // 人在groups中
83
89
  ;
84
90
  }
91
+ //仅可处理同用户组的工单
92
+ if (operateDataPermission === 'ONLY_THE_SAME_USER_GROUP') {
93
+ //判断组用户中是否包含处理人 || 判断处理人是否是自己
94
+ var handlerKeys = handlerList === null || handlerList === void 0 ? void 0 : handlerList.map(function (item) {
95
+ return item.userKey;
96
+ });
97
+ return intersection(userGroupList, handlerKeys).length !== 0 || !!(handlerList !== null && handlerList !== void 0 && handlerList.find(function (item) {
98
+ return item.userKey === currentUserKey;
99
+ }));
100
+ }
85
101
 
86
102
  // 只能处理分配到自己的任务
87
103
  // 判断处理人是否是自己
@@ -13,6 +13,7 @@ declare type CurrentNodeProps = {
13
13
  flowWorkOrderId?: string;
14
14
  queryRemarkList: () => void;
15
15
  autoSubmit?: boolean;
16
+ isSuperAdmin?: boolean;
16
17
  };
17
18
  declare const _default: React.ForwardRefExoticComponent<CurrentNodeProps & React.RefAttributes<unknown>>;
18
19
  export default _default;
@@ -31,7 +31,7 @@ import { getTag, currentUserHasOperatorAuth } from "../../common";
31
31
  import styles from "./index.module.less";
32
32
  import { PlatForm } from "../../../WorkOrder/types";
33
33
  import { useSignal } from "../../../hooks/useSignal";
34
- import { selectCurrentNodeDetail, selectTid, selectPlatInfo, selectFlowStatus, selectOperateParams, selectCurrentFlowAllShowHideRules, selectNodeAssistantMap } from "../../store/selector";
34
+ import { selectCurrentNodeDetail, selectTid, selectPlatInfo, selectFlowStatus, selectOperateParams, selectCurrentFlowAllShowHideRules, selectNodeAssistantMap, selectNodeUserGroupMap } from "../../store/selector";
35
35
  import { fetchCurrentTradeIdLinkWorkOrder, fetchPanelInfo } from "../../store/reducers";
36
36
  import { useSelector } from "../../context/useSelector";
37
37
  import { Context } from "../../context";
@@ -41,7 +41,7 @@ var formProps = {
41
41
  layout: 'vertical'
42
42
  };
43
43
  var CurrentNode = function CurrentNode(props, ref) {
44
- var _currentNodeDetail$no, _currentNodeDetail$no2, _currentNodeDetail$no3, _currentNodeDetail$no4, _currentNodeDetail$no16, _currentNodeDetail$fl, _currentNodeDetail$wo12, _localStorage, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$wo18, _currentNodeDetail$wo19, _currentNodeDetail$wo20, _currentNodeDetail$wo21, _currentNodeDetail$no19, _currentNodeDetail$no20, _currentNodeDetail$no21, _currentNodeDetail$wo22, _currentNodeDetail$no22, _currentNodeDetail$wo23;
44
+ var _currentNodeDetail$no, _currentNodeDetail$no2, _currentNodeDetail$no3, _currentNodeDetail$no4, _currentNodeDetail$no18, _currentNodeDetail$fl, _currentNodeDetail$wo12, _localStorage, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$wo18, _currentNodeDetail$wo19, _currentNodeDetail$wo20, _currentNodeDetail$wo21, _currentNodeDetail$no21, _currentNodeDetail$no22, _currentNodeDetail$no23, _currentNodeDetail$wo22, _currentNodeDetail$no24, _currentNodeDetail$wo23;
45
45
  var formRenderRef = useRef(null);
46
46
  useImperativeHandle(ref, function () {
47
47
  return {
@@ -88,6 +88,7 @@ var CurrentNode = function CurrentNode(props, ref) {
88
88
  var operateParams = useSelector(selectOperateParams);
89
89
  var allShowHideRules = useSelector(selectCurrentFlowAllShowHideRules);
90
90
  var assistantMap = useSelector(selectNodeAssistantMap);
91
+ var useGroupMap = useSelector(selectNodeUserGroupMap);
91
92
  var tradeKey = useMemo(function () {
92
93
  var _currentNodeDetail$wo, _currentNodeDetail$wo2, _currentNodeDetail$wo3, _currentNodeDetail$wo4;
93
94
  var tradeConfig = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo === void 0 ? void 0 : (_currentNodeDetail$wo2 = _currentNodeDetail$wo.componentDtoList) === null || _currentNodeDetail$wo2 === void 0 ? void 0 : _currentNodeDetail$wo2.find(function (item) {
@@ -102,20 +103,22 @@ var CurrentNode = function CurrentNode(props, ref) {
102
103
 
103
104
  // 是否是当前节点处理人
104
105
  var isCurrentNodeHandler = useMemo(function () {
105
- var _currentNodeDetail$no5, _currentNodeDetail$no6, _currentNodeDetail$no7, _currentNodeDetail$no8, _currentNodeDetail$no9, _currentNodeDetail$no10, _currentNodeDetail$wo5, _currentNodeDetail$no11, _currentNodeDetail$no12;
106
+ var _currentNodeDetail$no5, _currentNodeDetail$no6, _currentNodeDetail$no7, _currentNodeDetail$no8, _currentNodeDetail$no9, _currentNodeDetail$no10, _currentNodeDetail$no11, _currentNodeDetail$no12, _currentNodeDetail$wo5, _currentNodeDetail$no13, _currentNodeDetail$no14;
106
107
  return currentUserHasOperatorAuth({
108
+ isSuperAdmin: props === null || props === void 0 ? void 0 : props.isSuperAdmin,
107
109
  assistantList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no5 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no5 === void 0 ? void 0 : _currentNodeDetail$no5.id) && assistantMap[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no6 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no6 === void 0 ? void 0 : _currentNodeDetail$no6.id] || [],
110
+ userGroupList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no7 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no7 === void 0 ? void 0 : _currentNodeDetail$no7.id) && useGroupMap[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no8 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no8 === void 0 ? void 0 : _currentNodeDetail$no8.id] || [],
108
111
  currentUserKey: plat.userKey,
109
- staffIds: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no7 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no7 === void 0 ? void 0 : (_currentNodeDetail$no8 = _currentNodeDetail$no7.assistants) === null || _currentNodeDetail$no8 === void 0 ? void 0 : _currentNodeDetail$no8.staffIds) || [],
110
- operateDataPermission: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no9 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no9 === void 0 ? void 0 : (_currentNodeDetail$no10 = _currentNodeDetail$no9.assistants) === null || _currentNodeDetail$no10 === void 0 ? void 0 : _currentNodeDetail$no10.operateDataPermission,
112
+ staffIds: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no9 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no9 === void 0 ? void 0 : (_currentNodeDetail$no10 = _currentNodeDetail$no9.assistants) === null || _currentNodeDetail$no10 === void 0 ? void 0 : _currentNodeDetail$no10.staffIds) || [],
113
+ operateDataPermission: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no11 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no11 === void 0 ? void 0 : (_currentNodeDetail$no12 = _currentNodeDetail$no11.assistants) === null || _currentNodeDetail$no12 === void 0 ? void 0 : _currentNodeDetail$no12.operateDataPermission,
111
114
  handlerList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo5 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo5 === void 0 ? void 0 : _currentNodeDetail$wo5.handlerList) || [],
112
- isAllStaff: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no11 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no11 === void 0 ? void 0 : (_currentNodeDetail$no12 = _currentNodeDetail$no11.assistants) === null || _currentNodeDetail$no12 === void 0 ? void 0 : _currentNodeDetail$no12.isAllStaff
115
+ isAllStaff: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no13 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no13 === void 0 ? void 0 : (_currentNodeDetail$no14 = _currentNodeDetail$no13.assistants) === null || _currentNodeDetail$no14 === void 0 ? void 0 : _currentNodeDetail$no14.isAllStaff
113
116
  });
114
117
  }, [currentNodeDetail, plat.userKey, assistantMap]);
115
118
  var handleChangeTradeId = useMemoizedFn(function (tid) {
116
- var _currentNodeDetail$no13;
119
+ var _currentNodeDetail$no15;
117
120
  // 非开始节点不进行订单重复校验逻辑
118
- if ((currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no13 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no13 === void 0 ? void 0 : _currentNodeDetail$no13.nodeType) !== NodeType.START_NODE) {
121
+ if ((currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no15 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no15 === void 0 ? void 0 : _currentNodeDetail$no15.nodeType) !== NodeType.START_NODE) {
119
122
  return;
120
123
  }
121
124
  if (!tid) {
@@ -128,10 +131,10 @@ var CurrentNode = function CurrentNode(props, ref) {
128
131
  }
129
132
  });
130
133
  } else {
131
- var _currentNodeDetail$no14;
134
+ var _currentNodeDetail$no16;
132
135
  // 查询当前订单号有多少的重复
133
136
  var params = {
134
- flowNodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no14 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no14 === void 0 ? void 0 : _currentNodeDetail$no14.id,
137
+ flowNodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no16 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no16 === void 0 ? void 0 : _currentNodeDetail$no16.id,
135
138
  flowTemplateKey: operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey,
136
139
  desensitizedFlag: false,
137
140
  pageNo: 1,
@@ -151,11 +154,11 @@ var CurrentNode = function CurrentNode(props, ref) {
151
154
  });
152
155
  // 当前节点是开始节点、并且携带订单号时,此时会进行订单重复提醒
153
156
  useEffect(function () {
154
- var _currentNodeDetail$no15;
155
- if (plat.orderNo && NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no15 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no15 === void 0 ? void 0 : _currentNodeDetail$no15.nodeType) && operateParams !== null && operateParams !== void 0 && operateParams.flowTemplateKey && tradeKey) {
157
+ var _currentNodeDetail$no17;
158
+ if (plat.orderNo && NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no17 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no17 === void 0 ? void 0 : _currentNodeDetail$no17.nodeType) && operateParams !== null && operateParams !== void 0 && operateParams.flowTemplateKey && tradeKey) {
156
159
  handleChangeTradeId(plat.orderNo);
157
160
  }
158
- }, [plat.orderNo, operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey, currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no16 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no16 === void 0 ? void 0 : _currentNodeDetail$no16.nodeType, tradeKey]);
161
+ }, [plat.orderNo, operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey, currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no18 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no18 === void 0 ? void 0 : _currentNodeDetail$no18.nodeType, tradeKey]);
159
162
  var transData = useMemo(function () {
160
163
  if (flowStatus === FlowStatus.COMPLETED) {
161
164
  var _currentNodeDetail$wo6, _currentNodeDetail$wo7;
@@ -166,11 +169,11 @@ var CurrentNode = function CurrentNode(props, ref) {
166
169
  }
167
170
  }, [flowStatus, currentNodeDetail]);
168
171
  var handleWithdraw = function handleWithdraw() {
169
- var _currentNodeDetail$no17;
172
+ var _currentNodeDetail$no19;
170
173
  dispatch({
171
174
  type: 'setWithdrawWorkOrderDetail',
172
175
  payload: {
173
- nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no17 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no17 === void 0 ? void 0 : _currentNodeDetail$no17.id) || ''
176
+ nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no19 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no19 === void 0 ? void 0 : _currentNodeDetail$no19.id) || ''
174
177
  }
175
178
  });
176
179
  dispatch({
@@ -241,7 +244,7 @@ var CurrentNode = function CurrentNode(props, ref) {
241
244
  }();
242
245
  var handleRestartAutoTask = /*#__PURE__*/function () {
243
246
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
244
- var _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$no18;
247
+ var _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$no20;
245
248
  var _yield$restartAutoTas, success, _controllerRef$curren2;
246
249
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
247
250
  while (1) switch (_context2.prev = _context2.next) {
@@ -253,7 +256,7 @@ var CurrentNode = function CurrentNode(props, ref) {
253
256
  flowWorkOrderId: flowWorkOrderId,
254
257
  workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo10 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo10 === void 0 ? void 0 : _currentNodeDetail$wo10.id,
255
258
  workOrderUpdateTime: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo11 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo11 === void 0 ? void 0 : _currentNodeDetail$wo11.update,
256
- nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no18 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no18 === void 0 ? void 0 : _currentNodeDetail$no18.id) || ''
259
+ nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no20 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no20 === void 0 ? void 0 : _currentNodeDetail$no20.id) || ''
257
260
  })
258
261
  });
259
262
  case 2:
@@ -307,17 +310,17 @@ var CurrentNode = function CurrentNode(props, ref) {
307
310
  handleRestartAutoTask: handleRestartAutoTask,
308
311
  flowTemplateKey: (operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey) || '',
309
312
  flowWorkOrderId: flowWorkOrderId || '',
310
- nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no19 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no19 === void 0 ? void 0 : _currentNodeDetail$no19.id) || ''
313
+ nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : _currentNodeDetail$no21.id) || ''
311
314
  }), /*#__PURE__*/React.createElement("div", {
312
315
  className: styles.formRenderContainer
313
- }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no20 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no20 === void 0 ? void 0 : _currentNodeDetail$no20.nodeType) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) && (flowStatus === FlowStatus.COMPLETED && !editing ? /*#__PURE__*/React.createElement(RenderDetail, {
316
+ }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no22 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no22 === void 0 ? void 0 : _currentNodeDetail$no22.nodeType) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) && (flowStatus === FlowStatus.COMPLETED && !editing ? /*#__PURE__*/React.createElement(RenderDetail, {
314
317
  workOrderTemplateInfo: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo,
315
318
  transData: transData,
316
319
  platform: plat.platform,
317
320
  onOpenWangWang: onOpenWangWang
318
321
  }) : /*#__PURE__*/React.createElement(FormRender, {
319
322
  ref: formRenderRef,
320
- isShowShopList: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : _currentNodeDetail$no21.nodeType) && [PlatForm.PC, PlatForm.WEB].includes(plat.platform),
323
+ isShowShopList: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no23 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no23 === void 0 ? void 0 : _currentNodeDetail$no23.nodeType) && [PlatForm.PC, PlatForm.WEB].includes(plat.platform),
321
324
  plat: plat,
322
325
  templateDetail: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo,
323
326
  shopList: shopList,
@@ -334,7 +337,7 @@ var CurrentNode = function CurrentNode(props, ref) {
334
337
  handleChangeTradeId: handleChangeTradeId,
335
338
  canModifyPayment: true,
336
339
  flowAllShowHideRules: allShowHideRules,
337
- isStartNodeWaiting: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no22 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no22 === void 0 ? void 0 : _currentNodeDetail$no22.nodeType) && [NodeStatus.WAITING].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo23 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo23 === void 0 ? void 0 : _currentNodeDetail$wo23.flowStatus),
340
+ isStartNodeWaiting: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no24 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no24 === void 0 ? void 0 : _currentNodeDetail$no24.nodeType) && [NodeStatus.WAITING].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo23 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo23 === void 0 ? void 0 : _currentNodeDetail$wo23.flowStatus),
338
341
  firstOrderBackfill: flowStatus !== FlowStatus.COMPLETED,
339
342
  autoSubmit: autoSubmit
340
343
  })), isShowAutoNodeDetail && /*#__PURE__*/React.createElement(AutoTaskDetail, {
@@ -18,6 +18,7 @@ interface NodeItem {
18
18
  nodeIsAuto: boolean;
19
19
  flowTemplateKey: string;
20
20
  eventNodeType: string;
21
+ isSuperAdmin?: boolean;
21
22
  }
22
23
  declare const NodeItem: (props: NodeItem) => React.JSX.Element;
23
24
  export default NodeItem;
@@ -25,8 +25,8 @@ import Header from "../Header";
25
25
  import FormRender from "../FormRender";
26
26
  import RenderDetail from "../RenderDetail";
27
27
  import { calcWorkOrderList, submitParams } from "../../../common/utils/tools";
28
- import { queryNodeDetail, queryMultiNodeAssistantInfo } from "../../../model/flowTemplateDetail/api";
29
- import { selectPlatInfo, selectFlowStatus, selectCurrentFlowAllShowHideRules, selectNodeAssistantMap, selectOperateParams } from "../../store/selector";
28
+ import { queryNodeDetail, queryMultiNodeAssistantInfo, queryUserGroupList } from "../../../model/flowTemplateDetail/api";
29
+ import { selectPlatInfo, selectFlowStatus, selectCurrentFlowAllShowHideRules, selectNodeAssistantMap, selectOperateParams, selectNodeUserGroupMap } from "../../store/selector";
30
30
  import { FlowStatus, NodeType } from "../../../model/flowTemplateDetail/types";
31
31
  import { modifyWorkOrder } from "../../../model/flowTemplateDetail/api";
32
32
  import { PlatForm } from "../../../WorkOrder/types";
@@ -35,7 +35,7 @@ import { useSelector } from "../../context/useSelector";
35
35
  import { Context } from "../../context";
36
36
  import { AutoTaskDetail } from "../AutoTaskDetail";
37
37
  var NodeItem = function NodeItem(props) {
38
- var _data$data10, _data$data11, _data$data11$workOrde, _data$data12, _data$data12$workOrde, _data$data13, _data$data13$nodeInfo, _data$data14, _data$data15, _data$data15$nodeInfo, _data$data16, _data$data17, _data$data18, _data$data18$workOrde, _data$data19, _data$data20;
38
+ var _data$data12, _data$data13, _data$data13$workOrde, _data$data14, _data$data14$workOrde, _data$data15, _data$data15$nodeInfo, _data$data16, _data$data17, _data$data17$nodeInfo, _data$data18, _data$data19, _data$data20, _data$data20$workOrde, _data$data21, _data$data22;
39
39
  var tag = props.tag,
40
40
  nodeId = props.nodeId,
41
41
  nodeName = props.nodeName,
@@ -56,7 +56,9 @@ var NodeItem = function NodeItem(props) {
56
56
  nodeIsAuto = props.nodeIsAuto,
57
57
  flowTemplateKey = props.flowTemplateKey,
58
58
  onJumpPage = props.onJumpPage,
59
- eventNodeType = props.eventNodeType;
59
+ eventNodeType = props.eventNodeType,
60
+ _props$isSuperAdmin = props.isSuperAdmin,
61
+ isSuperAdmin = _props$isSuperAdmin === void 0 ? false : _props$isSuperAdmin;
60
62
  var _useContext = useContext(Context),
61
63
  dispatch = _useContext.dispatch;
62
64
  var plat = useSelector(selectPlatInfo);
@@ -77,6 +79,7 @@ var NodeItem = function NodeItem(props) {
77
79
  var flowStatus = useSelector(selectFlowStatus);
78
80
  var allShowHideRules = useSelector(selectCurrentFlowAllShowHideRules);
79
81
  var assistantMap = useSelector(selectNodeAssistantMap);
82
+ var useGroupMap = useSelector(selectNodeUserGroupMap);
80
83
  var _Form$useForm = Form.useForm(),
81
84
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
82
85
  form = _Form$useForm2[0];
@@ -98,12 +101,12 @@ var NodeItem = function NodeItem(props) {
98
101
  manual: true,
99
102
  onSuccess: function () {
100
103
  var _onSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(result) {
101
- var _currentNodeDetail$wo, _currentNodeDetail$no, currentNodeDetail, handlerList, assistants, assistantRes, _assistantRes$data;
104
+ var _currentNodeDetail$wo, _currentNodeDetail$no, _assistants$groupIds, currentNodeDetail, handlerList, assistants, userRes, assistantRes, _assistantRes$data;
102
105
  return _regeneratorRuntime().wrap(function _callee$(_context) {
103
106
  while (1) switch (_context.prev = _context.next) {
104
107
  case 0:
105
108
  if (!result.success) {
106
- _context.next = 17;
109
+ _context.next = 24;
107
110
  break;
108
111
  }
109
112
  setOpen(true);
@@ -112,20 +115,39 @@ var NodeItem = function NodeItem(props) {
112
115
  currentNodeDetail = result === null || result === void 0 ? void 0 : result.data;
113
116
  handlerList = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo === void 0 ? void 0 : _currentNodeDetail$wo.handlerList;
114
117
  assistants = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no === void 0 ? void 0 : _currentNodeDetail$no.assistants;
118
+ if (!((assistants === null || assistants === void 0 ? void 0 : assistants.operateDataPermission) === 'ONLY_THE_SAME_USER_GROUP' && assistants !== null && assistants !== void 0 && (_assistants$groupIds = assistants.groupIds) !== null && _assistants$groupIds !== void 0 && _assistants$groupIds.length)) {
119
+ _context.next = 13;
120
+ break;
121
+ }
122
+ _context.next = 9;
123
+ return queryUserGroupList({
124
+ groupUkList: (assistants === null || assistants === void 0 ? void 0 : assistants.groupIds) || []
125
+ });
126
+ case 9:
127
+ userRes = _context.sent;
128
+ if (userRes.success) {
129
+ dispatch({
130
+ type: 'setGroupUserList',
131
+ payload: _defineProperty({}, nodeId, userRes.data || [])
132
+ });
133
+ }
134
+ _context.next = 24;
135
+ break;
136
+ case 13:
115
137
  if (!(Array.isArray(handlerList) && handlerList.length &&
116
138
  // 有处理人
117
139
  !(assistants !== null && assistants !== void 0 && assistants.isAllStaff) // 不是所有人都能处理,查询能够处理的人
118
140
  )) {
119
- _context.next = 17;
141
+ _context.next = 24;
120
142
  break;
121
143
  }
122
- _context.prev = 7;
123
- _context.next = 10;
144
+ _context.prev = 14;
145
+ _context.next = 17;
124
146
  return queryMultiNodeAssistantInfo([{
125
147
  flowTemplateId: flowTemplateId,
126
148
  currentNodeId: nodeId
127
149
  }]);
128
- case 10:
150
+ case 17:
129
151
  assistantRes = _context.sent;
130
152
  if (assistantRes.success) {
131
153
  dispatch({
@@ -133,17 +155,17 @@ var NodeItem = function NodeItem(props) {
133
155
  payload: _defineProperty({}, nodeId, ((_assistantRes$data = assistantRes.data) === null || _assistantRes$data === void 0 ? void 0 : _assistantRes$data.userList) || [])
134
156
  });
135
157
  }
136
- _context.next = 17;
158
+ _context.next = 24;
137
159
  break;
138
- case 14:
139
- _context.prev = 14;
140
- _context.t0 = _context["catch"](7);
160
+ case 21:
161
+ _context.prev = 21;
162
+ _context.t0 = _context["catch"](14);
141
163
  console.error(_context.t0);
142
- case 17:
164
+ case 24:
143
165
  case "end":
144
166
  return _context.stop();
145
167
  }
146
- }, _callee, null, [[7, 14]]);
168
+ }, _callee, null, [[14, 21]]);
147
169
  }));
148
170
  function onSuccess(_x2) {
149
171
  return _onSuccess.apply(this, arguments);
@@ -239,15 +261,17 @@ var NodeItem = function NodeItem(props) {
239
261
 
240
262
  // 是否是当前节点处理人
241
263
  var isCurrentNodeHandler = useMemo(function () {
242
- var _data$data4, _data$data4$nodeInfo, _data$data5, _data$data5$nodeInfo, _data$data6, _data$data6$nodeInfo, _data$data6$nodeInfo$, _data$data7, _data$data7$nodeInfo, _data$data7$nodeInfo$, _data$data8, _data$data8$workOrder, _data$data9, _data$data9$nodeInfo, _data$data9$nodeInfo$;
264
+ var _data$data4, _data$data4$nodeInfo, _data$data5, _data$data5$nodeInfo, _data$data6, _data$data6$nodeInfo, _data$data7, _data$data7$nodeInfo, _data$data8, _data$data8$nodeInfo, _data$data8$nodeInfo$, _data$data9, _data$data9$nodeInfo, _data$data9$nodeInfo$, _data$data10, _data$data10$workOrde, _data$data11, _data$data11$nodeInfo, _data$data11$nodeInfo2;
243
265
  return currentUserHasOperatorAuth({
266
+ isSuperAdmin: isSuperAdmin,
244
267
  // assistantList: data?.data?.nodeInfo?.id && assistantMap['FN00278209550851436544'] || [],
245
268
  assistantList: (data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : (_data$data4$nodeInfo = _data$data4.nodeInfo) === null || _data$data4$nodeInfo === void 0 ? void 0 : _data$data4$nodeInfo.id) && assistantMap[data === null || data === void 0 ? void 0 : (_data$data5 = data.data) === null || _data$data5 === void 0 ? void 0 : (_data$data5$nodeInfo = _data$data5.nodeInfo) === null || _data$data5$nodeInfo === void 0 ? void 0 : _data$data5$nodeInfo.id] || [],
269
+ userGroupList: (data === null || data === void 0 ? void 0 : (_data$data6 = data.data) === null || _data$data6 === void 0 ? void 0 : (_data$data6$nodeInfo = _data$data6.nodeInfo) === null || _data$data6$nodeInfo === void 0 ? void 0 : _data$data6$nodeInfo.id) && useGroupMap[data === null || data === void 0 ? void 0 : (_data$data7 = data.data) === null || _data$data7 === void 0 ? void 0 : (_data$data7$nodeInfo = _data$data7.nodeInfo) === null || _data$data7$nodeInfo === void 0 ? void 0 : _data$data7$nodeInfo.id] || [],
246
270
  currentUserKey: plat.userKey,
247
- staffIds: (data === null || data === void 0 ? void 0 : (_data$data6 = data.data) === null || _data$data6 === void 0 ? void 0 : (_data$data6$nodeInfo = _data$data6.nodeInfo) === null || _data$data6$nodeInfo === void 0 ? void 0 : (_data$data6$nodeInfo$ = _data$data6$nodeInfo.assistants) === null || _data$data6$nodeInfo$ === void 0 ? void 0 : _data$data6$nodeInfo$.staffIds) || [],
248
- operateDataPermission: data === null || data === void 0 ? void 0 : (_data$data7 = data.data) === null || _data$data7 === void 0 ? void 0 : (_data$data7$nodeInfo = _data$data7.nodeInfo) === null || _data$data7$nodeInfo === void 0 ? void 0 : (_data$data7$nodeInfo$ = _data$data7$nodeInfo.assistants) === null || _data$data7$nodeInfo$ === void 0 ? void 0 : _data$data7$nodeInfo$.operateDataPermission,
249
- handlerList: (data === null || data === void 0 ? void 0 : (_data$data8 = data.data) === null || _data$data8 === void 0 ? void 0 : (_data$data8$workOrder = _data$data8.workOrder) === null || _data$data8$workOrder === void 0 ? void 0 : _data$data8$workOrder.handlerList) || [],
250
- isAllStaff: data === null || data === void 0 ? void 0 : (_data$data9 = data.data) === null || _data$data9 === void 0 ? void 0 : (_data$data9$nodeInfo = _data$data9.nodeInfo) === null || _data$data9$nodeInfo === void 0 ? void 0 : (_data$data9$nodeInfo$ = _data$data9$nodeInfo.assistants) === null || _data$data9$nodeInfo$ === void 0 ? void 0 : _data$data9$nodeInfo$.isAllStaff
271
+ staffIds: (data === null || data === void 0 ? void 0 : (_data$data8 = data.data) === null || _data$data8 === void 0 ? void 0 : (_data$data8$nodeInfo = _data$data8.nodeInfo) === null || _data$data8$nodeInfo === void 0 ? void 0 : (_data$data8$nodeInfo$ = _data$data8$nodeInfo.assistants) === null || _data$data8$nodeInfo$ === void 0 ? void 0 : _data$data8$nodeInfo$.staffIds) || [],
272
+ operateDataPermission: data === null || data === void 0 ? void 0 : (_data$data9 = data.data) === null || _data$data9 === void 0 ? void 0 : (_data$data9$nodeInfo = _data$data9.nodeInfo) === null || _data$data9$nodeInfo === void 0 ? void 0 : (_data$data9$nodeInfo$ = _data$data9$nodeInfo.assistants) === null || _data$data9$nodeInfo$ === void 0 ? void 0 : _data$data9$nodeInfo$.operateDataPermission,
273
+ handlerList: (data === null || data === void 0 ? void 0 : (_data$data10 = data.data) === null || _data$data10 === void 0 ? void 0 : (_data$data10$workOrde = _data$data10.workOrder) === null || _data$data10$workOrde === void 0 ? void 0 : _data$data10$workOrde.handlerList) || [],
274
+ isAllStaff: data === null || data === void 0 ? void 0 : (_data$data11 = data.data) === null || _data$data11 === void 0 ? void 0 : (_data$data11$nodeInfo = _data$data11.nodeInfo) === null || _data$data11$nodeInfo === void 0 ? void 0 : (_data$data11$nodeInfo2 = _data$data11$nodeInfo.assistants) === null || _data$data11$nodeInfo2 === void 0 ? void 0 : _data$data11$nodeInfo2.isAllStaff
251
275
  });
252
276
  }, [data, plat.userKey, assistantMap]);
253
277
  var isShowAutoNodeDetail = isAutoNode && ['ORDER_MEMO_MANY_RULES', 'AFTER_SALE_AUTO_RETURN_GOODS_AGREE_REJECT', 'AFTER_SALE_AUTO_REFUND_REJECT', 'LOGISTICS_INTERCEPT_MULTI_RULE', 'MESSAGE_NOTIFY_EVENT', 'DING_TALK_ROBOT_NOTIFY', 'HTTP_INVOKE', 'ORDER_MEMO', 'WDT_STORE_STATUS', 'BS_E3_RETAIL_RETURN_IN_STOCK_SYNC', 'RETAIL_RETURN_IN_STOCK_SYNC'].includes(eventNodeType);
@@ -268,7 +292,7 @@ var NodeItem = function NodeItem(props) {
268
292
  // }
269
293
  // };
270
294
 
271
- var _calcWorkOrderList = calcWorkOrderList([(data === null || data === void 0 ? void 0 : (_data$data10 = data.data) === null || _data$data10 === void 0 ? void 0 : _data$data10.workOrder) || {}], [].concat(_toConsumableArray((data === null || data === void 0 ? void 0 : (_data$data11 = data.data) === null || _data$data11 === void 0 ? void 0 : (_data$data11$workOrde = _data$data11.workOrderTemplateInfo) === null || _data$data11$workOrde === void 0 ? void 0 : _data$data11$workOrde.preNodeComponentDtoList) || []), _toConsumableArray((data === null || data === void 0 ? void 0 : (_data$data12 = data.data) === null || _data$data12 === void 0 ? void 0 : (_data$data12$workOrde = _data$data12.workOrderTemplateInfo) === null || _data$data12$workOrde === void 0 ? void 0 : _data$data12$workOrde.componentDtoList) || []))),
295
+ var _calcWorkOrderList = calcWorkOrderList([(data === null || data === void 0 ? void 0 : (_data$data12 = data.data) === null || _data$data12 === void 0 ? void 0 : _data$data12.workOrder) || {}], [].concat(_toConsumableArray((data === null || data === void 0 ? void 0 : (_data$data13 = data.data) === null || _data$data13 === void 0 ? void 0 : (_data$data13$workOrde = _data$data13.workOrderTemplateInfo) === null || _data$data13$workOrde === void 0 ? void 0 : _data$data13$workOrde.preNodeComponentDtoList) || []), _toConsumableArray((data === null || data === void 0 ? void 0 : (_data$data14 = data.data) === null || _data$data14 === void 0 ? void 0 : (_data$data14$workOrde = _data$data14.workOrderTemplateInfo) === null || _data$data14$workOrde === void 0 ? void 0 : _data$data14$workOrde.componentDtoList) || []))),
272
296
  _calcWorkOrderList2 = _slicedToArray(_calcWorkOrderList, 1),
273
297
  transData = _calcWorkOrderList2[0];
274
298
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, {
@@ -296,18 +320,18 @@ var NodeItem = function NodeItem(props) {
296
320
  display: open ? 'block' : 'none',
297
321
  marginTop: '16px'
298
322
  }
299
- }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(data === null || data === void 0 ? void 0 : (_data$data13 = data.data) === null || _data$data13 === void 0 ? void 0 : (_data$data13$nodeInfo = _data$data13.nodeInfo) === null || _data$data13$nodeInfo === void 0 ? void 0 : _data$data13$nodeInfo.nodeType) && (data === null || data === void 0 ? void 0 : (_data$data14 = data.data) === null || _data$data14 === void 0 ? void 0 : _data$data14.workOrderTemplateInfo) && /*#__PURE__*/React.createElement("div", null, editing ? /*#__PURE__*/React.createElement(FormRender, {
300
- isShowShopList: NodeType.START_NODE === (data === null || data === void 0 ? void 0 : (_data$data15 = data.data) === null || _data$data15 === void 0 ? void 0 : (_data$data15$nodeInfo = _data$data15.nodeInfo) === null || _data$data15$nodeInfo === void 0 ? void 0 : _data$data15$nodeInfo.nodeType) && [PlatForm.PC, PlatForm.WEB].includes(plat.platform),
323
+ }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(data === null || data === void 0 ? void 0 : (_data$data15 = data.data) === null || _data$data15 === void 0 ? void 0 : (_data$data15$nodeInfo = _data$data15.nodeInfo) === null || _data$data15$nodeInfo === void 0 ? void 0 : _data$data15$nodeInfo.nodeType) && (data === null || data === void 0 ? void 0 : (_data$data16 = data.data) === null || _data$data16 === void 0 ? void 0 : _data$data16.workOrderTemplateInfo) && /*#__PURE__*/React.createElement("div", null, editing ? /*#__PURE__*/React.createElement(FormRender, {
324
+ isShowShopList: NodeType.START_NODE === (data === null || data === void 0 ? void 0 : (_data$data17 = data.data) === null || _data$data17 === void 0 ? void 0 : (_data$data17$nodeInfo = _data$data17.nodeInfo) === null || _data$data17$nodeInfo === void 0 ? void 0 : _data$data17$nodeInfo.nodeType) && [PlatForm.PC, PlatForm.WEB].includes(plat.platform),
301
325
  plat: plat,
302
- templateDetail: data === null || data === void 0 ? void 0 : (_data$data16 = data.data) === null || _data$data16 === void 0 ? void 0 : _data$data16.workOrderTemplateInfo,
326
+ templateDetail: data === null || data === void 0 ? void 0 : (_data$data18 = data.data) === null || _data$data18 === void 0 ? void 0 : _data$data18.workOrderTemplateInfo,
303
327
  shopList: shopList,
304
- record: data === null || data === void 0 ? void 0 : (_data$data17 = data.data) === null || _data$data17 === void 0 ? void 0 : _data$data17.workOrder,
328
+ record: data === null || data === void 0 ? void 0 : (_data$data19 = data.data) === null || _data$data19 === void 0 ? void 0 : _data$data19.workOrder,
305
329
  accountName: plat.accountName,
306
330
  form: form,
307
331
  onOpenWangWang: onOpenWangWang,
308
332
  onJumpPage: onJumpPage,
309
333
  look: !editing || flowStatus === FlowStatus.STOPPING,
310
- shopId: data === null || data === void 0 ? void 0 : (_data$data18 = data.data) === null || _data$data18 === void 0 ? void 0 : (_data$data18$workOrde = _data$data18.workOrder) === null || _data$data18$workOrde === void 0 ? void 0 : _data$data18$workOrde.shopId,
334
+ shopId: data === null || data === void 0 ? void 0 : (_data$data20 = data.data) === null || _data$data20 === void 0 ? void 0 : (_data$data20$workOrde = _data$data20.workOrder) === null || _data$data20$workOrde === void 0 ? void 0 : _data$data20$workOrde.shopId,
311
335
  formProps: {
312
336
  className: 'customizeFormModalClassName',
313
337
  layout: 'vertical'
@@ -317,12 +341,12 @@ var NodeItem = function NodeItem(props) {
317
341
  firstOrderBackfill: false // TODO: 前面节点必然是已完成状态,已完成状态不再调用订单反填
318
342
  // handleChangeTradeId={handleChangeTradeId}
319
343
  }) : /*#__PURE__*/React.createElement(RenderDetail, {
320
- workOrderTemplateInfo: data === null || data === void 0 ? void 0 : (_data$data19 = data.data) === null || _data$data19 === void 0 ? void 0 : _data$data19.workOrderTemplateInfo,
344
+ workOrderTemplateInfo: data === null || data === void 0 ? void 0 : (_data$data21 = data.data) === null || _data$data21 === void 0 ? void 0 : _data$data21.workOrderTemplateInfo,
321
345
  transData: transData,
322
346
  platform: plat.platform,
323
347
  onOpenWangWang: onOpenWangWang
324
348
  })), isShowAutoNodeDetail && /*#__PURE__*/React.createElement(AutoTaskDetail, {
325
- flowEventData: data === null || data === void 0 ? void 0 : (_data$data20 = data.data) === null || _data$data20 === void 0 ? void 0 : _data$data20.flowEventData
349
+ flowEventData: data === null || data === void 0 ? void 0 : (_data$data22 = data.data) === null || _data$data22 === void 0 ? void 0 : _data$data22.flowEventData
326
350
  })));
327
351
  };
328
352
  export default NodeItem;
@@ -27,7 +27,7 @@ import { calcWorkOrderList, deleteCacheOrder, submitParams } from "../common/uti
27
27
  import { useMemoizedFn } from 'ahooks';
28
28
  import moment from 'moment';
29
29
  import { fetchPanelInfo, fetchAllFlowOperateRecord, fetchCollectOrder, fetchShareNodeConfig, fetchH5SharePermission } from "./store/reducers";
30
- import { selectFlowRecordList, selectRemarkRecordList, selectCurrentNodeDetail, selectTid, selectShopUniqueKey, selectOperateParams, selectFlowStatus, selectCurrentTradeIdWOrkOrderNumber, selectFlowTemplateId, selectLoading, selectOrderBackLoading, selectOrderBackKmLoading, selectWithDrawOrder, selectNodeAssistantMap, selectFlowTemplateType, selectFollow, selectAutoSubmitFlag, selectShowShareButton, selectH5SharePermission } from "./store/selector";
30
+ import { selectFlowRecordList, selectRemarkRecordList, selectCurrentNodeDetail, selectTid, selectShopUniqueKey, selectOperateParams, selectFlowStatus, selectCurrentTradeIdWOrkOrderNumber, selectFlowTemplateId, selectLoading, selectOrderBackLoading, selectOrderBackKmLoading, selectWithDrawOrder, selectNodeAssistantMap, selectFlowTemplateType, selectFollow, selectAutoSubmitFlag, selectShowShareButton, selectH5SharePermission, selectNodeUserGroupMap } from "./store/selector";
31
31
  import { NodeType, FlowStatus, FlowType } from "../model/flowTemplateDetail/types";
32
32
  import NodeItem from "./components/Item";
33
33
  import CurrentNode from "./components/CurrentNode";
@@ -61,7 +61,7 @@ import { PlatForm } from "../WorkOrder/types";
61
61
  var Text = Typography.Text,
62
62
  Link = Typography.Link;
63
63
  var FlowTemplateDetail = function FlowTemplateDetail(props) {
64
- var _currentNodeDetail$wo, _currentNodeDetail$no, _currentNodeDetail$wo2, _currentNodeDetail$no14, _shopList$find, _JSON$parse, _currentNodeDetail$wo30, _currentNodeDetail$wo31, _currentNodeDetail$wo32, _currentNodeDetail$wo33, _currentNodeDetail$no25, _currentNodeDetail$no26, _currentNodeDetail$no27, _currentNodeDetail$no28;
64
+ var _currentNodeDetail$wo, _currentNodeDetail$no, _currentNodeDetail$wo2, _currentNodeDetail$no14, _shopList$find, _JSON$parse, _currentNodeDetail$wo30, _currentNodeDetail$wo31, _currentNodeDetail$wo32, _currentNodeDetail$wo33, _currentNodeDetail$no27, _currentNodeDetail$no28, _currentNodeDetail$no29, _currentNodeDetail$no30;
65
65
  var flowTemplateKey = props.flowTemplateKey,
66
66
  _props$shopList = props.shopList,
67
67
  shopList = _props$shopList === void 0 ? [] : _props$shopList,
@@ -101,6 +101,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
101
101
  var autoSubmitFlag = useSelector(selectAutoSubmitFlag);
102
102
  var withdrawWorkOrderDetail = useSelector(selectWithDrawOrder);
103
103
  var assistantMap = useSelector(selectNodeAssistantMap);
104
+ var useGroupMap = useSelector(selectNodeUserGroupMap);
104
105
  var flowTemplateType = useSelector(selectFlowTemplateType);
105
106
  var follow = useSelector(selectFollow);
106
107
  var showShareButton = useSelector(selectShowShareButton);
@@ -1161,19 +1162,21 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1161
1162
  }
1162
1163
  }, [currentNodeDetail, autoSubmitFlag]);
1163
1164
  var isCurrentNodeHandler = useMemo(function () {
1164
- var _currentNodeDetail$no15, _currentNodeDetail$no16, _currentNodeDetail$no17, _currentNodeDetail$no18, _currentNodeDetail$no19, _currentNodeDetail$no20, _currentNodeDetail$wo27, _currentNodeDetail$no21, _currentNodeDetail$no22;
1165
+ var _currentNodeDetail$no15, _currentNodeDetail$no16, _currentNodeDetail$no17, _currentNodeDetail$no18, _currentNodeDetail$no19, _currentNodeDetail$no20, _currentNodeDetail$no21, _currentNodeDetail$no22, _currentNodeDetail$wo27, _currentNodeDetail$no23, _currentNodeDetail$no24;
1165
1166
  return currentUserHasOperatorAuth({
1167
+ isSuperAdmin: isSuperAdmin,
1166
1168
  assistantList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no15 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no15 === void 0 ? void 0 : _currentNodeDetail$no15.id) && assistantMap[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no16 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no16 === void 0 ? void 0 : _currentNodeDetail$no16.id] || [],
1169
+ userGroupList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no17 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no17 === void 0 ? void 0 : _currentNodeDetail$no17.id) && useGroupMap[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no18 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no18 === void 0 ? void 0 : _currentNodeDetail$no18.id] || [],
1167
1170
  currentUserKey: plat.userKey,
1168
- staffIds: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no17 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no17 === void 0 ? void 0 : (_currentNodeDetail$no18 = _currentNodeDetail$no17.assistants) === null || _currentNodeDetail$no18 === void 0 ? void 0 : _currentNodeDetail$no18.staffIds) || [],
1169
- operateDataPermission: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no19 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no19 === void 0 ? void 0 : (_currentNodeDetail$no20 = _currentNodeDetail$no19.assistants) === null || _currentNodeDetail$no20 === void 0 ? void 0 : _currentNodeDetail$no20.operateDataPermission,
1171
+ staffIds: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no19 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no19 === void 0 ? void 0 : (_currentNodeDetail$no20 = _currentNodeDetail$no19.assistants) === null || _currentNodeDetail$no20 === void 0 ? void 0 : _currentNodeDetail$no20.staffIds) || [],
1172
+ operateDataPermission: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : (_currentNodeDetail$no22 = _currentNodeDetail$no21.assistants) === null || _currentNodeDetail$no22 === void 0 ? void 0 : _currentNodeDetail$no22.operateDataPermission,
1170
1173
  handlerList: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo27 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo27 === void 0 ? void 0 : _currentNodeDetail$wo27.handlerList) || [],
1171
- isAllStaff: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : (_currentNodeDetail$no22 = _currentNodeDetail$no21.assistants) === null || _currentNodeDetail$no22 === void 0 ? void 0 : _currentNodeDetail$no22.isAllStaff
1174
+ isAllStaff: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no23 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no23 === void 0 ? void 0 : (_currentNodeDetail$no24 = _currentNodeDetail$no23.assistants) === null || _currentNodeDetail$no24 === void 0 ? void 0 : _currentNodeDetail$no24.isAllStaff
1172
1175
  });
1173
- }, [currentNodeDetail, plat, assistantMap]);
1176
+ }, [currentNodeDetail, plat, assistantMap, useGroupMap]);
1174
1177
  var defaultShopId = (_shopList$find = shopList.find(function (item) {
1175
- var _currentNodeDetail$no23, _currentNodeDetail$no24;
1176
- return item.accessToken === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no23 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no23 === void 0 ? void 0 : (_currentNodeDetail$no24 = _currentNodeDetail$no23.relationEvent) === null || _currentNodeDetail$no24 === void 0 ? void 0 : _currentNodeDetail$no24.defaultShopUniqueKey);
1178
+ var _currentNodeDetail$no25, _currentNodeDetail$no26;
1179
+ return item.accessToken === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no25 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no25 === void 0 ? void 0 : (_currentNodeDetail$no26 = _currentNodeDetail$no25.relationEvent) === null || _currentNodeDetail$no26 === void 0 ? void 0 : _currentNodeDetail$no26.defaultShopUniqueKey);
1177
1180
  })) === null || _shopList$find === void 0 ? void 0 : _shopList$find.shopId;
1178
1181
  var ReportOrderRender = function ReportOrderRender(props) {
1179
1182
  var _currentNodeDetail$wo28, _currentNodeDetail$wo29;
@@ -1350,7 +1353,8 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1350
1353
  openCloseCallback: function openCloseCallback() {
1351
1354
  setOpenCloseVisible('');
1352
1355
  },
1353
- eventNodeType: flowRecord.eventNodeType
1356
+ eventNodeType: flowRecord.eventNodeType,
1357
+ isSuperAdmin: isSuperAdmin
1354
1358
  }));
1355
1359
  }), currentNodeDetail && /*#__PURE__*/React.createElement(Timeline.Item, null, /*#__PURE__*/React.createElement(CurrentNode, {
1356
1360
  ref: currentNodeRef,
@@ -1365,14 +1369,15 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1365
1369
  onJumpPage: onJumpPage,
1366
1370
  onReminder: handleReminder,
1367
1371
  queryRemarkList: queryRemarkList,
1368
- autoSubmit: autoSubmit
1372
+ autoSubmit: autoSubmit,
1373
+ isSuperAdmin: isSuperAdmin
1369
1374
  }))), (remarkList === null || remarkList === void 0 ? void 0 : remarkList.length) > 0 && !['created', 'edit'].includes(privilege) && /*#__PURE__*/React.createElement(RemarkShow, _extends({}, remarkList[0], {
1370
1375
  readonly: readonly,
1371
1376
  handleOpenRemarkList: handleOpenRemarkList,
1372
1377
  handleOpenAddRemark: handleOpenAddRemark
1373
1378
  }))), getTag({
1374
- nodeIsAuto: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no25 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no25 === void 0 ? void 0 : _currentNodeDetail$no25.isAuto,
1375
- nodeType: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no26 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no26 === void 0 ? void 0 : _currentNodeDetail$no26.nodeType
1379
+ nodeIsAuto: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no27 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no27 === void 0 ? void 0 : _currentNodeDetail$no27.isAuto,
1380
+ nodeType: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no28 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no28 === void 0 ? void 0 : _currentNodeDetail$no28.nodeType
1376
1381
  }) === 'artificial' && (!(currentNodeDetail !== null && currentNodeDetail !== void 0 && currentNodeDetail.workOrder) || isCurrentNodeHandler || ['true', 'created'].includes(privilege)) && !readonly && /*#__PURE__*/React.createElement("div", {
1377
1382
  className: "footer"
1378
1383
  }, /*#__PURE__*/React.createElement(ActionList, {
@@ -1401,7 +1406,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1401
1406
  shopList: shopList
1402
1407
  }), /*#__PURE__*/React.createElement(ForWardModal, {
1403
1408
  flowTemplateId: flowTemplateId,
1404
- nodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no27 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no27 === void 0 ? void 0 : _currentNodeDetail$no27.id,
1409
+ nodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no29 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no29 === void 0 ? void 0 : _currentNodeDetail$no29.id,
1405
1410
  handleForWard: handleForWard
1406
1411
  }), /*#__PURE__*/React.createElement(StopModal, {
1407
1412
  handleStop: handleStop
@@ -1409,7 +1414,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1409
1414
  handleClose: handleClose
1410
1415
  }), /*#__PURE__*/React.createElement(RejectedModal, {
1411
1416
  flowTemplateId: flowTemplateId,
1412
- nodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no28 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no28 === void 0 ? void 0 : _currentNodeDetail$no28.id,
1417
+ nodeId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no30 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no30 === void 0 ? void 0 : _currentNodeDetail$no30.id,
1413
1418
  handleReturnWorkOrder: handleReturnWorkOrder
1414
1419
  }), /*#__PURE__*/React.createElement(RemarkModal, {
1415
1420
  handleSubmitRemark: handleSubmitRemark
@@ -12,6 +12,9 @@ export declare const fetchH5SharePermission: () => (dispatch: any) => Promise<vo
12
12
  export declare const setNodeAssistantInfo: (state: FlowTemplateDetailState, { payload }: PayloadAction<{
13
13
  [nodeId: string]: Assistant[];
14
14
  }>) => void;
15
+ export declare const setGroupUserList: (state: FlowTemplateDetailState, { payload }: PayloadAction<{
16
+ [nodeId: string]: string[];
17
+ }>) => void;
15
18
  export declare const setLoading: (state: FlowTemplateDetailState, { payload }: PayloadAction<boolean>) => void;
16
19
  export declare const setOrderBackLoading: (state: FlowTemplateDetailState, { payload }: PayloadAction<boolean>) => void;
17
20
  export declare const setOrderBackKmLoading: (state: FlowTemplateDetailState, { payload }: PayloadAction<boolean>) => void;
@@ -57,6 +60,9 @@ declare const reducers: (state: FlowTemplateDetailState | undefined, action: {
57
60
  assistantMap: {
58
61
  [nodeId: string]: Assistant[];
59
62
  };
63
+ userGroupMap: {
64
+ [nodeId: string]: string[];
65
+ };
60
66
  remarkList: Remark[];
61
67
  currentNode: CurrentNodeDetail;
62
68
  action: ActionType;