@kmkf-fe-packages/kmkf-work-order-service-component 2.2.31-beta.81 → 2.2.31-beta.85

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.
@@ -310,7 +310,8 @@ var CurrentNode = function CurrentNode(props, ref) {
310
310
  handleRestartAutoTask: handleRestartAutoTask,
311
311
  flowTemplateKey: (operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey) || '',
312
312
  flowWorkOrderId: flowWorkOrderId || '',
313
- nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : _currentNodeDetail$no21.id) || ''
313
+ nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no21 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no21 === void 0 ? void 0 : _currentNodeDetail$no21.id) || '',
314
+ flowTemplateId: flowTemplateId
314
315
  }), /*#__PURE__*/React.createElement("div", {
315
316
  className: styles.formRenderContainer
316
317
  }, [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, {
@@ -23,6 +23,7 @@ interface HeaderProps {
23
23
  flowTemplateKey: string;
24
24
  nodeId: string;
25
25
  flowWorkOrderId: string;
26
+ flowTemplateId: string;
26
27
  }
27
28
  declare const Header: (props: HeaderProps) => React.JSX.Element;
28
29
  export default Header;
@@ -7,10 +7,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useState } from 'react';
8
8
  import { Button, Spin, Tooltip, Typography, Space, Modal, Table } from 'antd';
9
9
  import moment from 'moment';
10
- import { useRequest } from 'ahooks';
10
+ import { useRequest, useToggle } from 'ahooks';
11
11
  import { useSelector } from "../../context/useSelector";
12
12
  import { selectPrivilege } from "../../store/selector";
13
- import { queryFlowFail } from "../../../model/flowTemplateDetail/api";
13
+ import { queryFlowFail, queryNodeDetail } from "../../../model/flowTemplateDetail/api";
14
+ import { useDoubleClick } from "../../../hooks/useDoubleClick/index";
14
15
  import { NODE_TYPE } from "../../../common/constant";
15
16
  import styles from "./index.module.less";
16
17
  var Text = Typography.Text;
@@ -31,7 +32,7 @@ var columns = [{
31
32
  width: '550px'
32
33
  }];
33
34
  var Header = function Header(props) {
34
- var _NODE_TYPE$tag, _NODE_TYPE$tag2, _data$data;
35
+ var _NODE_TYPE$tag, _NODE_TYPE$tag2, _data$data, _nodeDetail$data, _nodeDetail$data$flow;
35
36
  var tag = props.tag,
36
37
  nodeName = props.nodeName,
37
38
  showLook = props.showLook,
@@ -61,12 +62,31 @@ var Header = function Header(props) {
61
62
  handleRestartAutoTask = props.handleRestartAutoTask,
62
63
  flowTemplateKey = props.flowTemplateKey,
63
64
  nodeId = props.nodeId,
64
- flowWorkOrderId = props.flowWorkOrderId;
65
+ flowWorkOrderId = props.flowWorkOrderId,
66
+ flowTemplateId = props.flowTemplateId;
65
67
  var _useState = useState(false),
66
68
  _useState2 = _slicedToArray(_useState, 2),
67
69
  visible = _useState2[0],
68
70
  setVisible = _useState2[1];
71
+ var _useToggle = useToggle(false),
72
+ _useToggle2 = _slicedToArray(_useToggle, 2),
73
+ nodeInfoVisible = _useToggle2[0],
74
+ toggleNodeInfoVisible = _useToggle2[1].toggle;
69
75
  var privilege = useSelector(selectPrivilege);
76
+ var handleDoubleClick = useDoubleClick({
77
+ interval: 300,
78
+ // 可选,默认 300ms
79
+ onDoubleClick: function onDoubleClick(event) {
80
+ if (tag === 'judge') return;
81
+ toggleNodeInfoVisible();
82
+ if (tag === 'auto') {
83
+ requestNodeDetail();
84
+ }
85
+ },
86
+ onClick: function onClick(event) {
87
+ console.log('单击事件', event);
88
+ }
89
+ });
70
90
  var _useRequest = useRequest(function () {
71
91
  return queryFlowFail({
72
92
  flowTemplateKeys: [flowTemplateKey],
@@ -79,6 +99,18 @@ var Header = function Header(props) {
79
99
  requestLoading = _useRequest.loading,
80
100
  run = _useRequest.run,
81
101
  data = _useRequest.data;
102
+ var _useRequest2 = useRequest(function () {
103
+ return queryNodeDetail({
104
+ nodeId: nodeId,
105
+ flowTemplateId: flowTemplateId,
106
+ flowWorkOrderId: flowWorkOrderId
107
+ });
108
+ }, {
109
+ manual: true
110
+ }),
111
+ queryNodeDetailLoading = _useRequest2.loading,
112
+ requestNodeDetail = _useRequest2.run,
113
+ nodeDetail = _useRequest2.data;
82
114
  var handleLookAbnormal = function handleLookAbnormal() {
83
115
  run();
84
116
  setVisible(true);
@@ -96,7 +128,9 @@ var Header = function Header(props) {
96
128
  }, "".concat(nodeName, " ").concat(handler ? "(".concat(handleLabel, ": ").concat(handler, ")") : ''))
97
129
  }, /*#__PURE__*/React.createElement("span", {
98
130
  className: styles.nodeName
99
- }, /*#__PURE__*/React.createElement("span", null, nodeName), handler && /*#__PURE__*/React.createElement("span", {
131
+ }, /*#__PURE__*/React.createElement("span", {
132
+ onClick: handleDoubleClick
133
+ }, nodeName), handler && /*#__PURE__*/React.createElement("span", {
100
134
  className: styles.handler
101
135
  }, "(".concat(handleLabel, ": ").concat(handler, ")")))), /*#__PURE__*/React.createElement("div", {
102
136
  className: styles.loadingWrap
@@ -170,6 +204,14 @@ var Header = function Header(props) {
170
204
  x: 850,
171
205
  y: 300
172
206
  }
173
- }))));
207
+ })), /*#__PURE__*/React.createElement(Modal, {
208
+ title: "\u8282\u70B9\u4FE1\u606F",
209
+ onOk: toggleNodeInfoVisible,
210
+ onCancel: toggleNodeInfoVisible,
211
+ visible: nodeInfoVisible,
212
+ footer: null
213
+ }, /*#__PURE__*/React.createElement(Spin, {
214
+ spinning: queryNodeDetailLoading
215
+ }, /*#__PURE__*/React.createElement("p", null, "\u6D41\u7A0B\u5DE5\u5355ID: ", flowWorkOrderId), tag === 'artificial' && /*#__PURE__*/React.createElement("p", null, "\u6D41\u7A0B\u6A21\u677FID: ", flowTemplateId), /*#__PURE__*/React.createElement("p", null, "\u6D41\u7A0B\u6A21\u677FKey: ", flowTemplateKey), /*#__PURE__*/React.createElement("p", null, "\u8282\u70B9ID: ", nodeId), tag === 'auto' && /*#__PURE__*/React.createElement("p", null, "\u81EA\u52A8\u5316\u4EFB\u52A1ID: ", nodeDetail === null || nodeDetail === void 0 ? void 0 : (_nodeDetail$data = nodeDetail.data) === null || _nodeDetail$data === void 0 ? void 0 : (_nodeDetail$data$flow = _nodeDetail$data.flowEventData) === null || _nodeDetail$data$flow === void 0 ? void 0 : _nodeDetail$data$flow.uniqueKey)))));
174
216
  };
