@cloudbase/weda-ui 3.4.4 → 3.4.5

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 (41) hide show
  1. package/dist/configs/components/chart/bar.json +113 -8
  2. package/dist/configs/components/chart/line.js +113 -8
  3. package/dist/configs/components/chart/pie.json +113 -8
  4. package/dist/configs/components/chart/statisticsCard.json +57 -0
  5. package/dist/configs/components/dataView.js +7 -7
  6. package/dist/configs/components/graphicCard.json +1 -1
  7. package/dist/configs/components/listView.js +113 -9
  8. package/dist/configs/components/navLayout.json +1 -1
  9. package/dist/configs/components/table.json +124 -9
  10. package/dist/style/index.scss +1 -1
  11. package/dist/web/components/chart/common/data-transform.js +1 -1
  12. package/dist/web/components/chart/statisticsCard/index.js +1 -1
  13. package/dist/web/components/flow/components/UserSelectModel/UserSelect.js +9 -11
  14. package/dist/web/components/flow/components/UserSelectModel/UserSelectMobile.js +2 -6
  15. package/dist/web/components/flow/modules/chart/index.css +0 -3
  16. package/dist/web/components/flow/modules/control/ApprovalPopup.js +2 -3
  17. package/dist/web/components/flow/modules/control/Control.js +27 -15
  18. package/dist/web/components/flow/modules/control/ControlMobile.css +32 -0
  19. package/dist/web/components/flow/modules/control/ControlMobile.js +28 -13
  20. package/dist/web/components/flow/modules/control/FlowTaskInfoModal.js +4 -4
  21. package/dist/web/components/flow/modules/control/provider/useControlModel.js +2 -6
  22. package/dist/web/components/flow/modules/control/provider/useMobileModel.js +0 -2
  23. package/dist/web/components/flow/modules/control/provider/useRevokeAndBackHook.js +2 -0
  24. package/dist/web/components/flow/modules/control/utils/index.js +1 -0
  25. package/dist/web/components/flow/modules/control/utils/tools.js +3 -0
  26. package/dist/web/components/form/select/dropdown-select/h5.js +1 -1
  27. package/dist/web/components/form/select/dropdown-select/index.css +7 -0
  28. package/dist/web/components/form/select/index.js +2 -7
  29. package/dist/web/components/form/textarea/index.js +1 -1
  30. package/dist/web/components/form/uploaderFile/index.css +6 -5
  31. package/dist/web/components/form/uploaderFile/uploadFile.h5.js +10 -11
  32. package/dist/web/components/form/uploaderFile/uploadFile.pc.js +3 -2
  33. package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +39 -22
  34. package/dist/web/components/form/userOrgSelect/component/user-select-h5/user-select-h5.js +11 -2
  35. package/dist/web/components/listView/index.js +94 -97
  36. package/dist/web/components/richTextView/index.css +2 -0
  37. package/dist/web/components/swiper/index.js +14 -8
  38. package/dist/web/components/table/BaseTable.js +3 -3
  39. package/dist/web/utils/hooks/use-cloud-id-temp-url.js +2 -1
  40. package/dist/web/utils/platform.js +9 -1
  41. package/package.json +3 -3
@@ -6,14 +6,16 @@ import { useControlContext } from './provider';
6
6
  import { ACTION_TYPE } from './constants';
7
7
  import { ApprovalPopup } from './ApprovalPopup';
8
8
  import { ButtonLayout } from './Control';
9
+ import { setOperationButtonId } from './utils';
10
+ import { FlowTaskInfoModal } from './FlowTaskInfoModal';
9
11
  import './ControlMobile.css';
