@zat-design/sisyphus-react 3.4.5 → 3.4.6-beta.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.
Files changed (137) hide show
  1. package/dist/index.esm.css +151 -35
  2. package/dist/less.esm.css +151 -35
  3. package/es/ProConfigProvider/index.d.ts +2 -2
  4. package/es/ProConfigProvider/index.js +0 -3
  5. package/es/ProEditTable/components/RenderField/index.js +56 -48
  6. package/es/ProEditTable/index.js +3 -3
  7. package/es/ProEditTable/style/index.less +5 -7
  8. package/es/ProEditTable/utils/tools.d.ts +12 -0
  9. package/es/ProEditTable/utils/tools.js +79 -2
  10. package/es/ProForm/components/base/RangePicker/index.js +9 -9
  11. package/es/ProForm/components/base/TextArea/index.d.ts +1 -0
  12. package/es/ProForm/components/base/TextArea/index.js +4 -2
  13. package/es/ProForm/components/combination/Container/index.js +3 -2
  14. package/es/ProForm/components/combination/Container/style/index.less +5 -1
  15. package/es/ProForm/components/combination/FormList/index.js +1 -0
  16. package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
  17. package/es/ProForm/components/combination/ProCascader/index.js +256 -0
  18. package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +9 -6
  19. package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
  20. package/es/ProForm/components/combination/ProCascader/utils/index.js +26 -0
  21. package/es/ProForm/components/combination/ProModalSelect/index.js +47 -33
  22. package/es/ProForm/components/combination/ProModalSelect/style/index.less +23 -0
  23. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
  24. package/es/ProForm/components/combination/ProRangeLimit/index.js +17 -10
  25. package/es/ProForm/components/index.d.ts +1 -2
  26. package/es/ProForm/components/index.js +1 -4
  27. package/es/ProForm/components/render/Render.js +25 -20
  28. package/es/ProForm/components/render/RenderFields.js +4 -1
  29. package/es/ProForm/components/render/propsType.d.ts +5 -8
  30. package/es/ProForm/index.js +6 -2
  31. package/es/ProForm/propsType.d.ts +3 -0
  32. package/es/ProForm/style/index.less +2 -1
  33. package/es/ProForm/utils/index.d.ts +6 -1
  34. package/es/ProForm/utils/index.js +9 -6
  35. package/es/ProForm/utils/useChanged.js +1 -2
  36. package/es/ProForm/utils/useForm.js +19 -6
  37. package/es/ProForm/utils/useListChanged.js +1 -3
  38. package/es/ProIcon/config/index.d.ts +2 -0
  39. package/es/ProIcon/config/index.js +4 -2
  40. package/es/ProIcon/index.js +148 -81
  41. package/es/ProIcon/propsTypes.d.ts +6 -1
  42. package/es/ProIcon/utils/index.d.ts +5 -0
  43. package/es/ProIcon/utils/index.js +60 -0
  44. package/es/ProLayout/components/ProCollapse/index.js +6 -3
  45. package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
  46. package/es/ProSelect/index.js +15 -3
  47. package/es/ProSelect/propsType.d.ts +2 -0
  48. package/es/ProSelect/utils/index.d.ts +9 -0
  49. package/es/ProSelect/utils/index.js +60 -0
  50. package/es/ProStep/components/Step/index.js +4 -3
  51. package/es/ProStep/style/index.less +37 -0
  52. package/es/ProTable/utils.js +6 -3
  53. package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  54. package/es/ProThemeTools/component/PrdTools/index.js +16 -6
  55. package/es/ProThemeTools/component/PrdTools/style/index.less +56 -48
  56. package/es/ProTree/components/ProTree.js +96 -74
  57. package/es/ProTree/components/ProTreeSelect/index.js +5 -9
  58. package/es/ProTree/components/ProTreeSelect/style/index.less +6 -8
  59. package/es/ProTree/components/Tree.js +63 -41
  60. package/es/ProTree/style/index.less +38 -16
  61. package/es/ProUpload/index.js +11 -13
  62. package/es/ProUpload/propsType.d.ts +8 -3
  63. package/es/assets/view.svg +2 -2
  64. package/es/global.less +37 -28
  65. package/lib/ProConfigProvider/index.d.ts +2 -2
  66. package/lib/ProConfigProvider/index.js +0 -3
  67. package/lib/ProEditTable/components/RenderField/index.js +54 -46
  68. package/lib/ProEditTable/index.js +3 -3
  69. package/lib/ProEditTable/style/index.less +5 -7
  70. package/lib/ProEditTable/utils/tools.d.ts +12 -0
  71. package/lib/ProEditTable/utils/tools.js +80 -2
  72. package/lib/ProForm/components/base/RangePicker/index.js +9 -9
  73. package/lib/ProForm/components/base/TextArea/index.d.ts +1 -0
  74. package/lib/ProForm/components/base/TextArea/index.js +4 -2
  75. package/lib/ProForm/components/combination/Container/index.js +3 -2
  76. package/lib/ProForm/components/combination/Container/style/index.less +5 -1
  77. package/lib/ProForm/components/combination/FormList/index.js +1 -0
  78. package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
  79. package/lib/ProForm/components/combination/ProCascader/index.js +256 -0
  80. package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +9 -6
  81. package/lib/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
  82. package/lib/ProForm/components/combination/ProCascader/utils/index.js +33 -0
  83. package/lib/ProForm/components/combination/ProModalSelect/index.js +46 -32
  84. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +23 -0
  85. package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
  86. package/lib/ProForm/components/combination/ProRangeLimit/index.js +17 -10
  87. package/lib/ProForm/components/index.d.ts +1 -2
  88. package/lib/ProForm/components/index.js +1 -8
  89. package/lib/ProForm/components/render/Render.js +25 -20
  90. package/lib/ProForm/components/render/RenderFields.js +4 -1
  91. package/lib/ProForm/components/render/propsType.d.ts +5 -8
  92. package/lib/ProForm/index.js +5 -1
  93. package/lib/ProForm/propsType.d.ts +3 -0
  94. package/lib/ProForm/style/index.less +2 -1
  95. package/lib/ProForm/utils/index.d.ts +6 -1
  96. package/lib/ProForm/utils/index.js +9 -6
  97. package/lib/ProForm/utils/useChanged.js +1 -2
  98. package/lib/ProForm/utils/useForm.js +19 -6
  99. package/lib/ProForm/utils/useListChanged.js +1 -3
  100. package/lib/ProIcon/config/index.d.ts +2 -0
  101. package/lib/ProIcon/config/index.js +4 -2
  102. package/lib/ProIcon/index.js +144 -77
  103. package/lib/ProIcon/propsTypes.d.ts +6 -1
  104. package/lib/ProIcon/utils/index.d.ts +5 -0
  105. package/lib/ProIcon/utils/index.js +62 -1
  106. package/lib/ProLayout/components/ProCollapse/index.js +6 -3
  107. package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
  108. package/lib/ProSelect/index.js +15 -3
  109. package/lib/ProSelect/propsType.d.ts +2 -0
  110. package/lib/ProSelect/utils/index.d.ts +9 -0
  111. package/lib/ProSelect/utils/index.js +68 -0
  112. package/lib/ProStep/components/Step/index.js +4 -3
  113. package/lib/ProStep/style/index.less +37 -0
  114. package/lib/ProTable/utils.js +6 -3
  115. package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
  116. package/lib/ProThemeTools/component/PrdTools/index.js +16 -6
  117. package/lib/ProThemeTools/component/PrdTools/style/index.less +56 -48
  118. package/lib/ProTree/components/ProTree.js +96 -74
  119. package/lib/ProTree/components/ProTreeSelect/index.js +5 -9
  120. package/lib/ProTree/components/ProTreeSelect/style/index.less +6 -8
  121. package/lib/ProTree/components/Tree.js +63 -41
  122. package/lib/ProTree/style/index.less +38 -16
  123. package/lib/ProUpload/index.js +10 -12
  124. package/lib/ProUpload/propsType.d.ts +8 -3
  125. package/lib/assets/view.svg +2 -2
  126. package/lib/global.less +37 -28
  127. package/package.json +2 -2
  128. package/es/ProForm/components/base/ProCascader/index.d.ts +0 -14
  129. package/es/ProForm/components/base/ProCascader/index.js +0 -72
  130. package/es/ProForm/components/combination/ProAddressBar/index.js +0 -437
  131. package/lib/ProForm/components/base/ProCascader/index.d.ts +0 -14
  132. package/lib/ProForm/components/base/ProCascader/index.js +0 -78
  133. package/lib/ProForm/components/combination/ProAddressBar/index.js +0 -437
  134. /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
  135. /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
  136. /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
  137. /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
