@cloudbase/weda-ui 3.4.11-alpha.1 → 3.4.12

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.
Files changed (174) hide show
  1. package/dist/configs/components/common/form-input-required.js +3 -3
  2. package/dist/configs/components/dataView.js +20 -10
  3. package/dist/configs/components/form-checkbox.js +15 -2
  4. package/dist/configs/components/form-email.js +17 -2
  5. package/dist/configs/components/form-input.js +17 -2
  6. package/dist/configs/components/form-phone.js +17 -2
  7. package/dist/configs/components/form-radio.js +15 -2
  8. package/dist/configs/components/form-select-multiple.js +362 -0
  9. package/dist/configs/components/form-switch.js +15 -2
  10. package/dist/configs/components/form-text-area.js +15 -2
  11. package/dist/configs/components/form-url.js +17 -2
  12. package/dist/configs/components/listView.js +32 -49
  13. package/dist/configs/components/table.json +1 -54
  14. package/dist/configs/components/wd-bubble.js +46 -8
  15. package/dist/configs/components/wd-checkbox.js +464 -0
  16. package/dist/configs/components/wd-form.js +66 -10
  17. package/dist/configs/components/wd-input-email.js +37 -0
  18. package/dist/configs/components/wd-input-phone.js +43 -0
  19. package/dist/configs/components/wd-input-url.js +37 -0
  20. package/dist/configs/components/wd-input.js +94 -0
  21. package/dist/configs/components/wd-official-account.js +87 -0
  22. package/dist/configs/components/wd-radio.js +443 -0
  23. package/dist/configs/components/wd-switch.js +315 -0
  24. package/dist/configs/components/wd-table.js +1 -54
  25. package/dist/configs/components/wd-textarea.js +82 -0
  26. package/dist/configs/components/wd-tree.js +443 -0
  27. package/dist/configs/index.js +24 -1
  28. package/dist/configs/type-utils/type-form.js +681 -0
  29. package/dist/docs/common/components/methods-view.js +1 -1
  30. package/dist/docs/common/components/properties-view.js +3 -1
  31. package/dist/docs/common/format.js +7 -7
  32. package/dist/docs/common/tableView.js +3 -1
  33. package/dist/enum/index.js +196 -0
  34. package/dist/style/index.scss +1 -1
  35. package/dist/web/components/calendar/index.js +1 -1
  36. package/dist/web/components/customer-service/customer-service.js +19 -2
  37. package/dist/web/components/dataView/index.js +16 -3
  38. package/dist/web/components/flow/common/hooks/useCommonFlowData/flow-get.js +5 -1
  39. package/dist/web/components/flow/common/request.js +5 -5
  40. package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +8 -16
  41. package/dist/web/components/form/enumSelect/MultipleSelect.js +1 -0
  42. package/dist/web/components/form/enumSelect/SelectContainer.js +1 -0
  43. package/dist/web/components/form/formcell/index.css +13 -1
  44. package/dist/web/components/form/formcell/index.js +1 -1
  45. package/dist/web/components/form/location/components/LocationH5/location.h5.js +1 -1
  46. package/dist/web/components/form/location/components/LocationPC/Header.js +1 -0
  47. package/dist/web/components/form/location/index.js +1 -0
  48. package/dist/web/components/form/select/h5.js +8 -7
  49. package/dist/web/components/form/select/index.js +9 -9
  50. package/dist/web/components/form/select/region/index.js +1 -1
  51. package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +111 -0
  52. package/dist/web/components/form/selectMultiple/dropdown-select/index.css +270 -0
  53. package/dist/web/components/form/selectMultiple/dropdown-select/index.js +206 -0
  54. package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +115 -0
  55. package/dist/web/components/form/selectMultiple/dropdown-select/ui.js +113 -0
  56. package/dist/web/components/form/selectMultiple/h5.js +40 -0
  57. package/dist/web/components/form/selectMultiple/index.js +94 -0
  58. package/dist/web/components/form/selectMultiple/request.js +76 -0
  59. package/dist/web/components/form/selectMultiple/status/allEmpty.js +5 -0
  60. package/dist/web/components/form/selectMultiple/status/empty.js +19 -0
  61. package/dist/web/components/form/selectMultiple/status/index.css +63 -0
  62. package/dist/web/components/form/selectMultiple/status/index.js +7 -0
  63. package/dist/web/components/form/selectMultiple/status/loading.js +19 -0
  64. package/dist/web/components/form/selectMultiple/status/propsType.js +1 -0
  65. package/dist/web/components/form/selectMultiple/status/retry.js +19 -0
  66. package/dist/web/components/form/tips/index.css +9 -3
  67. package/dist/web/components/form/uploader/index.css +10 -0
  68. package/dist/web/components/form/uploader/uploader.h5.js +6 -6
  69. package/dist/web/components/form/uploader/uploader.pc.js +1 -1
  70. package/dist/web/components/form/uploaderFile/index.js +2 -0
  71. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +0 -19
  72. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +3 -24
  73. package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +7 -4
  74. package/dist/web/components/form/userOrgSelect/common/utils.js +1 -0
  75. package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +15 -5
  76. package/dist/web/components/form-input-hooks/index.js +39 -14
  77. package/dist/web/components/form-select-multiple/index.js +26 -0
  78. package/dist/web/components/formdetail/index.css +31 -1
  79. package/dist/web/components/formdetail/index.js +30 -0
  80. package/dist/web/components/index.js +17 -1
  81. package/dist/web/components/listView/index.js +20 -5
  82. package/dist/web/components/phone/index.js +26 -1
  83. package/dist/web/components/phoneCode/index.js +3 -1
  84. package/dist/web/components/repeater/index.js +1 -0
  85. package/dist/web/components/repeater-item/index.js +1 -0
  86. package/dist/web/components/richText/index.css +70 -67
  87. package/dist/web/components/richText/index.js +311 -251
  88. package/dist/web/components/richText/richtext.module.css +1 -0
  89. package/dist/web/components/richTextView/index.css +39 -0
  90. package/dist/web/components/richTextView/index.js +1 -1
  91. package/dist/web/components/share/index.js +26 -1
  92. package/dist/web/components/statusContent/index.js +1 -0
  93. package/dist/web/components/wd-checkbox/checkbox.js +34 -0
  94. package/dist/web/components/wd-checkbox/index.js +3 -0
  95. package/dist/web/components/wd-checkbox-list/checkboxList.js +140 -0
  96. package/dist/web/components/wd-checkbox-list/index.js +3 -0
  97. package/dist/web/components/wd-form/index.js +25 -12
  98. package/dist/web/components/wd-form/wd-form.js +42 -0
  99. package/dist/web/components/wd-form-cell/index.js +3 -0
  100. package/dist/web/components/wd-form-cell/wd-form-cell.js +42 -0
  101. package/dist/web/components/wd-form-item/index.js +4 -0
  102. package/dist/web/components/wd-form-item/wd-form-item.js +55 -0
  103. package/dist/web/components/wd-form-item/wd-input-group.js +24 -0
  104. package/dist/web/components/wd-input/index.js +3 -0
  105. package/dist/web/components/wd-input/wd-input.js +155 -0
  106. package/dist/web/components/wd-input-email/index.js +3 -0
  107. package/dist/web/components/wd-input-email/wd-input-email.js +13 -0
  108. package/dist/web/components/wd-input-group/index.js +3 -0
  109. package/dist/web/components/wd-input-group/wd-input-group.js +10 -0
  110. package/dist/web/components/wd-input-phone/index.js +3 -0
  111. package/dist/web/components/wd-input-phone/wd-input-phone.js +14 -0
  112. package/dist/web/components/wd-input-url/index.js +3 -0
  113. package/dist/web/components/wd-input-url/wd-input-url.js +13 -0
  114. package/dist/web/components/wd-input-wrap/index.js +3 -0
  115. package/dist/web/components/wd-input-wrap/wd-input-wrap.js +18 -0
  116. package/dist/web/components/wd-official-account/index.css +29 -0
  117. package/dist/web/components/wd-official-account/index.js +36 -0
  118. package/dist/web/components/wd-radio/index.js +3 -0
  119. package/dist/web/components/wd-radio/wd-radio.js +30 -0
  120. package/dist/web/components/wd-radio-list/index.js +3 -0
  121. package/dist/web/components/wd-radio-list/wd-radio-list.js +104 -0
  122. package/dist/web/components/wd-switch/index.js +3 -0
  123. package/dist/web/components/wd-switch/wd-switch.js +52 -0
  124. package/dist/web/components/wd-table/components/Table/index.js +12 -2
  125. package/dist/web/components/wd-table/hooks/useQueryParams.js +4 -1
  126. package/dist/web/components/wd-table/utils/index.js +6 -2
  127. package/dist/web/components/wd-table/wd-table.js +70 -57
  128. package/dist/web/components/wd-textarea/index.js +3 -0
  129. package/dist/web/components/wd-textarea/wd-textarea.js +78 -0
  130. package/dist/web/components/wd-tree/index.js +3 -0
  131. package/dist/web/components/wd-tree/utils.js +291 -0
  132. package/dist/web/components/wd-tree/wd-tree.js +193 -0
  133. package/dist/web/utils/constant.js +16 -0
  134. package/dist/web/utils/datasource.js +2 -2
  135. package/dist/web/utils/hooks/useFormLegacy.js +111 -0
  136. package/dist/web/utils/tool.js +12 -2
  137. package/dist/web/weda-ui.css +193 -3
  138. package/package.json +6 -5
  139. package/dist/web/components/emptyContent/index.js +0 -46
  140. package/dist/web/components/flow/components/FlowModuleText/Content.js +0 -6
  141. package/dist/web/components/flow/components/FlowModuleText/Title.js +0 -16
  142. package/dist/web/components/flow/components/FlowModuleText/index.js +0 -7
  143. package/dist/web/components/flow/components/FlowModuleText/utils.js +0 -34
  144. package/dist/web/components/flow/components/FlowStatusText/index.js +0 -37
  145. package/dist/web/components/flow/components/HighLightComment/index.js +0 -31
  146. package/dist/web/components/flow/components/index.js +0 -3
  147. package/dist/web/components/flow/constants/index.js +0 -65
  148. package/dist/web/components/flow/frame/getCommonFlowData.js +0 -80
  149. package/dist/web/components/flow/frame/hooks/index.js +0 -2
  150. package/dist/web/components/flow/frame/hooks/useCommonFlowRequest.js +0 -148
  151. package/dist/web/components/flow/frame/hooks/useElementMediaQuery.js +0 -15
  152. package/dist/web/components/flow/frame/index.js +0 -76
  153. package/dist/web/components/flow/frame/types.js +0 -277
  154. package/dist/web/components/flow/frame/utils.js +0 -149
  155. package/dist/web/components/flow/modules/chart/Chart.js +0 -282
  156. package/dist/web/components/flow/modules/chart/constants.js +0 -28
  157. package/dist/web/components/flow/modules/chart/index.css +0 -84
  158. package/dist/web/components/flow/modules/chart/isString.js +0 -5
  159. package/dist/web/components/flow/modules/chart/utils.js +0 -111
  160. package/dist/web/components/flow/modules/process/Process.js +0 -73
  161. package/dist/web/components/flow/modules/process/ProcessMobile.js +0 -81
  162. package/dist/web/components/flow/modules/process/index.js +0 -14
  163. package/dist/web/components/flow/modules/process/utils/index.js +0 -32
  164. package/dist/web/components/flow/services/flow.js +0 -111
  165. package/dist/web/components/flow/services/ideData/chart.js +0 -88
  166. package/dist/web/components/flow/services/ideData/index.js +0 -5
  167. package/dist/web/components/flow/services/ideData/instance.js +0 -23
  168. package/dist/web/components/flow/services/ideData/pageDetail.js +0 -42
  169. package/dist/web/components/flow/services/ideData/process.js +0 -27
  170. package/dist/web/components/flow/services/index.js +0 -2
  171. package/dist/web/components/flow/services/user.js +0 -23
  172. package/dist/web/components/flow/services/utils.js +0 -28
  173. package/dist/web/components/form/userOrgSelect/component/OrgPaths.js +0 -12
  174. package/dist/web/components/form/userOrgSelect/component/depart-select/departTreeSelect.h5.js +0 -156
