@cloudbase/weda-ui 3.4.9-alpha.1024 → 3.4.10
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/README.md +65 -30
- package/dist/configs/components/chart/bar.json +1 -1
- package/dist/configs/components/chart/line.js +1 -1
- package/dist/configs/components/chart/pie.json +1 -1
- package/dist/configs/components/customer-service.js +0 -2
- package/dist/configs/components/flowgraph.json +22 -0
- package/dist/configs/components/form-checkbox.js +1 -0
- package/dist/configs/components/form-date.js +1 -0
- package/dist/configs/components/form-depart-tree-select.js +2 -4
- package/dist/configs/components/form-email.js +1 -0
- package/dist/configs/components/form-image-uploader.js +1 -0
- package/dist/configs/components/form-input.js +1 -2
- package/dist/configs/components/form-location.js +2 -2
- package/dist/configs/components/form-multi-region.js +1 -0
- package/dist/configs/components/form-phone.js +1 -0
- package/dist/configs/components/form-radio.js +1 -0
- package/dist/configs/components/form-region.js +1 -0
- package/dist/configs/components/form-rich-text.js +1 -0
- package/dist/configs/components/form-select.js +1 -0
- package/dist/configs/components/form-switch.js +1 -0
- package/dist/configs/components/form-text-area.js +1 -0
- package/dist/configs/components/form-time.js +1 -0
- package/dist/configs/components/form-upload-file.js +1 -0
- package/dist/configs/components/form-url.js +1 -0
- package/dist/configs/components/form-user-tree-select.js +3 -4
- package/dist/configs/components/modal.js +0 -2
- package/dist/configs/components/navigationBar.json +1 -3
- package/dist/configs/components/wd-button.js +2 -2
- package/dist/configs/components/wd-icon.js +2 -2
- package/dist/configs/components/wd-link.js +2 -2
- package/dist/configs/components/wd-table.js +1 -1
- package/dist/configs/index.js +2 -0
- package/dist/docs/common/components/properties-view.js +3 -6
- package/dist/docs/common/tableView.js +7 -10
- package/dist/style/index.scss +1 -1
- package/dist/web/components/chart/common/core/eChartLine.js +12 -1
- package/dist/web/components/chart/common/data-transform.js +13 -9
- package/dist/web/components/chart/line/index.old.js +2 -1
- package/dist/web/components/flow/common/request.js +3 -3
- package/dist/web/components/flow/modules/chart/index.js +42 -3
- package/dist/web/components/flow/modules/chart/preview-data.js +88 -0
- package/dist/web/components/flow-graph/constants.js +28 -0
- package/dist/web/components/flow-graph/graph.js +267 -0
- package/dist/web/components/flow-graph/index.js +2 -0
- package/dist/web/components/flow-graph/style.css +109 -0
- package/dist/web/components/flow-graph/types.js +1 -0
- package/dist/web/components/form/select/dropdown-select/index.css +4 -0
- package/dist/web/components/form/select/dropdown-select/index.js +4 -1
- package/dist/web/components/form/select/request.js +9 -9
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +44 -490
- package/dist/web/components/form/userOrgSelect/common/utils.js +14 -58
- package/dist/web/components/form/userOrgSelect/component/OrgPaths.js +12 -0
- package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.js +1 -3
- package/dist/web/components/form/userOrgSelect/component/depart-select/departTreeSelect.h5.js +35 -56
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +46 -24
- package/dist/web/components/form/userOrgSelect/component/depart-select/org-modal-pc.js +11 -20
- package/dist/web/components/form/userOrgSelect/component/modal-select-h5.js +57 -120
- package/dist/web/components/form/userOrgSelect/component/org-tree.js +8 -24
- package/dist/web/components/form/userOrgSelect/component/user-org-list.js +4 -4
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +42 -33
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/user-select-h5.js +2 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/model-user-list.js +20 -51
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/org-tree.js +2 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +4 -17
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +4 -6
- package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +7 -3
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +68 -158
- package/dist/web/components/form/userOrgSelect/hooks/use-depart-data.js +3 -109
- package/dist/web/components/form-input-hooks/index.js +5 -2
- package/dist/web/components/index.js +1 -0
- package/dist/web/components/swiper/index.js +1 -2
- package/dist/web/components/table/BaseTable.js +1 -1
- package/dist/web/components/tabs/tabs.pc.js +10 -9
- package/dist/web/components/wd-form/index.js +28 -14
- package/dist/web/components/wd-table/components/ExportFileModalByApi/index.js +1 -1
- package/dist/web/components/wd-table/components/FieldRender/index.js +13 -2
- package/dist/web/components/wd-table/hooks/useChooseList.js +3 -5
- package/dist/web/components/wd-table/hooks/useTableData.js +1 -7
- package/dist/web/components/wd-table/utils/index.js +22 -3
- package/dist/web/components/wd-table/wd-table.js +9 -3
- package/dist/web/utils/datasource.js +3 -1
- package/package.json +2 -3
|
@@ -11,7 +11,7 @@ export const UserOrgContext = React.createContext(null);
|
|
|
11
11
|
export function UserSelectPC({ id, className, style, label = '人员选择', labelVisible = true, //标题显隐
|
|
12
12
|
placeholder = '请选择人员', disabled = false, layout = 'horizontal', requiredFlag = false, size = 'l', multiple = false, //多选
|
|
13
13
|
outerRef, request = defaultRequest, //接口请求
|
|
14
|
-
decorator, onCancel, onConfirm, errInfo, open, setOpen, selectedOrgId, setSelectedOrgId, selectedUserList, setSelectedUserList, confirmUserList, setConfirmUserList, selectedUserIds, setSelectedUserIds, pageNo, setPageNo, pageSize, filterParams, treeData,
|
|
14
|
+
decorator, onCancel, onConfirm, errInfo, open, setOpen, selectedOrgId, setSelectedOrgId, selectedUserList, setSelectedUserList, confirmUserList, setConfirmUserList, selectedUserIds, setSelectedUserIds, pageNo, setPageNo, pageSize, filterParams, treeData, error, onConfirmSelectUser, secondDisplay, naked, containerClass, triggerElement, }) {
|
|
15
15
|
// 外层组件类
|
|
16
16
|
const cls = classNames({
|
|
17
17
|
'weda-ui': true,
|
|
@@ -44,18 +44,16 @@ decorator, onCancel, onConfirm, errInfo, open, setOpen, selectedOrgId, setSelect
|
|
|
44
44
|
pageNo,
|
|
45
45
|
setPageNo,
|
|
46
46
|
pageSize,
|
|
47
|
-
|
|
48
|
-
treeData,
|
|
49
|
-
}, children: _jsx(Dropdown, { "data-testid": "userSelectDropdown", className: classNames(selectInputCls, `size-${size}`), disabled: disabled, open: open, onOpenChange: (open) => {
|
|
47
|
+
}, children: _jsx(Dropdown, { "data-testid": "userSelectDropdown", className: classNames(selectInputCls, `size-${size}`, containerClass), disabled: disabled, open: open, onOpenChange: (open) => {
|
|
50
48
|
if (open)
|
|
51
49
|
setSelectedUserList(confirmUserList);
|
|
52
50
|
setOpen(open);
|
|
53
|
-
}, appearance: 'button', button: _jsx(InputTags, { tagsList: confirmUserList, placeholder: placeholder, multiple: multiple, errInfo: errInfo, disabled: disabled, onClose: (e, item) => {
|
|
51
|
+
}, appearance: 'button', button: triggerElement || (_jsx(InputTags, { tagsList: confirmUserList, placeholder: placeholder, multiple: multiple, errInfo: errInfo, disabled: disabled, onClose: (e, item) => {
|
|
54
52
|
const currentConfirmUserList = confirmUserList.filter((l) => (l === null || l === void 0 ? void 0 : l.id) !== (item === null || item === void 0 ? void 0 : item.id));
|
|
55
53
|
setConfirmUserList(currentConfirmUserList);
|
|
56
54
|
onConfirmSelectUser(currentConfirmUserList);
|
|
57
55
|
e.stopPropagation();
|
|
58
|
-
} }), overlayClassName: 'weda-ui-user-selected-overlay-hidden', style: { width: '100%' }, children: _jsx(UserModel, { open: open, setOpen: setOpen, onConfirm: onConfirm, onCancel: onCancel, treeData: treeData || [], treeDataError: error, filterParams: filterParams, secondDisplay: secondDisplay }) }) }) }))({
|
|
56
|
+
} })), overlayClassName: 'weda-ui-user-selected-overlay-hidden', style: { width: '100%' }, children: _jsx(UserModel, { open: open, setOpen: setOpen, onConfirm: onConfirm, onCancel: onCancel, treeData: treeData || [], treeDataError: error, filterParams: filterParams, secondDisplay: secondDisplay }) }) }) }), naked ? null : undefined)({
|
|
59
57
|
id,
|
|
60
58
|
className: cls,
|
|
61
59
|
style,
|
|
@@ -986,11 +986,13 @@
|
|
|
986
986
|
|
|
987
987
|
.weda-select-user-dept .weda-select-user-dept__result-list,
|
|
988
988
|
.weda-select-user-dept__dialog .weda-select-user-dept__result-list {
|
|
989
|
-
flex: 1 1 0px;
|
|
989
|
+
/* flex: 1 1 0px;
|
|
990
990
|
display: flex;
|
|
991
991
|
align-items: center;
|
|
992
|
-
|
|
992
|
+
overflow: hidden; */
|
|
993
993
|
overflow-x: scroll;
|
|
994
|
+
width: 100%;
|
|
995
|
+
white-space: nowrap;
|
|
994
996
|
}
|
|
995
997
|
|
|
996
998
|
.weda-select-user-dept .weda-select-user-dept__result-list .wedatea2td-tag,
|
|
@@ -1037,13 +1039,15 @@
|
|
|
1037
1039
|
.weda-select-user-dept__dialog
|
|
1038
1040
|
.weda-select-user-dept__result-list
|
|
1039
1041
|
.weda-select-user-dept__result-item {
|
|
1040
|
-
position: relative;
|
|
1041
1042
|
background: #e3e6eb;
|
|
1042
1043
|
border-radius: 3px;
|
|
1043
1044
|
padding: 2px 30px 2px 8px;
|
|
1044
1045
|
font-size: 12px;
|
|
1045
1046
|
line-height: 20px;
|
|
1046
1047
|
color: rgba(0, 0, 0, 0.9);
|
|
1048
|
+
position: relative;
|
|
1049
|
+
display: inline-block;
|
|
1050
|
+
margin-left: 6px;
|
|
1047
1051
|
}
|
|
1048
1052
|
|
|
1049
1053
|
.weda-select-user-dept__dialog
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState } from 'react';
|
|
2
3
|
import { renderDecorator } from '../../renderDecorator';
|
|
3
4
|
import { IconFont } from 'tdesign-icons-react';
|
|
4
5
|
import classNames from '../../../../utils/classnames';
|
|
5
|
-
import {
|
|
6
|
-
import { dealOrgDataH5 } from '../common/utils';
|
|
6
|
+
import { fetchSearchOrg, getNodeFromTreeByCode } from '../common/utils';
|
|
7
7
|
import { Modal, Button, ConfigProvider, Radio, Status, Bubble, } from 'tea-component';
|
|
8
8
|
import { ModalSearchH5 } from '../component/modal-search-h5';
|
|
9
9
|
import { LoadingStatus, ErrorStatus } from '../component/error-tips';
|
|
10
|
-
|
|
10
|
+
import debounce from '../../../../utils/debounce';
|
|
11
|
+
export function DepartTreeSelectH5({ id, className, style, label = '部门选择', labelVisible = true, name = 'formDepartTreeSelect', placeholder = '请选择部门', disabled = false, layout = 'horizontal', requiredFlag = false, size = 'l', decorator, multiple = true, focus: autoFocus = false, confirmOrgList, setConfirmOrgList, selectedOrgList, setSelectedOrgList, errorInfo, setErrorInfo, treeData, }) {
|
|
11
12
|
var _a;
|
|
12
13
|
const cls = classNames({
|
|
13
14
|
'weda-ui': true,
|
|
@@ -22,27 +23,12 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
22
23
|
});
|
|
23
24
|
const [visible, setVisible] = React.useState(false);
|
|
24
25
|
const [isSearch, setIsSearch] = useState(false);
|
|
25
|
-
const [
|
|
26
|
-
|
|
27
|
-
const [
|
|
26
|
+
const [showTreeData, setShowTreeData] = useState([]);
|
|
27
|
+
// currentItem:到达当前页面是从currentItem部门点击来的
|
|
28
|
+
const [currentItem, setCurrentItem] = useState(null);
|
|
28
29
|
const [searchValue, setSearchValue] = useState('');
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
31
|
const [loading, setLoading] = useState({ id: null, status: false });
|
|
30
|
-
const [titleText, setTitleText] = useState('');
|
|
31
|
-
// 初始化数据
|
|
32
|
-
const initOrgsData = useCallback(async () => {
|
|
33
|
-
try {
|
|
34
|
-
setTitleText('选择部门');
|
|
35
|
-
const resData = (await request('InitRootOrgs', {})) || [];
|
|
36
|
-
const data = dealOrgDataH5(resData);
|
|
37
|
-
//初始化数据时,默认返回第一层组织结构
|
|
38
|
-
setCount(1);
|
|
39
|
-
setOrgsTreeData(data);
|
|
40
|
-
setOriginalOrgData([{ index: 1, treeData: data, title: '选择部门' }]);
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
44
|
-
}
|
|
45
|
-
}, [request]);
|
|
46
32
|
const handleFocus = (value) => {
|
|
47
33
|
setIsSearch(value);
|
|
48
34
|
};
|
|
@@ -50,169 +36,93 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
50
36
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
51
37
|
handleFocus(false);
|
|
52
38
|
setSearchValue('');
|
|
53
|
-
|
|
39
|
+
setShowTreeData(treeData);
|
|
54
40
|
};
|
|
55
|
-
const onSearch =
|
|
56
|
-
var _a;
|
|
41
|
+
const onSearch = debounce((key) => {
|
|
57
42
|
try {
|
|
58
43
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const { Orgs = [] } = await request('SearchByCondition', {
|
|
63
|
-
KeyWords: sValue.trim(),
|
|
64
|
-
SearchCondition: {
|
|
65
|
-
SearchType: 'SearchByOrg',
|
|
66
|
-
NeedUser: false,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
setOrgsTreeData(dealOrgDataH5(Orgs));
|
|
44
|
+
if (key && key.length > 0) {
|
|
45
|
+
const res = fetchSearchOrg({ key, treeData });
|
|
46
|
+
setShowTreeData(res);
|
|
70
47
|
}
|
|
71
48
|
else {
|
|
72
|
-
|
|
73
|
-
initOrgsData();
|
|
49
|
+
setShowTreeData(treeData);
|
|
74
50
|
}
|
|
75
51
|
}
|
|
76
52
|
catch (e) {
|
|
77
53
|
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
78
54
|
}
|
|
79
|
-
};
|
|
55
|
+
}, 500);
|
|
80
56
|
const onFocus = function () {
|
|
81
57
|
setSearchValue('');
|
|
82
|
-
initOrgsData();
|
|
83
58
|
setVisible(true);
|
|
59
|
+
setShowTreeData(treeData);
|
|
84
60
|
};
|
|
85
61
|
const onClose = () => {
|
|
86
62
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
87
63
|
setVisible(false);
|
|
88
|
-
|
|
89
|
-
initOrgsData();
|
|
64
|
+
setShowTreeData(treeData);
|
|
90
65
|
};
|
|
91
66
|
const onConfirm = (selectedOrgList = []) => {
|
|
92
67
|
setConfirmOrgList(selectedOrgList);
|
|
93
68
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
94
|
-
|
|
69
|
+
setShowTreeData(treeData);
|
|
95
70
|
setVisible(false);
|
|
96
71
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
//点击部门节点,获取子部门节点
|
|
102
|
-
const loadDepartData = async (node, count) => {
|
|
103
|
-
try {
|
|
104
|
-
setLoading({ id: node.orgId, status: true });
|
|
105
|
-
const { Orgs = [] } = await request('LazyDescribeOrgs', {
|
|
106
|
-
OrgId: node.orgId,
|
|
107
|
-
DescribeCondition: {
|
|
108
|
-
NeedUser: true,
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
// 如果不存在数据
|
|
112
|
-
if (!(Orgs === null || Orgs === void 0 ? void 0 : Orgs.length)) {
|
|
113
|
-
orgsTreeData.forEach((item, index, orgsTreeData) => {
|
|
114
|
-
if (item.id == node.id) {
|
|
115
|
-
orgsTreeData[index].expandable = false;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
setOrgsTreeData([...orgsTreeData]);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
const children = dealOrgDataH5(Orgs);
|
|
122
|
-
setTitleText(node === null || node === void 0 ? void 0 : node.content);
|
|
123
|
-
setOrgsTreeData(children);
|
|
124
|
-
originalOrgData.push({
|
|
125
|
-
index: count + 1,
|
|
126
|
-
treeData: children,
|
|
127
|
-
title: node === null || node === void 0 ? void 0 : node.content,
|
|
128
|
-
});
|
|
129
|
-
setCount(count + 1);
|
|
130
|
-
setOriginalOrgData(originalOrgData);
|
|
131
|
-
}
|
|
132
|
-
setLoading({ id: null, status: false });
|
|
133
|
-
}
|
|
134
|
-
catch (e) {
|
|
135
|
-
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
136
|
-
}
|
|
72
|
+
// 获取某节点子部门
|
|
73
|
+
const loadItem = (item) => {
|
|
74
|
+
setShowTreeData((item === null || item === void 0 ? void 0 : item.children) ? [].concat(item === null || item === void 0 ? void 0 : item.children) : []);
|
|
75
|
+
setCurrentItem(item);
|
|
137
76
|
};
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
setTitleText(item.title);
|
|
148
|
-
setOrgsTreeData((item === null || item === void 0 ? void 0 : item.treeData) || []);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
setOriginalOrgData(storageOriTreeData);
|
|
77
|
+
// 返回targetItem节点所在的层级
|
|
78
|
+
const returnToLevelOfNode = (targetItem) => {
|
|
79
|
+
if (!targetItem) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// 已经返回到根节点层级
|
|
83
|
+
if (!targetItem.parentcode || targetItem.parentcode === '!!ROOT') {
|
|
84
|
+
setShowTreeData(treeData);
|
|
85
|
+
setCurrentItem(null);
|
|
156
86
|
}
|
|
157
87
|
else {
|
|
158
|
-
|
|
88
|
+
// 要返回targetItem所在的层级,需要找到targetItem的父节点parent,再显示parent的子节点即可
|
|
89
|
+
const parent = getNodeFromTreeByCode(treeData, targetItem.parentcode);
|
|
90
|
+
setShowTreeData((parent === null || parent === void 0 ? void 0 : parent.children) || []);
|
|
91
|
+
// 标记当前是从根节点进到这一层
|
|
92
|
+
setCurrentItem(parent);
|
|
159
93
|
}
|
|
160
94
|
};
|
|
161
|
-
return renderDecorator(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
loadDepartData(item, count);
|
|
193
|
-
} },
|
|
194
|
-
React.createElement("div", { className: "item-name" }, item === null || item === void 0 ? void 0 : item.content),
|
|
195
|
-
(item === null || item === void 0 ? void 0 : item.expandable) &&
|
|
196
|
-
loading.id !== item.orgId && (React.createElement("div", { className: "lcap-icon lcap-icon-chevronright" }))))),
|
|
197
|
-
loading.id === item.orgId && (loading === null || loading === void 0 ? void 0 : loading.status) && (React.createElement("div", null,
|
|
198
|
-
React.createElement(IconFont, { name: "loading", className: `weda-grid-navigation__fonticon depart_loading` }))))));
|
|
199
|
-
}))) : (React.createElement(Status, { className: "dim-tree-select--blank", icon: 'blank', size: 's', title: `暂无部门数据` })))) : (React.createElement(LoadingStatus, null))),
|
|
200
|
-
React.createElement(Modal.Footer, null,
|
|
201
|
-
React.createElement("div", null,
|
|
202
|
-
selectedOrgList.length > 0 && (React.createElement("div", { className: "weda-select-user-dept__select-result" },
|
|
203
|
-
React.createElement("div", { className: "weda-select-user-dept__select-label" }, "\u5DF2\u9009\u62E9"),
|
|
204
|
-
React.createElement("div", { className: "weda-select-user-dept__result-list" }, selectedOrgList.map((d) => (React.createElement("div", { key: (d === null || d === void 0 ? void 0 : d.orgId) || (d === null || d === void 0 ? void 0 : d.value), className: "weda-select-user-dept__result-item", onClick: () => {
|
|
205
|
-
setSelectedOrgList(selectedOrgList.filter((e) => (e === null || e === void 0 ? void 0 : e.orgId) !== (d === null || d === void 0 ? void 0 : d.orgId)));
|
|
206
|
-
} }, d === null || d === void 0 ? void 0 :
|
|
207
|
-
d.content,
|
|
208
|
-
React.createElement("div", { className: "close" }))))))),
|
|
209
|
-
React.createElement("div", { className: "weda-select-user-dept__btn-group" },
|
|
210
|
-
React.createElement(Button, { type: "weak", onClick: onClose }, "\u53D6\u6D88"),
|
|
211
|
-
React.createElement(Bubble, { content: selectedOrgList.length === 0 && confirmOrgList.length === 0
|
|
212
|
-
? '请选择部门'
|
|
213
|
-
: null, className: "weda-select-user-dept__bubble" },
|
|
214
|
-
React.createElement(Button, { type: "primary", onClick: () => onConfirm(selectedOrgList), disabled: selectedOrgList.length === 0 &&
|
|
215
|
-
confirmOrgList.length === 0 }, "\u786E\u5B9A")))))))))({
|
|
95
|
+
return renderDecorator(_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: subCls, children: [_jsx("div", { className: "weui-cell__bd weui-flex", children: _jsx("input", { className: "weui-input", placeholder: placeholder,
|
|
96
|
+
//value={value}
|
|
97
|
+
value: (confirmOrgList || []).map((e) => e === null || e === void 0 ? void 0 : e.content).join(','), disabled: disabled, name: name, autoFocus: autoFocus, onClick: onFocus, readOnly: true, role: "input" }) }), _jsxs(Modal, { disableEscape: true, maskClosable: false, visible: visible, onClose: onClose, destroyOnClose: true, className: `weda-ui weda-select-user-dept__dialog`, children: [_jsxs(Modal.Body, { className: ((_a = selectedOrgList[0]) === null || _a === void 0 ? void 0 : _a.id) ? 'is-selected-value' : '', children: [_jsxs("div", { className: "weda-select-user-dept__dialog-header", children: [_jsx("div", { className: !currentItem ? '' : 'arrow-left', onClick: () => returnToLevelOfNode(currentItem) }), currentItem ? currentItem.content : '选择部门'] }), _jsx(ModalSearchH5, { value: searchValue, onChange: (key) => {
|
|
98
|
+
onSearch(key);
|
|
99
|
+
setSearchValue(key);
|
|
100
|
+
}, onCancel: cancleSearch, isSearch: isSearch, onFocus: () => {
|
|
101
|
+
handleFocus(true);
|
|
102
|
+
} }), (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorStatus) ? (_jsx(ErrorStatus, { description: (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorMessage) || null })) : !(loading === null || loading === void 0 ? void 0 : loading.status) ? (_jsx(_Fragment, { children: showTreeData && showTreeData.length > 0 ? (_jsx("div", { className: classNames('weda-select-user-dept__dialog-list'), children: showTreeData.map((item) => {
|
|
103
|
+
var _a;
|
|
104
|
+
return (_jsx("div", { className: "weda-select-user-dept__list-item", children: _jsxs("div", { className: "weda-select-user-dept__list-item-wrap", children: [_jsx(Radio.Group, { value: (_a = selectedOrgList.filter((e) => (e === null || e === void 0 ? void 0 : e.id) === (item === null || item === void 0 ? void 0 : item.id))[0]) === null || _a === void 0 ? void 0 : _a.id, onChange: (value) => {
|
|
105
|
+
const ids = selectedOrgList.map((item) => item === null || item === void 0 ? void 0 : item.id);
|
|
106
|
+
// 多选情况,取消选中某元素时
|
|
107
|
+
if (ids.indexOf(value) !== -1) {
|
|
108
|
+
setSelectedOrgList(selectedOrgList.filter((e) => e.id !== value));
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
selectedOrgList.push(item);
|
|
112
|
+
setSelectedOrgList(multiple ? [...selectedOrgList] : [item]);
|
|
113
|
+
}
|
|
114
|
+
}, layout: "column", children: _jsx(_Fragment, { children: (item === null || item === void 0 ? void 0 : item.selectable) ? (_jsx(Radio, { name: item === null || item === void 0 ? void 0 : item.id, children: _jsxs("div", { className: "weda-select-user-dept__item-detail weda-select-user-dept__item-detail-is-org", onClick: () => {
|
|
115
|
+
(item === null || item === void 0 ? void 0 : item.children) ? loadItem(item) : false;
|
|
116
|
+
}, children: [_jsx("div", { className: "item-name", children: item === null || item === void 0 ? void 0 : item.content }), (item === null || item === void 0 ? void 0 : item.children) &&
|
|
117
|
+
loading.id !== item.id && (_jsx("div", { className: "lcap-icon lcap-icon-chevronright" }))] }) })) : (_jsxs("div", { className: "weda-select-user-dept__item-detail weda-select-user-dept__item-detail-is-org", onClick: () => {
|
|
118
|
+
(item === null || item === void 0 ? void 0 : item.children) ? loadItem(item) : false;
|
|
119
|
+
}, children: [_jsx("div", { className: "item-name", children: item === null || item === void 0 ? void 0 : item.content }), (item === null || item === void 0 ? void 0 : item.children) && loading.id !== item.id && (_jsx("div", { className: "lcap-icon lcap-icon-chevronright" }))] })) }) }), loading.id === item.id && (loading === null || loading === void 0 ? void 0 : loading.status) && (_jsx("div", { children: _jsx(IconFont, { name: "loading", className: `weda-grid-navigation__fonticon depart_loading` }) }))] }) }, item === null || item === void 0 ? void 0 : item.id));
|
|
120
|
+
}) })) : (_jsx(Status, { className: "dim-tree-select--blank", icon: 'blank', size: 's', title: `暂无部门数据` })) })) : (_jsx(LoadingStatus, {}))] }), _jsx(Modal.Footer, { children: _jsxs("div", { children: [selectedOrgList.length > 0 && (_jsxs("div", { className: "weda-select-user-dept__select-result", children: [_jsx("div", { className: "weda-select-user-dept__select-label", children: "\u5DF2\u9009\u62E9" }), _jsx("div", { className: "weda-select-user-dept__result-list", children: selectedOrgList.map((d) => (_jsxs("div", { className: "weda-select-user-dept__result-item", onClick: () => {
|
|
121
|
+
setSelectedOrgList(selectedOrgList.filter((e) => (e === null || e === void 0 ? void 0 : e.id) !== (d === null || d === void 0 ? void 0 : d.id)));
|
|
122
|
+
}, children: [d === null || d === void 0 ? void 0 : d.content, _jsx("div", { className: "close" })] }, (d === null || d === void 0 ? void 0 : d.id) || (d === null || d === void 0 ? void 0 : d.value)))) })] })), _jsxs("div", { className: "weda-select-user-dept__btn-group", children: [_jsx(Button, { type: "weak", onClick: onClose, children: "\u53D6\u6D88" }), _jsx(Bubble, { content: selectedOrgList.length === 0 && confirmOrgList.length === 0
|
|
123
|
+
? '请选择部门'
|
|
124
|
+
: null, className: "weda-select-user-dept__bubble", children: _jsx(Button, { type: "primary", onClick: () => onConfirm(selectedOrgList), disabled: selectedOrgList.length === 0 &&
|
|
125
|
+
confirmOrgList.length === 0, children: "\u786E\u5B9A" }) })] })] }) })] })] }) }))({
|
|
216
126
|
id,
|
|
217
127
|
className: cls,
|
|
218
128
|
style,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import destr from 'destr';
|
|
3
3
|
import useSWR from 'swr';
|
|
4
|
-
import {
|
|
5
|
-
import { fetchUserData, DescribeOrgs, fetchAllCorps, fetchAllDepartments, CURRENT_CORP, } from '../common/fetch-data-service';
|
|
6
|
-
import { buildTree } from '../common/utils';
|
|
7
|
-
import { deepClone } from '../../../../utils/tool';
|
|
4
|
+
import { fetchUserData, DescribeOrgs } from '../common/fetch-data-service';
|
|
8
5
|
const Icon = (_jsx("img", { src: "https://qcloudimg.tencent-cloud.cn/raw/794436ec3d598c50f771e346a8fce4e0.svg" }));
|
|
9
6
|
const buildTreeData = (list) => {
|
|
10
7
|
let res = [];
|
|
@@ -22,7 +19,7 @@ const buildTreeData = (list) => {
|
|
|
22
19
|
selectable: true,
|
|
23
20
|
// 下面这3个属性是 TreeData 节点自定义属性
|
|
24
21
|
code: i.departmentCode,
|
|
25
|
-
|
|
22
|
+
parentcode: i.departmentParentCode,
|
|
26
23
|
depth: i.depth,
|
|
27
24
|
disableSelect: i.disableSelect,
|
|
28
25
|
};
|
|
@@ -49,7 +46,7 @@ const getChildren = (all, item) => {
|
|
|
49
46
|
selectable: true,
|
|
50
47
|
// 下面这3个属性是 TreeData 节点自定义属性
|
|
51
48
|
code: i.departmentCode,
|
|
52
|
-
|
|
49
|
+
parentcode: i.departmentParentCode,
|
|
53
50
|
depth: i.depth,
|
|
54
51
|
disableSelect: i.disableSelect,
|
|
55
52
|
};
|
|
@@ -91,106 +88,3 @@ export const useDepartData = (props) => {
|
|
|
91
88
|
*/
|
|
92
89
|
return { ...treeData, error };
|
|
93
90
|
};
|
|
94
|
-
const noOrgUsersDepartment = ({ parentCode }) => {
|
|
95
|
-
const id = `isNoOrgList-${uuidv4()}`;
|
|
96
|
-
return {
|
|
97
|
-
id,
|
|
98
|
-
name: 'isNoOrgList',
|
|
99
|
-
code: id,
|
|
100
|
-
parentCode,
|
|
101
|
-
content: '未关联部门用户',
|
|
102
|
-
icon: Icon,
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
export const useDepartDataNew = (props) => {
|
|
106
|
-
const { request } = props;
|
|
107
|
-
const { data: treeData, error } = useSWR('GetCorpsAndDepartments', async () => {
|
|
108
|
-
let orgList = [];
|
|
109
|
-
// 拉取关联企业: 需要拉取所有的企业,以及企业下的部门列表
|
|
110
|
-
const [allCorpList, allDepartmentsList] = await Promise.all([
|
|
111
|
-
fetchAllCorps(request).catch(() => {
|
|
112
|
-
return [];
|
|
113
|
-
}),
|
|
114
|
-
fetchAllDepartments(request),
|
|
115
|
-
]);
|
|
116
|
-
// 判断是否拉取到了关联企业
|
|
117
|
-
const associatedCorps = (allCorpList || []).filter((corp) => corp.id !== CURRENT_CORP.id);
|
|
118
|
-
// 组件中是否显示企业
|
|
119
|
-
const showCorps = associatedCorps && associatedCorps.length > 0;
|
|
120
|
-
/**
|
|
121
|
-
* 拉取到互联企业,组件第一级展示企业列表;否则,将【当前企业】下的部门平铺
|
|
122
|
-
*/
|
|
123
|
-
if (showCorps) {
|
|
124
|
-
orgList = [...allCorpList, ...allDepartmentsList];
|
|
125
|
-
/**
|
|
126
|
-
* 处理数据的层级关系
|
|
127
|
-
* 拉取了企业时,将一级部门的父节点指向对应的企业
|
|
128
|
-
*/
|
|
129
|
-
for (const item of orgList) {
|
|
130
|
-
if (item.type === 'department' && item.parentCode === '!!ROOT') {
|
|
131
|
-
if (item.corpId) {
|
|
132
|
-
// 一级部门的父级节点指向对应的企业
|
|
133
|
-
item.parentCode = item.corpId;
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
// 一级部门的corpId为空字符串时,表示属于【本企业】
|
|
137
|
-
item.parentCode = CURRENT_CORP.id;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
orgList = [...allDepartmentsList];
|
|
144
|
-
/**
|
|
145
|
-
* 处理数据的层级关系
|
|
146
|
-
* 只拉取部门时,将一级部门的parentCode置为空:构建树时判断parentCode为空来查找根节点
|
|
147
|
-
*/
|
|
148
|
-
for (const item of orgList) {
|
|
149
|
-
if (item.parentCode === '!!ROOT') {
|
|
150
|
-
item.parentCode = undefined;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
const formattedOrgList = orgList
|
|
155
|
-
.filter((item) => item.name)
|
|
156
|
-
.map((item) => {
|
|
157
|
-
const { id, name, code, parentCode, selectable, ...restProps } = item;
|
|
158
|
-
return {
|
|
159
|
-
id,
|
|
160
|
-
content: name,
|
|
161
|
-
icon: Icon,
|
|
162
|
-
name,
|
|
163
|
-
code,
|
|
164
|
-
parentCode,
|
|
165
|
-
children: undefined,
|
|
166
|
-
selectable,
|
|
167
|
-
disableSelect: false,
|
|
168
|
-
...restProps,
|
|
169
|
-
};
|
|
170
|
-
});
|
|
171
|
-
const { treeData } = buildTree(formattedOrgList);
|
|
172
|
-
// 选人组件:企业下显示【未关联部门用户】这个虚拟部门
|
|
173
|
-
const finalTreeData = deepClone(treeData);
|
|
174
|
-
// 显示企业:该部门作为根节点企业的子节点
|
|
175
|
-
if (showCorps) {
|
|
176
|
-
for (const corp of finalTreeData) {
|
|
177
|
-
if (!corp.children) {
|
|
178
|
-
corp.children = [];
|
|
179
|
-
}
|
|
180
|
-
corp.children.push(noOrgUsersDepartment({ parentCode: corp.id }));
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
// 不显示企业,该虚拟部门和一级部门平级
|
|
185
|
-
finalTreeData.push(noOrgUsersDepartment({ parentCode: CURRENT_CORP.id }));
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
orgList: formattedOrgList,
|
|
189
|
-
orgTreeData: treeData,
|
|
190
|
-
finalOrgTreeData: finalTreeData,
|
|
191
|
-
};
|
|
192
|
-
},
|
|
193
|
-
// 30秒dedupe
|
|
194
|
-
{ dedupingInterval: 30 * 1000 });
|
|
195
|
-
return { ...treeData, error };
|
|
196
|
-
};
|
|
@@ -79,6 +79,7 @@ export function useFormInputTrait(inputParams) {
|
|
|
79
79
|
.closest((w) => { var _a, _b; return ((_b = (_a = w.getConfig) === null || _a === void 0 ? void 0 : _a.call(w)) === null || _b === void 0 ? void 0 : _b.componentType) === 'form'; })) === null || _a === void 0 ? void 0 : _a.addFormItem) === null || _b === void 0 ? void 0 : _b.call(_a, name, $widget);
|
|
80
80
|
logger.debug('addFormItem', name);
|
|
81
81
|
return () => {
|
|
82
|
+
logger.debug('removeFormItem', name);
|
|
82
83
|
removeFormItem === null || removeFormItem === void 0 ? void 0 : removeFormItem();
|
|
83
84
|
};
|
|
84
85
|
}, [$widget, name, form]);
|
|
@@ -102,6 +103,7 @@ export function useFormInputTrait(inputParams) {
|
|
|
102
103
|
setHidden() {
|
|
103
104
|
setVisible(false);
|
|
104
105
|
},
|
|
106
|
+
initialDisabled: inputParams.disabled,
|
|
105
107
|
setDisable(value) {
|
|
106
108
|
const originalValue = disabled;
|
|
107
109
|
setDisabled(value);
|
|
@@ -197,9 +199,11 @@ export function useFormInputTrait(inputParams) {
|
|
|
197
199
|
logger.debug('useImperativeHandle', result);
|
|
198
200
|
return result;
|
|
199
201
|
}, [
|
|
202
|
+
inputParams.disabled,
|
|
200
203
|
name,
|
|
201
|
-
syncValue,
|
|
202
204
|
forceUpdate,
|
|
205
|
+
syncValue,
|
|
206
|
+
clearValidate,
|
|
203
207
|
setInnerHandle,
|
|
204
208
|
setSyncedValue,
|
|
205
209
|
disabled,
|
|
@@ -207,7 +211,6 @@ export function useFormInputTrait(inputParams) {
|
|
|
207
211
|
required,
|
|
208
212
|
rules,
|
|
209
213
|
requiredMsg,
|
|
210
|
-
clearValidate,
|
|
211
214
|
]);
|
|
212
215
|
const { data: fieldPermission, error: fieldPermissionError, isLoading: fieldPermissionLoading, } = useSWR(() => {
|
|
213
216
|
return [form.authValue, name];
|
|
@@ -125,6 +125,7 @@ export const ModelFlowLayout = loadable(() => import('./flow/modules/layout'), {
|
|
|
125
125
|
export const ModelFlowProcess = loadable(() => import('./flow/process'), {
|
|
126
126
|
fallback,
|
|
127
127
|
});
|
|
128
|
+
export const FlowGraph = loadable(() => import('./flow-graph'), { fallback });
|
|
128
129
|
export { default as Row } from './grid/row';
|
|
129
130
|
export { default as Col } from './grid/col';
|
|
130
131
|
export { default as Grid } from './grid/grid';
|
|
@@ -16,7 +16,7 @@ export default function Swiper({ children, className, style, autoplay = true, ci
|
|
|
16
16
|
const [height, setHeight] = useState(0);
|
|
17
17
|
const { change = () => { } } = events;
|
|
18
18
|
useEffect(() => {
|
|
19
|
-
const callback = (
|
|
19
|
+
const callback = () => {
|
|
20
20
|
const realChildren = Array.from(originChildrenRef.current.children).map((elem) => {
|
|
21
21
|
const reactFiberProp = Object.keys(elem).find((prop) => {
|
|
22
22
|
return (prop.startsWith('__reactInternalInstance') ||
|
|
@@ -27,7 +27,6 @@ export default function Swiper({ children, className, style, autoplay = true, ci
|
|
|
27
27
|
return reactElem;
|
|
28
28
|
});
|
|
29
29
|
setRealChildren(realChildren);
|
|
30
|
-
instance.disconnect();
|
|
31
30
|
};
|
|
32
31
|
const observer = new MutationObserver(callback);
|
|
33
32
|
observer.observe(originChildrenRef.current, {
|
|
@@ -6,8 +6,8 @@ import { getColumns, isProcessHoldOrLocked, formatDataToXlsx, getSearchAttribute
|
|
|
6
6
|
import { FilterFieldsPanel } from './FilterFields';
|
|
7
7
|
import { SelectableBlock } from './SelectableBlock';
|
|
8
8
|
import { REL_DICT, CELL_CUSTOM_OPTION } from '../../utils/constant';
|
|
9
|
-
import { ImportFileModalByApi } from './ImportFileModalByApi';
|
|
10
9
|
import { ExportFileModalByApi } from './ExportFileModalByApi';
|
|
10
|
+
import { ImportFileModalByApi } from './ImportFileModalByApi';
|
|
11
11
|
import { InOrOutRecordModeal } from './InOrOutRecordModeal';
|
|
12
12
|
import isObjectEqual from '../../utils/isObjectEqual';
|
|
13
13
|
import { useEnumContext } from '../../utils/hooks/context';
|
|
@@ -9,15 +9,16 @@ import { useSyncValue } from '../../utils/hooks/useSyncValue';
|
|
|
9
9
|
export default function TabsPc({ tabs = emptyArray, selectedIndex, events, className, style, isMultipleSlot = true, ...restProps }) {
|
|
10
10
|
const [activeIndex, setActiveIndex] = useSyncValue(selectedIndex);
|
|
11
11
|
const _tabs = React.useMemo(() => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
12
|
+
if (!Array.isArray(tabs) || tabs.length <= 0) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
return tabs.map((item, index) => {
|
|
16
|
+
return {
|
|
17
|
+
id: index.toString(),
|
|
18
|
+
label: item.title,
|
|
19
|
+
value: item.value,
|
|
20
|
+
};
|
|
21
|
+
});
|
|
21
22
|
}, [tabs]);
|
|
22
23
|
const eventsRef = useSyncedRef(events);
|
|
23
24
|
useCustomCompareEffect(() => {
|