@zat-design/sisyphus-react 3.13.18-beta.1 → 3.13.18-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 (37) hide show
  1. package/dist/index.esm.css +8 -2
  2. package/dist/less.esm.css +8 -2
  3. package/es/ProForm/components/base/DatePicker/index.js +16 -32
  4. package/es/ProForm/components/combination/Group/hooks/index.js +2 -7
  5. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -4
  6. package/es/ProForm/components/combination/ProModalSelect/index.js +41 -65
  7. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
  8. package/es/ProForm/components/combination/ProModalSelect/style/index.less +2 -2
  9. package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +57 -8
  10. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +23 -3
  11. package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +3 -1
  12. package/es/ProLayout/components/Layout/Menu/index.js +4 -1
  13. package/es/ProLayout/components/ProCollapse/style/index.less +14 -8
  14. package/es/ProLayout/index.js +3 -1
  15. package/es/ProLayout/propTypes.d.ts +9 -0
  16. package/es/ProLayout/utils/index.d.ts +7 -0
  17. package/es/ProLayout/utils/index.js +31 -1
  18. package/lib/ProForm/components/base/DatePicker/index.js +16 -32
  19. package/lib/ProForm/components/combination/Group/hooks/index.js +2 -7
  20. package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -4
  21. package/lib/ProForm/components/combination/ProModalSelect/index.js +41 -65
  22. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
  23. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +2 -2
  24. package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +56 -7
  25. package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +22 -2
  26. package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +3 -1
  27. package/lib/ProLayout/components/Layout/Menu/index.js +4 -1
  28. package/lib/ProLayout/components/ProCollapse/style/index.less +14 -8
  29. package/lib/ProLayout/index.js +3 -1
  30. package/lib/ProLayout/propTypes.d.ts +9 -0
  31. package/lib/ProLayout/utils/index.d.ts +7 -0
  32. package/lib/ProLayout/utils/index.js +30 -1
  33. package/package.json +1 -1
  34. package/es/ProForm/components/base/DatePicker/useDateLimit.d.ts +0 -9
  35. package/es/ProForm/components/base/DatePicker/useDateLimit.js +0 -15
  36. package/lib/ProForm/components/base/DatePicker/useDateLimit.d.ts +0 -9
  37. package/lib/ProForm/components/base/DatePicker/useDateLimit.js +0 -22
@@ -753,7 +753,7 @@
753
753
  margin-right: var(--zaui-space-size-sm, 8px);
754
754
  }
755
755
  .pro-collapse.pro-collapse-level2 .pro-collapse-content {
756
- padding: var(--zaui-space-size-sm, 8px) 0 !important;
756
+ padding: var(--zaui-space-size-md, 16px) !important;
757
757
  }
758
758
  .pro-collapse.pro-collapse-level2 .pro-collapse-level2-collapse {
759
759
  margin-bottom: var(--zaui-space-size-md, 16px);
@@ -789,6 +789,9 @@
789
789
  .pro-collapse.pro-collapse-level2 .pro-collapse-level2-no-collapse .ant-collapse-expand-icon {
790
790
  display: none;
791
791
  }
792
+ .pro-collapse.pro-collapse-level2 .pro-collapse-level2-no-collapse .pro-collapse-content {
793
+ padding: var(--zaui-space-size-sm, 8px) 0 !important;
794
+ }
792
795
  .pro-collapse .ant-collapse-extra .extra-info {
793
796
  margin-right: 24px;
794
797
  }
@@ -864,6 +867,9 @@
864
867
  margin-bottom: 0;
865
868
  border-bottom: 1px solid #d9d9d9;
866
869
  }
870
+ .pro-collapse.pro-collapse-level3 .pro-collapse-level3-no-collapse .ant-collapse-header {
871
+ padding: 0 !important;
872
+ }
867
873
  .pro-collapse.pro-collapse-level3 .ant-collapse-header {
868
874
  height: 48px !important;
869
875
  padding: 0 var(--zaui-space-size-md, 16px) !important;
@@ -924,7 +930,7 @@
924
930
  cursor: default;
925
931
  background: #F8F8F8 !important;
926
932
  }