@@ -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);
@@ -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.ProAddressBar, {
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.ProAddressBar, {
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.ProAddressBar, {
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, prefixCls, }: DevToolsPropsType) => JSX.Element;
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: ProForm === null || ProForm === void 0 ? void 0 : ProForm.labelAlign,
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
- padding-left : 12px;
20
- position : relative;
19
+ position: relative;
21
20
  margin-bottom: var(--zaui-space-size-md, 16px);
22
- font-size : var(--zaui-font-size, 14px);
21
+ padding-left: 12px;
22
+ font-size: var(--zaui-font-size, 14px);
23
23
 
24
24
  &:before {
25
- content : '';
26
- position : absolute;
27
- left : 0;
28
- top : 4px;
29
- width : 4px;
30
- height : 14px;
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
- width : 38px;
41
- height : 38px;
42
- border-radius : 50%;
43
- background : #fff;
44
- display : flex;
40
+ display: flex;
41
+ align-items: center;
45
42
  justify-content: center;
46
- align-items : center;
47
- border : 6px solid #fff;
48
- color : #fff;
49
- margin-right : 34px;
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 : var(--zaui-font-size, 14px);
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 : #a00f20;
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
- width : calc(100% - 64px);
102
- bottom : 20px;
103
- left : 32px;
104
- z-index : 10;
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 : flex;
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 : absolute;
133
- top : 6px;
134
- left : -37px;
135
- display : flex;
136
- align-items : center;
140
+ position: absolute;
141
+ top: 6px;
142
+ left: -37px;
143
+ display: flex;
144
+ align-items: center;
137
145
  justify-content: center;
138
- width : 32px;
139
- height : 38px;
140
- color : #fff;
141
- cursor : pointer;
146
+ width: 32px;
147
+ height: 38px;
148
+ color: #fff;
149
+ cursor: pointer;
142
150
 
143
151
  .close-icon {
144
- position : relative;
145
- left : 4px;
146
- z-index : 1;
147
- color : var(--zaui-text, #343434);
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 : absolute;
159
- top : 0;
160
- right : 0;
161
- bottom : 0;
162
- left : 0;
166
+ position: absolute;
167
+ top: 0;
168
+ right: 0;
169
+ bottom: 0;
170
+ left: 0;
163
171
  background-color: #fff;
164
- border-radius : 4px 0px 0px 4px;
165
- transform : perspective(0.15em) rotateY(-2deg);
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
- var innerVal = value;
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
- if (allValue && typeof value === 'string') {
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 onSelectTreeNode(props, info) {
340
- if (disabled || isView) {
341
- return null;
342
- }
343
- setState({
344
- clickShowLoading: loading
345
- });
346
- if (onSelect) {
347
- var _onSelect;
348
- (_onSelect = onSelect(props, info)) === null || _onSelect === void 0 ? void 0 : _onSelect.then(function () {
349
- setState({
350
- clickShowLoading: false
351
- });
352
- });
353
- }
354
- if (!(other === null || other === void 0 ? void 0 : other.checkable)) {
355
- // 单选将选中节点值冒泡到form
356
- var values = props;
357
- if (labelInValue) {
358
- values = state.flatTreeData.filter(function (item) {
359
- return values === item[fieldNameValue];
360
- });
361
- }
362
- onChange && onChange(values);
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,13 +409,13 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
413
409
  }
414
410
  return result;
415
411
  }
416
- var handleChange = function handleChange(newVal, option) {
412
+ var handleChange = function handleChange(newVal, label, extra) {
417
413
  // newVal回来得一定是label、value
418
414
  var result = newVal;
419
415
  if (props === null || props === void 0 ? void 0 : props.labelInValue) {
420
416
  result = getLabelByValue(selectList, newVal);
421
417
  }
422
- onChange && onChange(result, selectList, null);
418
+ onChange && onChange(result, label, extra);
423
419
  // 重置搜索
424
420
  showSearch && searchTreeEvent('');
425
421
  };
@@ -492,7 +488,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
492
488
  allowClear: allowClear || true,
493
489
  showArrow: true,
494
490
  treeNodeFilterProp: treeNodeFilterProp,
495
- virtual: false
491
+ virtual: true
496
492
  }, selectProps);
497
493
  if (value === null) {
498
494
  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
  }