@zat-design/sisyphus-react 3.6.1 → 3.6.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/index.esm.css +0 -6
  2. package/dist/less.esm.css +0 -6
  3. package/es/ProConfigProvider/index.d.ts +1 -0
  4. package/es/ProConfigProvider/index.js +6 -1
  5. package/es/ProEditTable/components/RenderField/index.js +1 -3
  6. package/es/ProEditTable/index.js +2 -1
  7. package/es/ProEditTable/utils/tools.js +1 -4
  8. package/es/ProEnum/hooks/useEnumRequest.d.ts +1 -1
  9. package/es/ProEnum/hooks/useEnumRequest.js +113 -113
  10. package/es/ProForm/components/render/Render.js +7 -1
  11. package/es/ProForm/components/render/propsType.d.ts +4 -0
  12. package/es/ProLayout/index.js +3 -1
  13. package/es/ProLayout/propTypes.d.ts +4 -0
  14. package/es/ProLayout/utils/index.d.ts +2 -2
  15. package/es/ProLayout/utils/index.js +6 -4
  16. package/es/ProTooltip/style/index.less +0 -8
  17. package/es/ProTree/components/ProTree.js +2 -1
  18. package/lib/ProConfigProvider/index.d.ts +1 -0
  19. package/lib/ProConfigProvider/index.js +6 -1
  20. package/lib/ProEditTable/components/RenderField/index.js +1 -3
  21. package/lib/ProEditTable/index.js +2 -1
  22. package/lib/ProEditTable/utils/tools.js +1 -4
  23. package/lib/ProEnum/hooks/useEnumRequest.d.ts +1 -1
  24. package/lib/ProEnum/hooks/useEnumRequest.js +113 -113
  25. package/lib/ProForm/components/render/Render.js +7 -1
  26. package/lib/ProForm/components/render/propsType.d.ts +4 -0
  27. package/lib/ProLayout/index.js +3 -1
  28. package/lib/ProLayout/propTypes.d.ts +4 -0
  29. package/lib/ProLayout/utils/index.d.ts +2 -2
  30. package/lib/ProLayout/utils/index.js +6 -4
  31. package/lib/ProTooltip/style/index.less +0 -8
  32. package/lib/ProTree/components/ProTree.js +2 -1
  33. package/package.json +1 -1
@@ -2141,12 +2141,6 @@
2141
2141
  .pro-edit-table-drag table tr th.ant-table-selection-column.ant-table-cell-fix-left {
2142
2142
  text-align: right;
2143
2143
  }
2144
- .ant-table-cell-fix-right {
2145
- z-index: 999 !important;
2146
- }
2147
- .ant-table-cell-fix-left {
2148
- z-index: 999 !important;
2149
- }
2150
2144
  .pro-tooltip {
2151
2145
  cursor: pointer;
2152
2146
  }
package/dist/less.esm.css CHANGED
@@ -2141,12 +2141,6 @@
2141
2141
  .pro-edit-table-drag table tr th.ant-table-selection-column.ant-table-cell-fix-left {
2142
2142
  text-align: right;
2143
2143
  }
2144
- .ant-table-cell-fix-right {
2145
- z-index: 999 !important;
2146
- }
2147
- .ant-table-cell-fix-left {
2148
- z-index: 999 !important;
2149
- }
2150
2144
  .pro-tooltip {
2151
2145
  cursor: pointer;
2152
2146
  }