175
217
  export default Header;
@@ -314,7 +314,8 @@ var NodeItem = function NodeItem(props) {
314
314
  handleLabel: '完成人',
315
315
  flowTemplateKey: flowTemplateKey,
316
316
  nodeId: nodeId,
317
- flowWorkOrderId: flowWorkOrderId
317
+ flowWorkOrderId: flowWorkOrderId,
318
+ flowTemplateId: flowTemplateId
318
319
  }), /*#__PURE__*/React.createElement("div", {
319
320
  style: {
320
321
  display: open ? 'block' : 'none',
@@ -6,6 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React from 'react';
8
8
  import { Table, message, Image } from 'antd';
9
+ import { ApaasImage } from '@kmkf-fe-packages/basic-components';
9
10
  import moment from 'moment';
10
11
  import styles from "./index.module.less";
11
12
  import { queryInstallationRepairDetail } from "./services";
@@ -22,12 +23,15 @@ export var renderImages = function renderImages(value) {
22
23
  flexWrap: 'wrap'
23
24
  }
24
25
  }, list.map(function (url, index) {
25
- return /*#__PURE__*/React.createElement(Image, {
26
+ return /*#__PURE__*/React.createElement("div", {
26
27
  key: "".concat(url, "-").concat(index),
28
+ style: {
29
+ marginRight: 4
30
+ }
31
+ }, /*#__PURE__*/React.createElement(ApaasImage, {
27
32
  src: url,
28
- width: 24,
29
- height: 24
30
- });
33
+ width: 24
34
+ }));
31
35
  })));
32
36
  };
33
37
  export var renderTable = function renderTable(value, record, item, effects, key) {
@@ -361,7 +361,15 @@ var serviceProgressDetailConfig = {
361
361
  title: '图片证明',
362
362
  dataIndex: 'image',
363
363
  render: renderImages
364
- }]
364
+ }],
365
+ 22: [[{
366
+ title: '师傅姓名',
367
+ dataIndex: 'workerName'
368
+ }, {
369
+ title: '关单时间',
370
+ dataIndex: 'time',
371
+ render: renderTime
372
+ }]]
365
373
  };
