@zat-design/sisyphus-react 3.7.3-beta.15 → 3.7.3-beta.17

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 (60) hide show
  1. package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
  2. package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
  3. package/coverage/lcov-report/src/.umi/core/index.html +206 -0
  4. package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
  5. package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
  6. package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
  7. package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
  8. package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
  9. package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
  10. package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
  11. package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
  12. package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
  13. package/coverage/lcov-report/src/.umi/index.html +116 -0
  14. package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
  15. package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
  16. package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
  17. package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
  18. package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
  19. package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
  20. package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
  21. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
  22. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
  23. package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
  24. package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
  25. package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
  26. package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
  27. package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
  28. package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
  29. package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
  30. package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
  31. package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
  32. package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
  33. package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
  34. package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
  35. package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
  36. package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
  37. package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
  38. package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
  39. package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
  40. package/es/ProForm/components/render/ChangedWrapper.js +21 -8
  41. package/es/ProForm/propsType.d.ts +1 -0
  42. package/es/ProSelect/index.js +4 -3
  43. package/es/ProTree/components/ProTreeSelect/index.js +8 -8
  44. package/es/ProTree/components/SearchTitle.d.ts +2 -1
  45. package/es/ProTree/components/SearchTitle.js +12 -2
  46. package/es/ProTreeModal/components/Tree.js +15 -17
  47. package/es/ProTreeModal/index.js +62 -7
  48. package/es/ProTreeModal/utils.d.ts +1 -0
  49. package/es/ProTreeModal/utils.js +21 -1
  50. package/lib/ProForm/components/render/ChangedWrapper.js +23 -10
  51. package/lib/ProForm/propsType.d.ts +1 -0
  52. package/lib/ProSelect/index.js +4 -3
  53. package/lib/ProTree/components/ProTreeSelect/index.js +8 -8
  54. package/lib/ProTree/components/SearchTitle.d.ts +2 -1
  55. package/lib/ProTree/components/SearchTitle.js +13 -2
  56. package/lib/ProTreeModal/components/Tree.js +15 -17
  57. package/lib/ProTreeModal/index.js +61 -6
  58. package/lib/ProTreeModal/utils.d.ts +1 -0
  59. package/lib/ProTreeModal/utils.js +20 -0
  60. package/package.json +1 -1
