@zat-design/sisyphus-react 3.4.5 → 3.4.6-beta.1
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/index.esm.css +140 -35
- package/dist/less.esm.css +140 -35
- package/es/ProConfigProvider/index.d.ts +2 -2
- package/es/ProConfigProvider/index.js +0 -3
- package/es/ProEditTable/components/RenderField/index.js +55 -48
- package/es/ProEditTable/index.js +3 -3
- package/es/ProEditTable/style/index.less +0 -5
- package/es/ProEditTable/utils/tools.d.ts +12 -0
- package/es/ProEditTable/utils/tools.js +79 -2
- package/es/ProForm/components/base/RangePicker/index.js +9 -9
- package/es/ProForm/components/combination/Container/index.js +3 -2
- package/es/ProForm/components/combination/Container/style/index.less +5 -1
- package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProCascader/index.js +256 -0
- package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +9 -6
- package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
- package/es/ProForm/components/combination/ProCascader/utils/index.js +26 -0
- package/es/ProForm/components/combination/ProModalSelect/index.js +13 -5
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +23 -0
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProRangeLimit/index.js +17 -10
- package/es/ProForm/components/index.d.ts +1 -2
- package/es/ProForm/components/index.js +1 -4
- package/es/ProForm/components/render/Render.js +18 -13
- package/es/ProForm/components/render/RenderFields.js +3 -1
- package/es/ProForm/components/render/propsType.d.ts +3 -7
- package/es/ProForm/index.js +6 -2
- package/es/ProForm/propsType.d.ts +2 -0
- package/es/ProForm/style/index.less +2 -1
- package/es/ProForm/utils/index.js +4 -1
- package/es/ProForm/utils/useChanged.js +1 -2
- package/es/ProForm/utils/useForm.js +18 -6
- package/es/ProForm/utils/useListChanged.js +1 -3
- package/es/ProIcon/config/index.d.ts +2 -0
- package/es/ProIcon/config/index.js +4 -2
- package/es/ProIcon/index.js +148 -81
- package/es/ProIcon/propsTypes.d.ts +6 -1
- package/es/ProIcon/utils/index.d.ts +5 -0
- package/es/ProIcon/utils/index.js +60 -0
- package/es/ProLayout/components/ProCollapse/index.js +6 -3
- package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/es/ProSelect/index.js +1 -1
- package/es/ProStep/components/Step/index.js +4 -3
- package/es/ProStep/style/index.less +37 -0
- package/es/ProTable/utils.js +6 -3
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +16 -6
- package/es/ProThemeTools/component/PrdTools/style/index.less +56 -48
- package/es/ProTree/components/ProTree.js +96 -74
- package/es/ProTree/components/ProTreeSelect/index.js +3 -7
- package/es/ProTree/components/Tree.js +63 -41
- package/es/ProTree/style/index.less +24 -17
- package/es/ProUpload/index.js +11 -13
- package/es/ProUpload/propsType.d.ts +8 -3
- package/es/assets/view.svg +2 -2
- package/es/global.less +6 -6
- package/lib/ProConfigProvider/index.d.ts +2 -2
- package/lib/ProConfigProvider/index.js +0 -3
- package/lib/ProEditTable/components/RenderField/index.js +53 -46
- package/lib/ProEditTable/index.js +3 -3
- package/lib/ProEditTable/style/index.less +0 -5
- package/lib/ProEditTable/utils/tools.d.ts +12 -0
- package/lib/ProEditTable/utils/tools.js +80 -2
- package/lib/ProForm/components/base/RangePicker/index.js +9 -9
- package/lib/ProForm/components/combination/Container/index.js +3 -2
- package/lib/ProForm/components/combination/Container/style/index.less +5 -1
- package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProCascader/index.js +256 -0
- package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +9 -6
- package/lib/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +33 -0
- package/lib/ProForm/components/combination/ProModalSelect/index.js +12 -4
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +23 -0
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +17 -10
- package/lib/ProForm/components/index.d.ts +1 -2
- package/lib/ProForm/components/index.js +1 -8
- package/lib/ProForm/components/render/Render.js +18 -13
- package/lib/ProForm/components/render/RenderFields.js +3 -1
- package/lib/ProForm/components/render/propsType.d.ts +3 -7
- package/lib/ProForm/index.js +5 -1
- package/lib/ProForm/propsType.d.ts +2 -0
- package/lib/ProForm/style/index.less +2 -1
- package/lib/ProForm/utils/index.js +4 -1
- package/lib/ProForm/utils/useChanged.js +1 -2
- package/lib/ProForm/utils/useForm.js +18 -6
- package/lib/ProForm/utils/useListChanged.js +1 -3
- package/lib/ProIcon/config/index.d.ts +2 -0
- package/lib/ProIcon/config/index.js +4 -2
- package/lib/ProIcon/index.js +144 -77
- package/lib/ProIcon/propsTypes.d.ts +6 -1
- package/lib/ProIcon/utils/index.d.ts +5 -0
- package/lib/ProIcon/utils/index.js +62 -1
- package/lib/ProLayout/components/ProCollapse/index.js +6 -3
- package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/lib/ProSelect/index.js +1 -1
- package/lib/ProStep/components/Step/index.js +4 -3
- package/lib/ProStep/style/index.less +37 -0
- package/lib/ProTable/utils.js +6 -3
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +16 -6
- package/lib/ProThemeTools/component/PrdTools/style/index.less +56 -48
- package/lib/ProTree/components/ProTree.js +96 -74
- package/lib/ProTree/components/ProTreeSelect/index.js +3 -7
- package/lib/ProTree/components/Tree.js +63 -41
- package/lib/ProTree/style/index.less +24 -17
- package/lib/ProUpload/index.js +10 -12
- package/lib/ProUpload/propsType.d.ts +8 -3
- package/lib/assets/view.svg +2 -2
- package/lib/global.less +6 -6
- package/package.json +2 -2
- package/es/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/es/ProForm/components/base/ProCascader/index.js +0 -72
- package/es/ProForm/components/combination/ProAddressBar/index.js +0 -437
- package/lib/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/lib/ProForm/components/base/ProCascader/index.js +0 -78
- package/lib/ProForm/components/combination/ProAddressBar/index.js +0 -437
- /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
- /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
package/lib/ProTable/utils.js
CHANGED
|
@@ -276,19 +276,22 @@ var formatColumn = exports.formatColumn = function formatColumn(column, original
|
|
|
276
276
|
'varied-cell': originalValue !== undefined,
|
|
277
277
|
'empty-cell': isEmpty
|
|
278
278
|
});
|
|
279
|
-
var renderValue = (0, _jsxRuntime.jsx)(_ProForm.default.
|
|
279
|
+
var renderValue = (0, _jsxRuntime.jsx)(_ProForm.default.ProCascader, {
|
|
280
280
|
isView: true,
|
|
281
|
+
mode: "address",
|
|
281
282
|
code: code,
|
|
282
283
|
value: realValue
|
|
283
284
|
});
|
|
284
|
-
var originalRenderValue = (0, _jsxRuntime.jsx)(_ProForm.default.
|
|
285
|
+
var originalRenderValue = (0, _jsxRuntime.jsx)(_ProForm.default.ProCascader, {
|
|
285
286
|
isView: true,
|
|
287
|
+
mode: "address",
|
|
286
288
|
code: code,
|
|
287
289
|
value: originalRealValue
|
|
288
290
|
});
|
|
289
|
-
return (0, _jsxRuntime.jsx)(_ProForm.default.
|
|
291
|
+
return (0, _jsxRuntime.jsx)(_ProForm.default.ProCascader, {
|
|
290
292
|
className: className,
|
|
291
293
|
isView: true,
|
|
294
|
+
mode: "address",
|
|
292
295
|
code: code,
|
|
293
296
|
value: realValue,
|
|
294
297
|
tooltip: originalValue !== undefined ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DevToolsPropsType } from '../../propsType';
|
|
2
|
-
declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe,
|
|
2
|
+
declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => JSX.Element;
|
|
3
3
|
export default PrdTools;
|
|
@@ -28,12 +28,10 @@ var PrdTools = function PrdTools(_ref) {
|
|
|
28
28
|
open = _ref.open,
|
|
29
29
|
state = _ref.state,
|
|
30
30
|
tableBorder = _ref.tableBorder,
|
|
31
|
-
tableStripe = _ref.tableStripe
|
|
32
|
-
prefixCls = _ref.prefixCls;
|
|
31
|
+
tableStripe = _ref.tableStripe;
|
|
33
32
|
var _useProConfig = (0, _ProConfigProvider.useProConfig)(),
|
|
34
33
|
config = _useProConfig.state,
|
|
35
34
|
dispatch = _useProConfig.dispatch;
|
|
36
|
-
var ProForm = config.ProForm;
|
|
37
35
|
var _useState = (0, _react.useState)([{
|
|
38
36
|
color: '#006AFF',
|
|
39
37
|
active: true
|
|
@@ -46,6 +44,9 @@ var PrdTools = function PrdTools(_ref) {
|
|
|
46
44
|
}, {
|
|
47
45
|
color: '#A00F20',
|
|
48
46
|
active: false
|
|
47
|
+
}, {
|
|
48
|
+
color: '#31AF96',
|
|
49
|
+
active: false
|
|
49
50
|
}]),
|
|
50
51
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
51
52
|
active = _useState2[0],
|
|
@@ -57,6 +58,7 @@ var PrdTools = function PrdTools(_ref) {
|
|
|
57
58
|
_ref2$zauiBrand = _ref2.zauiBrand,
|
|
58
59
|
zauiBrand = _ref2$zauiBrand === void 0 ? '#006AFF' : _ref2$zauiBrand;
|
|
59
60
|
if (zauiBrand) {
|
|
61
|
+
var _config$theme;
|
|
60
62
|
var newArray = active.map(function (activeItem) {
|
|
61
63
|
activeItem.active = false;
|
|
62
64
|
return {
|
|
@@ -69,7 +71,8 @@ var PrdTools = function PrdTools(_ref) {
|
|
|
69
71
|
type: 'set',
|
|
70
72
|
payload: {
|
|
71
73
|
theme: {
|
|
72
|
-
primaryColor: zauiBrand
|
|
74
|
+
primaryColor: zauiBrand,
|
|
75
|
+
qiankunPrimaryColor: config === null || config === void 0 ? void 0 : (_config$theme = config.theme) === null || _config$theme === void 0 ? void 0 : _config$theme.qiankunPrimaryColor
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
});
|
|
@@ -117,7 +120,8 @@ var PrdTools = function PrdTools(_ref) {
|
|
|
117
120
|
type: 'set',
|
|
118
121
|
payload: {
|
|
119
122
|
theme: {
|
|
120
|
-
primaryColor: item.color
|
|
123
|
+
primaryColor: item.color,
|
|
124
|
+
qiankunPrimaryColor: item.color
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
127
|
});
|
|
@@ -167,8 +171,14 @@ var PrdTools = function PrdTools(_ref) {
|
|
|
167
171
|
}), (0, _jsxRuntime.jsx)("div", {
|
|
168
172
|
className: "pro-theme-tools-item",
|
|
169
173
|
children: (0, _jsxRuntime.jsxs)(_antd.Radio.Group, {
|
|
170
|
-
value:
|
|
174
|
+
value: state.zauiFormAlign,
|
|
171
175
|
onChange: function onChange(e) {
|
|
176
|
+
setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
177
|
+
zauiFormAlign: e.target.value
|
|
178
|
+
}));
|
|
179
|
+
(0, _index.setThemes)({
|
|
180
|
+
'zaui-form-align': e.target.value
|
|
181
|
+
});
|
|
172
182
|
dispatch({
|
|
173
183
|
type: 'setWithLocal',
|
|
174
184
|
payload: {
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
p {
|
|
19
|
-
|
|
20
|
-
position : relative;
|
|
19
|
+
position: relative;
|
|
21
20
|
margin-bottom: var(--zaui-space-size-md, 16px);
|
|
22
|
-
|
|
21
|
+
padding-left: 12px;
|
|
22
|
+
font-size: var(--zaui-font-size, 14px);
|
|
23
23
|
|
|
24
24
|
&:before {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
left
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
background : var(--zaui-brand, #006aff);
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 4px;
|
|
27
|
+
left: 0;
|
|
28
|
+
width: 4px;
|
|
29
|
+
height: 14px;
|
|
30
|
+
background: var(--zaui-brand, #006aff);
|
|
32
31
|
border-radius: var(zaui-border-radius-card, 4px);
|
|
32
|
+
content: '';
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
display: flex;
|
|
38
38
|
|
|
39
39
|
li {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
border-radius : 50%;
|
|
43
|
-
background : #fff;
|
|
44
|
-
display : flex;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
45
42
|
justify-content: center;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
width: 38px;
|
|
44
|
+
height: 38px;
|
|
45
|
+
margin-right: 34px;
|
|
46
|
+
color: #fff;
|
|
47
|
+
background: #fff;
|
|
48
|
+
border: 6px solid #fff;
|
|
49
|
+
border-radius: 50%;
|
|
50
50
|
|
|
51
51
|
span {
|
|
52
|
-
font-size
|
|
52
|
+
font-size: var(--zaui-font-size, 14px);
|
|
53
53
|
vertical-align: -7px;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -81,8 +81,16 @@
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
&:nth-child(4) {
|
|
84
|
+
background: #a00f20;
|
|
85
|
+
|
|
86
|
+
&.active,
|
|
87
|
+
&:hover {
|
|
88
|
+
border-color: #f2dbdb;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
&:nth-child(5) {
|
|
84
92
|
margin-right: 0;
|
|
85
|
-
background
|
|
93
|
+
background: #31af96;
|
|
86
94
|
|
|
87
95
|
&.active,
|
|
88
96
|
&:hover {
|
|
@@ -98,16 +106,16 @@
|
|
|
98
106
|
|
|
99
107
|
.copy-btn {
|
|
100
108
|
position: absolute;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
bottom: 20px;
|
|
110
|
+
left: 32px;
|
|
111
|
+
z-index: 10;
|
|
112
|
+
width: calc(100% - 64px);
|
|
105
113
|
}
|
|
106
114
|
|
|
107
115
|
.pro-theme-tools-box {
|
|
108
|
-
display
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-wrap: wrap;
|
|
109
118
|
justify-content: space-between;
|
|
110
|
-
flex-wrap : wrap;
|
|
111
119
|
}
|
|
112
120
|
|
|
113
121
|
.pro-theme-tools-space {
|
|
@@ -129,22 +137,22 @@
|
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
.pro-drawer-close {
|
|
132
|
-
position
|
|
133
|
-
top
|
|
134
|
-
left
|
|
135
|
-
display
|
|
136
|
-
align-items
|
|
140
|
+
position: absolute;
|
|
141
|
+
top: 6px;
|
|
142
|
+
left: -37px;
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
137
145
|
justify-content: center;
|
|
138
|
-
width
|
|
139
|
-
height
|
|
140
|
-
color
|
|
141
|
-
cursor
|
|
146
|
+
width: 32px;
|
|
147
|
+
height: 38px;
|
|
148
|
+
color: #fff;
|
|
149
|
+
cursor: pointer;
|
|
142
150
|
|
|
143
151
|
.close-icon {
|
|
144
|
-
position
|
|
145
|
-
left
|
|
146
|
-
z-index
|
|
147
|
-
color
|
|
152
|
+
position: relative;
|
|
153
|
+
left: 4px;
|
|
154
|
+
z-index: 1;
|
|
155
|
+
color: var(--zaui-text, #343434);
|
|
148
156
|
font-size: var(--zaui-font-size-lg, 16px);
|
|
149
157
|
transform: translateZ(100px);
|
|
150
158
|
|
|
@@ -155,14 +163,14 @@
|
|
|
155
163
|
}
|
|
156
164
|
|
|
157
165
|
.pro-drawer-close::after {
|
|
158
|
-
position
|
|
159
|
-
top
|
|
160
|
-
right
|
|
161
|
-
bottom
|
|
162
|
-
left
|
|
166
|
+
position: absolute;
|
|
167
|
+
top: 0;
|
|
168
|
+
right: 0;
|
|
169
|
+
bottom: 0;
|
|
170
|
+
left: 0;
|
|
163
171
|
background-color: #fff;
|
|
164
|
-
border-radius
|
|
165
|
-
transform
|
|
166
|
-
content
|
|
172
|
+
border-radius: 4px 0px 0px 4px;
|
|
173
|
+
transform: perspective(0.15em) rotateY(-2deg);
|
|
174
|
+
content: '';
|
|
167
175
|
}
|
|
168
176
|
}
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
13
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
@@ -159,10 +161,7 @@ var ProTree = function ProTree(props) {
|
|
|
159
161
|
}
|
|
160
162
|
}, [dataSource, enumCode]);
|
|
161
163
|
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
162
|
-
if (enumCode) {
|
|
163
|
-
return undefined;
|
|
164
|
-
}
|
|
165
|
-
if (dataSource) {
|
|
164
|
+
if (enumCode || dataSource) {
|
|
166
165
|
return undefined;
|
|
167
166
|
}
|
|
168
167
|
var _ref = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
|
|
@@ -174,56 +173,60 @@ var ProTree = function ProTree(props) {
|
|
|
174
173
|
// 执行用户配置的枚举服务,拉取枚举数据进行更新
|
|
175
174
|
fetchFunction.run(defaultParams);
|
|
176
175
|
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options]);
|
|
176
|
+
var handleSignalSelect = function handleSignalSelect(value) {
|
|
177
|
+
var checkedValues = [];
|
|
178
|
+
var innerVal = value;
|
|
179
|
+
if (labelInValue) {
|
|
180
|
+
checkedValues = innerVal[fieldNameValue];
|
|
181
|
+
} else {
|
|
182
|
+
// 单选值场景为string走到这里
|
|
183
|
+
checkedValues = innerVal;
|
|
184
|
+
}
|
|
185
|
+
setState({
|
|
186
|
+
checkedValues: checkedValues
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
var handleCheckSelect = function handleCheckSelect(allKeys) {
|
|
190
|
+
var checkedValues = [];
|
|
191
|
+
if (allValue && typeof value === 'string') {
|
|
192
|
+
// 如果value等于allValue那么全选中,否则选中value得值
|
|
193
|
+
if (value === allValue) {
|
|
194
|
+
checkedValues = allKeys;
|
|
195
|
+
} else {
|
|
196
|
+
checkedValues = [value];
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
var innerVal = value;
|
|
200
|
+
// 开启 labelInValue [{ label:xx, value: ""}] 形式、需要取出来 value
|
|
201
|
+
if (labelInValue) {
|
|
202
|
+
var isObjectArray = innerVal && innerVal.every(function (element) {
|
|
203
|
+
return (0, _typeof2.default)(element) === 'object' && element !== null;
|
|
204
|
+
});
|
|
205
|
+
if (!isObjectArray) {
|
|
206
|
+
console.error('Please enter an array object');
|
|
207
|
+
}
|
|
208
|
+
checkedValues = innerVal && innerVal.map(function (item) {
|
|
209
|
+
return item[fieldNameValue];
|
|
210
|
+
});
|
|
211
|
+
} else {
|
|
212
|
+
// 复选,单纯value数组场景
|
|
213
|
+
checkedValues = innerVal;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
setState({
|
|
217
|
+
checkedValues: checkedValues,
|
|
218
|
+
checkAll: checkedValues.length === allKeys.length
|
|
219
|
+
});
|
|
220
|
+
};
|
|
177
221
|
(0, _react.useEffect)(function () {
|
|
178
222
|
if (value) {
|
|
179
|
-
var checkedValues = [];
|
|
180
223
|
var allKeys = state.allKeys;
|
|
181
224
|
if (!(other === null || other === void 0 ? void 0 : other.checkable)) {
|
|
182
225
|
// 单选
|
|
183
|
-
|
|
184
|
-
if (labelInValue) {
|
|
185
|
-
checkedValues = innerVal[fieldNameValue];
|
|
186
|
-
} else {
|
|
187
|
-
// 单选值场景为string走到这里
|
|
188
|
-
checkedValues = innerVal;
|
|
189
|
-
}
|
|
190
|
-
setState({
|
|
191
|
-
checkedValues: checkedValues
|
|
192
|
-
});
|
|
226
|
+
handleSignalSelect(value);
|
|
193
227
|
} else {
|
|
194
228
|
// 复选
|
|
195
|
-
|
|
196
|
-
// 如果value等于allValue那么全选中,否则选中value得值
|
|
197
|
-
if (value === allValue) {
|
|
198
|
-
checkedValues = allKeys;
|
|
199
|
-
} else {
|
|
200
|
-
checkedValues = [value];
|
|
201
|
-
}
|
|
202
|
-
} else {
|
|
203
|
-
var _innerVal = value;
|
|
204
|
-
// 开启 labelInValue [{ label:xx, value: ""}] 形式、需要取出来 value
|
|
205
|
-
if (labelInValue) {
|
|
206
|
-
var isObjectArray = _innerVal && _innerVal.every(function (element) {
|
|
207
|
-
return (0, _typeof2.default)(element) === 'object' && element !== null;
|
|
208
|
-
});
|
|
209
|
-
if (!isObjectArray) {
|
|
210
|
-
console.error('Please enter an array object');
|
|
211
|
-
checkedValues = [];
|
|
212
|
-
}
|
|
213
|
-
checkedValues = _innerVal && _innerVal.map(function (item) {
|
|
214
|
-
return item[fieldNameValue];
|
|
215
|
-
});
|
|
216
|
-
} else {
|
|
217
|
-
// 复选,单纯value数组场景
|
|
218
|
-
checkedValues = _innerVal;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
// treeViewData = filterCheckedNodes(originalTreeData, checkedValues, '', fieldNames);
|
|
222
|
-
setState({
|
|
223
|
-
checkedValues: checkedValues,
|
|
224
|
-
checkAll: checkedValues.length === allKeys.length
|
|
225
|
-
// treeViewData,
|
|
226
|
-
});
|
|
229
|
+
handleCheckSelect(allKeys);
|
|
227
230
|
}
|
|
228
231
|
} else if (!(other === null || other === void 0 ? void 0 : other.checkable)) {
|
|
229
232
|
// 单选--场景-->如果表单的value没有值,那么配置的selectedKey就起作用了,选中树节点
|
|
@@ -336,39 +339,58 @@ var ProTree = function ProTree(props) {
|
|
|
336
339
|
handleFinish(allValue, checked, checkedValues);
|
|
337
340
|
};
|
|
338
341
|
/** 点击了树节点开始loading,改变自身state并将值通过onchange上传到form */
|
|
339
|
-
var onSelectTreeNode = function
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
342
|
+
var onSelectTreeNode = /*#__PURE__*/function () {
|
|
343
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(props, info) {
|
|
344
|
+
var values;
|
|
345
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
346
|
+
while (1) switch (_context.prev = _context.next) {
|
|
347
|
+
case 0:
|
|
348
|
+
if (!(disabled || isView)) {
|
|
349
|
+
_context.next = 2;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
return _context.abrupt("return", null);
|
|
353
|
+
case 2:
|
|
354
|
+
setState({
|
|
355
|
+
clickShowLoading: loading
|
|
356
|
+
});
|
|
357
|
+
if (!onSelect) {
|
|
358
|
+
_context.next = 7;
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
_context.next = 6;
|
|
362
|
+
return onSelect(props, info);
|
|
363
|
+
case 6:
|
|
364
|
+
setState({
|
|
365
|
+
clickShowLoading: false
|
|
366
|
+
});
|
|
367
|
+
case 7:
|
|
368
|
+
if (!(other === null || other === void 0 ? void 0 : other.checkable)) {
|
|
369
|
+
// 单选将选中节点值冒泡到form
|
|
370
|
+
values = props;
|
|
371
|
+
if (labelInValue) {
|
|
372
|
+
values = state.flatTreeData.filter(function (item) {
|
|
373
|
+
return values === item[fieldNameValue];
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
onChange && onChange(values);
|
|
377
|
+
}
|
|
378
|
+
case 8:
|
|
379
|
+
case "end":
|
|
380
|
+
return _context.stop();
|
|
381
|
+
}
|
|
382
|
+
}, _callee);
|
|
383
|
+
}));
|
|
384
|
+
return function onSelectTreeNode(_x, _x2) {
|
|
385
|
+
return _ref2.apply(this, arguments);
|
|
386
|
+
};
|
|
387
|
+
}();
|
|
365
388
|
var boxClass = (0, _classnames.default)((0, _defineProperty2.default)({
|
|
366
389
|
'pro-tree': true,
|
|
367
390
|
'footer-shadow': footer
|
|
368
391
|
}, className, className));
|
|
369
392
|
var toggleExpand = function toggleExpand() {
|
|
370
393
|
var _state$innerExpandKey;
|
|
371
|
-
// expandedKeys
|
|
372
394
|
if (state === null || state === void 0 ? void 0 : (_state$innerExpandKey = state.innerExpandKeys) === null || _state$innerExpandKey === void 0 ? void 0 : _state$innerExpandKey.length) {
|
|
373
395
|
setState({
|
|
374
396
|
innerExpandKeys: []
|
|
@@ -195,12 +195,8 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
195
195
|
}
|
|
196
196
|
}, [enumCode, dataSource]);
|
|
197
197
|
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
198
|
-
// code存在,不执行接口请求
|
|
199
|
-
if (enumCode) {
|
|
200
|
-
return undefined;
|
|
201
|
-
}
|
|
202
|
-
// dataSource存在不执行接口请求
|
|
203
|
-
if (dataSource) {
|
|
198
|
+
// code存在huo dataSource存在,不执行接口请求
|
|
199
|
+
if (enumCode || dataSource) {
|
|
204
200
|
return undefined;
|
|
205
201
|
}
|
|
206
202
|
// disabled 状态时,不查询接口
|
|
@@ -413,7 +409,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
413
409
|
}
|
|
414
410
|
return result;
|
|
415
411
|
}
|
|
416
|
-
var handleChange = function handleChange(newVal
|
|
412
|
+
var handleChange = function handleChange(newVal) {
|
|
417
413
|
// newVal回来得一定是label、value
|
|
418
414
|
var result = newVal;
|
|
419
415
|
if (props === null || props === void 0 ? void 0 : props.labelInValue) {
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -17,13 +19,13 @@ var _icons = require("@ant-design/icons");
|
|
|
17
19
|
var _SearchTitle = _interopRequireDefault(require("./SearchTitle"));
|
|
18
20
|
var _utils = require("../utils");
|
|
19
21
|
var _locale = _interopRequireDefault(require("../../locale"));
|
|
20
|
-
var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode"];
|
|
22
|
+
var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode", "isRadioSelect"];
|
|
21
23
|
/*
|
|
22
24
|
*@Date: 2023-07-25 13:49:35
|
|
23
25
|
*@LastEditTime: 2023-07-25 13:49:35
|
|
24
26
|
*@Author: liudongliang
|
|
25
27
|
*@Description: 树每行节点渲染组件,复选时阻止点击事件冒泡,只有点击树节点文本会向上触发onSelect事件
|
|
26
|
-
*/
|
|
28
|
+
*/
|
|
27
29
|
/* eslint-disable no-plusplus */
|
|
28
30
|
var tagsBgColors = ['rgba(0, 106, 255,0.16)', 'rgba(0, 196, 74,0.16)', 'rgba(255, 140, 0,0.16)', 'rgba(255, 80, 80,0.16)', 'rgba(97, 97, 97, 0.16)'];
|
|
29
31
|
var tagsColors = ['#006AFF', '#00C44A', '#FF8C00', '#FF5050', '#616161'];
|
|
@@ -55,19 +57,22 @@ function List(props) {
|
|
|
55
57
|
innerExpandKeys = props.innerExpandKeys,
|
|
56
58
|
selectedKey = props.selectedKey,
|
|
57
59
|
disabledMode = props.disabledMode,
|
|
60
|
+
isRadioSelect = props.isRadioSelect,
|
|
58
61
|
other = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
59
62
|
var fieldNameLabel = fieldNames.label;
|
|
60
63
|
var fieldNameValue = fieldNames.value;
|
|
61
64
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
62
65
|
expandedKeys: [],
|
|
63
66
|
autoExpandParent: true,
|
|
64
|
-
currentClickTreeNode: null
|
|
67
|
+
currentClickTreeNode: null,
|
|
68
|
+
handing: false
|
|
65
69
|
}),
|
|
66
70
|
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
67
71
|
_useSetState2$ = _useSetState2[0],
|
|
68
72
|
expandedKeys = _useSetState2$.expandedKeys,
|
|
69
73
|
autoExpandParent = _useSetState2$.autoExpandParent,
|
|
70
74
|
currentClickTreeNode = _useSetState2$.currentClickTreeNode,
|
|
75
|
+
handing = _useSetState2$.handing,
|
|
71
76
|
setState = _useSetState2[1];
|
|
72
77
|
(0, _react.useEffect)(function () {
|
|
73
78
|
if (searchStr) {
|
|
@@ -107,18 +112,44 @@ function List(props) {
|
|
|
107
112
|
});
|
|
108
113
|
}
|
|
109
114
|
}, [selectedKey]);
|
|
110
|
-
var onSelect = function
|
|
111
|
-
var
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
var onSelect = /*#__PURE__*/function () {
|
|
116
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value, item) {
|
|
117
|
+
var _props$onSelect;
|
|
118
|
+
var val;
|
|
119
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
120
|
+
while (1) switch (_context.prev = _context.next) {
|
|
121
|
+
case 0:
|
|
122
|
+
if (!handing) {
|
|
123
|
+
_context.next = 2;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
return _context.abrupt("return", null);
|
|
127
|
+
case 2:
|
|
128
|
+
val = value;
|
|
129
|
+
if (!isRadioSelect && value === currentClickTreeNode) {
|
|
130
|
+
// 如果当前点击了已经选中节点,那么取消选择
|
|
131
|
+
val = '';
|
|
132
|
+
}
|
|
133
|
+
setState({
|
|
134
|
+
currentClickTreeNode: val,
|
|
135
|
+
handing: true
|
|
136
|
+
});
|
|
137
|
+
_context.next = 7;
|
|
138
|
+
return props === null || props === void 0 ? void 0 : (_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 ? void 0 : _props$onSelect.call(props, val, item);
|
|
139
|
+
case 7:
|
|
140
|
+
setState({
|
|
141
|
+
handing: false
|
|
142
|
+
});
|
|
143
|
+
case 8:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context.stop();
|
|
146
|
+
}
|
|
147
|
+
}, _callee);
|
|
148
|
+
}));
|
|
149
|
+
return function onSelect(_x, _x2) {
|
|
150
|
+
return _ref.apply(this, arguments);
|
|
151
|
+
};
|
|
152
|
+
}();
|
|
122
153
|
var TreeNodeRow = function TreeNodeRow(props) {
|
|
123
154
|
var nodeClass = props.nodeClass,
|
|
124
155
|
item = props.item,
|
|
@@ -268,7 +299,6 @@ function List(props) {
|
|
|
268
299
|
})]
|
|
269
300
|
}, onlyKey);
|
|
270
301
|
};
|
|
271
|
-
// const _treeData = useMemo(() => {
|
|
272
302
|
function fn() {
|
|
273
303
|
var loop = function loop(data, index) {
|
|
274
304
|
index++;
|
|
@@ -280,33 +310,27 @@ function List(props) {
|
|
|
280
310
|
isChecked = true;
|
|
281
311
|
}
|
|
282
312
|
var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]) : item[fieldNameLabel];
|
|
313
|
+
var nodeTitle = (0, _jsxRuntime.jsx)(TreeNodeRow, {
|
|
314
|
+
nodeClass: nodeClass,
|
|
315
|
+
item: item,
|
|
316
|
+
index: index,
|
|
317
|
+
title: (item === null || item === void 0 ? void 0 : item.title) || title,
|
|
318
|
+
isChecked: isChecked,
|
|
319
|
+
onlyKey: item[fieldNameValue]
|
|
320
|
+
});
|
|
283
321
|
if (item[fieldNames.children]) {
|
|
284
|
-
return {
|
|
285
|
-
title:
|
|
286
|
-
|
|
287
|
-
item: item,
|
|
288
|
-
index: index,
|
|
289
|
-
title: title,
|
|
290
|
-
isChecked: isChecked,
|
|
291
|
-
onlyKey: item[fieldNameValue]
|
|
292
|
-
}),
|
|
293
|
-
key: item[fieldNameValue],
|
|
322
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
323
|
+
title: nodeTitle,
|
|
324
|
+
key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue],
|
|
294
325
|
children: loop(item[fieldNames.children], index)
|
|
295
|
-
};
|
|
326
|
+
});
|
|
296
327
|
}
|
|
297
|
-
return {
|
|
298
|
-
title:
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
index: index,
|
|
302
|
-
title: title,
|
|
303
|
-
isChecked: isChecked,
|
|
304
|
-
onlyKey: item[fieldNameValue]
|
|
305
|
-
}),
|
|
306
|
-
key: item[fieldNameValue]
|
|
307
|
-
};
|
|
328
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
329
|
+
title: nodeTitle,
|
|
330
|
+
key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue]
|
|
331
|
+
});
|
|
308
332
|
});
|
|
309
|
-
return treeRow;
|
|
333
|
+
return treeRow;
|
|
310
334
|
};
|
|
311
335
|
if ((other === null || other === void 0 ? void 0 : other.mode) === 'view') {
|
|
312
336
|
return;
|
|
@@ -317,8 +341,6 @@ function List(props) {
|
|
|
317
341
|
}
|
|
318
342
|
return loop(newTreeData, -1);
|
|
319
343
|
}
|
|
320
|
-
// return fn();
|
|
321
|
-
// }, [searchStr, expandedKeys, showCodeName, originalTreeData, currentClickTreeNode]);
|
|
322
344
|
var _treeData = fn();
|
|
323
345
|
var onExpand = function onExpand(newExpandedKeys) {
|
|
324
346
|
setState({
|