927
- .pro-collapse .pro-collapse-content:has(> .pro-collapse-level3):not(:has(> .pro-collapse-level2)) {
933
+ .pro-collapse .pro-collapse-level2 .pro-collapse-content:has(.pro-collapse-level3) {
928
934
  padding: var(--zaui-space-size-md, 16px) !important;
929
935
  padding-right: 0 !important;
930
936
  }
package/dist/less.esm.css CHANGED
@@ -753,7 +753,7 @@
753
753
  margin-right: var(--zaui-space-size-sm, 8px);
754
754
  }
755
755
  .pro-collapse.pro-collapse-level2 .pro-collapse-content {
756
- padding: var(--zaui-space-size-sm, 8px) 0 !important;
756
+ padding: var(--zaui-space-size-md, 16px) !important;
757
757
  }
758
758
  .pro-collapse.pro-collapse-level2 .pro-collapse-level2-collapse {
759
759
  margin-bottom: var(--zaui-space-size-md, 16px);
@@ -789,6 +789,9 @@
789
789
  .pro-collapse.pro-collapse-level2 .pro-collapse-level2-no-collapse .ant-collapse-expand-icon {
790
790
  display: none;
791
791
  }
792
+ .pro-collapse.pro-collapse-level2 .pro-collapse-level2-no-collapse .pro-collapse-content {
793
+ padding: var(--zaui-space-size-sm, 8px) 0 !important;
794
+ }
792
795
  .pro-collapse .ant-collapse-extra .extra-info {
793
796
  margin-right: 24px;
794
797
  }
@@ -864,6 +867,9 @@
864
867
  margin-bottom: 0;
865
868
  border-bottom: 1px solid #d9d9d9;
866
869
  }
870
+ .pro-collapse.pro-collapse-level3 .pro-collapse-level3-no-collapse .ant-collapse-header {
871
+ padding: 0 !important;
872
+ }
867
873
  .pro-collapse.pro-collapse-level3 .ant-collapse-header {
868
874
  height: 48px !important;
869
875
  padding: 0 var(--zaui-space-size-md, 16px) !important;
@@ -924,7 +930,7 @@
924
930
  cursor: default;
925
931
  background: #F8F8F8 !important;
926
932
  }