@@ -1,73 +0,0 @@
1
- import React from 'react';
2
- import moment from 'moment';
3
- import classNames from '../../../../utils/classnames';
4
- import { Text, Status, LoadingTip, Card } from 'tea-component';
5
- import { HighLightComment, FlowModuleText, getModuleTextProps, getModuleContentStyle, } from '../../components';
6
- import { STATUS } from '../../constants';
7
- import { getStatusStr, showTwoUserList } from './utils';
8
- const ApproveProcess = (props) => {
9
- const { commonFlowData, flowLocalProps, ide, loading } = props;
10
- const flowModelContentStyle = getModuleContentStyle(ide);
11
- const { steps } = commonFlowData;
12
- const { safeJsonParse } = flowLocalProps;
13
- const renderContent = () => {
14
- if (loading) {
15
- return React.createElement(LoadingTip, null);
16
- }
17
- if ((steps === null || steps === void 0 ? void 0 : steps.length) === 0) {
18
- return React.createElement(Status, { icon: "blank", size: "l", title: "\u6682\u65E0\u6D41\u8F6C\u8BB0\u5F55", ...props });
19
- }
20
- return (React.createElement("div", { className: classNames('page-process__progress', 'page-process__progress__app-page') },
21
- React.createElement("div", { className: "approval-progress" }, (steps || []).map((item, index) => {
22
- var _a, _b, _c, _d, _e, _f;
23
- const details = item.contentInfo;
24
- return (React.createElement("div", { className: "approval-progress__item", key: index },
25
- React.createElement("div", { className: `approval-progress__dot ${!item.status ? '' : item.status}` }),
26
- React.createElement("div", { className: "approval-progress__content" },
27
- React.createElement("div", { className: "approval-progress__row tea-mb-2n" },
28
- item.status === STATUS.DROP ? (React.createElement("div", { className: "approval-progress__dept", style: {
29
- color: 'rgb(231, 87, 87)',
30
- ...flowModelContentStyle,
31
- } }, item.result)) : (React.createElement("div", { className: "approval-progress__dept", style: flowModelContentStyle }, item.name)),
32
- ![STATUS.CC, STATUS.DROP].includes(item.status) && (React.createElement("div", { className: "approval-progress__user", style: flowModelContentStyle },
33
- item.status === STATUS.START ? '发起人' : '审批人',
34
- "\uFF1A",
35
- showTwoUserList(item.operaName, item.approvalStrategy))),
36
- ![STATUS.START, STATUS.END, STATUS.CC].includes(item.status) && getStatusStr(item.status)),
37
- React.createElement("div", { className: "approval-progress__row approval-progress__row--start tea-mb-2n" },
38
- details.createTime && (React.createElement(Text, { theme: "weak", className: "approval-progress__date" }, moment(details.createTime).format('YYYY-MM-DD HH:mm:ss'))),
39
- item.status === STATUS.CC && (React.createElement(Text, { theme: "weak", style: { maxWidth: 500 }, overflow: true, tooltip: true },
40
- "\u6284\u9001\uFF1A", (_b = (_a = details.ccUserInfos) === null || _a === void 0 ? void 0 : _a.map((i) => i.name)) === null || _b === void 0 ? void 0 :
41
- _b.join('、'))),
42
- details.ccUsers && (React.createElement(Text, { theme: "weak", style: { maxWidth: 500 }, overflow: true, tooltip: true },
43
- "\u6284\u9001\uFF1A", (_c = Object.values(details.ccUsers)) === null || _c === void 0 ? void 0 :
44
- _c.join('、'))),
45
- item.status === STATUS.TRANS && (React.createElement(Text, { theme: "weak" },
46
- "\u56DE\u9000\u5230\u6307\u5B9A\u8282\u70B9\uFF1A",
47
- (details === null || details === void 0 ? void 0 : details.operation)
48
- ? (_d = safeJsonParse(details === null || details === void 0 ? void 0 : details.operation)[1]) === null || _d === void 0 ? void 0 : _d.name
49
- : '')),
50
- !!details.operationComment && (React.createElement(Text, { theme: "weak", className: "approval-progress__comment" },
51
- "\u5BA1\u6279\u610F\u89C1\uFF1A",
52
- React.createElement(HighLightComment, { details: details })))),
53
- React.createElement("div", { className: "approval-progress__row", style: {
54
- flexDirection: 'column',
55
- alignItems: 'flex-start',
56
- } },
57
- item.status === 'countersign' && (React.createElement(Text, { theme: "weak", className: "approval-progress__advice-item" },
58
- React.createElement("i", { className: "apa-icon apa-icon-label tea-mr-2n" }),
59
- "\u52A0\u7B7E\uFF1A",
60
- (details === null || details === void 0 ? void 0 : details.operation)
61
- ? safeJsonParse(details.operation)
62
- .map((i) => i.name)
63
- .join(',')
64
- : '')),
65
- details.isCC && (React.createElement(Text, { theme: "weak", className: "approval-progress__advice-item" },
66
- React.createElement("i", { className: "apa-icon apa-icon-trans tea-mr-2n" }),
67
- "\u6284\u9001\uFF1A", (_f = (_e = details.ccUserInfos) === null || _e === void 0 ? void 0 : _e.map((i) => i.name)) === null || _f === void 0 ? void 0 :
68
- _f.join('、')))))));
69
- }))));
70
- };
71
- return (React.createElement(Card.Body, { className: "page-process__progress-card", title: React.createElement(FlowModuleText.Title, { ...getModuleTextProps(ide) }) }, renderContent()));
72
- };
73
- export default ApproveProcess;
@@ -1,81 +0,0 @@
1
- import React from 'react';
2
- import moment from 'moment';
3
- import { Text, Status, LoadingTip, Card } from 'tea-component';
4
- import { HighLightComment, FlowModuleText, getModuleTextProps, getModuleContentStyle, } from '../../components';
5
- import { STATUS } from '../../constants';
6
- import { getStatusStr, showTwoUserList } from './utils';
7
- const ApproveProcessMobile = (props) => {
8
- const { commonFlowData, flowLocalProps, ide, loading } = props;
9
- const flowModelContentStyle = getModuleContentStyle(ide);
10
- const { steps } = commonFlowData;
11
- const { safeJsonParse } = flowLocalProps;
12
- const renderContent = () => {
13
- if (loading) {
14
- return React.createElement(LoadingTip, null);
15
- }
16
- if ((steps === null || steps === void 0 ? void 0 : steps.length) === 0) {
17
- return React.createElement(Status, { icon: "blank", size: "l", title: "\u6682\u65E0\u6D41\u8F6C\u8BB0\u5F55", ...props });
18
- }
19
- if ((steps === null || steps === void 0 ? void 0 : steps.length) > 0) {
20
- return (React.createElement("div", { className: "page-process__progress process-progress--mb" },
21
- React.createElement("div", { className: "approval-progress approval-progress-mb" }, (steps || []).map((item, index) => {
22
- var _a, _b, _c, _d, _e, _f;
23
- const details = item.contentInfo;
24
- return (React.createElement("div", { className: "approval-progress__item", key: `${index}_${item === null || item === void 0 ? void 0 : item.name}` },
25
- React.createElement("div", { className: `approval-progress__dot ${!item.status ? '' : item.status}` }),
26
- React.createElement("div", { className: "approval-progress__content", style: { width: 'calc(100% - 26px)' } },
27
- React.createElement("div", { className: "approval-progress__row tea-mb-2n" },
28
- item.status === STATUS.DROP ? (React.createElement("div", { className: "approval-progress__dept", style: {
29
- color: 'rgb(231, 87, 87)',
30
- ...flowModelContentStyle,
31
- } }, item.result)) : (React.createElement("div", { className: "approval-progress__dept", style: flowModelContentStyle }, item.name)),
32
- ![STATUS.START, STATUS.END, STATUS.CC].includes(item.status) && getStatusStr(item.status)),
33
- React.createElement("div", { className: "approval-progress__row tea-mb-1n" },
34
- ![STATUS.CC].includes(item.status) && (React.createElement(Text, { theme: "weak", className: "tea-mr-4n", style: {
35
- maxWidth: 'calc(100% - 120px)',
36
- wordBreak: 'break-all',
37
- ...flowModelContentStyle,
38
- } },
39
- item.status === STATUS.START ? '发起人' : '审批人',
40
- "\uFF1A",
41
- showTwoUserList(item.operaName, item.approvalStrategy))),
42
- details.createTime && (React.createElement(Text, { theme: "weak", className: "approval-progress__date" }, moment(details.createTime).format('YYYY-MM-DD HH:mm:ss')))),
43
- item.status === STATUS.CC && (React.createElement("div", { className: "approval-progress__row approval-progress__row--start tea-mb-1n" },
44
- React.createElement(Text, { theme: "weak", style: { maxWidth: 200 }, overflow: true, tooltip: true },
45
- "\u6284\u9001\uFF1A", (_b = (_a = details.ccUserInfos) === null || _a === void 0 ? void 0 : _a.map((i) => i.name)) === null || _b === void 0 ? void 0 :
46
- _b.join('、')))),
47
- details.ccUsers && (React.createElement(Text, { theme: "weak", style: { maxWidth: 200 }, overflow: true, tooltip: true },
48
- "\u6284\u9001\uFF1A", (_c = Object.values(details.ccUsers)) === null || _c === void 0 ? void 0 :
49
- _c.join('、'))),
50
- item.status === STATUS.TRANS && (React.createElement("div", { className: "approval-progress__row approval-progress__row--start tea-mb-1n" },
51
- React.createElement(Text, { theme: "weak" },
52
- "\u56DE\u9000\u5230\u6307\u5B9A\u8282\u70B9\uFF1A",
53
- (details === null || details === void 0 ? void 0 : details.operation)
54
- ? (_d = safeJsonParse(details === null || details === void 0 ? void 0 : details.operation)[1]) === null || _d === void 0 ? void 0 : _d.name
55
- : ''))),
56
- !!details.operationComment && (React.createElement("div", { className: "approval-progress__row approval-progress__row--start tea-mb-1n" },
57
- React.createElement(Text, { theme: "weak", className: "approval-progress__comment-mb" },
58
- "\u5BA1\u6279\u610F\u89C1\uFF1A",
59
- React.createElement(HighLightComment, { details: details })))),
60
- React.createElement("div", { className: "approval-progress__row", style: {
61
- flexDirection: 'column',
62
- alignItems: 'flex-start',
63
- } },
64
- item.status === 'countersign' && (React.createElement(Text, { theme: "weak", className: "approval-progress__advice-item" },
65
- React.createElement("i", { className: "apa-icon apa-icon-label tea-mr-2n" }),
66
- "\u52A0\u7B7E\uFF1A",
67
- (details === null || details === void 0 ? void 0 : details.operation)
68
- ? safeJsonParse(details.operation)
69
- .map((i) => i.name)
70
- .join(',')
71
- : '')),
72
- details.isCC && (React.createElement(Text, { theme: "weak", className: "approval-progress__advice-item" },
73
- React.createElement("i", { className: "apa-icon apa-icon-trans tea-mr-2n" }),
74
- "\u6284\u9001\uFF1A", (_f = (_e = details.ccUserInfos) === null || _e === void 0 ? void 0 : _e.map((i) => i.name)) === null || _f === void 0 ? void 0 :
75
- _f.join('、')))))));
76
- }))));
77
- }
78
- };
79
- return (React.createElement(Card.Body, { className: "page-process__progress-card", title: React.createElement(FlowModuleText.Title, { ...getModuleTextProps(ide) }) }, renderContent()));
80
- };
81
- export default ApproveProcessMobile;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { createModuleFrame } from '../../frame';
3
- import ApproveProcess from './Process';
4
- import ApproveProcessMobile from './ProcessMobile';
5
- import './index.css';
6
- const ModelFlowProcess = (props) => {
7
- const { flowLocalProps } = props;
8
- const { isH5, isNarrowElement } = flowLocalProps;
9
- if (isH5 || isNarrowElement) {
10
- return React.createElement(ApproveProcessMobile, { ...props });
11
- }
12
- return React.createElement(ApproveProcess, { ...props });
13
- };
14
- export default createModuleFrame(ModelFlowProcess, 'flow-process');
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import { Tag, Bubble } from 'tea-component';
3
- import { STATUS_TEXT } from '../../../constants';
4
- export const getStatusStr = (status) => {
5
- const { theme, text } = (STATUS_TEXT === null || STATUS_TEXT === void 0 ? void 0 : STATUS_TEXT[status]) || {};
6
- if (text) {
7
- return (React.createElement(Tag, { className: "approval-progress__status", theme: theme }, text));
8
- }
9
- return null;
10
- };
11
- export const showTwoUserList = (operatorName, approvalStrategy) => {
12
- if (typeof operatorName === 'string') {
13
- return operatorName || '-';
14
- }
15
- if (Array.isArray(operatorName)) {
16
- const names = operatorName.filter((name) => name);
17
- if (!names.length) {
18
- return '-';
19
- }
20
- if (names.length < 2) {
21
- return names[0];
22
- }
23
- return (React.createElement(Bubble, { arrowPointAtCenter: true, placement: "top-end", content: names.join('、') }, names === null || names === void 0 ? void 0 :
24
- names.slice(0, 2).join('、'),
25
- React.createElement("span", null,
26
- "\u7B49",
27
- React.createElement("span", { style: { color: '#2473f2' } },
28
- names.length,
29
- "\u4EBA"),
30
- approvalStrategy === '1' ? '任签' : '加签')));
31
- }
32
- };
@@ -1,111 +0,0 @@
1
- import { toTransKeyCase } from './utils';
2
- import { chartMockData, pageDetailMockData, processMockData, instanceMockData, } from './ideData';
3
- // 获取批办过程接口
4
- export const fetchInstanceOperation = async (params, { callWedaApi, isWedaIde }) => {
5
- if (isWedaIde) {
6
- return toTransKeyCase(processMockData, 'toLowerCase');
7
- }
8
- if (!(params === null || params === void 0 ? void 0 : params.instanceId)) {
9
- return;
10
- }
11
- const result = await callWedaApi({
12
- action: 'GetInstanceOperation',
13
- data: toTransKeyCase(params, 'toUpperCase'),
14
- });
15
- return toTransKeyCase(result, 'toLowerCase');
16
- };
17
- /**
18
- * 获取流程实例运行图(新版)
19
- * @param {instanceId: string} params
20
- */
21
- export const fetchProcessInfoList = async (params, { isWedaIde, callWedaApi }) => {
22
- if (isWedaIde) {
23
- return toTransKeyCase(chartMockData, 'toLowerCase');
24
- }
25
- const result = await callWedaApi({
26
- action: 'GetProcessCanvasInfo',
27
- data: toTransKeyCase(params, 'toUpperCase'),
28
- });
29
- return toTransKeyCase(result, 'toLowerCase');
30
- };
31
- /**
32
- * 获取流程信息
33
- * @param {instanceId: string} params
34
- */
35
- export const fetchProcess = async (params, { isWedaIde, callWedaApi }) => {
36
- if (isWedaIde) {
37
- return toTransKeyCase(instanceMockData, 'toLowerCase');
38
- }
39
- const result = await callWedaApi({
40
- action: 'DescribeProcessInstance',
41
- data: toTransKeyCase(params, 'toUpperCase'),
42
- });
43
- return toTransKeyCase(result, 'toLowerCase');
44
- };
45
- // 获取流程信息详情
46
- export async function getApprovalPageDetail(params, { isWedaIde, callWedaApi }) {
47
- if (isWedaIde) {
48
- return toTransKeyCase(pageDetailMockData, 'toLowerCase');
49
- }
50
- const result = await callWedaApi({
51
- action: 'GetApprovalPageDetail',
52
- data: toTransKeyCase(params, 'toUpperCase'),
53
- });
54
- return toTransKeyCase(result, 'toLowerCase');
55
- }
56
- // 撤销流程接口
57
- export const revokeFlow = async (params, { callWedaApi }) => {
58
- const result = await callWedaApi({
59
- action: 'Revoke',
60
- data: toTransKeyCase(params, 'toUpperCase'),
61
- });
62
- return toTransKeyCase(result, 'toLowerCase');
63
- };
64
- // 获取回退节点列表
65
- export const fetchBackNodeList = async (params, { callWedaApi }) => {
66
- const result = await callWedaApi({
67
- action: 'GetPreElementList',
68
- data: toTransKeyCase(params, 'toUpperCase'),
69
- });
70
- return toTransKeyCase(result, 'toLowerCase');
71
- };
72
- // 回退流程接口
73
- export const rollBackFlow = async (params, { callWedaApi }) => {
74
- const result = await callWedaApi({
75
- action: 'RollBack',
76
- data: toTransKeyCase(params, 'toUpperCase'),
77
- });
78
- return toTransKeyCase(result, 'toLowerCase');
79
- };
80
- // 审批流页面提交
81
- export const postApprovalFlow = async (params, { callWedaApi }) => {
82
- const result = await callWedaApi({
83
- action: 'CompleteTask',
84
- data: toTransKeyCase(params, 'toUpperCase', 'variableInfos'),
85
- });
86
- return toTransKeyCase(result, 'toLowerCase');
87
- };
88
- // 审批流页面会签
89
- export const postApprovalSign = async (params, { callWedaApi }) => {
90
- const result = await callWedaApi({
91
- action: 'AddCounterSignAssignee',
92
- data: toTransKeyCase(params, 'toUpperCase'),
93
- });
94
- return toTransKeyCase(result, 'toLowerCase');
95
- };
96
- // 审批人列表提交
97
- export const postFlowTaskList = async (params, { callWedaApi }) => {
98
- const result = await callWedaApi({
99
- action: 'SubmitFlowTaskList',
100
- data: toTransKeyCase(params, 'toUpperCase'),
101
- });
102
- return toTransKeyCase(result, 'toLowerCase');
103
- };
104
- // 流程催办
105
- export const postPressTask = async (params, { callWedaApi }) => {
106
- const result = await callWedaApi({
107
- action: 'PressTask',
108
- data: toTransKeyCase(params, 'toUpperCase'),
109
- });
110
- return toTransKeyCase(result, 'toLowerCase');
111
- };
@@ -1,88 +0,0 @@
1
- export const chartMockData = {
2
- Nodes: [
3
- {
4
- visited: true,
5
- Id: 2,
6
- ElementId: 'approvalNode1656317642548',
7
- Name: '经理审批',
8
- DataType: 17,
9
- Status: 1,
10
- Conf: [
11
- {
12
- Name: '张三',
13
- Status: 2,
14
- OpTime: 1656502417000,
15
- Comment: '',
16
- AttachmentInfo: '[]',
17
- NewProcessors: 'true',
18
- },
19
- ],
20
- },
21
- {
22
- visited: true,
23
- Id: 3,
24
- ElementId: 'approvalNode1656317679079',
25
- Name: '总监审批',
26
- DataType: 17,
27
- Status: 3,
28
- Conf: [
29
- { Name: '王五', Status: 0, OpTime: 0 },
30
- { Name: '李四', Status: 0, OpTime: 0 },
31
- ],
32
- },
33
- {
34
- visited: true,
35
- Id: 4,
36
- ElementId: 'approvalNode1656317682440',
37
- Name: '人事审批',
38
- DataType: 17,
39
- Status: 2,
40
- },
41
- {
42
- visited: true,
43
- Id: 1,
44
- ElementId: 'startNode',
45
- Name: '开始',
46
- DataType: 1,
47
- Status: 1,
48
- },
49
- {
50
- visited: true,
51
- Id: 5,
52
- ElementId: 'endNode',
53
- Name: '结束',
54
- DataType: 13,
55
- Status: 2,
56
- },
57
- ],
58
- Edges: [
59
- {
60
- Label: '同意',
61
- Type: 2,
62
- Source: 'approvalNode1656317679079',
63
- Target: 'approvalNode1656317682440',
64
- Status: 2,
65
- },
66
- {
67
- Label: '同意c',
68
- Type: 2,
69
- Source: 'approvalNode1656317682440',
70
- Target: 'endNode',
71
- Status: 2,
72
- },
73
- {
74
- Label: '同意',
75
- Type: 2,
76
- Source: 'approvalNode1656317642548',
77
- Target: 'approvalNode1656317679079',
78
- Status: 2,
79
- },
80
- {
81
- Label: '',
82
- Type: 2,
83
- Source: 'startNode',
84
- Target: 'approvalNode1656317642548',
85
- Status: 2,
86
- },
87
- ],
88
- };
@@ -1,5 +0,0 @@
1
- import { chartMockData } from './chart';
2
- import { instanceMockData } from './instance';
3
- import { pageDetailMockData } from './pageDetail';
4
- import { processMockData } from './process';
5
- export { chartMockData, processMockData, instanceMockData, pageDetailMockData };
@@ -1,23 +0,0 @@
1
- export const instanceMockData = {
2
- InstanceId: '1540637032124833793',
3
- Name: '示例流程名称',
4
- Description: '',
5
- StartedBy: '示例流程发起人',
6
- CurrentApprover: '1538836331989536769',
7
- StartTime: 1656151467000,
8
- IsCompleted: false,
9
- StartAppCode: '1',
10
- StartAppName: '',
11
- CurrentNodeId: 'approvalNode1655879748434',
12
- CurrentNodeName: '审批节点',
13
- CurrentNodeType: 17,
14
- TaskId: '1540637033316016132',
15
- FlowCode: '1540158815012335618',
16
- FlowVersion: '10.0',
17
- Flag: 0,
18
- CanApprove: true,
19
- CanDelete: true,
20
- TenantZoneId: '',
21
- OperationName: '[{"branchName":"同意","branchType":1,"edgeId":"approvalNode1655879748434_to_updateRecord1656037357881"},{"branchName":"拒绝","branchType":2,"edgeId":""}]',
22
- UserTaskType: 1,
23
- };
@@ -1,42 +0,0 @@
1
- export const pageDetailMockData = {
2
- PageUrl: '',
3
- VariableInfos: {
4
- ObjectListMap: [],
5
- ObjectMap: [],
6
- },
7
- AppCode: '1',
8
- Show: true,
9
- ShowSubmitApp: false,
10
- ShowCarbonCopy: true,
11
- ShowTurnToPerson: true,
12
- ShowAddAssignee: true,
13
- ShowRollBack: true,
14
- ShowRevoke: false,
15
- OutEntityCodes: [],
16
- Buttons: {
17
- 1: '同意',
18
- 2: '拒绝',
19
- },
20
- DataSourceInputParams: [
21
- {
22
- recordId: '0a4ec1f962b6ddaa0c9312965714b19e',
23
- entityCode: 'hongqi_x2spbdq',
24
- flag: true,
25
- paramCode: '165587975739916917',
26
- scope: 'GLOBAL',
27
- name: 'startNodeoutputKey#165587975739916917',
28
- fieldValueMap: {
29
- owner: '1538836331989536769',
30
- createdAt: 1656151466297,
31
- createBy: '1538836331989536769',
32
- test: 'trigger-two_usertask',
33
- updateBy: '1538836331989536769',
34
- _id: '0a4ec1f962b6ddaa0c9312965714b19e',
35
- age: 10,
36
- updatedAt: 1656151466297,
37
- },
38
- appCode: 1,
39
- fieldType: 'OBJECT',
40
- },
41
- ],
42
- };
@@ -1,27 +0,0 @@
1
- export const processMockData = {
2
- ElementInfos: [
3
- {
4
- Id: '1542109022301507586',
5
- Name: '经理审批',
6
- OperaName: ['张三'],
7
- Result: 'true',
8
- ContentInfo: {
9
- Action: 2,
10
- AttachmentInfo: '[]',
11
- OperationComment: '',
12
- CreateTime: 1656502417000,
13
- OpinionUserMap: {},
14
- HighlightPositionList: '{}',
15
- },
16
- },
17
- {
18
- Name: '总监审批',
19
- OperaName: ['王五', '李四'],
20
- Result: '待审批',
21
- ApprovalStrategy: '1',
22
- ContentInfo: {
23
- CreateTime: 1656502417000,
24
- },
25
- },
26
- ],
27
- };
@@ -1,2 +0,0 @@
1
- export * from './user';
2
- export * from './flow';
@@ -1,23 +0,0 @@
1
- export const getWedaUserList = async (params, { callWedaApi, IS_WEDA_IDE }) => {
2
- if (IS_WEDA_IDE) {
3
- return [];
4
- }
5
- const result = await callWedaApi({
6
- action: 'DescribeWedaUserList',
7
- data: {
8
- UserType: 'internalUser',
9
- ...params,
10
- },
11
- });
12
- return result;
13
- };
14
- export const getUserQuery = async (params, { callWedaApi, IS_WEDA_IDE }) => {
15
- if (IS_WEDA_IDE) {
16
- return [];
17
- }
18
- const result = await callWedaApi({
19
- action: 'SearchUser',
20
- data: params,
21
- });
22
- return result;
23
- };
@@ -1,28 +0,0 @@
1
- const transKey = (str, method) => {
2
- const firstChar = method === 'toLowerCase'
3
- ? str.charAt(0).toLowerCase()
4
- : str.charAt(0).toUpperCase();
5
- return `${firstChar}${str.slice(1)}`;
6
- };
7
- const isArray = (value) => Array.isArray(value);
8
- const isObject = (value) => Object.prototype.toString.call(value) === '[object Object]';
9
- /**
10
- * 将对象的key的首字母转换为大写或者小写
11
- */
12
- export function toTransKeyCase(target, method, ignoreKeyValue) {
13
- const result = {};
14
- if (isArray(target)) {
15
- return target === null || target === void 0 ? void 0 : target.map((item) => toTransKeyCase(item, method));
16
- }
17
- if (isObject(target)) {
18
- return Object.keys(target).reduce((acc, key) => {
19
- const finalKey = transKey(key, method);
20
- acc[finalKey] =
21
- ignoreKeyValue && ignoreKeyValue === key
22
- ? target[key]
23
- : toTransKeyCase(target[key], method);
24
- return acc;
25
- }, result);
26
- }
27
- return target;
28
- }
@@ -1,12 +0,0 @@
1
- import { Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { getTreePaths } from '../common/utils';
3
- export const OrgPaths = ({ nodeId, treeData }) => {
4
- if (!nodeId || !treeData) {
5
- return null;
6
- }
7
- const paths = getTreePaths(nodeId, treeData);
8
- if (paths && paths.length > 0) {
9
- return _jsxs(_Fragment, { children: ["(", paths.map((node) => node.content).join('/'), ")"] });
10
- }
11
- return null;
12
- };