366
374
  var getServiceProgressList = function getServiceProgressList(serviceProgress, singleColumn) {
367
375
  var _serviceProgressDetai;
@@ -352,6 +352,12 @@ declare type ServiceProgressDataType = {
352
352
  workerRemark: string;
353
353
  processRemark: string;
354
354
  };
355
+ } | {
356
+ serviceProgress: 22;
357
+ data: {
358
+ time: string;
359
+ workerName: string;
360
+ };
355
361
  };
356
362
  export declare type ServiceProgressListType = ({
357
363
  operateTime: string;
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export interface UseDoubleClickOptions {
3
+ /**
4
+ * 双击的时间间隔(毫秒),默认 300ms
5
+ */
6
+ interval?: number;
7
+ /**
8
+ * 双击时的回调函数
9
+ */
10
+ onDoubleClick?: (event: MouseEvent | React.MouseEvent) => void;
11
+ /**
12
+ * 单击时的回调函数(可选)
13
+ */
14
+ onClick?: (event: MouseEvent | React.MouseEvent) => void;
15
+ }
16
+ /**
17
+ * 双击事件 Hook
18
+ * @param options 配置选项
19
+ * @returns 返回点击事件处理函数
20
+ */
21
+ export declare const useDoubleClick: (options?: UseDoubleClickOptions) => (event: MouseEvent | React.MouseEvent) => void;
@@ -0,0 +1,55 @@
1
+ import { useRef } from 'react';
2
+ import { useMemoizedFn, useLatest } from 'ahooks';
3
+ /**
4
+ * 双击事件 Hook
5
+ * @param options 配置选项
6
+ * @returns 返回点击事件处理函数
7
+ */
8
+ export var useDoubleClick = function useDoubleClick() {
9
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10
+ var _options$interval = options.interval,
11
+ interval = _options$interval === void 0 ? 300 : _options$interval,
12
+ onDoubleClick = options.onDoubleClick,
13
+ onClick = options.onClick;
14
+
15
+ // 使用 useLatest 确保回调函数始终是最新的
16
+ var onDoubleClickRef = useLatest(onDoubleClick);
17
+ var onClickRef = useLatest(onClick);
18
+
19
+ // 记录上次点击时间
20
+ var lastClickTimeRef = useRef(0);
21
+ // 记录单击定时器
22
+ var singleClickTimerRef = useRef(null);
23
+
24
+ // 使用 useMemoizedFn 记忆化处理函数,避免不必要的重新渲染
25
+ var handleClick = useMemoizedFn(function (event) {
26
+ var currentTime = Date.now();
27
+ var timeSinceLastClick = currentTime - lastClickTimeRef.current;
28
+
29
+ // 清除之前的单击定时器
30
+ if (singleClickTimerRef.current) {
31
+ clearTimeout(singleClickTimerRef.current);
32
+ singleClickTimerRef.current = null;
33
+ }
34
+
35
+ // 如果在时间间隔内,认为是双击
36
+ if (timeSinceLastClick < interval && timeSinceLastClick > 0) {
37
+ var _onDoubleClickRef$cur;
38
+ // 执行双击回调
39
+ (_onDoubleClickRef$cur = onDoubleClickRef.current) === null || _onDoubleClickRef$cur === void 0 ? void 0 : _onDoubleClickRef$cur.call(onDoubleClickRef, event);
40
+ // 重置时间,避免连续三次点击触发两次双击
41
+ lastClickTimeRef.current = 0;
42
+ } else {
43
+ // 否则,设置定时器等待可能的第二次点击
44
+ lastClickTimeRef.current = currentTime;
45
+ singleClickTimerRef.current = setTimeout(function () {
46
+ var _onClickRef$current;
47
+ // 如果超时后没有第二次点击,执行单击回调
48
+ (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event);
49
+ singleClickTimerRef.current = null;
50
+ lastClickTimeRef.current = 0;
51
+ }, interval);
52
+ }
53
+ });
54
+ return handleClick;
55
+ };
@@ -822,6 +822,7 @@ export interface QyFlowPanelInfoResponse {
822
822
  }>;
823
823
  };
824
824
  };
825
+ uniqueKey: string;
825
826
  };
826
827
  };
827
828
  /**
@@ -1585,6 +1586,7 @@ export interface QueryNodeDetailResponse {
1585
1586
  [k: string]: any;
1586
1587
  };
1587
1588
  flowEventData?: {
1589
+ uniqueKey: string;
1588
1590
  eventData?: {
1589
1591
  businessStatus?: Array<{
1590
1592
  businessKey: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-work-order-service-component",
3
- "version": "2.2.31-beta.81",
3
+ "version": "2.2.31-beta.85",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -75,7 +75,7 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "0695c52c896f5fe7760679381f75a2d850aed2d8",
78
+ "gitHead": "3f8ae78a735591aed976bb9df9f10ca0338fd05f",
79
79
  "gitHooks": {
80
80
  "pre-commit": "lint-staged"
81
81
  }