@zat-design/sisyphus-react 3.4.5 → 3.4.6-beta.2
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 +147 -34
- package/dist/less.esm.css +147 -34
- 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 +19 -14
- 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.d.ts +6 -1
- package/es/ProForm/utils/index.js +9 -6
- 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 +5 -9
- package/es/ProTree/components/ProTreeSelect/style/index.less +6 -8
- package/es/ProTree/components/Tree.js +63 -41
- package/es/ProTree/style/index.less +38 -16
- 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 +19 -14
- 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.d.ts +6 -1
- package/lib/ProForm/utils/index.js +9 -6
- 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 +5 -9
- package/lib/ProTree/components/ProTreeSelect/style/index.less +6 -8
- package/lib/ProTree/components/Tree.js +63 -41
- package/lib/ProTree/style/index.less +38 -16
- 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
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import React, { useMemo, useState } from 'react';
|
|
5
5
|
import { cloneDeep } from 'lodash';
|
|
6
|
-
import
|
|
6
|
+
import ProIcon from '../../../ProIcon/index';
|
|
7
7
|
import catalogSvg from '../../../assets/catalog.svg';
|
|
8
8
|
import Anchor from '../Anchor';
|
|
9
9
|
import locale from '../../../locale';
|
|
@@ -59,9 +59,10 @@ export var Step = function Step(_ref) {
|
|
|
59
59
|
onMouseLeave: handleMouseLeave,
|
|
60
60
|
children: [_jsxs("div", {
|
|
61
61
|
className: "step-menu",
|
|
62
|
-
children: [_jsx(
|
|
62
|
+
children: [_jsx(ProIcon, {
|
|
63
|
+
src: catalogSvg,
|
|
63
64
|
className: "menu-icon",
|
|
64
|
-
|
|
65
|
+
actionMap: {}
|
|
65
66
|
}), onOff && _jsx("div", {
|
|
66
67
|
children: locale === null || locale === void 0 ? void 0 : (_locale$ProStep = locale.ProStep) === null || _locale$ProStep === void 0 ? void 0 : _locale$ProStep.catalogue
|
|
67
68
|
})]
|
|
@@ -27,6 +27,43 @@
|
|
|
27
27
|
height: 48px;
|
|
28
28
|
font-size: var(--zaui-font-size-lg, 16px);
|
|
29
29
|
border-bottom: 1px solid var(--zaui-line, #dddddd);
|
|
30
|
+
> .anticon {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
width: 48px;
|
|
35
|
+
height: 24px;
|
|
36
|
+
> .menu-icon {
|
|
37
|
+
width: auto !important;
|
|
38
|
+
height: auto !important;
|
|
39
|
+
font-size: var(--zaui-font-size-lg-title, 24px);
|
|
40
|
+
fill: var(--zaui-brand, #006aff);
|
|
41
|
+
> div {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
width: 48px;
|
|
46
|
+
height: 24px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
> button {
|
|
50
|
+
width: auto !important;
|
|
51
|
+
height: auto !important;
|
|
52
|
+
> .menu-icon {
|
|
53
|
+
width: auto !important;
|
|
54
|
+
height: auto !important;
|
|
55
|
+
font-size: var(--zaui-font-size-lg-title, 24px);
|
|
56
|
+
fill: var(--zaui-brand, #006aff);
|
|
57
|
+
> div {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
width: 48px;
|
|
62
|
+
height: 24px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
30
67
|
|
|
31
68
|
> .menu-icon {
|
|
32
69
|
font-size: var(--zaui-font-size-lg-title, 24px);
|
package/es/ProTable/utils.js
CHANGED
|
@@ -269,19 +269,22 @@ export var formatColumn = function formatColumn(column, originalObj, dataSourceO
|
|
|
269
269
|
'varied-cell': originalValue !== undefined,
|
|
270
270
|
'empty-cell': isEmpty
|
|
271
271
|
});
|
|
272
|
-
var renderValue = _jsx(ProForm.
|
|
272
|
+
var renderValue = _jsx(ProForm.ProCascader, {
|
|
273
273
|
isView: true,
|
|
274
|
+
mode: "address",
|
|
274
275
|
code: code,
|
|
275
276
|
value: realValue
|
|
276
277
|
});
|
|
277
|
-
var originalRenderValue = _jsx(ProForm.
|
|
278
|
+
var originalRenderValue = _jsx(ProForm.ProCascader, {
|
|
278
279
|
isView: true,
|
|
280
|
+
mode: "address",
|
|
279
281
|
code: code,
|
|
280
282
|
value: originalRealValue
|
|
281
283
|
});
|
|
282
|
-
return _jsx(ProForm.
|
|
284
|
+
return _jsx(ProForm.ProCascader, {
|
|
283
285
|
className: className,
|
|
284
286
|
isView: true,
|
|
287
|
+
mode: "address",
|
|
285
288
|
code: code,
|
|
286
289
|
value: realValue,
|
|
287
290
|
tooltip: originalValue !== undefined ? _jsxs(_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 = useProConfig(),
|
|
34
33
|
config = _useProConfig.state,
|
|
35
34
|
dispatch = _useProConfig.dispatch;
|
|
36
|
-
var ProForm = config.ProForm;
|
|
37
35
|
var _useState = 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 = _slicedToArray(_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
|
}), _jsx("div", {
|
|
168
172
|
className: "pro-theme-tools-item",
|
|
169
173
|
children: _jsxs(_Radio.Group, {
|
|
170
|
-
value:
|
|
174
|
+
value: state.zauiFormAlign,
|
|
171
175
|
onChange: function onChange(e) {
|
|
176
|
+
setState(_objectSpread(_objectSpread({}, state), {}, {
|
|
177
|
+
zauiFormAlign: e.target.value
|
|
178
|
+
}));
|
|
179
|
+
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
|
}
|
|
@@ -5,6 +5,8 @@ import _Input from "antd/es/input";
|
|
|
5
5
|
import "antd/es/spin/style";
|
|
6
6
|
import _Spin from "antd/es/spin";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
9
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
8
10
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
9
11
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
10
12
|
import "antd/es/message/style";
|
|
@@ -159,10 +161,7 @@ var ProTree = function ProTree(props) {
|
|
|
159
161
|
}
|
|
160
162
|
}, [dataSource, enumCode]);
|
|
161
163
|
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 _typeof(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
|
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 _typeof(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 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(props, info) {
|
|
344
|
+
var values;
|
|
345
|
+
return _regeneratorRuntime().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 = classNames(_defineProperty({
|
|
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: []
|
|
@@ -193,12 +193,8 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
193
193
|
}
|
|
194
194
|
}, [enumCode, dataSource]);
|
|
195
195
|
useDeepCompareEffect(function () {
|
|
196
|
-
// code存在,不执行接口请求
|
|
197
|
-
if (enumCode) {
|
|
198
|
-
return undefined;
|
|
199
|
-
}
|
|
200
|
-
// dataSource存在不执行接口请求
|
|
201
|
-
if (dataSource) {
|
|
196
|
+
// code存在huo dataSource存在,不执行接口请求
|
|
197
|
+
if (enumCode || dataSource) {
|
|
202
198
|
return undefined;
|
|
203
199
|
}
|
|
204
200
|
// disabled 状态时,不查询接口
|
|
@@ -411,13 +407,13 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
411
407
|
}
|
|
412
408
|
return result;
|
|
413
409
|
}
|
|
414
|
-
var handleChange = function handleChange(newVal,
|
|
410
|
+
var handleChange = function handleChange(newVal, label, extra) {
|
|
415
411
|
// newVal回来得一定是label、value
|
|
416
412
|
var result = newVal;
|
|
417
413
|
if (props === null || props === void 0 ? void 0 : props.labelInValue) {
|
|
418
414
|
result = getLabelByValue(selectList, newVal);
|
|
419
415
|
}
|
|
420
|
-
onChange && onChange(result,
|
|
416
|
+
onChange && onChange(result, label, extra);
|
|
421
417
|
// 重置搜索
|
|
422
418
|
showSearch && searchTreeEvent('');
|
|
423
419
|
};
|
|
@@ -490,7 +486,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
490
486
|
allowClear: allowClear || true,
|
|
491
487
|
showArrow: true,
|
|
492
488
|
treeNodeFilterProp: treeNodeFilterProp,
|
|
493
|
-
virtual:
|
|
489
|
+
virtual: true
|
|
494
490
|
}, selectProps);
|
|
495
491
|
if (value === null) {
|
|
496
492
|
delete treeProps.value;
|
|
@@ -40,6 +40,12 @@
|
|
|
40
40
|
color: red;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
// 隐藏单选下拉树后面勾号
|
|
44
|
+
.@{ant-prefix}-select-tree-node-content-wrapper{
|
|
45
|
+
.check-mark-icon{
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
43
49
|
// 单选
|
|
44
50
|
&.signal-tree{
|
|
45
51
|
.@{ant-prefix}-select-tree{
|
|
@@ -63,14 +69,6 @@
|
|
|
63
69
|
display: block;
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
|
-
.@{ant-prefix}-select-tree-node-content-wrapper{
|
|
67
|
-
background-color: transparent;
|
|
68
|
-
&.@{ant-prefix}-select-tree-node-selected{
|
|
69
|
-
.check-mark-icon{
|
|
70
|
-
display: block;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
72
|
.@{ant-prefix}-select-tree-treenode:hover{
|
|
75
73
|
background-color: #f5f5f5;
|
|
76
74
|
}
|