927
- .pro-collapse .pro-collapse-content:has(> .pro-collapse-level3):not(:has(> .pro-collapse-level2)) {
933
+ .pro-collapse .pro-collapse-level2 .pro-collapse-content:has(.pro-collapse-level3) {
928
934
  padding: var(--zaui-space-size-md, 16px) !important;
929
935
  padding-right: 0 !important;
930
936
  }
@@ -1,10 +1,9 @@
1
1
  import "antd/es/date-picker/style";
2
2
  import _DatePicker from "antd/es/date-picker";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
4
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
7
- import _uniq from "lodash/uniq";
6
+ import _omit from "lodash/omit";
8
7
  import _isObject from "lodash/isObject";
9
8
  import _isString from "lodash/isString";
10
9
  import _isFunction from "lodash/isFunction";
@@ -25,18 +24,11 @@ var DatePicker = function DatePicker(props) {
25
24
  viewEmpty = _ref.viewEmpty,
26
25
  valueType = _ref.valueType;
27
26
  var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
28
- var initialConfig = useProConfig('DatePicker');
29
- var _className = classNames(_defineProperty({
27
+ var initialConfig = useProConfig('DatePicker') || {};
28
+ var nextFormat = format;
29
+ var nextClassName = classNames(_defineProperty({
30
30
  'full-form-item': true
31
31
  }, className, !!className));
32
- var _viewFormat = Array.isArray(format) ? format[0] : format;
33
- var tempFormat = Array.isArray(format) ? format : [format];
34
- if (_isFunction(format)) {
35
- tempFormat = [];
36
- }
37
- var _format = _uniq([].concat(_toConsumableArray(tempFormat), ['YYYY-MM-DD', 'YYYYMMDD', 'YYYY/MM/DD', 'YYYY_MM_DD', 'YYYY.MM.DD'])).filter(function (formatKey) {
38
- return !!formatKey;
39
- });
40
32
  if (isView) {
41
33
  var value = rest.value;
42
34
  var viewChildren = null;
@@ -47,38 +39,30 @@ var DatePicker = function DatePicker(props) {
47
39
  } else if (_isFunction(format)) {
48
40
  viewChildren = format(value);
49
41
  } else if (_isString(value)) {
50
- viewChildren = moment(value).format(_viewFormat);
42
+ viewChildren = moment(value).format(format);
51
43
  }
52
44
  return _jsx(Container, {
53
45
  viewEmpty: viewEmpty,
54
46
  children: viewChildren
55
47
  });
56
48
  }
57
- var _defaultShowTime = {
58
- format: 'HH:mm:ss'
59
- };
60
49
  // dateTime模式下默认开启time选择
61
- var _rest = _objectSpread({}, rest);
50
+ var restProps = _objectSpread({}, rest);
62
51
  // showTime默认值受valueType属性影响
63
- if (rest.showTime === undefined) {
64
- if (valueType === 'dateTime') {
65
- _rest.showTime = true;
66
- }
52
+ if (restProps.showTime === false) {
53
+ restProps.showTime = false;
54
+ } else if (valueType === 'dateTime') {
55
+ restProps.showTime = true;
56
+ nextFormat = 'YYYY-MM-DD HH:mm:ss';
67
57
  }
68
58
  // 字符串时间格式兼容
69
- if (_isString(_rest.value)) {
70
- _rest.value = moment(_rest.value);
71
- }
72
- if (_rest.showTime === true) {
73
- _rest.showTime = _objectSpread({}, _defaultShowTime);
74
- }
75
- if (_isObject(_rest.showTime)) {
76
- _rest.showTime = Object.assign(_defaultShowTime, _rest.showTime);
59
+ if (_isString(restProps.value)) {
60
+ restProps.value = moment(restProps.value);
77
61
  }
78
62
  return _jsx(_DatePicker, _objectSpread(_objectSpread(_objectSpread({}, initialConfig), {}, {
79
- format: _format
80
- }, _rest), {}, {
81
- className: _className
63
+ format: nextFormat
64
+ }, _omit(restProps, ['otherProps'])), {}, {
65
+ className: nextClassName
82
66
  }));
83
67
  };
84
68
  export default DatePicker;
@@ -165,14 +165,9 @@ export var useTransformColumns = function useTransformColumns(params) {
165
165
  getValueProps: transform === null || transform === void 0 ? void 0 : transform.getValueProps,
166
166
  fieldProps: _objectSpread(_objectSpread(_objectSpread({}, column === null || column === void 0 ? void 0 : column.fieldProps), reactiveProps === null || reactiveProps === void 0 ? void 0 : reactiveProps.fieldProps), {}, {
167
167
  onChange: handleChange,
168
- onBlur: handleBlur
169
- }, names ? {
170
- value: form.getFieldValue(columnName)
171
- } // 独立字段模式
172
- : {
168
+ onBlur: handleBlur,
173
169
  value: value === null || value === void 0 ? void 0 : value[index]
174
- } // 数组值模式
175
- )
170
+ })
176
171
  });
177
172
  });
178
173
  };
@@ -62,7 +62,7 @@ export function useRequestList(service, options, useRequestOptions) {
62
62
  queryBean: _condition !== null && _condition !== void 0 ? _condition : {}
63
63
  }) : _condition;
64
64
  return transformParams ? transformParams(tempParams) : tempParams;
65
- }, [page, searchValues]);
65
+ }, [page, searchValues, _defaultParams, transformParams]);
66
66
  // 调接口