10
12
  export const FlowControlMobile = (props) => {
11
13
  const { commonFlowData, flowLocalProps, ide } = props;
12
14
  const { pageInfo, flowDetail } = commonFlowData;
13
- const { safeJsonParse, currentPageType } = flowLocalProps;
15
+ const { isWedaIde, safeJsonParse, currentPageType } = flowLocalProps;
14
16
  const {
15
17
  // ControlModel
16
- submitApplyLoading, showMoreAction, ifSubmitAndCc, ccUsers, onControlChick, onShowMoreVisibleChange, loadingAssign, onBackFlowCenter,
18
+ submitApplyLoading, showMoreAction, ifSubmitAndCc, hasGoBack, ccUsers, onControlChick, onShowMoreVisibleChange, loadingAssign, onBackFlowCenter,
17
19
  // RevokeModel
18
20
  showRevokeModal, showBackModal, backNodeList, backNode, setShowRevokeModal, doneRevokeFn, doneBackFn, setShowBackModal, getNodeList, setBackNode, onUserSelectModalInfoChange, setUserSelectModelVisible, userSelectApproveField, userSelectModelVisible, userSelectMode, } = useControlContext();
19
21
  const onClickRollBack = async () => {
@@ -29,6 +31,7 @@ export const FlowControlMobile = (props) => {
29
31
  showTurnToPerson: {
30
32
  label: '转办',
31
33
  action: (e) => onControlChick(ACTION_TYPE.TRANSFER, e),
34
+ operationName: 'turn_to_person',
32
35
  },
33
36
  showRollBack: {
34
37
  label: '回退',
@@ -36,6 +39,7 @@ export const FlowControlMobile = (props) => {
36
39
  await getNodeList();
37
40
  setShowBackModal(true);
38
41
  },
42
+ operationName: 'roll_back',
39
43
  },
40
44
  showAddAssignee: {
41
45
  label: '加签',
@@ -55,39 +59,50 @@ export const FlowControlMobile = (props) => {
55
59
  mode: 'multiple',
56
60
  });
57
61
  },
62
+ operationName: 'add_assignee',
58
63
  },
59
64
  };
60
65
  const renderButtonGroup = () => {
61
- var _a;
66
+ var _a, _b;
67
+ if (hasGoBack)
68
+ return null;
69
+ if (((_a = ide.bindMetadata) === null || _a === void 0 ? void 0 : _a.approvalPageType) === 'apply' && isWedaIde) {
70
+ return (React.createElement("div", { className: "mf-progress-mb--footer" },
71
+ React.createElement(ButtonLayout, { gap: 10 },
72
+ React.createElement(Button, { type: "primary" }, "\u63D0\u4EA4\u7533\u8BF7"),
73
+ React.createElement(Button, { type: "weak" }, "\u4FDD\u5B58\u8349\u7A3F"),
74
+ React.createElement(Button, { type: "weak" }, "\u53D6\u6D88"))));
75
+ }
62
76
  if (['CREATE', 'DONE'].includes(currentPageType) && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.showRevoke)) {
63
77
  return (React.createElement("div", { className: "mf-progress-mb--footer" },
64
- React.createElement(Button, { type: "primary", onClick: () => setShowRevokeModal(true) }, "\u64A4\u9500")));
78
+ React.createElement(Button, { type: "primary", onClick: () => setShowRevokeModal(true), id: setOperationButtonId('revoke') }, "\u64A4\u9500")));
65
79
  }