@@ -0,0 +1,268 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/.umi/umi.ts</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../prettify.css" />
9
+ <link rel="stylesheet" href="../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/.umi</a> umi.ts</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">0% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>0/14</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">0% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>0/7</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">0% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>0/4</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">0% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>0/13</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <div class='status-line low'></div>
65
+ <pre><table class="coverage">
66
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
+ <a name='L2'></a><a href='#L2'>2</a>
68
+ <a name='L3'></a><a href='#L3'>3</a>
69
+ <a name='L4'></a><a href='#L4'>4</a>
70
+ <a name='L5'></a><a href='#L5'>5</a>
71
+ <a name='L6'></a><a href='#L6'>6</a>
72
+ <a name='L7'></a><a href='#L7'>7</a>
73
+ <a name='L8'></a><a href='#L8'>8</a>
74
+ <a name='L9'></a><a href='#L9'>9</a>
75
+ <a name='L10'></a><a href='#L10'>10</a>
76
+ <a name='L11'></a><a href='#L11'>11</a>
77
+ <a name='L12'></a><a href='#L12'>12</a>
78
+ <a name='L13'></a><a href='#L13'>13</a>
79
+ <a name='L14'></a><a href='#L14'>14</a>
80
+ <a name='L15'></a><a href='#L15'>15</a>
81
+ <a name='L16'></a><a href='#L16'>16</a>
82
+ <a name='L17'></a><a href='#L17'>17</a>
83
+ <a name='L18'></a><a href='#L18'>18</a>
84
+ <a name='L19'></a><a href='#L19'>19</a>
85
+ <a name='L20'></a><a href='#L20'>20</a>
86
+ <a name='L21'></a><a href='#L21'>21</a>
87
+ <a name='L22'></a><a href='#L22'>22</a>
88
+ <a name='L23'></a><a href='#L23'>23</a>
89
+ <a name='L24'></a><a href='#L24'>24</a>
90
+ <a name='L25'></a><a href='#L25'>25</a>
91
+ <a name='L26'></a><a href='#L26'>26</a>
92
+ <a name='L27'></a><a href='#L27'>27</a>
93
+ <a name='L28'></a><a href='#L28'>28</a>
94
+ <a name='L29'></a><a href='#L29'>29</a>
95
+ <a name='L30'></a><a href='#L30'>30</a>
96
+ <a name='L31'></a><a href='#L31'>31</a>
97
+ <a name='L32'></a><a href='#L32'>32</a>
98
+ <a name='L33'></a><a href='#L33'>33</a>
99
+ <a name='L34'></a><a href='#L34'>34</a>
100
+ <a name='L35'></a><a href='#L35'>35</a>
101
+ <a name='L36'></a><a href='#L36'>36</a>
102
+ <a name='L37'></a><a href='#L37'>37</a>
103
+ <a name='L38'></a><a href='#L38'>38</a>
104
+ <a name='L39'></a><a href='#L39'>39</a>
105
+ <a name='L40'></a><a href='#L40'>40</a>
106
+ <a name='L41'></a><a href='#L41'>41</a>
107
+ <a name='L42'></a><a href='#L42'>42</a>
108
+ <a name='L43'></a><a href='#L43'>43</a>
109
+ <a name='L44'></a><a href='#L44'>44</a>
110
+ <a name='L45'></a><a href='#L45'>45</a>
111
+ <a name='L46'></a><a href='#L46'>46</a>
112
+ <a name='L47'></a><a href='#L47'>47</a>
113
+ <a name='L48'></a><a href='#L48'>48</a>
114
+ <a name='L49'></a><a href='#L49'>49</a>
115
+ <a name='L50'></a><a href='#L50'>50</a>
116
+ <a name='L51'></a><a href='#L51'>51</a>
117
+ <a name='L52'></a><a href='#L52'>52</a>
118
+ <a name='L53'></a><a href='#L53'>53</a>
119
+ <a name='L54'></a><a href='#L54'>54</a>
120
+ <a name='L55'></a><a href='#L55'>55</a>
121
+ <a name='L56'></a><a href='#L56'>56</a>
122
+ <a name='L57'></a><a href='#L57'>57</a>
123
+ <a name='L58'></a><a href='#L58'>58</a>
124
+ <a name='L59'></a><a href='#L59'>59</a>
125
+ <a name='L60'></a><a href='#L60'>60</a>
126
+ <a name='L61'></a><a href='#L61'>61</a>
127
+ <a name='L62'></a><a href='#L62'>62</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
128
+ <span class="cline-any cline-neutral">&nbsp;</span>
129
+ <span class="cline-any cline-neutral">&nbsp;</span>
130
+ <span class="cline-any cline-neutral">&nbsp;</span>
131
+ <span class="cline-any cline-neutral">&nbsp;</span>
132
+ <span class="cline-any cline-neutral">&nbsp;</span>
133
+ <span class="cline-any cline-neutral">&nbsp;</span>
134
+ <span class="cline-any cline-neutral">&nbsp;</span>
135
+ <span class="cline-any cline-neutral">&nbsp;</span>
136
+ <span class="cline-any cline-neutral">&nbsp;</span>
137
+ <span class="cline-any cline-neutral">&nbsp;</span>
138
+ <span class="cline-any cline-neutral">&nbsp;</span>
139
+ <span class="cline-any cline-neutral">&nbsp;</span>
140
+ <span class="cline-any cline-no">&nbsp;</span>
141
+ <span class="cline-any cline-neutral">&nbsp;</span>
142
+ <span class="cline-any cline-no">&nbsp;</span>
143
+ <span class="cline-any cline-neutral">&nbsp;</span>
144
+ <span class="cline-any cline-neutral">&nbsp;</span>
145
+ <span class="cline-any cline-neutral">&nbsp;</span>
146
+ <span class="cline-any cline-no">&nbsp;</span>
147
+ <span class="cline-any cline-neutral">&nbsp;</span>
148
+ <span class="cline-any cline-neutral">&nbsp;</span>
149
+ <span class="cline-any cline-neutral">&nbsp;</span>
150
+ <span class="cline-any cline-neutral">&nbsp;</span>
151
+ <span class="cline-any cline-neutral">&nbsp;</span>
152
+ <span class="cline-any cline-neutral">&nbsp;</span>
153
+ <span class="cline-any cline-neutral">&nbsp;</span>
154
+ <span class="cline-any cline-neutral">&nbsp;</span>
155
+ <span class="cline-any cline-neutral">&nbsp;</span>
156
+ <span class="cline-any cline-neutral">&nbsp;</span>
157
+ <span class="cline-any cline-neutral">&nbsp;</span>
158
+ <span class="cline-any cline-neutral">&nbsp;</span>
159
+ <span class="cline-any cline-no">&nbsp;</span>
160
+ <span class="cline-any cline-neutral">&nbsp;</span>
161
+ <span class="cline-any cline-neutral">&nbsp;</span>
162
+ <span class="cline-any cline-neutral">&nbsp;</span>
163
+ <span class="cline-any cline-neutral">&nbsp;</span>
164
+ <span class="cline-any cline-no">&nbsp;</span>
165
+ <span class="cline-any cline-neutral">&nbsp;</span>
166
+ <span class="cline-any cline-neutral">&nbsp;</span>
167
+ <span class="cline-any cline-neutral">&nbsp;</span>
168
+ <span class="cline-any cline-no">&nbsp;</span>
169
+ <span class="cline-any cline-neutral">&nbsp;</span>
170
+ <span class="cline-any cline-neutral">&nbsp;</span>
171
+ <span class="cline-any cline-neutral">&nbsp;</span>
172
+ <span class="cline-any cline-neutral">&nbsp;</span>
173
+ <span class="cline-any cline-neutral">&nbsp;</span>
174
+ <span class="cline-any cline-neutral">&nbsp;</span>
175
+ <span class="cline-any cline-no">&nbsp;</span>
176
+ <span class="cline-any cline-neutral">&nbsp;</span>
177
+ <span class="cline-any cline-no">&nbsp;</span>
178
+ <span class="cline-any cline-no">&nbsp;</span>
179
+ <span class="cline-any cline-no">&nbsp;</span>
180
+ <span class="cline-any cline-no">&nbsp;</span>
181
+ <span class="cline-any cline-no">&nbsp;</span>
182
+ <span class="cline-any cline-neutral">&nbsp;</span>
183
+ <span class="cline-any cline-neutral">&nbsp;</span>
184
+ <span class="cline-any cline-no">&nbsp;</span>
185
+ <span class="cline-any cline-neutral">&nbsp;</span>
186
+ <span class="cline-any cline-neutral">&nbsp;</span>
187
+ <span class="cline-any cline-neutral">&nbsp;</span>
188
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// @ts-nocheck
189
+ import './core/polyfill';
190
+ import '@@/core/devScripts';
191
+ import { plugin } from './core/plugin';
192
+ import './core/pluginRegister';
193
+ import { createHistory } from './core/history';
194
+ import { ApplyPluginsType } from '/Users/zakj/Desktop/pro/za-material-warehouse/node_modules/@umijs/runtime';
195
+ import { renderClient } from '/Users/zakj/Desktop/pro/za-material-warehouse/node_modules/@umijs/renderer-react/dist/index.js';
196
+ import { getRoutes } from './core/routes';
197
+ &nbsp;
198
+ &nbsp;
199
+ import '../global.less';
200
+ import { _onCreate } from './plugin-locale/locale';
201
+ <span class="cstat-no" title="statement not covered" >_onCreate();</span>
202
+ &nbsp;
203
+ const getClientRender = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(a</span>rgs: { hot?: boolean; routes?: any[] } = <span class="branch-0 cbranch-no" title="branch not covered" >{})</span> =&gt; <span class="cstat-no" title="statement not covered" >plugin.applyPlugins({</span></span>
204
+ key: 'render',
205
+ type: ApplyPluginsType.compose,
206
+ initialValue: <span class="fstat-no" title="function not covered" >()</span> =&gt; {
207
+ const opts = <span class="cstat-no" title="statement not covered" >plugin.applyPlugins({</span>
208
+ key: 'modifyClientRenderOpts',
209
+ type: ApplyPluginsType.modify,
210
+ initialValue: {
211
+ routes: args.routes || getRoutes(),
212
+ plugin,
213
+ history: createHistory(args.hot),
214
+ isServer: process.env.__IS_SERVER,
215
+ dynamicImport: true,
216
+ rootElement: 'root',
217
+ defaultTitle: `sisyphus(3.4.3-beta.6)`,
218
+ },
219
+ });
220
+ <span class="cstat-no" title="statement not covered" > return renderClient(opts);</span>
221
+ },
222
+ args,
223
+ });
224
+ &nbsp;
225
+ const clientRender = <span class="cstat-no" title="statement not covered" >getClientRender();</span>
226
+ export default clientRender();
227
+ &nbsp;
228
+ &nbsp;
229
+ <span class="cstat-no" title="statement not covered" > window.g_umi = {</span>
230
+ version: '3.5.41',
231
+ };
232
+
233
+ &nbsp;
234
+ // hot module replacement
235
+ // @ts-ignore
236
+ <span class="cstat-no" title="statement not covered" >if (module.hot) {</span>
237
+ // @ts-ignore
238
+ <span class="cstat-no" title="statement not covered" > module.hot.accept('./core/routes', <span class="fstat-no" title="function not covered" >()</span> =&gt; {</span>
239
+ const ret = <span class="cstat-no" title="statement not covered" >require('./core/routes');</span>
240
+ <span class="cstat-no" title="statement not covered" > if (ret.then) {</span>
241
+ <span class="cstat-no" title="statement not covered" > ret.then(<span class="fstat-no" title="function not covered" >({</span> getRoutes }) =&gt; {</span>
242
+ <span class="cstat-no" title="statement not covered" > getClientRender({ hot: true, routes: getRoutes() })();</span>
243
+ });
244
+ } else {
245
+ <span class="cstat-no" title="statement not covered" > getClientRender({ hot: true, routes: ret.getRoutes() })();</span>
246
+ }
247
+ });
248
+ }
249
+ &nbsp;</pre></td></tr></table></pre>
250
+
251
+ <div class='push'></div><!-- for sticky footer -->
252
+ </div><!-- /wrapper -->
253
+ <div class='footer quiet pad2 space-top1 center small'>
254
+ Code coverage generated by
255
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
256
+ at 2024-01-24T02:49:50.075Z
257
+ </div>
258
+ <script src="../../prettify.js"></script>
259
+ <script>
260
+ window.onload = function () {
261
+ prettyPrint();
262
+ };
263
+ </script>
264
+ <script src="../../sorter.js"></script>
265
+ <script src="../../block-navigation.js"></script>
266
+ </body>
267
+ </html>
268
+
@@ -2,6 +2,7 @@ import "antd/es/space/style";
2
2
  import _Space from "antd/es/space";