@@ -29,5 +29,6 @@ interface Actions {
29
29
  export declare const ProConfigProvider: FC<{
30
30
  value?: ProConfigState;
31
31
  locale?: string;
32
+ onSuccess?: (data: any, params: any) => void;
32
33
  }>;
33
34
  export default ProConfigProvider;
@@ -75,7 +75,7 @@ export var ProConfigProvider = function ProConfigProvider(props) {
75
75
  _useReducer2 = _slicedToArray(_useReducer, 2),
76
76
  state = _useReducer2[0],
77
77
  dispatch = _useReducer2[1];
78
- useEnumRequest(_objectSpread(_objectSpread(_objectSpread({}, state.ProEnum), props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.ProEnum), props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.globalConfig), dispatch);
78
+ var enumRes = useEnumRequest(_objectSpread(_objectSpread(_objectSpread({}, state.ProEnum), props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.ProEnum), props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.globalConfig), dispatch);
79
79
  useEffect(function () {
80
80
  // 本地配置取出
81
81
  var localConfigStr = localStorage.getItem('localConfig');
@@ -93,6 +93,11 @@ export var ProConfigProvider = function ProConfigProvider(props) {
93
93
  // 设置默认语言
94
94
  setLanguage(props === null || props === void 0 ? void 0 : props.locale);
95
95
  }
96
+ useEffect(function () {
97
+ if (enumRes === null || enumRes === void 0 ? void 0 : enumRes.data) {
98
+ (props === null || props === void 0 ? void 0 : props.onSuccess) && (props === null || props === void 0 ? void 0 : props.onSuccess(enumRes === null || enumRes === void 0 ? void 0 : enumRes.data, enumRes === null || enumRes === void 0 ? void 0 : enumRes.params));
99
+ }
100
+ }, [enumRes === null || enumRes === void 0 ? void 0 : enumRes.loading]);
96
101
  return _jsx(ProConfigContext.Provider, {
97
102
  value: {
98
103
  state: merge(state, props.value),
@@ -414,7 +414,7 @@ var RenderField = function RenderField(_ref) {
414
414
  }
415
415
  _args = formatArgs([].concat(args));
416
416
  rowPath = [].concat(_toConsumableArray(namePath), [index]);
417
- row = form.getFieldValue(rowPath, true); // if (type === 'InputNumber' && column.name) row[column.name] = args[0];
417
+ row = form.getFieldValue(rowPath, true);
418
418
  orgRow = cloneDeep(row);
419
419
  _args[1] = row;
420
420
  _context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
@@ -443,8 +443,6 @@ var RenderField = function RenderField(_ref) {
443
443
  if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
444
444
  debounceValidate(validateFieldKeys);
445
445
  }
446
- } else {
447
- debounceValidate();
448
446
  }
449
447
  if (!isCell) {
450
448
  _context2.next = 20;
@@ -276,7 +276,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
276
276
  return transformColumns(columns, config);
277
277
  }, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath]);
278
278
  useEffect(function () {
279
- var isAllHasKey = value.every(function (item) {
279
+ var _value$every;
280
+ var isAllHasKey = value === null || value === void 0 ? void 0 : (_value$every = value.every) === null || _value$every === void 0 ? void 0 : _value$every.call(value, function (item) {
280
281
  return item.rowKey;
281
282
  });
282
283
  // 初始化默认生成row-key
@@ -7,10 +7,7 @@ export var getRandom = function getRandom() {
7
7
  export var difference = function difference(object, base) {
8
8
  var changes = function changes(object, base) {
9
9
  return transform(object, function (result, value, key) {
10
- var _key$indexOf;
11
- if ((key === null || key === void 0 ? void 0 : (_key$indexOf = key.indexOf) === null || _key$indexOf === void 0 ? void 0 : _key$indexOf.call(key, '-')) > -1) {
12
- result[key] = true;
13
- } else if (!isEqual(value, base[key])) {
10
+ if (!isEqual(value, base[key])) {
14
11
  result[key] = isObject(value) && isObject(base[key]) ? changes(value, base[key]) : value;
15
12
  }
16
13
  });
@@ -1,4 +1,4 @@
1
1
  import { ProEnumConfig } from '../propsType';
2
2
  import '../utils/eventCenter';
3
- declare const useEnumRequest: (props: ProEnumConfig, dispatch: any) => void;
3
+ declare const useEnumRequest: (props: ProEnumConfig, dispatch: any) => import("ahooks/lib/useRequest/src/types").Result<any, any>;
4
4
  export default useEnumRequest;
@@ -45,120 +45,119 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
45
45
  console.info('proEnum:', msg);
46
46
  }
47
47
  };
48
- var _useRequestFunc = useRequestFunc(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread(_objectSpread({
49
- manual: true,
50
- cacheKey: cacheKey,
51
- cacheTime: -1,
52
- staleTime: 6e4 * 60
53
- }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
54
- setCache: function () {
55
- var _setCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
56
- var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
57
- return _regeneratorRuntime().wrap(function _callee$(_context) {
58
- while (1) switch (_context.prev = _context.next) {
59
- case 0:
60
- response = res.data;
61
- if (!(transformResponse && typeof transformResponse === 'function')) {
62
- _context.next = 10;
63
- break;
64
- }
65
- _context.next = 4;
66
- return transformResponse(res.data);
67
- case 4:
68
- response = _context.sent;
69
- if (!(_typeof(response) !== 'object' || response == null)) {
70
- _context.next = 9;
71
- break;
72
- }
73
- throw new Error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum2 = locale.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
74
- case 9:
75
- res.data = response;
76
- case 10:
77
- if (!(_typeof(response) !== 'object' || response === null)) {
78
- _context.next = 12;
79
- break;
80
- }
81
- throw Error('response enum data must be object');
82
- case 12:
83
- if (!(Object.keys(response).length === 0)) {
84
- _context.next = 14;
85
- break;
86
- }
87
- throw Error('Please return valid enumeration data');
88
- case 14:
89
- // 只返回fieldNames对象的key
90
- if (clear) {
91
- // 忽略清洗的 codes
92
- ignoreCodes = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.ignoreCodes) || [];
93
- Object.keys(response).forEach(function (key) {
94
- var options = _toConsumableArray(response[key]) || [];
95
- if (ignoreCodes.includes(key)) {
96
- response[key] = options;
97
- } else {
98
- response[key] = options.map(function (item) {
99
- return cacheFieldNames(fieldNames, item);
100
- });
101
- }
102
- });
103
- res.data = response;
104
- }
105
- cacheData = getEnumData(storage, cacheKey, baseEnumStorage) || {
106
- data: {}
107
- }; // 合并缓存数据
108
- res.data = _objectSpread(_objectSpread({}, cacheData === null || cacheData === void 0 ? void 0 : cacheData.data), res.data);
109
- setEnumData(storage, cacheKey, res);
110
- // 同步数据到全局
111
- dispatch({
112
- type: 'setProEnumDic',
113
- payload: _objectSpread(_objectSpread(_objectSpread({}, dics), dataSource), res.data)
48
+ var enumRes = useRequestFunc(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread(_objectSpread({
49
+ manual: true,
50
+ cacheKey: cacheKey,
51
+ cacheTime: -1,
52
+ staleTime: 6e4 * 60
53
+ }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
54
+ setCache: function () {
55
+ var _setCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
56
+ var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
57
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
58
+ while (1) switch (_context.prev = _context.next) {
59
+ case 0:
60
+ response = res.data;
61
+ if (!(transformResponse && typeof transformResponse === 'function')) {
62
+ _context.next = 10;
63
+ break;
64
+ }
65
+ _context.next = 4;
66
+ return transformResponse(res.data);
67
+ case 4:
68
+ response = _context.sent;
69
+ if (!(_typeof(response) !== 'object' || response == null)) {
70
+ _context.next = 9;
71
+ break;
72
+ }
73
+ throw new Error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum2 = locale.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
74
+ case 9:
75
+ res.data = response;
76
+ case 10:
77
+ if (!(_typeof(response) !== 'object' || response === null)) {
78
+ _context.next = 12;
79
+ break;
80
+ }
81
+ throw Error('response enum data must be object');
82
+ case 12:
83
+ if (!(Object.keys(response).length === 0)) {
84
+ _context.next = 14;
85
+ break;
86
+ }
87
+ throw Error('Please return valid enumeration data');
88
+ case 14:
89
+ // 只返回fieldNames对象的key
90
+ if (clear) {
91
+ // 忽略清洗的 codes
92
+ ignoreCodes = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.ignoreCodes) || [];
93
+ Object.keys(response).forEach(function (key) {
94
+ var options = _toConsumableArray(response[key]) || [];
95
+ if (ignoreCodes.includes(key)) {
96
+ response[key] = options;
97
+ } else {
98
+ response[key] = options.map(function (item) {
99
+ return cacheFieldNames(fieldNames, item);
100
+ });
101
+ }
114
102
  });
115
- if (main) {
116
- setTimeout(function () {
117
- var _locale$ProEnum3;
118
- window.eventCenter.publish('zat-design-pro-component-event', res.data);
119
- logDebug(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum3 = locale.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.mainInitByRequest);
120
- }, 10000);
121
- }
122
- return _context.abrupt("return", res);
123
- case 21:
124
- case "end":
125
- return _context.stop();
126
- }
127
- }, _callee);
128
- }));
129
- function setCache(_x) {
130
- return _setCache.apply(this, arguments);
131
- }
132
- return setCache;
133
- }(),
134
- getCache: function getCache() {
135
- var res = getEnumData(storage, cacheKey, baseEnumStorage) || {
136
- data: {}
137
- };
138
- dispatch({
139
- type: 'setProEnumDic',
140
- payload: _objectSpread(_objectSpread(_objectSpread({}, dics), dataSource), res === null || res === void 0 ? void 0 : res.data)
141
- });
142
- if (main) {
143
- setTimeout(function () {
144
- var _locale$ProEnum4;
145
- window.eventCenter.publish('zat-design-pro-component-event', res.data);
146
- logDebug(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.mainInitByCache);
147
- }, 10000);
148
- }
149
- return res;
150
- },
151
- onSuccess: function onSuccess(res) {
152
- var _res$status = res.status,
153
- status = _res$status === void 0 ? 200 : _res$status,
154
- msg = res.message;
155
- if (status !== 200) {
156
- var _locale$ProEnum5;
157
- throw new Error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum5 = locale.ProEnum) === null || _locale$ProEnum5 === void 0 ? void 0 : _locale$ProEnum5.requestError);
158
- }
103
+ res.data = response;
104
+ }
105
+ cacheData = getEnumData(storage, cacheKey, baseEnumStorage) || {
106
+ data: {}
107
+ }; // 合并缓存数据
108
+ res.data = _objectSpread(_objectSpread({}, cacheData === null || cacheData === void 0 ? void 0 : cacheData.data), res.data);
109
+ setEnumData(storage, cacheKey, res);
110
+ // 同步数据到全局
111
+ dispatch({
112
+ type: 'setProEnumDic',
113
+ payload: _objectSpread(_objectSpread(_objectSpread({}, dics), dataSource), res.data)
114
+ });
115
+ if (main) {
116
+ setTimeout(function () {
117
+ var _locale$ProEnum3;
118
+ window.eventCenter.publish('zat-design-pro-component-event', res.data);
119
+ logDebug(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum3 = locale.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.mainInitByRequest);
120
+ }, 10000);
121
+ }
122
+ return _context.abrupt("return", res);
123
+ case 21:
124
+ case "end":
125
+ return _context.stop();
126
+ }
127
+ }, _callee);
128
+ }));
129
+ function setCache(_x) {
130
+ return _setCache.apply(this, arguments);
159
131
  }
160
- })),
161
- run = _useRequestFunc.run;
132
+ return setCache;
133
+ }(),
134
+ getCache: function getCache() {
135
+ var res = getEnumData(storage, cacheKey, baseEnumStorage) || {
136
+ data: {}
137
+ };
138
+ dispatch({
139
+ type: 'setProEnumDic',
140
+ payload: _objectSpread(_objectSpread(_objectSpread({}, dics), dataSource), res === null || res === void 0 ? void 0 : res.data)
141
+ });
142
+ if (main) {
143
+ setTimeout(function () {
144
+ var _locale$ProEnum4;
145
+ window.eventCenter.publish('zat-design-pro-component-event', res.data);
146
+ logDebug(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.mainInitByCache);
147
+ }, 10000);
148
+ }
149
+ return res;
150
+ },
151
+ onSuccess: function onSuccess(res) {
152
+ var _res$status = res.status,
153
+ status = _res$status === void 0 ? 200 : _res$status,
154
+ msg = res.message;
155
+ if (status !== 200) {
156
+ var _locale$ProEnum5;
157
+ throw new Error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum5 = locale.ProEnum) === null || _locale$ProEnum5 === void 0 ? void 0 : _locale$ProEnum5.requestError);
158
+ }
159
+ }
160
+ }));
162
161
  var mergeData = /*#__PURE__*/function () {
163
162
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
164
163
  var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
@@ -258,7 +257,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
258
257
  window.localStorage.removeItem(cacheKey);
259
258
  window.sessionStorage.removeItem(cacheKey);
260
259
  }
