@cloudbase/weda-ui 3.4.5 → 3.4.7
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.
- package/dist/configs/components/form/input.json +48 -2
- package/dist/configs/components/form/richText.json +2 -1
- package/dist/configs/components/form/uploader.json +62 -14
- package/dist/configs/components/grid/col.js +4 -1
- package/dist/configs/components/grid/grid.js +8 -3
- package/dist/configs/components/grid/row.js +51 -3
- package/dist/configs/components/repeater.js +4 -1
- package/dist/configs/components/table.json +1 -0
- package/dist/configs/components/wd-bubble.js +6 -0
- package/dist/configs/components/wd-button.js +6 -0
- package/dist/configs/components/wd-divider.js +7 -18
- package/dist/configs/components/wd-icon.js +7 -0
- package/dist/configs/components/wd-image.js +7 -0
- package/dist/configs/components/wd-link.js +7 -2
- package/dist/configs/components/wd-text.js +14 -6
- package/dist/configs/index.js +0 -2
- package/dist/docs/common/componentList.js +1 -1
- package/dist/web/actions/showModal/index.js +1 -1
- package/dist/web/components/calendar/index.js +2 -2
- package/dist/web/components/flow/components/index.js +0 -4
- package/dist/web/components/flow/frame/index.js +4 -3
- package/dist/web/components/flow/frame/types.js +11 -5
- package/dist/web/components/flow/frame/utils.js +60 -1
- package/dist/web/components/flow/modules/chart/Chart.js +2 -3
- package/dist/web/components/flow/modules/combination/index.js +1 -1
- package/dist/web/components/flow/modules/operations/components/button/index.js +11 -0
- package/dist/web/components/flow/modules/operations/components/button/style.css +5 -0
- package/dist/web/components/flow/modules/operations/components/index.js +6 -0
- package/dist/web/components/flow/modules/operations/components/popup/index.js +100 -0
- package/dist/web/components/flow/modules/operations/components/popup/style.css +154 -0
- package/dist/web/components/flow/modules/operations/components/popup/types.js +1 -0
- package/dist/web/components/flow/modules/operations/components/user-select/index.js +43 -0
- package/dist/web/components/flow/modules/operations/components/user-select/style.css +4 -0
- package/dist/web/components/flow/modules/operations/components/user-select/types.js +1 -0
- package/dist/web/components/flow/modules/operations/config/approval-form-config.js +140 -0
- package/dist/web/components/flow/modules/operations/config/control-config.js +218 -0
- package/dist/web/components/flow/modules/operations/config/index.js +2 -0
- package/dist/web/components/flow/modules/operations/config/types.js +1 -0
- package/dist/web/components/flow/modules/operations/control.js +26 -0
- package/dist/web/components/flow/modules/operations/controls-items/add-assignee-btn.js +33 -0
- package/dist/web/components/flow/modules/operations/controls-items/apply-cc-btn.js +12 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/comment/index.js +188 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/comment/style.css +51 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/drawer-form/index.js +64 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/drawer-form/types.js +1 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/drawer-form/view-model.js +83 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/field/index.js +16 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/field/style.css +56 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/index.js +47 -0
- package/dist/web/components/flow/modules/operations/controls-items/approval-drawer/style.css +60 -0
- package/dist/web/components/flow/modules/operations/controls-items/cancel-apply-btn.js +15 -0
- package/dist/web/components/flow/modules/operations/controls-items/check-list-popup/index.js +11 -0
- package/dist/web/components/flow/modules/operations/controls-items/check-list-popup/style.css +26 -0
- package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +98 -0
- package/dist/web/components/flow/modules/operations/controls-items/index.js +18 -0
- package/dist/web/components/flow/modules/operations/controls-items/initiation-btn.js +25 -0
- package/dist/web/components/flow/modules/operations/controls-items/revoke-modal/index.js +50 -0
- package/dist/web/components/flow/modules/operations/controls-items/revoke-modal/style.css +28 -0
- package/dist/web/components/flow/modules/operations/controls-items/roll-back-modal.js +104 -0
- package/dist/web/components/flow/modules/operations/controls-items/types.js +1 -0
- package/dist/web/components/flow/modules/operations/index.js +2 -0
- package/dist/web/components/flow/modules/operations/style.css +20 -0
- package/dist/web/components/flow/modules/operations/view-model.js +137 -0
- package/dist/web/components/flow/services/ideData/instance.js +2 -2
- package/dist/web/components/flow/services/ideData/pageDetail.js +1 -0
- package/dist/web/components/form/uploader/index.css +19 -0
- package/dist/web/components/form/uploader/index.js +21 -3
- package/dist/web/components/form/uploader/uploader.h5.js +14 -8
- package/dist/web/components/form/uploader/uploader.pc.js +29 -16
- package/dist/web/components/form/uploaderFile/index.css +5 -2
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +15 -12
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +11 -8
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +0 -1
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +1 -1
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +9 -5
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/user-select-h5.js +4 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +2 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +4 -2
- package/dist/web/components/grid/col.js +81 -18
- package/dist/web/components/grid/grid.js +1 -1
- package/dist/web/components/grid/row.js +4 -2
- package/dist/web/components/index.js +1 -1
- package/dist/web/components/listView/index.js +4 -3
- package/dist/web/components/lottery/index.js +122 -123
- package/dist/web/components/table/ExportFileModalByApi/index.js +1 -1
- package/dist/web/components/table/ImportFileModal/index.js +1 -1
- package/dist/web/components/table/ImportFileModalByApi/index.js +1 -1
- package/dist/web/components/wd-bubble/wd-bubble.js +11 -3
- package/dist/web/components/wd-button/wd-button.js +22 -13
- package/dist/web/components/wd-divider/wd-divider.js +10 -7
- package/dist/web/components/wd-icon/wd-icon.js +12 -3
- package/dist/web/components/wd-image/index.js +12 -5
- package/dist/web/components/wd-link/wd-link.js +11 -3
- package/dist/web/components/wd-text/wd-text.js +15 -3
- package/dist/web/utils/hooks/use-cloud-id-temp-url.js +7 -3
- package/dist/web/utils/platform.js +0 -1
- package/dist/web/utils/tool.js +11 -0
- package/dist/web/utils/widget-api/index.js +3 -0
- package/package.json +5 -3
- package/dist/configs/components/auth.json +0 -17
- package/dist/web/components/flow/components/FlowUserSelect/index.css +0 -116
- package/dist/web/components/flow/components/FlowUserSelect/index.js +0 -115
- package/dist/web/components/flow/components/HighlightTextarea/index.css +0 -42
- package/dist/web/components/flow/components/HighlightTextarea/index.js +0 -131
- package/dist/web/components/flow/components/UserSelectModel/UserSelect.js +0 -72
- package/dist/web/components/flow/components/UserSelectModel/UserSelectMobile.css +0 -8
- package/dist/web/components/flow/components/UserSelectModel/UserSelectMobile.js +0 -82
- package/dist/web/components/flow/components/UserSelectModel/index.js +0 -18
- package/dist/web/components/flow/components/WedaUserTransfer/index.css +0 -3
- package/dist/web/components/flow/components/WedaUserTransfer/index.js +0 -162
- package/dist/web/components/flow/modules/control/ApprovalDrawer.css +0 -144
- package/dist/web/components/flow/modules/control/ApprovalDrawer.js +0 -178
- package/dist/web/components/flow/modules/control/ApprovalPopup.css +0 -115
- package/dist/web/components/flow/modules/control/ApprovalPopup.js +0 -240
- package/dist/web/components/flow/modules/control/Control.css +0 -29
- package/dist/web/components/flow/modules/control/Control.js +0 -105
- package/dist/web/components/flow/modules/control/ControlMobile.css +0 -101
- package/dist/web/components/flow/modules/control/ControlMobile.js +0 -148
- package/dist/web/components/flow/modules/control/FlowTaskInfoModal.css +0 -3
- package/dist/web/components/flow/modules/control/FlowTaskInfoModal.js +0 -31
- package/dist/web/components/flow/modules/control/constants/index.js +0 -35
- package/dist/web/components/flow/modules/control/index.js +0 -15
- package/dist/web/components/flow/modules/control/provider/index.js +0 -17
- package/dist/web/components/flow/modules/control/provider/useControlModel.js +0 -252
- package/dist/web/components/flow/modules/control/provider/useMobileModel.js +0 -84
- package/dist/web/components/flow/modules/control/provider/useRevokeAndBackHook.js +0 -84
- package/dist/web/components/flow/modules/control/utils/ControlModelUtils.js +0 -57
- package/dist/web/components/flow/modules/control/utils/index.js +0 -3
- package/dist/web/components/flow/modules/control/utils/tools.js +0 -3
|
@@ -7,6 +7,7 @@ import { renderDecorator } from '../renderDecorator';
|
|
|
7
7
|
import isObjectEqual from '../../../utils/isObjectEqual';
|
|
8
8
|
import { emptyArray, emptyObject } from '../../../utils/constant';
|
|
9
9
|
import { useTempUrl } from '../../../utils/hooks/use-cloud-id-temp-url';
|
|
10
|
+
import { getParentForm } from '../../../utils/widget-api';
|
|
10
11
|
// 默认组件类前缀
|
|
11
12
|
const CLASS_PREFIX = 'weda-upload-file-pc';
|
|
12
13
|
// 上传状态字典
|
|
@@ -27,7 +28,8 @@ layout, id = '', style, labelVisible = true, label = '上传文件', requiredFla
|
|
|
27
28
|
// 组件属性
|
|
28
29
|
decorator, tips = '', btnTitle = '点击上传', maxUploadCount = 9, maxSize = 1024, single = true, defaultValue = emptyArray, // 组件默认初始化值
|
|
29
30
|
value = emptyArray, // 用于模型组件中 formily 的值管理
|
|
30
|
-
acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPath = 'weda-uploader', onChange = null, isEdit = true, }) {
|
|
31
|
+
acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPath = 'weda-uploader', onChange = null, isEdit = true, $node, }) {
|
|
32
|
+
var _a;
|
|
31
33
|
const [fileIDList, setfileIDList] = React.useState(isInIde() ? [] : filterStrList([].concat(defaultValue, value))); // 上传成功文件ID列表,fileID[]
|
|
32
34
|
const [fileList, setFileList] = React.useState([]); // 上传中的文件列表,file[],file为原始文件 + uuid属性
|
|
33
35
|
const [fileSizeObj, setFileSizeObj] = React.useState({}); // 管理上传文件大小 {uuid:size}
|
|
@@ -35,6 +37,7 @@ acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPa
|
|
|
35
37
|
const prevDefaultRef = React.useRef([]);
|
|
36
38
|
const fileRef = React.useRef(fileIDList);
|
|
37
39
|
const maxSizeLimit = maxSize > 500 ? 500 : maxSize;
|
|
40
|
+
const formType = ((_a = getParentForm($node)) === null || _a === void 0 ? void 0 : _a.formType) || 'create';
|
|
38
41
|
React.useMemo(() => {
|
|
39
42
|
//有有效默认值时不刷新,解决初次渲染默认值不显示问题
|
|
40
43
|
if (!isInIde() &&
|
|
@@ -156,11 +159,11 @@ acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPa
|
|
|
156
159
|
React.createElement(List.Item, null,
|
|
157
160
|
React.createElement("div", { className: `${CLASS_PREFIX}--item ${CLASS_PREFIX}--item-header` },
|
|
158
161
|
React.createElement("div", { className: `${CLASS_PREFIX}--item-title ${CLASS_PREFIX}--item-label` }, "\u6587\u4EF6\u540D"),
|
|
159
|
-
React.createElement("div", { className: `${CLASS_PREFIX}--item-size ${CLASS_PREFIX}--item-label` }, "\u5927\u5C0F"),
|
|
162
|
+
formType !== 'read' && (React.createElement("div", { className: `${CLASS_PREFIX}--item-size ${CLASS_PREFIX}--item-label` }, "\u5927\u5C0F")),
|
|
160
163
|
React.createElement("div", { className: `${CLASS_PREFIX}--item-status ${CLASS_PREFIX}--item-label` }, "\u72B6\u6001"),
|
|
161
164
|
React.createElement("div", { className: `${CLASS_PREFIX}--item-action` }, "\u64CD\u4F5C"))),
|
|
162
|
-
fileIDList.map((d) => (React.createElement(List.Item, { key: d }, React.createElement(TcbFileEcho, { disabled: disabled, fileID: d })))),
|
|
163
|
-
fileList.map((item) => (React.createElement(List.Item, { key: item === null || item === void 0 ? void 0 : item._uuid }, React.createElement(TcbFileUpload, { disabled: disabled, file: item })))),
|
|
165
|
+
fileIDList.map((d) => (React.createElement(List.Item, { key: d }, React.createElement(TcbFileEcho, { disabled: disabled, fileID: d, formType: formType })))),
|
|
166
|
+
fileList.map((item) => (React.createElement(List.Item, { key: item === null || item === void 0 ? void 0 : item._uuid }, React.createElement(TcbFileUpload, { disabled: disabled, file: item, formType: formType })))),
|
|
164
167
|
isEdit && fileIDList.length === 0 && fileList.length === 0 && (React.createElement(List.Item, { className: `${CLASS_PREFIX}--item-empty` },
|
|
165
168
|
React.createElement("div", { className: `${CLASS_PREFIX}--item` },
|
|
166
169
|
"\u70B9\u51FB\u4E0A\u65B9\u201C",
|
|
@@ -178,7 +181,7 @@ acceptTypes = emptyArray, downloadVisible = true, deleteVisible = true, uploadPa
|
|
|
178
181
|
/**
|
|
179
182
|
* 基于 FileID 回显文件表格行组件
|
|
180
183
|
*/
|
|
181
|
-
const TcbFileEcho = ({ fileID, disabled }) => {
|
|
184
|
+
const TcbFileEcho = ({ fileID, disabled, formType }) => {
|
|
182
185
|
const { fileSizeObj } = React.useContext(FileContext) || {};
|
|
183
186
|
const { data: src } = useTempUrl(fileID);
|
|
184
187
|
const title = React.useMemo(() => {
|
|
@@ -191,7 +194,7 @@ const TcbFileEcho = ({ fileID, disabled }) => {
|
|
|
191
194
|
}, [fileID]);
|
|
192
195
|
return (React.createElement("div", { className: `${CLASS_PREFIX}--item ${CLASS_PREFIX}--item-body` },
|
|
193
196
|
React.createElement("div", { className: `${CLASS_PREFIX}--item-title`, title: title }, cutFileTitle(title)),
|
|
194
|
-
React.createElement("div", { className: `${CLASS_PREFIX}--item-size` }, fileSizeObj[fileID] || '--'),
|
|
197
|
+
formType !== 'read' && (React.createElement("div", { className: `${CLASS_PREFIX}--item-size` }, fileSizeObj[fileID] || '--')),
|
|
195
198
|
React.createElement("div", { className: `${CLASS_PREFIX}--item-status` },
|
|
196
199
|
React.createElement(UploadFileStatus, null)),
|
|
197
200
|
React.createElement("div", { className: `${CLASS_PREFIX}--item-action` },
|
|
@@ -200,7 +203,7 @@ const TcbFileEcho = ({ fileID, disabled }) => {
|
|
|
200
203
|
/**
|
|
201
204
|
* 基于 File 上传文件过程表格行组件
|
|
202
205
|
*/
|
|
203
|
-
const TcbFileUpload = ({ file, disabled }) => {
|
|
206
|
+
const TcbFileUpload = ({ file, disabled, formType }) => {
|
|
204
207
|
const { uploadPath, onChange, events } = React.useContext(FileContext) || {};
|
|
205
208
|
const [percent, setPercent] = React.useState(0); // 上传进度
|
|
206
209
|
const [status, setStatus] = React.useState('0'); // 上传状态
|
|
@@ -240,7 +243,7 @@ const TcbFileUpload = ({ file, disabled }) => {
|
|
|
240
243
|
};
|
|
241
244
|
return (React.createElement("div", { className: `${CLASS_PREFIX}--item ${CLASS_PREFIX}--item-body` },
|
|
242
245
|
React.createElement("div", { className: `${CLASS_PREFIX}--item-title`, title: title }, cutFileTitle(title)),
|
|
243
|
-
React.createElement("div", { className: `${CLASS_PREFIX}--item-size` }, size),
|
|
246
|
+
formType !== 'read' && (React.createElement("div", { className: `${CLASS_PREFIX}--item-size` }, size)),
|
|
244
247
|
React.createElement("div", { className: `${CLASS_PREFIX}--item-status` },
|
|
245
248
|
React.createElement(UploadFileStatus, { status: status, percent: percent })),
|
|
246
249
|
React.createElement("div", { className: `${CLASS_PREFIX}--item-action` },
|
|
@@ -236,7 +236,6 @@ export async function getDepartByIds({ ids, request }) {
|
|
|
236
236
|
const dataRecord = res === null || res === void 0 ? void 0 : res.DataList.map((item) => JSON.parse((item === null || item === void 0 ? void 0 : item.DataRecord) || {}));
|
|
237
237
|
return { orgList: dealOrgData(dataRecord), orgIds };
|
|
238
238
|
}
|
|
239
|
-
// return [];
|
|
240
239
|
return res;
|
|
241
240
|
}
|
|
242
241
|
catch (error) {
|
|
@@ -39,7 +39,7 @@ export default function DepartTreeSelect(props) {
|
|
|
39
39
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
40
40
|
if (ids && ids.length !== 0 && !isInIde()) {
|
|
41
41
|
const { orgList } = await getDepartByIds({ ids, request });
|
|
42
|
-
setConfirmOrgList(orgList);
|
|
42
|
+
setConfirmOrgList(orgList || []);
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
setConfirmOrgList([]);
|
|
@@ -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, confirmAction, } = props;
|
|
14
|
+
const { events = emptyObject, defaultValue = emptyArray, confirmValue = '', defaultValueType = 'noneUser', onChange = null, multiple = false, request = defaultRequest, where, confirmAction, closeAction, } = props;
|
|
15
15
|
const platform = usePlatform();
|
|
16
16
|
const [errInfo, setErrInfo] = useState({
|
|
17
17
|
errorStatus: false,
|
|
@@ -92,12 +92,14 @@ export default function UserTreeSelect(props) {
|
|
|
92
92
|
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, setOnChangeValue(multiple, confirmUserList, true));
|
|
93
93
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
94
|
}, [confirmUserList]);
|
|
95
|
+
/** 点击确认时获取所选用户,调用confirmAction,将所选用户向外传出 */
|
|
96
|
+
const onConfirmSelectUser = (selectedUserList) => {
|
|
97
|
+
const selectedUser = setOnChangeValue(multiple, selectedUserList, true);
|
|
98
|
+
confirmAction === null || confirmAction === void 0 ? void 0 : confirmAction(selectedUser);
|
|
99
|
+
};
|
|
95
100
|
//确定 关闭弹窗
|
|
96
101
|
const onConfirm = () => {
|
|
97
|
-
|
|
98
|
-
userIds: setOnChangeValue(multiple, selectedUserList),
|
|
99
|
-
users: setOnChangeValue(multiple, selectedUserList, true),
|
|
100
|
-
});
|
|
102
|
+
onConfirmSelectUser(selectedUserList);
|
|
101
103
|
setConfirmUserList(selectedUserList);
|
|
102
104
|
setOpen(false);
|
|
103
105
|
};
|
|
@@ -106,6 +108,7 @@ export default function UserTreeSelect(props) {
|
|
|
106
108
|
setSelectedUserIds([]);
|
|
107
109
|
setSelectedUserList([]);
|
|
108
110
|
setOpen(false);
|
|
111
|
+
closeAction === null || closeAction === void 0 ? void 0 : closeAction();
|
|
109
112
|
};
|
|
110
113
|
const restProps = {
|
|
111
114
|
errInfo,
|
|
@@ -126,6 +129,7 @@ export default function UserTreeSelect(props) {
|
|
|
126
129
|
filterParams,
|
|
127
130
|
treeData,
|
|
128
131
|
error,
|
|
132
|
+
onConfirmSelectUser,
|
|
129
133
|
};
|
|
130
134
|
if ((props === null || props === void 0 ? void 0 : props.showType) === 'pc') {
|
|
131
135
|
return React.createElement(UserSelectPC, { ...restProps, ...props });
|
|
@@ -8,7 +8,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
9
|
outerRef, pageNo, setPageNo, pageSize,
|
|
10
10
|
// platform,
|
|
11
|
-
request = defaultRequest, onCancel, onConfirm, selectedUserList, setSelectedUserList, confirmUserList, setConfirmUserList, open, setOpen, filterParams, treeData, error, }) {
|
|
11
|
+
request = defaultRequest, onCancel, onConfirm, selectedUserList, setSelectedUserList, confirmUserList, setConfirmUserList, open, setOpen, filterParams, treeData, error, onConfirmSelectUser, }) {
|
|
12
12
|
const cls = classNames({
|
|
13
13
|
'weda-ui': true,
|
|
14
14
|
'weda-select-user-dept': true,
|
|
@@ -43,7 +43,9 @@ request = defaultRequest, onCancel, onConfirm, selectedUserList, setSelectedUser
|
|
|
43
43
|
return renderDecorator(React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
|
|
44
44
|
React.createElement("div", { className: subCls, onClick: onFocus },
|
|
45
45
|
React.createElement(InputTags, { tagsList: confirmUserList, placeholder: placeholder, multiple: multiple, errInfo: errorInfo, disabled: disabled, platForm: 'h5', onClose: (e, item) => {
|
|
46
|
-
|
|
46
|
+
const currentConfirmUserList = confirmUserList.filter((l) => (l === null || l === void 0 ? void 0 : l.id) !== (item === null || item === void 0 ? void 0 : item.id));
|
|
47
|
+
setConfirmUserList(currentConfirmUserList);
|
|
48
|
+
onConfirmSelectUser(currentConfirmUserList);
|
|
47
49
|
e.stopPropagation();
|
|
48
50
|
} })),
|
|
49
51
|
React.createElement(ModalSelectH5, { open: open, request: request, treeData: treeData, originalOrgData: originalOrgData, setOriginalOrgData: setOriginalOrgData, multiple: multiple, errorInfo: errorInfo, selectedUserList: selectedUserList, setSelectedUserList: setSelectedUserList, confirmUserList: confirmUserList, onClose: onCancel, onConfirm: onConfirm, setErrorInfo: setErrorInfo, filterParams: filterParams, pageNo: pageNo, setPageNo: setPageNo, pageSize: pageSize, treeDataError: error })))({
|
|
@@ -8,7 +8,7 @@ import { SelectedList } from '../selected-list';
|
|
|
8
8
|
import { fetchSearchUser } from '../../common/fetch-data-service';
|
|
9
9
|
import debounce from '../../../../../utils/debounce';
|
|
10
10
|
import '../index.css';
|
|
11
|
-
export const UserModel = ({ open,
|
|
11
|
+
export const UserModel = ({ open, onCancel, onConfirm, treeData, treeDataError, filterParams, }) => {
|
|
12
12
|
var _a;
|
|
13
13
|
const { selectedUserList, setSelectedUserIds, request, selectedUserIds, setSelectedUserList, multiple, setPageNo, confirmUserList, } = React.useContext(UserOrgContext) || {};
|
|
14
14
|
const [selectedOrgId, setSelectedOrgId] = useState(null);
|
|
@@ -49,7 +49,7 @@ export const UserModel = ({ open, setOpen, onCancel, onConfirm, treeData, treeDa
|
|
|
49
49
|
setErrInfo({ errorStatus: true, errorMessage: e });
|
|
50
50
|
}
|
|
51
51
|
}, 500);
|
|
52
|
-
return (React.createElement(Modal, { visible: open, caption: "\u9009\u62E9\u6210\u5458", onClose: () =>
|
|
52
|
+
return (React.createElement(Modal, { visible: open, caption: "\u9009\u62E9\u6210\u5458", onClose: () => onCancel(null), className: "weda-ui weda-ui-user-select-modal" },
|
|
53
53
|
React.createElement(Modal.Body, null,
|
|
54
54
|
React.createElement("div", { className: "weda-ui-user-select-container" },
|
|
55
55
|
React.createElement(ModalSearch, { searchList: searchUserList, errInfo: errInfo, loading: loading, keyWords: keyWords, selectedList: selectedUserList, multiple: multiple, setSelectedList: setSelectedUserList, selectedIds: selectedUserIds, filterParams: filterParams, onSearch: (key) => onSearch(key), onReset: () => setSearchUserList([]) }),
|
|
@@ -10,7 +10,7 @@ export const UserOrgContext = React.createContext(null);
|
|
|
10
10
|
export function UserSelectPC({ id, className, style, label = '人员选择', labelVisible = true, //标题显隐
|
|
11
11
|
placeholder = '请选择人员', disabled = false, layout = 'horizontal', requiredFlag = false, size = 'l', multiple = false, //多选
|
|
12
12
|
outerRef, request = defaultRequest, //接口请求
|
|
13
|
-
decorator, onCancel, onConfirm, errInfo, open, setOpen, selectedUserList, setSelectedUserList, confirmUserList, setConfirmUserList, selectedUserIds, setSelectedUserIds, pageNo, setPageNo, pageSize, filterParams, treeData, error, }) {
|
|
13
|
+
decorator, onCancel, onConfirm, errInfo, open, setOpen, selectedUserList, setSelectedUserList, confirmUserList, setConfirmUserList, selectedUserIds, setSelectedUserIds, pageNo, setPageNo, pageSize, filterParams, treeData, error, onConfirmSelectUser, }) {
|
|
14
14
|
// 外层组件类
|
|
15
15
|
const cls = classNames({
|
|
16
16
|
'weda-ui': true,
|
|
@@ -48,7 +48,9 @@ decorator, onCancel, onConfirm, errInfo, open, setOpen, selectedUserList, setSel
|
|
|
48
48
|
setSelectedUserList(confirmUserList);
|
|
49
49
|
setOpen(open);
|
|
50
50
|
}, appearance: 'button', button: React.createElement(InputTags, { tagsList: confirmUserList, placeholder: placeholder, multiple: multiple, errInfo: errInfo, disabled: disabled, onClose: (e, item) => {
|
|
51
|
-
|
|
51
|
+
const currentConfirmUserList = confirmUserList.filter((l) => (l === null || l === void 0 ? void 0 : l.id) !== (item === null || item === void 0 ? void 0 : item.id));
|
|
52
|
+
setConfirmUserList(currentConfirmUserList);
|
|
53
|
+
onConfirmSelectUser(currentConfirmUserList);
|
|
52
54
|
e.stopPropagation();
|
|
53
55
|
} }), overlayClassName: 'weda-ui-user-selected-overlay-hidden', style: { width: '100%' } },
|
|
54
56
|
React.createElement(UserModel, { open: open, setOpen: setOpen, onConfirm: onConfirm, onCancel: onCancel, treeData: treeData || [], treeDataError: error, filterParams: filterParams })))))({
|
|
@@ -1,33 +1,96 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import classNames from '../../utils/classnames';
|
|
3
|
+
import { usePlatform } from '../../utils/platform';
|
|
3
4
|
import './_utils.css';
|
|
5
|
+
// 和编辑器对应
|
|
6
|
+
const manualCheckedType = {
|
|
7
|
+
twelveAdjust: 'twelve-adjust',
|
|
8
|
+
exactAdjust: 'exact-adjust',
|
|
9
|
+
};
|
|
4
10
|
const numberRegex = /^\d{1,2}$/;
|
|
5
11
|
export default function Col(props) {
|
|
6
12
|
const { className: userClassName, id, style, alignSelf, widthType, lgWidthType, children, events, } = props;
|
|
7
|
-
const
|
|
13
|
+
const platform = usePlatform();
|
|
14
|
+
const classNameStyle = useMemo(() => {
|
|
8
15
|
const clsxObj = {
|
|
9
16
|
'wd-grid-col': true,
|
|
10
17
|
[`wd-g-align-self-${alignSelf}`]: alignSelf,
|
|
11
18
|
[userClassName]: userClassName,
|
|
12
19
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
let exactStyle = style;
|
|
21
|
+
if (platform === 'h5') {
|
|
22
|
+
// 移动端是否是12列手动调节
|
|
23
|
+
let isTwelveAdjust = true;
|
|
24
|
+
let twelveAdjustWidthType = widthType;
|
|
25
|
+
if (typeof widthType == 'object') {
|
|
26
|
+
twelveAdjustWidthType = widthType.value;
|
|
27
|
+
isTwelveAdjust = widthType.type === manualCheckedType.twelveAdjust;
|
|
28
|
+
}
|
|
29
|
+
if (isTwelveAdjust) {
|
|
30
|
+
clsxObj['wd-grid-col'] = true;
|
|
31
|
+
if (twelveAdjustWidthType === 'fit-content') {
|
|
32
|
+
// 适应内容
|
|
33
|
+
clsxObj['wd-grid-col-auto'] = true;
|
|
34
|
+
}
|
|
35
|
+
else if (twelveAdjustWidthType === 'auto-fill' && (style === null || style === void 0 ? void 0 : style.width)) {
|
|
36
|
+
// 自动填充,如果有宽,则设置宽生效
|
|
37
|
+
clsxObj['wd-grid-col'] = false;
|
|
38
|
+
exactStyle = style;
|
|
39
|
+
}
|
|
40
|
+
else if (
|
|
41
|
+
// 12列调节
|
|
42
|
+
typeof twelveAdjustWidthType === 'number' ||
|
|
43
|
+
(typeof twelveAdjustWidthType === 'string' &&
|
|
44
|
+
numberRegex.test(twelveAdjustWidthType))) {
|
|
45
|
+
clsxObj[`wd-grid-col-${twelveAdjustWidthType}`] = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// 像素精确调节
|
|
50
|
+
clsxObj['wd-grid-col'] = false;
|
|
51
|
+
exactStyle = { ...style, width: twelveAdjustWidthType };
|
|
52
|
+
}
|
|
26
53
|
}
|
|
27
54
|
else {
|
|
28
|
-
|
|
55
|
+
// pc 端是否是12列手动调节
|
|
56
|
+
let isTwelveAdjustLg = true;
|
|
57
|
+
let twelveAdjustWidthTypeLg = lgWidthType;
|
|
58
|
+
if (typeof lgWidthType == 'object') {
|
|
59
|
+
twelveAdjustWidthTypeLg = lgWidthType.value;
|
|
60
|
+
isTwelveAdjustLg = lgWidthType.type === manualCheckedType.twelveAdjust;
|
|
61
|
+
}
|
|
62
|
+
if (isTwelveAdjustLg) {
|
|
63
|
+
clsxObj['wd-grid-col'] = true;
|
|
64
|
+
if (twelveAdjustWidthTypeLg === 'fit-content') {
|
|
65
|
+
// 适应内容
|
|
66
|
+
clsxObj['wd-grid-col-lg-auto'] = true;
|
|
67
|
+
}
|
|
68
|
+
else if (twelveAdjustWidthTypeLg === 'auto-fill' && (style === null || style === void 0 ? void 0 : style.width)) {
|
|
69
|
+
// 自动填充,如果有宽,则设置宽生效
|
|
70
|
+
clsxObj['wd-grid-col'] = false;
|
|
71
|
+
exactStyle = style;
|
|
72
|
+
}
|
|
73
|
+
else if (
|
|
74
|
+
// 12列调节
|
|
75
|
+
typeof twelveAdjustWidthTypeLg === 'number' ||
|
|
76
|
+
(typeof twelveAdjustWidthTypeLg === 'string' &&
|
|
77
|
+
numberRegex.test(twelveAdjustWidthTypeLg))) {
|
|
78
|
+
clsxObj[`wd-grid-col-lg-${twelveAdjustWidthTypeLg}`] = true;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
clsxObj['wd-grid-col-lg'] = true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// 像素精确调节
|
|
86
|
+
clsxObj['wd-grid-col'] = false;
|
|
87
|
+
exactStyle = { ...style, width: twelveAdjustWidthTypeLg };
|
|
88
|
+
}
|
|
29
89
|
}
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
90
|
+
return {
|
|
91
|
+
className: classNames(clsxObj),
|
|
92
|
+
style: exactStyle,
|
|
93
|
+
};
|
|
94
|
+
}, [alignSelf, lgWidthType, userClassName, widthType, style, platform]);
|
|
95
|
+
return (React.createElement("div", { className: classNameStyle.className, id: id, style: classNameStyle.style, onClick: (e) => { var _a; return (_a = events === null || events === void 0 ? void 0 : events.tap) === null || _a === void 0 ? void 0 : _a.call(events, {}, { originEvent: e }); }, "data-role": "wd-col" }, children));
|
|
33
96
|
}
|
|
@@ -10,7 +10,7 @@ export default function Grid(props) {
|
|
|
10
10
|
'wd-grid': true,
|
|
11
11
|
[`wd-grid-gx-${gutterX}`]: !isNil(gutterX),
|
|
12
12
|
// 产品要求gutterX 同时间决定row一个换行的间距和 row之间的间距
|
|
13
|
-
[`wd-grid-gy-${gutterY}`]: !isNil(gutterY),
|
|
13
|
+
// [`wd-grid-gy-${gutterY}`]: !isNil(gutterY),
|
|
14
14
|
[`wd-grid-grb-${gutterY}`]: !isNil(gutterY),
|
|
15
15
|
[userClassName]: userClassName,
|
|
16
16
|
});
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import classNames from '../../utils/classnames';
|
|
3
|
+
import { isNil } from '../../utils/lodash';
|
|
3
4
|
import './_utils.css';
|
|
4
5
|
export default function Row(props) {
|
|
5
|
-
const { className: userClassName, id, style, children, events, alignItems, } = props;
|
|
6
|
+
const { className: userClassName, id, style, children, events, alignItems, gutterX, } = props;
|
|
6
7
|
const className = useMemo(() => {
|
|
7
8
|
return classNames({
|
|
8
9
|
'wd-grid-row': true,
|
|
10
|
+
[`wd-grid-gx-${gutterX}`]: gutterX != -1 && !isNil(gutterX),
|
|
9
11
|
[`wd-g-align-items-${alignItems}`]: alignItems,
|
|
10
12
|
[userClassName]: userClassName,
|
|
11
13
|
});
|
|
12
|
-
}, [alignItems, userClassName]);
|
|
14
|
+
}, [alignItems, userClassName, gutterX]);
|
|
13
15
|
return (React.createElement("div", { className: className, id: id, style: style, onClick: (e) => { var _a; return (_a = events === null || events === void 0 ? void 0 : events.tap) === null || _a === void 0 ? void 0 : _a.call(events, {}, { originEvent: e }); }, "data-role": "wd-row" }, children));
|
|
14
16
|
}
|
|
@@ -103,7 +103,7 @@ export const ModelFlowChart = loadable(() => import('./flow/modules/chart'), {
|
|
|
103
103
|
export const ModelFlow = loadable(() => import('./flow/modules/combination'), {
|
|
104
104
|
fallback,
|
|
105
105
|
});
|
|
106
|
-
export const ModelFlowControl = loadable(() => import('./flow/modules/
|
|
106
|
+
export const ModelFlowControl = loadable(() => import('./flow/modules/operations'), { fallback });
|
|
107
107
|
export const ModelFlowBasic = loadable(() => import('./flow/modules/basic'), {
|
|
108
108
|
fallback,
|
|
109
109
|
});
|
|
@@ -181,8 +181,9 @@ export default React.forwardRef(function ListView(props, ref) {
|
|
|
181
181
|
*/
|
|
182
182
|
const onEvents = useCallback((data, datasource) => {
|
|
183
183
|
var _a, _b;
|
|
184
|
-
const
|
|
185
|
-
const
|
|
184
|
+
const isDataViewApis = !isRecords && !isModel;
|
|
185
|
+
const fetchRecords = [].concat(isDataViewApis ? data : (data === null || data === void 0 ? void 0 : data.records) || []);
|
|
186
|
+
const total = isDataViewApis ? 0 : Number(data === null || data === void 0 ? void 0 : data.total) || 0;
|
|
186
187
|
if (['loadMoreButton', 'bottomLoad'].includes(paramRef.current.pagination)) {
|
|
187
188
|
dataRef.current = {
|
|
188
189
|
total,
|
|
@@ -196,7 +197,7 @@ export default React.forwardRef(function ListView(props, ref) {
|
|
|
196
197
|
data: beforeDataChange(dataRef.current.records || []),
|
|
197
198
|
state: getContextState(),
|
|
198
199
|
});
|
|
199
|
-
if (total === 0) {
|
|
200
|
+
if (total === 0 && !isDataViewApis) {
|
|
200
201
|
setStatus('empty');
|
|
201
202
|
(_b = events === null || events === void 0 ? void 0 : events.queryEmpty) === null || _b === void 0 ? void 0 : _b.call(events, {
|
|
202
203
|
datasource,
|