3
3
  import "antd/es/tooltip/style";
4
4
  import _Tooltip from "antd/es/tooltip";
5
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
6
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
6
7
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
7
8
  var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName"];
@@ -13,7 +14,7 @@ import { diffOriginal } from '../../utils/diffOriginal';
13
14
  import { useProConfig } from '../../../ProConfigProvider';
14
15
  import { isEmpty } from '../../../utils';
15
16
  var ChangedWrapper = function ChangedWrapper(props) {
16
- var _diffConfig$toolTip;
17
+ var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
17
18
  var name = props.name,
18
19
  names = props.names,
19
20
  namesStr = props.namesStr,
@@ -51,11 +52,9 @@ var ChangedWrapper = function ChangedWrapper(props) {
51
52
  var isChanged = diffType === 'changed';
52
53
  var tipContent = useMemo(function () {
53
54
  if (!isWatch || noChange) return undefined;
54
- return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, {
55
- isView: true,
56
- value: originalValue,
57
- checked: type === 'Switch' ? originalValue : undefined
58
- })) : undefined;
55
+ return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, _defineProperty({
56
+ isView: true
57
+ }, valuePropName, originalValue))) : undefined;
59
58
  }, [originalValue, children]);
60
59
  if (!isWatch || noChange) {
61
60
  return /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest));