67
67
  var result = useRequest(service || defaultService, _objectSpread(_objectSpread({}, useRequestOptions), {}, {
68
68
  defaultParams: [params]
@@ -98,9 +98,7 @@ export function useRequestList(service, options, useRequestOptions) {
98
98
  }, [onChange, searchValues]);
99
99
  // 重置查询条件
100
100
  var onReset = useCallback(function () {
101
- onSearch({
102
- d: Date.now()
103
- });
101
+ onSearch({});
104
102
  }, [onSearch]);
105
103
  var dataSource = useMemo(function () {
106
104
  if (data) {
@@ -1,9 +1,9 @@
1
- import "antd/es/tooltip/style";
2
- import _Tooltip from "antd/es/tooltip";
3
1
  import "antd/es/button/style";
4
2
  import _Button from "antd/es/button";
5
3
  import "antd/es/input/style";
6
4
  import _Input from "antd/es/input";
5
+ import "antd/es/tooltip/style";
6
+ import _Tooltip from "antd/es/tooltip";
7
7
  import "antd/es/spin/style";
8
8
  import _Spin from "antd/es/spin";
9
9
  import "antd/es/space/style";
@@ -19,11 +19,13 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
19
19
  import "antd/es/form/style";
20
20
  import _Form from "antd/es/form";
21
21
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
22
+ import _isObject from "lodash/isObject";
22
23
  import _isFunction from "lodash/isFunction";
23
24
  import _isEqual from "lodash/isEqual";
25
+ import _isBoolean from "lodash/isBoolean";
24
26
  import _isArray from "lodash/isArray";
25
27
  import _debounce from "lodash/debounce";
26
- var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "searchForm", "searchKey", "defaultOne", "otherProps"],
28
+ var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "mode", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "tooltip", "searchForm", "searchKey", "defaultOne", "otherProps"],
27
29
  _excluded2 = ["onOk"],
28
30
  _excluded3 = ["rowKey", "columns", "rowSelection"];
29
31
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -48,6 +50,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
48
50
  fieldNames = props.fieldNames,
49
51
  _props$readOnly = props.readOnly,
50
52
  readOnly = _props$readOnly === void 0 ? true : _props$readOnly,
53
+ _props$mode = props.mode,
54
+ mode = _props$mode === void 0 ? 'select' : _props$mode,
51
55
  addonAfter = props.addonAfter,
52
56
  configOption = props.configOption,
53
57
  title = props.title,
@@ -60,11 +64,19 @@ var ProModalSelect = function ProModalSelect(props, ref) {
60
64
  beforeOpen = props.beforeOpen,
61
65
  afterOpen = props.afterOpen,
62
66
  isTooltip = props.isTooltip,
67
+ tooltip = props.tooltip,
63
68
  searchForm = props.searchForm,
64
69
  searchKey = props.searchKey,
65
70
  defaultOne = props.defaultOne,
66
71
  otherProps = props.otherProps,
67
72
  restProps = _objectWithoutProperties(props, _excluded);
73
+ var _tooltip = tooltip !== null && tooltip !== void 0 ? tooltip : isTooltip;
74
+ var nextMode = useMemo(function () {
75
+ if (_isBoolean(readOnly) && readOnly === false) {
76
+ return 'input';
77
+ }
78
+ return mode;
79
+ }, [mode, readOnly]);
68
80
  var contentForm = _Form.useFormInstance();
69
81
  if (!configOption || Object.prototype.toString.call(configOption) !== '[object Object]') {
70
82
  throw new Error('error: 请检查枚举选择弹框的配置项【configOption】');
@@ -171,8 +183,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
171
183
  transformParams: transformParams,
172
184
  transformResponse: transformResponse
173
185
  }, _objectSpread({
174
- manual: true,
175
- ready: (initParams || defaultOne) && !readOnly || visible
186
+ ready: (initParams || defaultOne) && nextMode === 'input' || visible
176
187
  }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
177
188
  data = _useRequestList2.data,
178
189
  loading = _useRequestList2.loading,
@@ -203,7 +214,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
203
214
  if (typeof data === 'string' || typeof data === 'number') {
204
215
  return data;
205
216
  }
206
- if (Object.prototype.toString.call(data) === '[object Object]') {
217
+ if (_isObject(data)) {
207
218
  return handleFormat(_objectSpread(_objectSpread({}, data), {}, {
208
219
  value: data[valueKey],
209
220
  label: data[labelKey]
@@ -240,7 +251,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
240
251
  * @returns {any}
241
252
  */
242
253
  var getRowKey = function getRowKey(record) {
243
- if (typeof rowKey === 'function') {
254
+ if (_isFunction(rowKey)) {
244
255
  return rowKey(record);
245
256
  }
246
257
  return record[rowKey];
@@ -262,7 +273,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
262
273
  var handleChangeValue = function handleChangeValue(e) {
263
274
  onChange(e.target.value);
264
275
  preValue.current = e.target.value;
265
- if (!readOnly) {
276
+ if (nextMode === 'input') {
266
277
  setState({
267
278
  _value: e.target.value
268
279
  });
@@ -520,7 +531,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
520
531
  selectedRows: list,
521
532
  selectedRowKeys: nextSelectRowKeys
522
533
  });
523
- } else if (!readOnly) {
534
+ } else if (nextMode === 'input') {
524
535
  // 当传入initParams且文本框非只读时,不调用接口获取初始化数据
525
536
  setState({
526
537
  _value: value,
@@ -608,13 +619,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
608
619
  selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || [],
609
620
  _value: undefined
610
621
  });
611
- } else if (Object.prototype.toString.call(value) === '[object Array]') {
622
+ } else if (_isArray(value)) {
612
623
  setState({
613
624
  selectedRowKeys: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || value,
614
625
  selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || value,
615
626
  _value: value
616
627
  });
617
- } else if (Object.prototype.toString.call(value) === '[object Object]') {
628
+ } else if (_isObject(value)) {
618
629
  var initialValue = _defineProperty(_defineProperty({}, valueKey, value[valueKey]), labelKey, value[labelKey]);
619
630
  setState({
620
631
  selectedRowKeys: [value],
@@ -637,7 +648,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
637
648
  nextState.selectedRowKeys = [];
638
649
  nextState.selectedRows = [];
639
650
  }
640
- if (Object.prototype.toString.call(value) === '[object Object]') {
651
+ if (_isObject(value)) {
641
652
  nextState.selectedRowKeys = [getRowKey(value)];
642
653
  nextState.selectedRows = [value];
643
654
  }
@@ -663,12 +674,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
663
674
  hideTooltipIfOpen(fieldRef.current, visible);
664
675
  }, [visible]);
665
676
  useEffect(function () {
666
- if (value && !visible && isInit && !readOnly) {
677
+ if (value && !visible && isInit && nextMode === 'input') {
667
678
  getInitValues();
668
679
  }
669
680
  }, [JSON.stringify(value), visible, isInit]);
670
681
  useDebounceEffect(function () {
671
- if (value && !visible && readOnly && (!_isEqual(value, preValue.current) || (options === null || options === void 0 ? void 0 : options.length) === 0)) {
682
+ if (value && !visible && nextMode === 'select' && (!_isEqual(value, preValue.current) || (options === null || options === void 0 ? void 0 : options.length) === 0)) {
672
683
  var _options$some;
673
684
  preValue.current = value;
674
685
  var _data3 = labelInValue ? value[valueKey] : value;
@@ -735,7 +746,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
735
746
  });
736
747
  }
737
748
  }
738
- if (!readOnly) {
749
+ if (nextMode === 'input') {
739
750
  if (labelInValue && _value && !_isEqual(value, _value)) {
740
751
  setState({
741
752
  _value: value,
@@ -758,7 +769,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
758
769
  width: '100%'
759
770
  },
760
771
  block: true,
761
- children: [readOnly ? _jsx(ProSelect, _objectSpread({
772
+ children: [nextMode === 'select' ? _jsx(ProSelect, _objectSpread({
762
773
  value: value,
763
774
  onChange: handleSelectValue,
764
775
  disabled: disabled,
@@ -774,16 +785,21 @@ var ProModalSelect = function ProModalSelect(props, ref) {
774
785
  }) : null,
775
786
  onFocus: handleSelectFocus,
776
787
  onSearch: handleSelectSearch,
788
+ tooltip: _tooltip,
777
789
  style: {
778
790
  width: isView || disabled ? '100%' : 'calc(100% - 30px)'
779
791
  }
780
- }, restProps)) : _jsx(_Input, _objectSpread({
781
- value: viewText,
782
- onChange: handleChangeValue,
783
- disabled: disabled,
784
- autoComplete: "off",
785
- allowClear: true
786
- }, restProps)), isView || disabled ? null : _jsx(_Button, {
792
+ }, restProps)) : _jsx(_Tooltip, {
793
+ title: _tooltip ? viewText : null,
794
+ placement: "topLeft",
795
+ children: _jsx(_Input, _objectSpread({
796
+ value: viewText,
797
+ onChange: handleChangeValue,
798
+ disabled: disabled,
799
+ autoComplete: "off",
800
+ allowClear: true
801
+ }, restProps))
802
+ }), isView || disabled ? null : _jsx(_Button, {
787
803
  icon: _jsx(ReactSVG, {
788
804
  className: "viewSvg",
789
805
  src: viewSvg,
@@ -798,41 +814,6 @@ var ProModalSelect = function ProModalSelect(props, ref) {
798
814
  children: customRender
799
815
  });
800
816
  }
801
- useDeepCompareEffect(function () {
802
- if (isTooltip && value) {
803
- var dom = document.getElementById(uuid);
804
- dom.addEventListener('mouseover', function (e) {
805
- if (value && e.target.tagName === 'INPUT') {
806
- setState({
807
- open: true
808
- });
809
- }
810
- });
811
- dom.addEventListener('mouseout', function (e) {
812
- if (e.target.tagName === 'INPUT') {
813
- setState({
814
- open: false
815
- });
816
- }
817
- });
818
- return function () {
819
- dom.removeEventListener('mouseover', function (e) {
820
- if (value && e.target.tagName === 'INPUT') {
821
- setState({
822
- open: true
823
- });
824
- }
825
- });
826
- dom.removeEventListener('mouseout', function (e) {
827
- if (e.target.tagName === 'INPUT') {
828
- setState({
829
- open: false
830
- });
831
- }
832
- });
833
- };
834
- }
835
- }, [value, isTooltip]);
836
817
  useDeepCompareEffect(function () {
837
818
  setState({
838
819
  options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
@@ -870,14 +851,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
870
851
  className: _className,
871
852
  style: style,
872
853
  ref: fieldRef,
873
- children: isTooltip && viewText ? _jsx(_Tooltip, {
874
- placement: "topLeft",
875
- open: open,
876
- title: viewText,
877
- children: initRender
878
- }) : initRender
854
+ children: initRender
879
855
  }), _jsxs(ProDrawerForm, _objectSpread(_objectSpread({
880
- showType: "Modal",
856
+ mode: "Modal",
881
857
  title: title,
882
858
  onOk: handleFinish,
883
859
  // @ts-ignore
@@ -80,17 +80,21 @@ interface ProModalPropsType {
80
80
  beforeOpen?: any;
81
81
  /** 打开弹框后的回调函数 */
82
82
  afterOpen?: any;
83
- /** 是否启用tooltip提示 */
83
+ /** 废弃 是否启用tooltip提示 */
84
84
  isTooltip?: boolean;
85
+ /** 是否启用tooltip提示 */
86
+ tooltip?: boolean;
85
87
  /** 是否以"值-名称"形式展示 */
86
88
  showCodeName?: boolean;
87
89
  /** 查询表单实例,用于获取查询表单数据 */
88
90
  searchForm?: FormInstance;
89
91
  /** 模糊查询的字段名 */
90
92
  searchKey?: string;
93
+ /** 展示形式 */
94
+ mode?: 'input' | 'select';
91
95
  }
92
96
  /** 模态框选择器属性类型(结合Select和Input属性) */
93
- export declare type ProModalSelectPropsType = SelectProps & InputProps & ProModalPropsType;
97
+ export declare type ProModalSelectPropsType = Omit<SelectProps & InputProps, 'mode'> & ProModalPropsType;
94
98
  /** 配置选项类型 */
95
99
  export type ProModalSelectConfigType = ConfigOption;
96
100
  /** 模态框属性类型 */
@@ -98,5 +102,5 @@ export type ProModalType = Omit<ProModalPropsType, 'configOption'> & {
98
102
  configOption: ProModalSelectConfigType;
99
103
  };
100
104
  /** 模态框选择器类型(结合Select和Input属性) */
101
- export type ProModalSelectType = SelectProps & InputProps & ProModalType;
105
+ export type ProModalSelectType = Omit<SelectProps & InputProps, 'mode'> & ProModalType;
102
106
  export {};
@@ -53,7 +53,7 @@
53
53
  }
54
54
  }
55
55
 
56
- // 新加适用于 readonly false
56
+ // 新加适用于 _readOnly false
57
57
  .@{ant-prefix}-input-affix-wrapper {
58
58
  border-top-right-radius: 0;
59
59
  border-bottom-right-radius: 0;
@@ -100,7 +100,7 @@
100
100
  }
101
101
 
102
102
  .@{ant-prefix}-input-affix-wrapper-status-error{
103
-
103
+
104
104
  }
105
105
 
106
106
 
@@ -10,10 +10,11 @@ import { Link } from 'react-router-dom';
10
10
  import { Icon } from '../../index';
11
11
  import SideMenu from '../SideMenu';
12
12
  import { LayoutContext } from '../../../../index';
13
- import { getUrlParams, getPathNameKey } from '../../../../utils';
13
+ import { getUrlParams, getPathNameKey, findMenuItemByKey } from '../../../../utils';
14
14
  var FoldMenu = function FoldMenu(props) {
15
15
  var style = props.style,
16
- dataSource = props.dataSource;
16
+ dataSource = props.dataSource,
17
+ onMenuClick = props.onMenuClick;
17
18
  var menus = dataSource.menus,
18
19
  iconfontUrl = dataSource.iconfontUrl,
19
20
  notice = dataSource.notice,
@@ -82,7 +83,8 @@ var FoldMenu = function FoldMenu(props) {
82
83
  content: _jsx(SideMenu, {
83
84
  dataSource: _objectSpread(_objectSpread({}, dataSource), {}, {
84
85
  menus: item
85
- })
86
+ }),
87
+ onMenuClick: onMenuClick
86
88
  }),
87
89
  color: "#fff",
88
90
  overlayClassName: noticeCls,
@@ -91,12 +93,42 @@ var FoldMenu = function FoldMenu(props) {
91
93
  height: "calc(100vh - ".concat(headerHeight + (notice ? 32 : 0), "px)")
92
94
  },
93
95
  placement: "rightTop",
94
- children: LiNode
96
+ children: _jsx("span", {
97
+ onClick: function onClick() {
98
+ // 查找完整的菜单项数据
99
+ var menuItem = findMenuItemByKey(menus, String(id));
100
+ var menuKeyPath = (menuItem === null || menuItem === void 0 ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map(function (id) {
101
+ return String(id);
102
+ }) : [String(id)];
103
+ // 调用用户传入的onMenuClick回调
104
+ if (onMenuClick) {
105
+ onMenuClick({
106
+ item: menuItem,
107
+ key: String(id),
108
+ keyPath: menuKeyPath
109
+ });
110
+ }
111
+ },
112
+ children: LiNode
113
+ })
95
114
  }, "".concat(id, "-").concat(name)) : !collapsed ? _jsx(_Tooltip, {
96
115
  placement: "right",
97
116
  title: name,
98
117
  children: _jsx("span", {
99
118
  onClick: function onClick() {
119
+ // 查找完整的菜单项数据
120
+ var menuItem = findMenuItemByKey(menus, String(id));
121
+ var menuKeyPath = (menuItem === null || menuItem === void 0 ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map(function (id) {
122
+ return String(id);
123
+ }) : [String(id)];
124
+ // 调用用户传入的onMenuClick回调
125
+ if (onMenuClick) {
126
+ onMenuClick({
127
+ item: menuItem,
128
+ key: String(id),
129
+ keyPath: menuKeyPath
130
+ });
131
+ }
100
132
  onSelected({
101
133
  selectedPath: toPath
102
134
  });
@@ -106,10 +138,27 @@ var FoldMenu = function FoldMenu(props) {
106
138
  children: LiNode
107
139
  }, toPath)
108
140
  })
109
- }, toPath) : _jsx(Link, {
110
- to: toPath,
111
- children: LiNode
112
- }, toPath);
141
+ }, toPath) : _jsx("span", {
142
+ onClick: function onClick() {
143
+ // 查找完整的菜单项数据
144
+ var menuItem = findMenuItemByKey(menus, String(id));
145
+ var menuKeyPath = (menuItem === null || menuItem === void 0 ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map(function (id) {
146
+ return String(id);
147
+ }) : [String(id)];
148
+ // 调用用户传入的onMenuClick回调
149
+ if (onMenuClick) {
150
+ onMenuClick({
151
+ item: menuItem,
152
+ key: String(id),
153
+ keyPath: menuKeyPath
154
+ });
155
+ }
156
+ },
157
+ children: _jsx(Link, {
158
+ to: toPath,
159
+ children: LiNode
160
+ }, toPath)
161
+ });
113
162
  })
114
163
  })
115
164
  });
@@ -10,7 +10,7 @@ import { CaretDownOutlined } from '@ant-design/icons';
10
10
  import classnames from 'classnames';
11
11
  import { Link } from 'react-router-dom';
12
12
  import { LayoutContext } from '../../../../index';
13
- import { getIdsByPathName } from '../../../../utils';
13
+ import { getIdsByPathName, findMenuItemByKey } from '../../../../utils';
14
14
  import { Icon } from '../../index';
15
15
  var OpenMenu = function OpenMenu(props) {
16
16
  var _getIdsByPathName;
@@ -18,7 +18,8 @@ var OpenMenu = function OpenMenu(props) {
18
18
  dataSource = props.dataSource,
19
19
  style = props.style,
20
20
  _props$theme = props.theme,
21
- theme = _props$theme === void 0 ? 'dark' : _props$theme;
21
+ theme = _props$theme === void 0 ? 'dark' : _props$theme,
22
+ onMenuClick = props.onMenuClick;
22
23
  var _ref = dataSource || {},
23
24
  menus = _ref.menus,
24
25
  sideMenu = _ref.sideMenu;
@@ -142,7 +143,26 @@ var OpenMenu = function OpenMenu(props) {
142
143
  onClick: function onClick(_ref2) {
143
144
  var _item$props, _item$props2;
144
145
  var item = _ref2.item,
145
- keyPath = _ref2.keyPath;
146
+ keyPath = _ref2.keyPath,
147
+ key = _ref2.key,
148
+ domEvent = _ref2.domEvent;
149
+ // console.log('item', item);
150
+ // console.log('keyPath', keyPath);
151
+ // console.log('key', key);
152
+ // console.log('domEvent', domEvent);
153
+ // 查找完整的菜单项数据
154
+ var menuItem = findMenuItemByKey(menus, key);
155
+ var menuKeyPath = (menuItem === null || menuItem === void 0 ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map(function (id) {
156
+ return String(id);
157
+ }) : keyPath;
158
+ // 调用用户传入的onMenuClick回调
159
+ if (onMenuClick) {
160
+ onMenuClick({
161
+ item: menuItem,
162
+ key: key,
163
+ keyPath: menuKeyPath
164
+ });
165
+ }
146
166
  setState({
147
167
  selectedKeys: keyPath,
148
168
  router: item === null || item === void 0 ? void 0 : (_item$props = item.props) === null || _item$props === void 0 ? void 0 : _item$props.router
@@ -4,7 +4,8 @@ import classnames from 'classnames';
4
4
  import { useSize } from 'ahooks';
5
5
  import OpenMenu from '../OpenMenu';
6
6
  var SideMenu = function SideMenu(props) {
7
- var dataSource = props.dataSource;
7
+ var dataSource = props.dataSource,
8
+ onMenuClick = props.onMenuClick;
8
9
  var ref = useRef(null);
9
10
  var size = useSize(ref);
10
11
  var menus = dataSource.menus,
@@ -24,6 +25,7 @@ var SideMenu = function SideMenu(props) {
24
25
  children: _jsx(OpenMenu, {
25
26
  className: "pro-layout-sider-menu-list",
26
27
  theme: "light",
28
+ onMenuClick: onMenuClick,
27
29
  dataSource: {
28
30
  menus: (menus === null || menus === void 0 ? void 0 : menus.children) || [],
29
31
  iconfontUrl: iconfontUrl,