66
80
  if (['DRAFT', 'CREATEFLOW', 'TODO'].includes(currentPageType) &&
67
81
  (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.show)) {
68
82
  return (React.createElement("div", { className: "mf-progress-mb--footer" }, (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.showSubmitApp) ? (React.createElement(ButtonLayout, { gap: 10 },
69
- flowDetail.canDelete ? (React.createElement(Button, { type: "link", onClick: () => onControlChick(ACTION_TYPE.SAVE_DRAFT) }, "\u4FDD\u5B58\u8349\u7A3F")) : null,
70
- ifSubmitAndCc ? (React.createElement(Button, { type: "link", onClick: onClickAddCcUser },
83
+ flowDetail.canDelete ? (React.createElement(Button, { type: "link", onClick: () => onControlChick(ACTION_TYPE.SAVE_DRAFT), id: setOperationButtonId('save_draft') }, "\u4FDD\u5B58\u8349\u7A3F")) : null,
84
+ ifSubmitAndCc ? (React.createElement(Button, { type: "link", onClick: onClickAddCcUser, id: setOperationButtonId('cc') },
71
85
  "+\u6284\u9001\u4EBA(",
72
86
  ccUsers.length || 0,
73
87
  ")")) : null,
74
- React.createElement(Button, { type: "primary", loading: submitApplyLoading, onClick: () => onControlChick(ACTION_TYPE.SUBMIT) }, ((_a = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons) === null || _a === void 0 ? void 0 : _a[3]) || '提交申请'),
88
+ React.createElement(Button, { type: "primary", loading: submitApplyLoading, onClick: () => onControlChick(ACTION_TYPE.SUBMIT), id: setOperationButtonId('submit') }, ((_b = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons) === null || _b === void 0 ? void 0 : _b[3]) || '提交申请'),
75
89
  flowDetail.canDelete ? (React.createElement(Button, { type: "weak", onClick: onBackFlowCenter }, "\u53D6\u6D88")) : null)) : (React.createElement(ButtonLayout, { gap: 10 },
76
90
  ['showTurnToPerson', 'showRollBack', 'showAddAssignee'].filter((key) => pageInfo[key]).length >= 2 ? (React.createElement(Button, { type: "link", onClick: onShowMoreVisibleChange }, "\u66F4\u591A")) : (['showTurnToPerson', 'showRollBack', 'showAddAssignee']
77
91
  .filter((key) => pageInfo[key])
78
92
  .map((key, actionIndex) => {
79
- const { label, action } = buttonActionMap[key];
80
- return (React.createElement(Button, { key: `actionItem-${actionIndex}`, className: "apa-height-xl tea-mr-4n tea-mt-1n", type: "link", onClick: action }, label));
93
+ const { label, action, operationName } = buttonActionMap[key];
94
+ return (React.createElement(Button, { key: `actionItem-${actionIndex}`, className: "apa-height-xl tea-mr-4n tea-mt-1n", type: "link", onClick: action, id: setOperationButtonId(operationName) }, label));
81
95
  })),
82
- flowDetail.userTaskType === 2 ? (React.createElement(Button, { type: "primary", style: { flex: 3 }, onClick: (e) => onControlChick(ACTION_TYPE.HANDLE, e) }, flowDetail.operationName)) : (React.createElement(React.Fragment, null,
83
- React.createElement(Button, { onClick: (e) => onControlChick(ACTION_TYPE.REJECT, e) }, (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons) ? pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons[2] : '拒绝'),
84
- React.createElement(Button, { type: "primary", onClick: (e) => onControlChick(ACTION_TYPE.AGREE, e) }, (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons) ? pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons[1] : '同意')))))));
96
+ flowDetail.userTaskType === 2 ? (React.createElement(Button, { type: "primary", style: { flex: 3 }, onClick: (e) => onControlChick(ACTION_TYPE.HANDLE, e), id: setOperationButtonId('handle') }, flowDetail.operationName)) : (React.createElement(React.Fragment, null,
97
+ React.createElement(Button, { onClick: (e) => onControlChick(ACTION_TYPE.REJECT, e), id: setOperationButtonId('reject') }, (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons) ? pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons[2] : '拒绝'),
98
+ React.createElement(Button, { type: "primary", onClick: (e) => onControlChick(ACTION_TYPE.AGREE, e), id: setOperationButtonId('agree') }, (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons) ? pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.buttons[1] : '同意')))))));
85
99
  }
86
100
  };
87
101
  return (
88
102
  // eslint-disable-next-line react/jsx-props-no-spreading
89
103
  React.createElement("div", { ...ide },
90
104
  renderButtonGroup(),
105
+ React.createElement(FlowTaskInfoModal, { layout: "vertical" }),
91
106
  React.createElement(Popup, { className: "cp-mobile-dialog apa-m-overlay approval-progress__more--dialog", visible: showMoreAction, onClose: onShowMoreVisibleChange,
92
107
  // disableCloseIcon={true}
93
108
  closeIcon: false, position: "bottom" },
@@ -128,6 +143,6 @@ export const FlowControlMobile = (props) => {
128
143
  } }, "\u5B8C\u6210")),
129
144
  (backNodeList === null || backNodeList === void 0 ? void 0 : backNodeList.length) ? (React.createElement("ul", { className: "list-content" }, backNodeList === null || backNodeList === void 0 ? void 0 : backNodeList.map((item) => (React.createElement("li", { key: item.value, className: backNode === item.value ? 'list-checked' : '', onClick: () => setBackNode(item.value) },
130
145
  React.createElement("span", null, item.text)))))) : (React.createElement(Status, { icon: "blank", size: "l", title: "\u6682\u65E0\u53EF\u56DE\u9000\u8282\u70B9" }))),