@@ -73,19 +72,33 @@ var ChangedWrapper = function ChangedWrapper(props) {
73
72
  'pro-form-item-changed': isChanged,
74
73
  'pro-form-item-add': isAdd
75
74
  });
75
+ // @ts-ignore
76
+ var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
76
77
  return _jsx(_Tooltip, {
77
78
  open: tipOpenCalc(),
79
+ mouseEnterDelay: 1,
78
80
  getPopupContainer: function getPopupContainer(target) {
79
81
  return target.parentElement;
80
82
  },
81
83
  title: _jsxs(_Space, {
82
- children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
84
+ direction: "vertical",
85
+ children: [_jsxs(_Space, {
86
+ children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
87
+ }), _showEllipse && _jsxs(_Space, {
88
+ children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
89
+ isView: true
90
+ })) : undefined]
91
+ })]
83
92
  }),
84
93
  placement: "topLeft",
85
94
  children: _jsx("div", {
86
95
  className: diffClassName,
87
96
  style: style,
88
- children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest)) : undefined
97
+ children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
98
+ otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
99
+ isDiffChange: isChanged
100
+ })
101
+ })) : undefined
89
102
  })
90
103
  });
91
104
  };
@@ -44,6 +44,7 @@ export interface ProFormOtherProps {
44
44
  listName?: any[] | string | number;
45
45
  globalControl?: boolean;
46
46
  formDisabled?: boolean;
47
+ isDiffChange?: boolean;
47
48
  }