261
- run(defaultParams);
260
+ enumRes.run(defaultParams);
262
261
  // TODO 这段代码目前看起来是没啥用的、没起到作用
263
262
  mergeData();
264
263
  } else if (Object.keys(dataSource)) {
@@ -304,5 +303,6 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
304
303
  window.eventCenter.unsubscribe('zat-design-pro-component-event', shareProEnumDic);
305
304
  };
306
305
  }, []);
306
+ return enumRes;
307
307
  };
308
308
  export default useEnumRequest;
@@ -353,7 +353,13 @@ var Render = function Render(props) {
353
353
  mark: 'pro_table_render',
354
354
  render: function render(inputProps, doms) {
355
355
  return _jsxs(_Fragment, {
356
- children: [_jsxs("div", {
356
+ children: [_jsx(_Space, {
357
+ size: 0,
358
+ style: {
359
+ marginTop: 8
360
+ },
361
+ children: formItemProps.above
362
+ }), _jsxs("div", {
357
363
  style: {
358
364
  display: 'flex',
359
365
  alignItems: 'center'
@@ -214,6 +214,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
214
214
  before?: string | React.ReactNode;
215
215
  /** 表单后缀信息 */
216
216
  after?: string | React.ReactNode;
217
+ /** 表单上方辅助信息 */
218
+ above?: string | React.ReactNode;
217
219
  /** 表单下方辅助信息 */
218
220
  extra?: string | React.ReactNode;
219
221
  /** 是否固定字段, 不隐藏 */
@@ -244,6 +246,8 @@ export interface RenderProps<Values = any> {
244
246
  before?: string | React.ReactNode;
245
247
  /** 表单后缀信息 */
246
248
  after?: string | React.ReactNode;
249
+ /** 表单上方辅助信息 */
250
+ above?: string | React.ReactNode;
247
251
  /** 表单下方辅助信息 */
248
252
  extra?: string | React.ReactNode;
249
253
  parentNames?: string;
@@ -25,6 +25,8 @@ var ProLayout = function ProLayout(props) {
25
25
  headerNotice = props.headerNotice,
26
26
  noticeIn = props.notice,
27
27
  dataSource = props.dataSource,
28
+ _props$pathPrefix = props.pathPrefix,
29
+ pathPrefix = _props$pathPrefix === void 0 ? '' : _props$pathPrefix,
28
30
  theme = props.theme,
29
31
  onCollapsedChange = props.onCollapsedChange;
30
32
  var _useSetState = useSetState({
@@ -51,7 +53,7 @@ var ProLayout = function ProLayout(props) {
51
53
  if (Array.isArray(dataSource) && !dataSource.length) {
52
54
  return _message.warning('Warning: Missing menu data source, or menu data source is not an array');
53
55
  }
54
- var userData = transformMenus(dataSource);
56
+ var userData = transformMenus(dataSource, pathPrefix);
55
57
  setState({
56
58
  menus: userData
57
59
  });
@@ -44,6 +44,10 @@ export interface ProLayoutProps {
44
44
  dataSource?: DataSourceProps | Partial<MenusProps>;
45
45
  collapsed?: boolean;
46
46
  /**
47
+ * 菜单拼接前缀
48
+ */
49
+ pathPrefix?: string;
50
+ /**
47
51
  * 是否带有菜单界面,true不带,只显示content内容
48
52
  */
49
53
  pure?: pureKey;
@@ -11,13 +11,13 @@ export declare const getIdsByPathName: (menus: any[], activeMenu?: string) => nu
11
11
  * @param menuData 菜单数据源
12
12
  * @returns []
13
13
  */
14
- export declare const transformMenu: (menuData: any[]) => any[];
14
+ export declare const transformMenu: (menuData: any[], pathPrefix: string) => any[];
15
15
  /**
16
16
  * 转换菜单数据源评价keyUrlPath与keyIdPath
17
17
  * @param data 菜单数据源
18
18
  * @returns []
19
19
  */
20
- export declare const transformMenus: (data: MenusProps) => any[] | MenusProps;
20
+ export declare const transformMenus: (data: MenusProps, pathPrefix: string) => any[] | MenusProps;
21
21
  /**
22
22
  * 获取URL中的search参数
23
23
  * @param name 参数key
@@ -40,7 +40,7 @@ export var getIdsByPathName = function getIdsByPathName(menus, activeMenu) {
40
40
  * @param menuData 菜单数据源
41
41
  * @returns []
42
42
  */
43
- export var transformMenu = function transformMenu(menuData) {
43
+ export var transformMenu = function transformMenu(menuData, pathPrefix) {
44
44
  var data = _toConsumableArray(menuData);
45
45
  var menuDeep = function menuDeep(menuDeepItem) {
46
46
  if (!Array.isArray(menuDeepItem) || !menuDeepItem.length) {
@@ -49,6 +49,8 @@ export var transformMenu = function transformMenu(menuData) {
49
49
  menuDeepItem.forEach(function (item, index) {
50
50
  var _item$keyUrlPath, _item$keyIdPath, _item$children;
51
51
  item.code = item.code || item.id;
52
+ item.url = "".concat(pathPrefix).concat(item.url);
53
+ item.redirectUrl = (item === null || item === void 0 ? void 0 : item.redirectUrl) ? "".concat(pathPrefix).concat(item.redirectUrl) : '';
52
54
  // 拼接父级url与id数据
53
55
  if (item === null || item === void 0 ? void 0 : (_item$keyUrlPath = item.keyUrlPath) === null || _item$keyUrlPath === void 0 ? void 0 : _item$keyUrlPath.length) {
54
56
  item.keyUrlPath.push(item.redirectUrl || item.url);
@@ -85,18 +87,18 @@ export var transformMenu = function transformMenu(menuData) {
85
87
  * @param data 菜单数据源
86
88
  * @returns []
87
89
  */
88
- export var transformMenus = function transformMenus(data) {
90
+ export var transformMenus = function transformMenus(data, pathPrefix) {
89
91
  if (isPlainObject(data)) {
90
92
  // @ts-ignore
91
93
  if (!Array.isArray(data === null || data === void 0 ? void 0 : data.menus)) {
92
94
  return [];
93
95
  }
94
96
  // @ts-ignore
95
- data.menus = transformMenu(data.menus);
97
+ data.menus = transformMenu(data.menus, pathPrefix);
96
98
  return data;
97
99
  }
98
100
  if (Array.isArray(data)) {
99
- return transformMenu(data);
101
+ return transformMenu(data, pathPrefix);
100
102
  }
101
103
  return data;
102
104
  };
@@ -1,14 +1,6 @@
1
1
  @root-entry-name: 'default';
2
2
  @import (reference) '~antd/es/style/themes/index.less';
3
3
 
4
- .@{ant-prefix}-table-cell-fix-right {
5
- z-index: 999 !important;
6
- }
7
-
8
- .@{ant-prefix}-table-cell-fix-left {
9
- z-index: 999 !important;
10
- }
11
-
12
4
  .pro-tooltip {
13
5
  cursor: pointer;
14
6
 
@@ -360,6 +360,7 @@ var ProTree = function ProTree(props) {
360
360
  /** 点击了树节点开始loading,改变自身state并将值通过onchange上传到form */
361
361
  var onSelectTreeNode = /*#__PURE__*/function () {
362
362
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(props, info) {
363
+ var _options$;
363
364
  var values, options, option;
364
365
  return _regeneratorRuntime().wrap(function _callee$(_context) {
365
366
  while (1) switch (_context.prev = _context.next) {
@@ -393,7 +394,7 @@ var ProTree = function ProTree(props) {
393
394
  return values === item[fieldNameValue];
394
395
  });
395
396
  }
396
- option = options === null || options === void 0 ? void 0 : options[0];
397
+ option = (_options$ = options === null || options === void 0 ? void 0 : options[0]) !== null && _options$ !== void 0 ? _options$ : {};
397
398
  delete option[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'];
398
399
  if (!(other === null || other === void 0 ? void 0 : other.checkable)) {
399
400
  // 单选将选中节点值冒泡到form, 给onFieldChange添加options
@@ -29,5 +29,6 @@ interface Actions {
29
29
  export declare const ProConfigProvider: FC<{
30
30
  value?: ProConfigState;
31
31
  locale?: string;
32
+ onSuccess?: (data: any, params: any) => void;
32
33
  }>;
33
34
  export default ProConfigProvider;
@@ -84,7 +84,7 @@ var ProConfigProvider = exports.ProConfigProvider = function ProConfigProvider(p
84
84
  _useReducer2 = (0, _slicedToArray2.default)(_useReducer, 2),
85
85
  state = _useReducer2[0],
86
86
  dispatch = _useReducer2[1];
87
- (0, _useEnumRequest.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.ProEnum), props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.ProEnum), props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.globalConfig), dispatch);
87
+ var enumRes = (0, _useEnumRequest.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.ProEnum), props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.ProEnum), props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.globalConfig), dispatch);
88
88
  (0, _react.useEffect)(function () {
89
89
  // 本地配置取出
90
90
  var localConfigStr = localStorage.getItem('localConfig');
@@ -102,6 +102,11 @@ var ProConfigProvider = exports.ProConfigProvider = function ProConfigProvider(p
102
102
  // 设置默认语言
103
103
  (0, _locale.setLanguage)(props === null || props === void 0 ? void 0 : props.locale);
104
104
  }
105
+ (0, _react.useEffect)(function () {
106
+ if (enumRes === null || enumRes === void 0 ? void 0 : enumRes.data) {
107
+ (props === null || props === void 0 ? void 0 : props.onSuccess) && (props === null || props === void 0 ? void 0 : props.onSuccess(enumRes === null || enumRes === void 0 ? void 0 : enumRes.data, enumRes === null || enumRes === void 0 ? void 0 : enumRes.params));
108
+ }
109
+ }, [enumRes === null || enumRes === void 0 ? void 0 : enumRes.loading]);
105
110
  return (0, _jsxRuntime.jsx)(ProConfigContext.Provider, {
106
111
  value: {
107
112
  state: (0, _merge.default)(state, props.value),
@@ -417,7 +417,7 @@ var RenderField = function RenderField(_ref) {
417
417
  }
418
418
  _args = formatArgs([].concat(args));
419
419
  rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
420
- row = form.getFieldValue(rowPath, true); // if (type === 'InputNumber' && column.name) row[column.name] = args[0];
420
+ row = form.getFieldValue(rowPath, true);
421
421
  orgRow = (0, _lodash.cloneDeep)(row);
422
422
  _args[1] = row;
423
423
  _context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
@@ -446,8 +446,6 @@ var RenderField = function RenderField(_ref) {
446
446
  if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
447
447
  debounceValidate(validateFieldKeys);
448
448
  }
449
- } else {
450
- debounceValidate();
451
449
  }
452
450
  if (!isCell) {
453
451
  _context2.next = 20;
@@ -277,7 +277,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
277
277
  return (0, _utils.transformColumns)(columns, config);
278
278
  }, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath]);
279
279
  (0, _react.useEffect)(function () {
280
- var isAllHasKey = value.every(function (item) {
280
+ var _value$every;
281
+ var isAllHasKey = value === null || value === void 0 ? void 0 : (_value$every = value.every) === null || _value$every === void 0 ? void 0 : _value$every.call(value, function (item) {
281
282
  return item.rowKey;
282
283
  });
283
284
  // 初始化默认生成row-key
@@ -14,10 +14,7 @@ var getRandom = exports.getRandom = function getRandom() {
14
14
  var difference = exports.difference = function difference(object, base) {
15
15
  var changes = function changes(object, base) {
16
16
  return (0, _lodash.transform)(object, function (result, value, key) {
17
- var _key$indexOf;
18
- if ((key === null || key === void 0 ? void 0 : (_key$indexOf = key.indexOf) === null || _key$indexOf === void 0 ? void 0 : _key$indexOf.call(key, '-')) > -1) {
19
- result[key] = true;
20
- } else if (!(0, _lodash.isEqual)(value, base[key])) {
17
+ if (!(0, _lodash.isEqual)(value, base[key])) {
21
18
  result[key] = (0, _lodash.isObject)(value) && (0, _lodash.isObject)(base[key]) ? changes(value, base[key]) : value;
22
19
  }
23
20
  });
@@ -1,4 +1,4 @@
1
1
  import { ProEnumConfig } from '../propsType';
2
2
  import '../utils/eventCenter';
3
- declare const useEnumRequest: (props: ProEnumConfig, dispatch: any) => void;
3
+ declare const useEnumRequest: (props: ProEnumConfig, dispatch: any) => import("ahooks/lib/useRequest/src/types").Result<any, any>;
4
4
  export default useEnumRequest;
@@ -52,120 +52,119 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
52
52
  console.info('proEnum:', msg);
53
53
  }
54
54
  };
55
- var _useRequestFunc = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)((0, _objectSpread2.default)({
56
- manual: true,
57
- cacheKey: cacheKey,
58
- cacheTime: -1,
59
- staleTime: 6e4 * 60
60
- }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
61
- setCache: function () {
62
- var _setCache = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(res) {
63
- var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
64
- return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
65
- while (1) switch (_context.prev = _context.next) {
66
- case 0:
67
- response = res.data;
68
- if (!(transformResponse && typeof transformResponse === 'function')) {
69
- _context.next = 10;
70
- break;
71
- }
72
- _context.next = 4;
73
- return transformResponse(res.data);
74
- case 4:
75
- response = _context.sent;
76
- if (!((0, _typeof2.default)(response) !== 'object' || response == null)) {
77
- _context.next = 9;
78
- break;
79
- }
80
- throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum2 = _locale.default.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
81
- case 9:
82
- res.data = response;
83
- case 10:
84
- if (!((0, _typeof2.default)(response) !== 'object' || response === null)) {
85
- _context.next = 12;
86
- break;
87
- }
88
- throw Error('response enum data must be object');
89
- case 12:
90
- if (!(Object.keys(response).length === 0)) {
91
- _context.next = 14;
92
- break;
93
- }
94
- throw Error('Please return valid enumeration data');
95
- case 14:
96
- // 只返回fieldNames对象的key
97
- if (clear) {
98
- // 忽略清洗的 codes
99
- ignoreCodes = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.ignoreCodes) || [];
100
- Object.keys(response).forEach(function (key) {
101
- var options = (0, _toConsumableArray2.default)(response[key]) || [];
102
- if (ignoreCodes.includes(key)) {
103
- response[key] = options;
104
- } else {
105
- response[key] = options.map(function (item) {
106
- return (0, _utils.cacheFieldNames)(fieldNames, item);
107
- });
108
- }
109
- });
110
- res.data = response;
111
- }
112
- cacheData = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage) || {
113
- data: {}
114
- }; // 合并缓存数据
115
- res.data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, cacheData === null || cacheData === void 0 ? void 0 : cacheData.data), res.data);
116
- (0, _utils.setEnumData)(storage, cacheKey, res);
117
- // 同步数据到全局
118
- dispatch({
119
- type: 'setProEnumDic',
120
- payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource), res.data)
55
+ var enumRes = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)((0, _objectSpread2.default)({
56
+ manual: true,
57
+ cacheKey: cacheKey,
58
+ cacheTime: -1,
59
+ staleTime: 6e4 * 60
60
+ }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
61
+ setCache: function () {
62
+ var _setCache = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(res) {
63
+ var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
64
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
65
+ while (1) switch (_context.prev = _context.next) {
66
+ case 0:
67
+ response = res.data;
68
+ if (!(transformResponse && typeof transformResponse === 'function')) {
69
+ _context.next = 10;
70
+ break;
71
+ }
72
+ _context.next = 4;
73
+ return transformResponse(res.data);
74
+ case 4:
75
+ response = _context.sent;
76
+ if (!((0, _typeof2.default)(response) !== 'object' || response == null)) {
77
+ _context.next = 9;
78
+ break;
79
+ }
80
+ throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum2 = _locale.default.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
81
+ case 9:
82
+ res.data = response;
83
+ case 10:
84
+ if (!((0, _typeof2.default)(response) !== 'object' || response === null)) {
85
+ _context.next = 12;
86
+ break;
87
+ }
88
+ throw Error('response enum data must be object');
89
+ case 12:
90
+ if (!(Object.keys(response).length === 0)) {
91
+ _context.next = 14;
92
+ break;
93
+ }
94
+ throw Error('Please return valid enumeration data');
95
+ case 14:
96
+ // 只返回fieldNames对象的key
97
+ if (clear) {
98
+ // 忽略清洗的 codes
99
+ ignoreCodes = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.ignoreCodes) || [];
100
+ Object.keys(response).forEach(function (key) {
101
+ var options = (0, _toConsumableArray2.default)(response[key]) || [];
102
+ if (ignoreCodes.includes(key)) {
103
+ response[key] = options;
104
+ } else {
105
+ response[key] = options.map(function (item) {
106
+ return (0, _utils.cacheFieldNames)(fieldNames, item);
107
+ });
108
+ }
121
109
  });
122
- if (main) {
123
- setTimeout(function () {
124
- var _locale$ProEnum3;
125
- window.eventCenter.publish('zat-design-pro-component-event', res.data);
126
- logDebug(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum3 = _locale.default.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.mainInitByRequest);
127
- }, 10000);
128
- }
129
- return _context.abrupt("return", res);
130
- case 21:
131
- case "end":
132
- return _context.stop();
133
- }
134
- }, _callee);
135
- }));
136
- function setCache(_x) {
137
- return _setCache.apply(this, arguments);
138
- }
139
- return setCache;
140
- }(),
141
- getCache: function getCache() {
142
- var res = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage) || {
143
- data: {}
144
- };
145
- dispatch({
146
- type: 'setProEnumDic',
147
- payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource), res === null || res === void 0 ? void 0 : res.data)
148
- });
149
- if (main) {
150
- setTimeout(function () {
151
- var _locale$ProEnum4;
152
- window.eventCenter.publish('zat-design-pro-component-event', res.data);
153
- logDebug(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum4 = _locale.default.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.mainInitByCache);
154
- }, 10000);
155
- }
156
- return res;
157
- },
158
- onSuccess: function onSuccess(res) {
159
- var _res$status = res.status,
160
- status = _res$status === void 0 ? 200 : _res$status,
161
- msg = res.message;
162
- if (status !== 200) {
163
- var _locale$ProEnum5;
164
- throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum5 = _locale.default.ProEnum) === null || _locale$ProEnum5 === void 0 ? void 0 : _locale$ProEnum5.requestError);
165
- }
110
+ res.data = response;
111
+ }
112
+ cacheData = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage) || {
113
+ data: {}
114
+ }; // 合并缓存数据
115
+ res.data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, cacheData === null || cacheData === void 0 ? void 0 : cacheData.data), res.data);
116
+ (0, _utils.setEnumData)(storage, cacheKey, res);
117
+ // 同步数据到全局
118
+ dispatch({
119
+ type: 'setProEnumDic',
120
+ payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource), res.data)
121
+ });
122
+ if (main) {
123
+ setTimeout(function () {
124
+ var _locale$ProEnum3;
125
+ window.eventCenter.publish('zat-design-pro-component-event', res.data);
126
+ logDebug(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum3 = _locale.default.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.mainInitByRequest);
127
+ }, 10000);
128
+ }
129
+ return _context.abrupt("return", res);
130
+ case 21:
131
+ case "end":
132
+ return _context.stop();
133
+ }
134
+ }, _callee);
135
+ }));
136
+ function setCache(_x) {
137
+ return _setCache.apply(this, arguments);
166
138
  }
167
- })),
168
- run = _useRequestFunc.run;
139
+ return setCache;
140
+ }(),
141
+ getCache: function getCache() {
142
+ var res = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage) || {
143
+ data: {}
144
+ };
145
+ dispatch({
146
+ type: 'setProEnumDic',
147
+ payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource), res === null || res === void 0 ? void 0 : res.data)
148
+ });
149
+ if (main) {
150
+ setTimeout(function () {
151
+ var _locale$ProEnum4;
152
+ window.eventCenter.publish('zat-design-pro-component-event', res.data);
153
+ logDebug(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum4 = _locale.default.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.mainInitByCache);
154
+ }, 10000);
155
+ }
156
+ return res;
157
+ },
158
+ onSuccess: function onSuccess(res) {
159
+ var _res$status = res.status,
160
+ status = _res$status === void 0 ? 200 : _res$status,
161
+ msg = res.message;
162
+ if (status !== 200) {
163
+ var _locale$ProEnum5;
164
+ throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum5 = _locale.default.ProEnum) === null || _locale$ProEnum5 === void 0 ? void 0 : _locale$ProEnum5.requestError);
165
+ }
166
+ }
167
+ }));
169
168
  var mergeData = /*#__PURE__*/function () {
170
169
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
171
170
  var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
@@ -265,7 +264,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
265
264
  window.localStorage.removeItem(cacheKey);
266
265
  window.sessionStorage.removeItem(cacheKey);
267
266
  }
268
- run(defaultParams);
267
+ enumRes.run(defaultParams);
269
268
  // TODO 这段代码目前看起来是没啥用的、没起到作用
270
269
  mergeData();
271
270
  } else if (Object.keys(dataSource)) {
@@ -311,5 +310,6 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
311
310
  window.eventCenter.unsubscribe('zat-design-pro-component-event', shareProEnumDic);
312
311
  };
313
312
  }, []);
313
+ return enumRes;
314
314
  };
315
315
  var _default = exports.default = useEnumRequest;
@@ -351,7 +351,13 @@ var Render = function Render(props) {
351
351
  mark: 'pro_table_render',
352
352
  render: function render(inputProps, doms) {
353
353
  return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
354
- children: [(0, _jsxRuntime.jsxs)("div", {
354
+ children: [(0, _jsxRuntime.jsx)(_antd.Space, {
355
+ size: 0,
356
+ style: {
357
+ marginTop: 8
358
+ },
359
+ children: formItemProps.above
360
+ }), (0, _jsxRuntime.jsxs)("div", {
355
361
  style: {
356
362
  display: 'flex',
357
363
  alignItems: 'center'
@@ -214,6 +214,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
214
214
  before?: string | React.ReactNode;
215
215
  /** 表单后缀信息 */
216
216
  after?: string | React.ReactNode;
217
+ /** 表单上方辅助信息 */
218
+ above?: string | React.ReactNode;
217
219
  /** 表单下方辅助信息 */
218
220
  extra?: string | React.ReactNode;
219
221
  /** 是否固定字段, 不隐藏 */
@@ -244,6 +246,8 @@ export interface RenderProps<Values = any> {
244
246
  before?: string | React.ReactNode;
245
247
  /** 表单后缀信息 */
246
248
  after?: string | React.ReactNode;
249
+ /** 表单上方辅助信息 */
250
+ above?: string | React.ReactNode;
247
251
  /** 表单下方辅助信息 */
248
252
  extra?: string | React.ReactNode;
249
253
  parentNames?: string;
@@ -31,6 +31,8 @@ var ProLayout = function ProLayout(props) {
31
31
  headerNotice = props.headerNotice,
32
32
  noticeIn = props.notice,
33
33
  dataSource = props.dataSource,
34
+ _props$pathPrefix = props.pathPrefix,
35
+ pathPrefix = _props$pathPrefix === void 0 ? '' : _props$pathPrefix,
34
36
  theme = props.theme,
35
37
  onCollapsedChange = props.onCollapsedChange;
36
38
  var _useSetState = (0, _ahooks.useSetState)({
@@ -57,7 +59,7 @@ var ProLayout = function ProLayout(props) {
57
59
  if (Array.isArray(dataSource) && !dataSource.length) {
58
60
  return _antd.message.warning('Warning: Missing menu data source, or menu data source is not an array');
59
61
  }
60
- var userData = (0, _utils.transformMenus)(dataSource);
62
+ var userData = (0, _utils.transformMenus)(dataSource, pathPrefix);
61
63
  setState({
62
64
  menus: userData
63
65
  });
@@ -44,6 +44,10 @@ export interface ProLayoutProps {
44
44
  dataSource?: DataSourceProps | Partial<MenusProps>;
45
45
  collapsed?: boolean;
46
46
  /**
47
+ * 菜单拼接前缀
48
+ */
49
+ pathPrefix?: string;
50
+ /**
47
51
  * 是否带有菜单界面,true不带,只显示content内容
48
52
  */
49
53
  pure?: pureKey;
@@ -11,13 +11,13 @@ export declare const getIdsByPathName: (menus: any[], activeMenu?: string) => nu
11
11
  * @param menuData 菜单数据源
12
12
  * @returns []
13
13
  */
14
- export declare const transformMenu: (menuData: any[]) => any[];
14
+ export declare const transformMenu: (menuData: any[], pathPrefix: string) => any[];
15
15
  /**
16
16
  * 转换菜单数据源评价keyUrlPath与keyIdPath
17
17
  * @param data 菜单数据源
18
18
  * @returns []
19
19
  */
20
- export declare const transformMenus: (data: MenusProps) => any[] | MenusProps;
20
+ export declare const transformMenus: (data: MenusProps, pathPrefix: string) => any[] | MenusProps;
21
21
  /**
22
22
  * 获取URL中的search参数
23
23
  * @param name 参数key
@@ -50,7 +50,7 @@ var getIdsByPathName = exports.getIdsByPathName = function getIdsByPathName(menu
50
50
  * @param menuData 菜单数据源
51
51
  * @returns []
52
52
  */
53
- var transformMenu = exports.transformMenu = function transformMenu(menuData) {
53
+ var transformMenu = exports.transformMenu = function transformMenu(menuData, pathPrefix) {
54
54
  var data = (0, _toConsumableArray2.default)(menuData);
55
55
  var menuDeep = function menuDeep(menuDeepItem) {
56
56
  if (!Array.isArray(menuDeepItem) || !menuDeepItem.length) {
@@ -59,6 +59,8 @@ var transformMenu = exports.transformMenu = function transformMenu(menuData) {
59
59
  menuDeepItem.forEach(function (item, index) {
60
60
  var _item$keyUrlPath, _item$keyIdPath, _item$children;
61
61
  item.code = item.code || item.id;
62
+ item.url = "".concat(pathPrefix).concat(item.url);
63
+ item.redirectUrl = (item === null || item === void 0 ? void 0 : item.redirectUrl) ? "".concat(pathPrefix).concat(item.redirectUrl) : '';
62
64
  // 拼接父级url与id数据
63
65
  if (item === null || item === void 0 ? void 0 : (_item$keyUrlPath = item.keyUrlPath) === null || _item$keyUrlPath === void 0 ? void 0 : _item$keyUrlPath.length) {
64
66
  item.keyUrlPath.push(item.redirectUrl || item.url);
@@ -95,18 +97,18 @@ var transformMenu = exports.transformMenu = function transformMenu(menuData) {
95
97
  * @param data 菜单数据源
96
98
  * @returns []
97
99
  */
98
- var transformMenus = exports.transformMenus = function transformMenus(data) {
100
+ var transformMenus = exports.transformMenus = function transformMenus(data, pathPrefix) {
99
101
  if ((0, _lodash.isPlainObject)(data)) {
100
102
  // @ts-ignore
101
103
  if (!Array.isArray(data === null || data === void 0 ? void 0 : data.menus)) {
102
104
  return [];
103
105
  }
104
106
  // @ts-ignore
105
- data.menus = transformMenu(data.menus);
107
+ data.menus = transformMenu(data.menus, pathPrefix);
106
108
  return data;
107
109
  }
108
110
  if (Array.isArray(data)) {
109
- return transformMenu(data);
111
+ return transformMenu(data, pathPrefix);
110
112
  }
111
113
  return data;
112
114
  };
@@ -1,14 +1,6 @@
1
1
  @root-entry-name: 'default';
2
2
  @import (reference) '~antd/es/style/themes/index.less';
3
3
 
4
- .@{ant-prefix}-table-cell-fix-right {
5
- z-index: 999 !important;
6
- }
7
-
8
- .@{ant-prefix}-table-cell-fix-left {
9
- z-index: 999 !important;
10
- }
11
-
12
4
  .pro-tooltip {
13
5
  cursor: pointer;
14
6
 
@@ -360,6 +360,7 @@ var ProTree = function ProTree(props) {
360
360
  /** 点击了树节点开始loading,改变自身state并将值通过onchange上传到form */
361
361
  var onSelectTreeNode = /*#__PURE__*/function () {
362
362
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(props, info) {
363
+ var _options$;
363
364
  var values, options, option;
364
365
  return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
365
366
  while (1) switch (_context.prev = _context.next) {
@@ -393,7 +394,7 @@ var ProTree = function ProTree(props) {
393
394
  return values === item[fieldNameValue];
394
395
  });
395
396
  }
396
- option = options === null || options === void 0 ? void 0 : options[0];
397
+ option = (_options$ = options === null || options === void 0 ? void 0 : options[0]) !== null && _options$ !== void 0 ? _options$ : {};
397
398
  delete option[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'];
398
399
  if (!(other === null || other === void 0 ? void 0 : other.checkable)) {
399
400
  // 单选将选中节点值冒泡到form, 给onFieldChange添加options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.6.1",
3
+ "version": "3.6.2-beta.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",