131
- userSelectModelVisible ? (React.createElement(UserSelectModel, { visible: true, approveField: userSelectApproveField, mode: userSelectMode, close: () => setUserSelectModelVisible(false), mobileModel: true, values: ccUsers.map((user) => user.value) })) : null,
146
+ React.createElement(UserSelectModel, { visible: userSelectModelVisible, approveField: userSelectApproveField, mode: userSelectMode, close: () => setUserSelectModelVisible(false), mobileModel: true, values: ccUsers.map((user) => user.value) }),
132
147
  React.createElement(ApprovalPopup, { pageInfo: pageInfo, flowDetail: flowDetail, safeJsonParse: safeJsonParse })));
133
148
  };
@@ -3,7 +3,7 @@ import { Modal, SelectMultiple, Button, Form } from 'tea-component';
3
3
  // import { history } from 'umi';
4
4
  import { useControlContext } from './provider';
5
5
  import './FlowTaskInfoModal.css';
6
- export const FlowTaskInfoModal = () => {
6
+ export const FlowTaskInfoModal = ({ layout = 'default', }) => {
7
7
  // const { visible, setVisible, flowTaskInfoList, flowTaskIds, setFlowTaskIds, allInfos } = props;
8
8
  const { flowTaskInfoList, flowTaskInfoModalVisible, flowTaskIds, setFlowTaskIds, onCloseFlowTaskInfoModal, } = useControlContext();
9
9
  const [options, setOptions] = useState([]);
@@ -18,13 +18,13 @@ export const FlowTaskInfoModal = () => {
18
18
  });
19
19
  setOptions(tempOptions);
20
20
  }, [flowTaskInfoList]);
21
- return (React.createElement(Modal, { visible: flowTaskInfoModalVisible, caption: '选择下一节点处理人', onClose: onCloseFlowTaskInfoModal },
21
+ return (React.createElement(Modal, { visible: flowTaskInfoModalVisible, caption: '选择下一节点处理人', onClose: onCloseFlowTaskInfoModal, size: "auto" },
22
22
  React.createElement(Modal.Body, null,
23
- React.createElement(Form, { style: { marginBottom: '5px' } },
23
+ React.createElement(Form, { style: { marginBottom: '5px' }, layout: layout },
24
24
  React.createElement(Form.Item, { label: '选择处理人', className: "flow_center_next_approve-form_item" },
25
25
  React.createElement(SelectMultiple, { appearance: "button", size: 'full', searchable: true, matchButtonWidth: true, staging: false, options: options, onChange: (val) => {
26
26
  setFlowTaskIds(val);
27
- }, value: flowTaskIds })))),
27
+ }, value: flowTaskIds, style: { width: 200 } })))),
28
28
  React.createElement(Modal.Footer, null,
29
29
  React.createElement(Button, { type: "primary", onClick: onCloseFlowTaskInfoModal }, "\u786E\u5B9A"),
30
30
  React.createElement(Button, { type: "weak", onClick: onCloseFlowTaskInfoModal }, "\u53D6\u6D88"))));