48
49
  export interface DiffConfigProps<Values = any> {
49
50
  /** 比对原始数据源 */
@@ -24,6 +24,7 @@ import './index.less';
24
24
  var Option = _Select.Option;
25
25
  export var ProSelect = function ProSelect(props, ref) {
26
26
  var _selectProps$showCode, _locale$ProSelect;
27
+ console.log('props11: ', props);
27
28
  var _ref = useProConfig('ProSelect') || {},
28
29
  _ref$fieldNames = _ref.fieldNames,
29
30
  proSelectFieldNames = _ref$fieldNames === void 0 ? {} : _ref$fieldNames,
@@ -296,7 +297,8 @@ export var ProSelect = function ProSelect(props, ref) {
296
297
  showArrow: true,
297
298
  loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
298
299
  onChange: handleChange,
299
- optionLabelProp: "children" // 解决warning报错,添加默认值
300
+ // optionLabelProp={otherProps?.isDiffChange ? "label" : 'children'} // 解决warning报错,添加默认值
301
+ optionLabelProp: "label" // 解决warning报错,添加默认值
300
302
  ,
301
303
  showSearch: true,
302
304
  filterOption: isFunction(_onSearch) ? false : function (input, option) {
@@ -314,16 +316,15 @@ export var ProSelect = function ProSelect(props, ref) {
314
316
  value: transformValue(),
315
317
  children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
316
318
  return _jsx(Option, {
319
+ label: item[label],
317
320
  value: item[code],
318
321
  record: item,
319
322
  disabled: !!item.disabled,
320
323
  children: _jsx(TooltipOption, {
321
324
  title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
322
325
  children: OptionRender ? _jsx("span", {
323
- title: OptionRender(item),
324
326
  children: OptionRender(item)
325
327
  }) : _jsx("span", {
326
- title: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
327
328
  children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
328
329
  })
329
330
  }, item[code])
@@ -76,13 +76,13 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
76
76
  var _props$value = props.value,
77
77
  value = _props$value === void 0 ? undefined : _props$value;
78
78
  var _props$showEllipse = props.showEllipse,
79
- showEllipse = _props$showEllipse === void 0 ? true : _props$showEllipse,
80
- _props$isDiffChange = props.isDiffChange,
81
- isDiffChange = _props$isDiffChange === void 0 ? false : _props$isDiffChange;
79
+ showEllipse = _props$showEllipse === void 0 ? true : _props$showEllipse;
80
+ var _ref2 = otherProps !== null && otherProps !== void 0 ? otherProps : {},
81
+ isDiffChange = _ref2.isDiffChange;
82
82
  var _showEllipse = showEllipse && !isDiffChange;
83
- var _ref2 = otherProps || {},
84
- isView = _ref2.isView,
85
- viewEmpty = _ref2.viewEmpty;
83
+ var _ref3 = otherProps || {},
84
+ isView = _ref3.isView,
85
+ viewEmpty = _ref3.viewEmpty;
86
86
  if (fieldNames && Object.keys(fieldNames).length) {
87
87
  code = fieldNames.value || 'value';
88
88
  label = fieldNames.label || 'label';
@@ -215,8 +215,8 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
215
215
  return undefined;
216
216
  }
217
217
  // 如果配置手动加载,不执行请求
218
- var _ref3 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
219
- defaultParams = _ref3.defaultParams;
218
+ var _ref4 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
219
+ defaultParams = _ref4.defaultParams;
220
220
  // 执行用户配置的枚举服务,拉取枚举数据进行更新
221
221
  fetchFunction.run(defaultParams);
222
222
  }, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, defaultDisableValue]);
@@ -1,10 +1,11 @@
1
1
  /// <reference types="react" />
2
+ import { ProFormOtherProps } from '../../ProForm/propsType';
2
3
  declare function SearchTitle(props: {
3
4
  searchStr?: string;
4
5
  label?: string;
5
6
  showEllipse?: boolean;
6
7
  ellipseWidth?: string;
7
- isDiffChange?: boolean;
8
+ otherProps?: ProFormOtherProps;
8
9
  }): import("react/jsx-runtime").JSX.Element;
9
10
  declare const _default: import("react").MemoExoticComponent<typeof SearchTitle>;
10
11
  export default _default;
@@ -1,4 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /*
3
+ * @Author: za-xuwenli xuwenli@zhongan.io
4
+ * @Date: 2024-09-26 14:37:00
5
+ * @LastEditors: za-xuwenli xuwenli@zhongan.io
6
+ * @LastEditTime: 2024-09-26 17:50:59
7
+ * @FilePath: /za-material-warehouse/src/ProTree/components/SearchTitle.tsx
8
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
9
+ */
2
10
  import { memo } from 'react';
3
11
  import AdaptiveTooltip from './AdaptiveTooltip';
4
12
  function SearchTitle(props) {
@@ -7,8 +15,10 @@ function SearchTitle(props) {
7
15
  searchStr = _props$searchStr === void 0 ? '' : _props$searchStr,
8
16
  showEllipse = props.showEllipse,
9
17
  ellipseWidth = props.ellipseWidth,
10
- _props$isDiffChange = props.isDiffChange,
11
- isDiffChange = _props$isDiffChange === void 0 ? false : _props$isDiffChange;
18
+ otherProps = props.otherProps;
19
+ var _ref = otherProps !== null && otherProps !== void 0 ? otherProps : {},
20
+ _ref$isDiffChange = _ref.isDiffChange,
21
+ isDiffChange = _ref$isDiffChange === void 0 ? false : _ref$isDiffChange;
12
22
  var strTitle = label;
13
23
  var index = strTitle === null || strTitle === void 0 ? void 0 : strTitle.indexOf(searchStr);
14
24
  var beforeStr = strTitle === null || strTitle === void 0 ? void 0 : strTitle.substring(0, index);
@@ -177,23 +177,21 @@ function List(props, ref) {
177
177
  setAutoExpandParent(false);
178
178
  };
179
179
  if (mode === 'render') {
180
- return _jsx(_Fragment, {
181
- children: _jsx(_Tree, {
182
- disabled: disabled,
183
- style: {
184
- width: '100%'
185
- },
186
- checkable: true,
187
- treeData: _treeData,
188
- onExpand: onExpand,
189
- expandedKeys: expandedKeys,
190
- autoExpandParent: autoExpandParent,
191
- selectable: false,
192
- onCheck: onCheck,
193
- checkedKeys: checkedValues,
194
- checkStrictly: checkStrictly,
195
- height: 432
196
- })
180
+ return _jsx(_Tree, {
181
+ disabled: disabled,
182
+ style: {
183
+ width: '100%'
184
+ },
185
+ checkable: true,
186
+ treeData: _treeData,
187
+ onExpand: onExpand,
188
+ expandedKeys: expandedKeys,
189
+ autoExpandParent: autoExpandParent,
190
+ selectable: false,
191
+ onCheck: onCheck,
192
+ checkedKeys: checkedValues,
193
+ checkStrictly: searchStr ? true : checkStrictly,
194
+ height: 432
197
195
  });
198
196
  }
199
197
  return _jsx(_Fragment, {
@@ -15,7 +15,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
15
15
  * @Author: za-xuwenli xuwenli@zhongan.io
16
16
  * @Date: 2024-06-04 10:01:18
17
17
  * @LastEditors: za-xuwenli xuwenli@zhongan.io
18
- * @LastEditTime: 2024-06-25 17:56:33
18
+ * @LastEditTime: 2024-09-27 11:49:28
19
19
  * @FilePath: /za-material-warehouse/src/ProTreeModal/index.tsx
20
20
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
21
21
  */
@@ -26,7 +26,8 @@ import { ReactSVG } from 'react-svg';
26
26
  import classNames from 'classnames';
27
27
  import { ProDrawerForm, useProConfig } from '../index';
28
28
  import { Trigger, ListView, TreeView, Cascader } from './components';
29
- import { getFlatTreeData, filterCheckedNodes, getChildrenKeys, findTreeNodeByKey, getAllKeys, transformMessage } from './utils';
29
+ import { getFlatTreeData, filterCheckedNodes, getChildrenKeys, findTreeNodeByKey, getAllKeys, transformMessage, addLevelAndParentId } from './utils';
30
+ import { transformTreeToArray, treeNodeFind } from '../ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index';
30
31
  import searchSVG from '../assets/input-search.svg';
31
32
  import locale, { formatMessage } from '../locale';
32
33
  import './style/index.less';
@@ -98,7 +99,8 @@ var ProTreeModal = function ProTreeModal(props) {
98
99
  flatTreeData: [],
99
100
  searchStr: '',
100
101
  checkAll: false,
101
- allKeys: []
102
+ allKeys: [],
103
+ transformedTree: []
102
104
  }),
103
105
  _useSetState2 = _slicedToArray(_useSetState, 2),
104
106
  state = _useSetState2[0],
@@ -220,6 +222,12 @@ var ProTreeModal = function ProTreeModal(props) {
220
222
  });
221
223
  }
222
224
  }, [value, state.allKeys, state.open]);
225
+ useDeepCompareEffect(function () {
226
+ var transformedTree = addLevelAndParentId(state.treeData, fieldNames);
227
+ setState({
228
+ transformedTree: transformedTree
229
+ });
230
+ }, [state.treeData]);
223
231
  var handleClick = function handleClick() {
224
232
  setState({
225
233
  open: true
@@ -360,8 +368,55 @@ var ProTreeModal = function ProTreeModal(props) {
360
368
  var onCheck = function onCheck(checkedKeys, info) {
361
369
  var checkedValues = _toConsumableArray(state.checkedValues);
362
370
  var originalTreeData = state.originalTreeData;
371
+ // 如果有检索则自管理
372
+ if (state.searchStr) {
373
+ var _transformTreeToArray;
374
+ var node = info.node;
375
+ // 从完整树中找到当前节点
376
+ var activeNode = treeNodeFind(state.transformedTree, function (t) {
377
+ return t[fieldNameValue] === node[fieldNameValue];
378
+ }, {
379
+ childrenKey: fieldNames.children
380
+ });
381
+ var allChildren = (_transformTreeToArray = transformTreeToArray([activeNode], {
382
+ childrenKey: fieldNames.children
383
+ })) === null || _transformTreeToArray === void 0 ? void 0 : _transformTreeToArray.map(function (item) {
384
+ return item[fieldNameValue];
385
+ });
386
+ // 子项合并勾选
387
+ checkedValues = checkedValues.concat(allChildren);
388
+ // 从完整树中拿到父节点 只要存在父节点,那么就判断当前children是否全被勾选 若全被勾选就合并当前key到勾选队列
389
+ var _recourse2 = function _recourse(findNode) {
390
+ if (findNode.parentId) {
391
+ var _transformTreeToArray2;
392
+ var parentNode = treeNodeFind(state.transformedTree, function (t) {
393
+ return t[fieldNameValue] === findNode.parentId;
394
+ }, {
395
+ childrenKey: fieldNames.children
396
+ });
397
+ var parentChildrenKeys = (_transformTreeToArray2 = transformTreeToArray([parentNode], {
398
+ childrenKey: fieldNames.children
399
+ })) === null || _transformTreeToArray2 === void 0 ? void 0 : _transformTreeToArray2.map(function (item) {
400
+ return item[fieldNameValue];
401
+ });
402
+ var parentChildrenAllChecked = parentChildrenKeys.every(function (key) {
403
+ return checkedValues.includes(key);
404
+ });
405
+ if (parentChildrenAllChecked) {
406
+ // 把当前父节点追加进来
407
+ checkedValues = checkedValues.concat([parentNode[fieldNameValue]]);
408
+ // 继续向上查找
409
+ if (parentNode.parentId) {
410
+ _recourse2(parentNode);
411
+ }
412
+ }
413
+ }
414
+ };
415
+ _recourse2(activeNode);
416
+ }
417
+ var _checkStrictly = state.searchStr ? true : checkStrictly;
363
418
  // 此时应该取消掉自身并包含它所有的子集
364
- if (!info.checked && !checkStrictly) {
419
+ if (!info.checked && !_checkStrictly) {
365
420
  // 1. 取消自身
366
421
  // 2. 把所有的子节点也要取消
367
422
  var childrenkeys = [];
@@ -378,8 +433,8 @@ var ProTreeModal = function ProTreeModal(props) {
378
433
  return !parentKeys.includes(key);
379
434
  });
380
435
  } else {
381
- // checkStrictly 模式下取 checkedKeys.checked 或者自身的 key
382
- if (checkStrictly) {
436
+ // _checkStrictly 模式下取 checkedKeys.checked 或者自身的 key
437
+ if (_checkStrictly) {
383
438
  if (!info.checked) {
384
439
  checkedValues = checkedValues.filter(function (key) {
385
440
  return key !== info.node.key;
@@ -618,7 +673,7 @@ var ProTreeModal = function ProTreeModal(props) {
618
673
  });
619
674
  case TREE:
620
675
  return _jsx(TreeView, {
621
- treeData: state.treeData,
676
+ treeData: state.transformedTree,
622
677
  originalTreeData: state.originalTreeData,
623
678
  flatTreeData: state.flatTreeData,
624
679
  checkedValues: state.checkedValues,
@@ -36,3 +36,4 @@ export declare function filterCheckedNodes(data: any, checkedKeys: any, searchSt
36
36
  */
37
37
  export declare function getChildrenKeys(node: TreeDataProps, childrenKeys: string[], fieldNames: FieldNamesType, type: 'treeClose' | 'treeCheck'): void;
38
38
  export declare const transformMessage: (obj: any, message: string) => string;
39
+ export declare const addLevelAndParentId: (tree: any[], fieldNames: any, currentLevel?: number, currentParentId?: any) => any[];
@@ -197,4 +197,24 @@ export var transformMessage = function transformMessage(obj, message) {
197
197
  _message = message.replaceAll("{".concat(key, "}"), obj[key]);
198
198
  });
199
199
  return _message;
200
- };
200
+ };
201
+ var _addLevelAndParentId = function addLevelAndParentId() {
202
+ var tree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
203
+ var fieldNames = arguments.length > 1 ? arguments[1] : undefined;
204
+ var currentLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
205
+ var currentParentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
206
+ var _fieldNames$children = fieldNames.children,
207
+ children = _fieldNames$children === void 0 ? 'children' : _fieldNames$children,
208
+ _fieldNames$value = fieldNames.value,
209
+ value = _fieldNames$value === void 0 ? 'value' : _fieldNames$value;
210
+ return tree.map(function (node) {
211
+ var newNode = _objectSpread({}, node);
212
+ newNode.level = currentLevel;
213
+ newNode.parentId = currentParentId;
214
+ if (node[children]) {
215
+ newNode[children] = _addLevelAndParentId(node[children], fieldNames, currentLevel + 1, newNode[value]);
216
+ }
217
+ return newNode;
218
+ });
219
+ };
220
+ export { _addLevelAndParentId as addLevelAndParentId };