@@ -90,9 +90,7 @@ export const useControlModel = (params) => {
90
90
  const onSaveDraft = () => {
91
91
  const params = {
92
92
  buttonAction: ACTION_TYPE_MAP[ACTION_TYPE.SAVE_DRAFT],
93
- ccUserIds: (ccUsers === null || ccUsers === void 0 ? void 0 : ccUsers.length)
94
- ? ccUsers.map(({ value }) => value).join(',')
95
- : undefined,
93
+ ccUserIds: (ccUsers === null || ccUsers === void 0 ? void 0 : ccUsers.length) ? ccUsers.join(',') : undefined,
96
94
  flowCode: flowDetail.flowCode,
97
95
  instanceId: flowDetail.instanceId,
98
96
  nodeId: flowDetail.currentNodeId,
@@ -126,9 +124,7 @@ export const useControlModel = (params) => {
126
124
  setSubmitLoading(true);
127
125
  const params = {
128
126
  buttonAction: ACTION_TYPE_MAP[handleType],
129
- ccUserIds: (ccUsers === null || ccUsers === void 0 ? void 0 : ccUsers.length)
130
- ? ccUsers.map(({ value }) => value).join(',')
131
- : undefined,
127
+ ccUserIds: (ccUsers === null || ccUsers === void 0 ? void 0 : ccUsers.length) ? ccUsers.join(',') : undefined,
132
128
  flowCode: flowDetail.flowCode,
133
129
  instanceId: flowDetail.instanceId,
134
130
  nodeId: flowDetail.currentNodeId,
@@ -26,8 +26,6 @@ export const useMobileModel = (params, controlModel) => {
26
26
  setApprovers(approvers || []);
27
27
  setOpinionUserMap({ ...opinionUserMap });
28
28
  setHighlightPositionMap({ ...highlightPositionMap });
29
- setApprover(approver);
30
- setApprovers(approvers);
31
29
  setFileList(fileList);
32
30
  if (ccUsers) {
33
31
  setCcUsers(ccUserFormStorage.map((user) => ({
@@ -50,6 +50,8 @@ export const useRevokeAndBackHook = (params, controlModel) => {
50
50
  });
51
51
  const doneBackFn = () => {
52
52
  var _a;
53
+ if (!backNode)
54
+ return;
53
55
  // 调用回退接口
54
56
  rollBackFlow({
55
57
  flowCode: flowDetail.flowCode,
@@ -1,2 +1,3 @@
1
1
  import ControlModelUtils from './ControlModelUtils';
2
+ export * from './tools';
2
3
  export { ControlModelUtils };
@@ -0,0 +1,3 @@
1
+ export function setOperationButtonId(operationName) {
2
+ return `weda_flow_${operationName}_btn`;
3
+ }
@@ -130,7 +130,7 @@ export function SelectPickerH5({ updateValue, selectedValue, options, isTurnPage
130
130
  setSearchValue('');
131
131
  updateValue(item, true, true);
132
132
  } },
133
- React.createElement("p", null, item.label)));
133
+ React.createElement("p", { className: 'weda-ui-custom-picker__cloumn-item-text' }, item.label)));
134
134
  }),
135
135
  status === Status.LOADING && (React.createElement("li", { key: 'loading' },
136
136
  React.createElement(Loading, null))),
@@ -157,3 +157,10 @@
157
157
  .wedatea2td-search--simple .wedatea2td-input--search {
158
158
  caret-color: #000000;
159
159
  }
160
+
161
+ .weda-ui-custom-picker__cloumn-item-text {
162
+ overflow: hidden;
163
+ text-overflow: ellipsis;
164
+ white-space: nowrap;
165
+ margin-right: 40px;
166
+ }
@@ -187,13 +187,8 @@ function SelectPc({ where, dataSourceName, viewId, format, primaryField, enumNam
187
187
  setSelectedValue(value);
188
188
  } }));
189
189
  case 'date': {
190
- const now = moment();
191
- const start = startDate
192
- ? decodeIsoDatetime(startDate, 'date')
193
- : `${now.year() - 20}-01-01`;
194
- const end = endDate
195
- ? decodeIsoDatetime(endDate, 'date')
196
- : `${now.year() + 20}-12-31`;
190
+ const start = startDate ? decodeIsoDatetime(startDate, 'date') : null;
191
+ const end = endDate ? decodeIsoDatetime(endDate, 'date') : null;
197
192
  const dateProps = {
198
193
  range: [moment(start), moment(end)],
199
194
  onChange: onDataChange,
@@ -24,7 +24,7 @@ label = '标题', labelVisible = true, defaultValue = '', placeholder = '请输
24
24
  'weui-cell_disabled': disabled,
25
25
  });
26
26
  // 两次默认值不同时, 需要刷新value
27
- const [value, setValue] = useSyncValue(defaultValue);
27
+ const [value, setValue] = useSyncValue(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
28
28
  const counter = React.useMemo(() => (value === null || value === void 0 ? void 0 : value.length) || 0, [value]);
29
29
  const onChange = function (e) {
30
30
  const text = typeof e === 'string' ? e : e.target.value;
@@ -274,7 +274,7 @@
274
274
 
275
275
  .weda-upload-file-mobile .weda-upload-file-mobile__item {
276
276
  width: 100%;
277
- padding: 16px;
277
+ padding: 8px;
278
278
  display: flex;
279
279
  justify-content: space-between;
280
280
  align-items: center;
@@ -319,7 +319,7 @@
319
319
  .weda-upload-file-mobile__item
320
320
  .weda-upload-file-mobile__item-left {
321
321
  flex: 1;
322
- margin-right: 16px;
322
+ margin-right: 4px;
323
323
  width: 70%;
324
324
  }
325
325
 
@@ -336,7 +336,7 @@
336
336
  font-size: 0.875em;
337
337
  line-height: 1.375em;
338
338
  color: rgba(0, 0, 0, 0.9);
339
- max-width: 6.5rem;
339
+ max-width: 100%;
340
340
  overflow: hidden;
341
341
  text-overflow: ellipsis;
342
342
  white-space: nowrap;
@@ -345,8 +345,8 @@
345
345
  .weda-upload-file-mobile
346
346
  .weda-upload-file-mobile__item
347
347
  .weda-upload-file-mobile__file-status {
348
- margin-left: 24px;
349
- display: flex;
348
+ margin-left: 4px;
349
+ display: inline;
350
350
  }
351
351
 
352
352
  .weda-upload-file-mobile
@@ -399,6 +399,7 @@
399
399
  background-color: #e7e7e7;
400
400
  height: 3px !important;
401
401
  margin-bottom: 0;
402
+ display: inline;
402
403
  }
403
404
 
404
405
  .weda-upload-file-mobile
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import weui from '../../../utils/weui';
3
3
  import isObjectEqual from '../../../utils/isObjectEqual';
4
4
  import { ConfigProvider, Button, Icon, Text, List, Progress, Tooltip, message, } from 'tea-component';
5
- import { filterStrList, isCloudFileID, isHttpFileID, transSize, downloadFile, transFileCloudidToName, randomStr, isInIde, } from '../../../utils/platform';
5
+ import { filterStrList, isCloudFileID, isHttpFileID, transSize, downloadFile, transFileCloudidToName, randomStr, isInIde, isWebInMiniprogram, } from '../../../utils/platform';
6
6
  import { getCloudInstance } from '../../../utils/tcb';
7
7
  import classNames from '../../../utils/classnames';
8
8
  import { renderDecorator } from '../renderDecorator';
@@ -269,10 +269,9 @@ const UploadFileStatus = ({ status = 'UPLOAD_STATUS_SUCCESS', percent = 0, size,
269
269
  (status == 'UPLOAD_STATUS_PENDING' && percent)) {
270
270
  return (React.createElement(React.Fragment, null,
271
271
  React.createElement("div", { className: `${CLASS_PREFIX}__file-detail` },
272
- React.createElement(Text, { className: `${CLASS_PREFIX}__file-name` }, title),
273
- React.createElement("div", { className: `${CLASS_PREFIX}__file-status` },
274
- React.createElement("div", { className: `${CLASS_PREFIX}__file-status` },
275
- React.createElement(Progress, { percent: percent, theme: "default", strokeColor: '#0052D9', className: `${CLASS_PREFIX}__file-progress` })))),
272
+ React.createElement(Text, { className: `${CLASS_PREFIX}__file-name` }, title)),
273
+ React.createElement("div", null,
274
+ React.createElement(Progress, { percent: percent, theme: "default", strokeColor: '#0052D9', className: `${CLASS_PREFIX}__file-progress` })),
276
275
  React.createElement("div", { className: `${CLASS_PREFIX}__file-foot` },
277
276
  React.createElement("div", null,
278
277
  React.createElement(Text, null,
@@ -284,15 +283,15 @@ const UploadFileStatus = ({ status = 'UPLOAD_STATUS_SUCCESS', percent = 0, size,
284
283
  return (React.createElement(React.Fragment, null,
285
284
  React.createElement("div", { className: `${CLASS_PREFIX}__file-detail` },
286
285
  React.createElement(Tooltip, { title: title },
287
- React.createElement(Text, { className: `${CLASS_PREFIX}__file-name` }, title)),
286
+ React.createElement(Text, { className: `${CLASS_PREFIX}__file-name` }, title))),
287
+ isEdit && (React.createElement("div", { className: `${CLASS_PREFIX}__file-foot` },
288
+ React.createElement("div", null,
289
+ React.createElement(Text, null, size)),
288
290
  isEdit && (React.createElement("div", { className: `${CLASS_PREFIX}__file-status` },
289
291
  React.createElement(Icon, { type: ((_a = statusMap[status]) === null || _a === void 0 ? void 0 : _a.icon) ||
290
292
  statusMap['UPLOAD_STATUS_PENDING'].icon }),
291
293
  React.createElement(Text, { className: `${CLASS_PREFIX}__file-status--msg` }, ((_b = statusMap[status]) === null || _b === void 0 ? void 0 : _b.title) ||
292
- statusMap['UPLOAD_STATUS_PENDING'].title)))),
293
- isEdit && (React.createElement("div", { className: `${CLASS_PREFIX}__file-foot` },
294
- React.createElement("div", null,
295
- React.createElement(Text, null, size))))));
294
+ statusMap['UPLOAD_STATUS_PENDING'].title)))))));
296
295
  };
297
296
  /**
298
297
  * 操作列组件, onChange 从最外层 UploadFilePc 传进来
@@ -319,7 +318,7 @@ const UploadFileAction = ({ status = 'UPLOAD_STATUS_PENDING', fileID = '', uuid
319
318
  return (React.createElement(React.Fragment, null,
320
319
  deleteVisible && renderDelete(),
321
320
  ' ',
322
- downloadVisible && renderDownLoad()));
321
+ downloadVisible && !isWebInMiniprogram() && renderDownLoad()));
323
322
  case 'UPLOAD_STATUS_ERROR':
324
323
  return (React.createElement(React.Fragment, null,
325
324
  deleteVisible && renderDelete(),
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Upload, ConfigProvider, Button, message, Icon, Text, List, } from 'tea-component';
3
- import { filterStrList, isCloudFileID, isHttpFileID, transSize, downloadFile, cutFileTitle, transFileCloudidToName, randomStr, isInIde, } from '../../../utils/platform';
3
+ import { filterStrList, isCloudFileID, isHttpFileID, transSize, downloadFile, cutFileTitle, transFileCloudidToName, randomStr, isInIde, isWebInMiniprogram, } from '../../../utils/platform';
4
4
  import { getCloudInstance } from '../../../utils/tcb';
5
5
  import classNames from '../../../utils/classnames';
6
6
  import { renderDecorator } from '../renderDecorator';
@@ -281,7 +281,8 @@ const UploadFileAction = ({ title = 'downfile', status = '0', fileID = '', uuid
281
281
  onReLoad === null || onReLoad === void 0 ? void 0 : onReLoad(file);
282
282
  } }, "\u91CD\u65B0\u4E0A\u4F20"));
283
283
  // 操作列按钮-下载
284
- const renderDownLoad = () => downloadVisible && (React.createElement(Button, { type: "link", title: "\u70B9\u51FB\u4E0B\u8F7D\u6587\u4EF6", onClick: () => downloadFile(src, title) }, "\u4E0B\u8F7D"));
284
+ const renderDownLoad = () => downloadVisible &&
285
+ !isWebInMiniprogram && (React.createElement(Button, { type: "link", title: "\u70B9\u51FB\u4E0B\u8F7D\u6587\u4EF6", onClick: () => downloadFile(src, title) }, "\u4E0B\u8F7D"));
285
286
  switch (status) {
286
287
  case '0':
287
288
  return renderCancel();
@@ -11,7 +11,7 @@ import { useViewData } from '../../hooks/use-views-data';
11
11
  import { useDepartData } from '../../hooks/use-depart-data';
12
12
  import { parseStrToArr } from '../../common/utils';
13
13
  export default function UserTreeSelect(props) {
14
- const { events = emptyObject, defaultValue = emptyArray, confirmValue = '', defaultValueType = 'noneUser', onChange = null, multiple = false, request = defaultRequest, where, } = props;
14
+ const { events = emptyObject, defaultValue = emptyArray, confirmValue = '', defaultValueType = 'noneUser', onChange = null, multiple = false, request = defaultRequest, where, confirmAction, } = props;
15
15
  const platform = usePlatform();
16
16
  const [errInfo, setErrInfo] = useState({
17
17
  errorStatus: false,
@@ -86,32 +86,18 @@ export default function UserTreeSelect(props) {
86
86
  // eslint-disable-next-line react-hooks/exhaustive-deps
87
87
  }, [defaultValueType, selectUserIds]);
88
88
  useEffect(() => {
89
- var _a, _b, _c;
89
+ var _a;
90
90
  setSelectedUserList(confirmUserList);
91
- onChange === null || onChange === void 0 ? void 0 : onChange(multiple
92
- ? confirmUserList.length > 0
93
- ? confirmUserList.map((e) => {
94
- return e === null || e === void 0 ? void 0 : e.id;
95
- })
96
- : null
97
- : (_a = confirmUserList[0]) === null || _a === void 0 ? void 0 : _a.id);
98
- (_b = events === null || events === void 0 ? void 0 : events.change) === null || _b === void 0 ? void 0 : _b.call(events, multiple
99
- ? {
100
- value: confirmUserList.length > 0
101
- ? confirmUserList.map((e) => {
102
- return e === null || e === void 0 ? void 0 : e.id;
103
- })
104
- : null,
105
- data: confirmUserList,
106
- }
107
- : {
108
- value: ((_c = confirmUserList[0]) === null || _c === void 0 ? void 0 : _c.id) || null,
109
- data: confirmUserList[0] || null,
110
- });
91
+ onChange === null || onChange === void 0 ? void 0 : onChange(setOnChangeValue(multiple, confirmUserList));
92
+ (_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, setOnChangeValue(multiple, confirmUserList, true));
111
93
  // eslint-disable-next-line react-hooks/exhaustive-deps
112
94
  }, [confirmUserList]);
113
95
  //确定 关闭弹窗
114
96
  const onConfirm = () => {
97
+ confirmAction === null || confirmAction === void 0 ? void 0 : confirmAction({
98
+ userIds: setOnChangeValue(multiple, selectedUserList),
99
+ users: setOnChangeValue(multiple, selectedUserList, true),
100
+ });
115
101
  setConfirmUserList(selectedUserList);
116
102
  setOpen(false);
117
103
  };
@@ -149,3 +135,34 @@ export default function UserTreeSelect(props) {
149
135
  }
150
136
  return platform === 'h5' ? (React.createElement(UserSelectH5, { ...restProps, ...props })) : (React.createElement(UserSelectPC, { ...restProps, ...props }));
151
137
  }
138
+ /**
139
+ * 设置onChange值
140
+ * @param multiple 是否是多选
141
+ * @param confirmUserList 已选用户列表
142
+ * @param isEventChange 是否是event事件
143
+ */
144
+ function setOnChangeValue(multiple, confirmUserList, isEventChange = false) {
145
+ var _a, _b;
146
+ if (isEventChange) {
147
+ return multiple
148
+ ? {
149
+ value: confirmUserList.length > 0
150
+ ? confirmUserList.map((e) => {
151
+ return e === null || e === void 0 ? void 0 : e.id;
152
+ })
153
+ : null,
154
+ data: confirmUserList,
155
+ }
156
+ : {
157
+ value: ((_a = confirmUserList[0]) === null || _a === void 0 ? void 0 : _a.id) || null,
158
+ data: confirmUserList[0] || null,
159
+ };
160
+ }
161
+ return multiple
162
+ ? confirmUserList.length > 0
163
+ ? confirmUserList.map((e) => {
164
+ return e === null || e === void 0 ? void 0 : e.id;
165
+ })
166
+ : null
167
+ : (_b = confirmUserList[0]) === null || _b === void 0 ? void 0 : _b.id;
168
+ }
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useImperativeHandle } from 'react';
2
2
  import { renderDecorator } from '../../../renderDecorator';
3
3
  import classNames from '../../../../../utils/classnames';
4
4
  import { defaultRequest } from '../../common/fetch-data-service';
@@ -6,7 +6,7 @@ import { ConfigProvider } from 'tea-component';
6
6
  import { ModalSelectH5 } from '../modal-select-h5';
7
7
  import { InputTags } from '../input-tags';
8
8
  export function UserTreeSelectH5({ id, className, style, label = '成员选择', labelVisible = true, placeholder = '请选择成员', disabled = false, layout = 'horizontal', requiredFlag = false, decorator, multiple = false, //是否多选
9
- pageNo, setPageNo, pageSize,
9
+ outerRef, pageNo, setPageNo, pageSize,
10
10
  // platform,
11
11
  request = defaultRequest, onCancel, onConfirm, selectedUserList, setSelectedUserList, confirmUserList, setConfirmUserList, open, setOpen, filterParams, treeData, error, }) {
12
12
  const cls = classNames({
@@ -26,6 +26,15 @@ request = defaultRequest, onCancel, onConfirm, selectedUserList, setSelectedUser
26
26
  errorStatus: false,
27
27
  errorMessage: null,
28
28
  });
29
+ useImperativeHandle(outerRef, () => {
30
+ return {
31
+ methods: {
32
+ open: () => {
33
+ setOpen(true);
34
+ },
35
+ },
36
+ };
37
+ }, [setOpen]);
29
38
  const onFocus = function () {
30
39
  setSelectedUserList(confirmUserList);
31
40
  if (!disabled)