fan-standard-comp 4.1.2 → 4.1.4

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 (79) hide show
  1. package/dist/fan-standard-comp.min.css +1 -1
  2. package/dist/fan-standard-comp.min.js +1 -1
  3. package/es/CompositeTable/index.d.ts +0 -0
  4. package/es/CompositeTable/index.js +211 -0
  5. package/es/CompositeTable/index.style.d.ts +5 -0
  6. package/es/CompositeTable/index.style.js +27 -0
  7. package/es/FormComp/FieldComponent/ExtensionField.d.ts +2 -2
  8. package/es/FormComp/FieldComponent/ExtensionField.js +1 -1
  9. package/es/FormComp/FieldComponent/index.js +2 -6
  10. package/es/StandardContent/ContentHeader.js +17 -25
  11. package/es/StandardContent/SubfieldContent.js +12 -9
  12. package/es/StandardContent/WrapperContent.js +9 -8
  13. package/es/StandardContent/styles/Subfield.js +18 -5
  14. package/es/StandardContent/styles/Wrapper.js +13 -2
  15. package/es/StandardContent/styles/index.less +8 -2
  16. package/es/StandardFilter/index.js +52 -28
  17. package/es/StandardFilter/style/FilterStyle.js +3 -2
  18. package/es/StandardFilter/style/index.less +7 -0
  19. package/es/StandardForm/index.js +3 -1
  20. package/es/StandardTable/index.d.ts +4 -28
  21. package/es/StandardTable/index.js +65 -5
  22. package/es/StandardTable/types.d.ts +33 -0
  23. package/es/StandardTable/types.js +1 -0
  24. package/es/StandardTablePro/index.d.ts +5 -7
  25. package/es/StandardTablePro/index.js +246 -84
  26. package/es/StandardTablePro/types.d.ts +29 -0
  27. package/es/StandardTablePro/types.js +1 -0
  28. package/es/StandardTablePro/useFetchData.d.ts +0 -0
  29. package/es/StandardTablePro/useFetchData.js +275 -0
  30. package/es/StandardTablePro/utils.d.ts +3 -0
  31. package/es/StandardTablePro/utils.js +49 -0
  32. package/es/index.d.ts +2 -0
  33. package/es/index.js +3 -0
  34. package/es/types.d.ts +1 -0
  35. package/es/types.js +1 -0
  36. package/es/utils/ValueFormat.d.ts +1 -1
  37. package/es/utils/ValueFormat.js +42 -27
  38. package/es/utils/getParentNodes.js +1 -1
  39. package/es/utils/urlUtils.d.ts +6 -0
  40. package/es/utils/urlUtils.js +26 -0
  41. package/lib/CompositeTable/index.d.ts +0 -0
  42. package/lib/CompositeTable/index.js +212 -0
  43. package/lib/CompositeTable/index.style.d.ts +5 -0
  44. package/lib/CompositeTable/index.style.js +33 -0
  45. package/lib/FormComp/FieldComponent/ExtensionField.d.ts +2 -2
  46. package/lib/FormComp/FieldComponent/ExtensionField.js +1 -1
  47. package/lib/FormComp/FieldComponent/index.js +2 -6
  48. package/lib/StandardContent/ContentHeader.js +16 -24
  49. package/lib/StandardContent/SubfieldContent.js +12 -9
  50. package/lib/StandardContent/WrapperContent.js +9 -8
  51. package/lib/StandardContent/styles/Subfield.js +18 -5
  52. package/lib/StandardContent/styles/Wrapper.js +13 -2
  53. package/lib/StandardContent/styles/index.less +8 -2
  54. package/lib/StandardFilter/index.js +52 -28
  55. package/lib/StandardFilter/style/FilterStyle.js +3 -2
  56. package/lib/StandardFilter/style/index.less +7 -0
  57. package/lib/StandardForm/index.js +3 -1
  58. package/lib/StandardTable/index.d.ts +4 -28
  59. package/lib/StandardTable/index.js +64 -4
  60. package/lib/StandardTable/types.d.ts +33 -0
  61. package/lib/StandardTable/types.js +5 -0
  62. package/lib/StandardTablePro/index.d.ts +5 -7
  63. package/lib/StandardTablePro/index.js +244 -82
  64. package/lib/StandardTablePro/types.d.ts +29 -0
  65. package/lib/StandardTablePro/types.js +5 -0
  66. package/lib/StandardTablePro/useFetchData.d.ts +0 -0
  67. package/lib/StandardTablePro/useFetchData.js +276 -0
  68. package/lib/StandardTablePro/utils.d.ts +3 -0
  69. package/lib/StandardTablePro/utils.js +55 -0
  70. package/lib/index.d.ts +2 -0
  71. package/lib/index.js +20 -0
  72. package/lib/types.d.ts +1 -0
  73. package/lib/types.js +16 -0
  74. package/lib/utils/ValueFormat.d.ts +1 -1
  75. package/lib/utils/ValueFormat.js +42 -29
  76. package/lib/utils/getParentNodes.js +1 -1
  77. package/lib/utils/urlUtils.d.ts +6 -0
  78. package/lib/utils/urlUtils.js +27 -3
  79. package/package.json +2 -2
@@ -0,0 +1,212 @@
1
+ /*
2
+ /!**
3
+ * 组合组件;配置"筛选StandardFilter"、"列表StandardTable"
4
+ * 不加业务相关的功能
5
+ * @param {Object} dataSource 数据源
6
+ * @value {Array} list 列表数据
7
+ * @value {Object} pagination 页码配置
8
+ * @param {Function} request 接口请求数据源
9
+ * @param {Object} params 请求参数:页码、筛选条件等
10
+ * @param {Object} defaultParams 默认参数,在筛选重置的情况下不会更改
11
+ * request:
12
+ * 1、列表接口数据
13
+ * *!/
14
+ import React, { ReactNode, forwardRef, useEffect, useState, useCallback, useImperativeHandle, useMemo } from 'react'
15
+ import { StandardFilter, StandardTable, ButtonGroup, } from "fan-standard-comp";
16
+ import { useStyles } from './index.style'
17
+ import { commonUse } from "@/data";
18
+ import { Spin } from 'antd';
19
+ import dayjs from "dayjs";
20
+
21
+ interface FilterFormProps {
22
+ formItemGroup: any[]
23
+ buttonGroup?: any[] | ReactNode
24
+ syncToUrl?: (values) => void // 从url上取值后进行转换
25
+ dateFormatter?: 'dayjs' | 'string' // 日期类的控件是否将其格式转换
26
+ }
27
+
28
+ interface CompositeTableProps {
29
+ dataSource?: any // 列表数据静态数据来源
30
+ request?: Function // 接口数据
31
+ params?: any // 请求参数/页码
32
+ defaultParams?: any // 默认的参数,在筛选重置的情况下不会更改
33
+ formItemGroup?: any[]
34
+ buttonGroup?: any[] | ReactNode
35
+ commonUse: any
36
+ children?: ReactNode
37
+ onChange?: (targetKey: string, data?: any) => void // 页码或表单触发更新
38
+ formatForm?: (fields: any) => void; // 转换筛选表单值
39
+ page?: number | string, // 页码
40
+ size?: number | string // 单页数量
41
+ getTableData?: Function // 获取表格数据
42
+ form?: FilterFormProps // 筛选表单
43
+ }
44
+
45
+
46
+ const CompositeTable = forwardRef((props: CompositeTableProps, ref) => {
47
+ const {
48
+ dataSource, buttonGroup = [], params = {}, defaultParams = {}, columns, children, request,
49
+ onChange,
50
+ getTableData,
51
+ form,
52
+ title
53
+ } = props;
54
+ const {
55
+ formItemGroup = [], syncToUrl,
56
+ } = form
57
+ const { styles, cx } = useStyles();
58
+ const [resDataSource, setResDataSource] = useState({
59
+ list: [],
60
+ pagination: {},
61
+ keywords: {}
62
+ })
63
+ const [formKeywords, setFormKeywords] = useState({})
64
+ const [queryLoading, setQueryLoading] = useState(false)
65
+ const [searchLoading, setSearchLoading] = useState(false)
66
+ const [filterForm, setFilterForm] = useState({
67
+ values: {},
68
+ form: undefined,
69
+ })
70
+ const paramsKey = useMemo(() => {
71
+ return params
72
+ }, [params])
73
+
74
+ const localPagination = {page:1, size: 10} // 基础页码
75
+
76
+ // ref 的转发
77
+ useImperativeHandle(ref, () => {
78
+ return {
79
+ ...filterForm,
80
+ dataSource: resDataSource,
81
+ setDataSource: setResDataSource,
82
+ reload: (filter) => loadData('refresh', {}, filter) // 更新列表
83
+ }
84
+ });
85
+ /!**
86
+ * 加载数据方法
87
+ * @param {string} updateKey 触发列表位置
88
+ * @param {Object} pagination 分页选项器
89
+ * @param {Object} filters 过滤条件
90
+ * @param {Object} sorter 排序条件
91
+ *!/
92
+ const loadData: any = useCallback(async (updateKey: string, pagination?: any = {}, filters?: any = {}, sorter?: any = {},
93
+ ) => {
94
+ if (updateKey !== 'init') {
95
+ handleChange(updateKey, updateKey === 'reset' ? {} : { ...pagination, ...filters, ...sorter })
96
+ }
97
+ if (request) {
98
+ setQueryLoading(true)
99
+ let parameter = Object.assign(
100
+ { ...defaultParams },
101
+ // updateKey === 'init' ? { ...params } : {}, // 重置条件下,会清空params
102
+ syncToUrl ? syncToUrl(params) : { ...params },
103
+ {
104
+ page: pagination?.page || params?.page || localPagination.page,
105
+ size: pagination?.size || params?.size || localPagination.size
106
+ },
107
+ {
108
+ ...filters
109
+ },
110
+ // 排序与筛选待定
111
+ // (sorter && sorter.field && {
112
+ // sortField: sorter.field
113
+ // }) || {},
114
+ // (sorter && sorter.order && {
115
+ // sortOrder: sorter.order
116
+ // }) || {},
117
+ )
118
+ const response = await request(parameter)
119
+ setQueryLoading(false)
120
+ setSearchLoading(false)
121
+ // 转换列表数据
122
+ if (response.code === '200') {
123
+ setResDataSource(Object.assign({
124
+ list: response?.data?.records,
125
+ total: response?.data?.total || 0,
126
+ pagination: {
127
+ total: response?.data?.total || 0,
128
+ current: response?.data?.current || commonUse.basePagination.page,
129
+ pageSize: response?.data?.pageSize || commonUse.basePagination.size,
130
+ },
131
+ keywords: parameter || {}, // 关键字搜索字段
132
+ }),)
133
+ } else {
134
+ setResDataSource({
135
+ list: [],
136
+ pagination: {},
137
+ keywords: {}
138
+ })
139
+ }
140
+ } else if (dataSource) {
141
+ setResDataSource(dataSource)
142
+ }
143
+ }, [params, formItemGroup, dataSource, request])
144
+ // console.log('resDataSource', resDataSource.keywords)
145
+ useEffect(() => {
146
+ getTableData && getTableData(resDataSource)
147
+ }, [resDataSource])
148
+ const fetchData = () => {
149
+
150
+ }
151
+ const handleChange = (targetKey: string, data?: any) => {
152
+ onChange && onChange(targetKey, data)
153
+ }
154
+ useEffect(() => {
155
+ setFormKeywords(syncToUrl ? syncToUrl({ ...params }) : { ...params })
156
+ }, [params, syncToUrl])
157
+ useEffect(() => {
158
+ loadData('init')
159
+ }, [])
160
+ return <div className={cx('f-composite-container', styles.CompositeContainerStyle)}>
161
+ <StandardFilter {...form}
162
+ formItemGroup={formItemGroup}
163
+ gridLayout={'horizontal'} // 表单组与按钮组的排版
164
+ formLayout={'horizontal'} // 表单控件组的排版
165
+ min={100}
166
+ itemGroupConfig={{
167
+ columnCount: 4
168
+ }}
169
+ getFormFields={(fields, form) => {
170
+ setFilterForm({ values: fields, form: form?.current })
171
+ }}
172
+ initialValues={formKeywords}
173
+ onFilterSearch={(fields) => {
174
+ setSearchLoading(true)
175
+ formItemGroup.forEach(fItem => {
176
+ if (fItem.searchTransform && fields[fItem.filedName]) {
177
+ // 筛选参数转换
178
+ let trans = fItem.searchTransform(fields[fItem.filedName])
179
+ delete fields[fItem.filedName] // 提交时,删除有格式转换的字段名
180
+ fields = { ...fields, ...trans }
181
+ }
182
+ })
183
+ loadData('search', { ...commonUse.basePagination }, fields)
184
+ }}
185
+ onFilterReset={() => {
186
+ loadData('reset', {page: 1,}, {})
187
+ }}
188
+ className={cx('f-composite-filter', styles.CompositeFilterStyle)}
189
+ confirmButtonProps={{
190
+ loading: searchLoading
191
+ }}
192
+ // dateFormatter={'string'}
193
+ />
194
+ <StandardTable data={resDataSource} columns={columns}
195
+ title={title}
196
+ buttonGroup={buttonGroup}
197
+ className={cx('f-composite-table', styles.CompositeTableStyle)}
198
+ onChange={(pagination, filters, sorter,) => {
199
+ // console.log(' pagination, filters, sorter', pagination, filters, sorter)
200
+ loadData('table', {
201
+ page: pagination.current,
202
+ size: pagination.pageSize
203
+ }, filters, sorter)
204
+ }}
205
+ />
206
+ {children}
207
+ </div>
208
+ })
209
+
210
+ export default CompositeTable
211
+ */
212
+ "use strict";
@@ -0,0 +1,5 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ CompositeContainerStyle: import("antd-style").SerializedStyles;
3
+ CompositeFilterStyle: import("antd-style").SerializedStyles;
4
+ CompositeTableStyle: import("antd-style").SerializedStyles;
5
+ }>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useStyles = void 0;
7
+ var _antdStyle = require("antd-style");
8
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
9
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
10
+ var useStyles = exports.useStyles = (0, _antdStyle.createStyles)(function (_ref) {
11
+ var token = _ref.token,
12
+ css = _ref.css,
13
+ cx = _ref.cx;
14
+ var commonCard = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", "px;\n padding: ", "px;\n "])), token.borderRadiusLG, token.paddingLG);
15
+ return {
16
+ CompositeContainerStyle: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow-x: hidden;\n "]))),
17
+ CompositeFilterStyle: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .filter-form {\n padding: ", "px;\n padding-bottom: 0;\n background-color: ", ";\n //margin-bottom: ", "px;\n //border-radius: ", "px;\n }\n\n .filter-btns {\n padding: ", "px;\n padding-bottom: 0;\n // border-top-left-radius: ", "px;\n // border-top-right-radius: ", "px;\n background-color: ", ";\n }\n "])), token.paddingMD, token.colorBgBase, token.marginMD, token.borderRadiusLG, token.paddingMD, token.borderRadiusLG, token.borderRadiusLG, token.colorBgBase),
18
+ // CompositeButtonGroupStyle: css`
19
+ // padding: ${token.paddingMD}px;
20
+ // background-color: ${token.colorBgBase};
21
+ // border-top-left-radius: ${token.borderRadiusLG}px;
22
+ // border-top-right-radius: ${token.borderRadiusLG}px;
23
+ // display: flex;
24
+ // .f-composite-button-group-grid {
25
+ // flex: 1;
26
+ // &.align-right{
27
+ // text-align: right;
28
+ // }
29
+ // }
30
+ // `,
31
+ CompositeTableStyle: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n &.f-composite-table {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n // padding: ", "px;\n // padding-top: 0;\n .spec-pagination {\n background-color: ", ";\n //justify-content: flex-start;\n }\n }\n "])), token.paddingMD, token.colorBgBase)
32
+ };
33
+ });
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const ExtensionField: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
3
- export default ExtensionField;
2
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>>;
3
+ export default _default;
@@ -24,4 +24,4 @@ var ExtensionField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
24
24
  var MatchTypeComponent = (MatchType === null || MatchType === void 0 ? void 0 : MatchType.component) || null;
25
25
  return typeof MatchTypeComponent === 'function' ? /*#__PURE__*/_react.default.createElement(MatchTypeComponent, fieldProps) : MatchTypeComponent;
26
26
  });
27
- var _default = exports.default = ExtensionField;
27
+ var _default = exports.default = /*#__PURE__*/_react.default.memo(ExtensionField);
@@ -148,9 +148,7 @@ var FieldComponent = /*#__PURE__*/_react.default.forwardRef(function (props, ref
148
148
  compContent = viewOnly ? value || 0 : /*#__PURE__*/_react.default.createElement(_antd.InputNumber, _extends({
149
149
  placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入数字'
150
150
  }, sortLimitRule, defaultProps, {
151
- style: _objectSpread(_objectSpread({}, defaultStyle), {}, {
152
- width: '120px'
153
- }, defaultProps.style)
151
+ style: _objectSpread(_objectSpread({}, defaultStyle), defaultProps.style) // 去掉width: '120px',
154
152
  }));
155
153
  break;
156
154
  case 'select':
@@ -289,9 +287,7 @@ var FieldComponent = /*#__PURE__*/_react.default.forwardRef(function (props, ref
289
287
  type: type,
290
288
  protoConfig: protoConfig
291
289
  }) : /*#__PURE__*/_react.default.createElement(_antd.TimePicker, _extends({}, defaultProps, {
292
- style: _objectSpread(_objectSpread(_objectSpread({}, defaultStyle), defaultProps.style), {}, {
293
- width: 'auto'
294
- })
290
+ style: _objectSpread(_objectSpread({}, defaultStyle), defaultProps.style) // 去掉 width: 'auto'
295
291
  }));
296
292
  break;
297
293
  case 'timePickerRange':
@@ -24,42 +24,29 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
24
24
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
25
25
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
26
26
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
27
- var Child = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
28
- var _useState = (0, _react.useState)(0),
29
- _useState2 = _slicedToArray(_useState, 2),
30
- count = _useState2[0],
31
- setCount = _useState2[1];
32
- (0, _react.useImperativeHandle)(ref, function () {
33
- return {
34
- getCurrentCount: function getCurrentCount() {
35
- return count;
36
- }
37
- };
38
- }, [count]);
39
- return /*#__PURE__*/_react.default.createElement("div", null, "Count: ", count);
40
- });
41
27
  var ContentHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
42
- var _breadcrumb$items;
28
+ var _breadcrumb$items, _tabs$items;
43
29
  var breadcrumb = props.breadcrumb,
44
30
  className = props.className,
45
31
  title = props.title,
46
32
  getClientHeight = props.getClientHeight,
47
33
  extra = props.extra,
48
34
  prefix = props.prefix,
49
- goBack = props.goBack;
35
+ goBack = props.goBack,
36
+ tabs = props.tabs;
50
37
  var componentName = 'spec-content-header';
51
38
  var _useStyle = (0, _Header.default)(componentName),
52
39
  _useStyle2 = _slicedToArray(_useStyle, 2),
53
40
  wrapSSR = _useStyle2[0],
54
41
  hashId = _useStyle2[1];
55
- var _useState3 = (0, _react.useState)(false),
42
+ var _useState = (0, _react.useState)(false),
43
+ _useState2 = _slicedToArray(_useState, 2),
44
+ visible = _useState2[0],
45
+ setVisible = _useState2[1];
46
+ var _useState3 = (0, _react.useState)(0),
56
47
  _useState4 = _slicedToArray(_useState3, 2),
57
- visible = _useState4[0],
58
- setVisible = _useState4[1];
59
- var _useState5 = (0, _react.useState)(0),
60
- _useState6 = _slicedToArray(_useState5, 2),
61
- clientHeight = _useState6[0],
62
- setClientHeight = _useState6[1];
48
+ clientHeight = _useState4[0],
49
+ setClientHeight = _useState4[1];
63
50
  var headerRef = (0, _react.useRef)(null);
64
51
  var handleGoBack = function handleGoBack() {
65
52
  if (goBack) {
@@ -127,6 +114,11 @@ var ContentHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
127
114
  className: componentName + '-title-name'
128
115
  }, " ", title), extra && /*#__PURE__*/_react.default.createElement("div", {
129
116
  className: componentName + '-title-extra'
130
- }, " ", extra)) : null));
117
+ }, " ", extra)) : null, (tabs === null || tabs === void 0 || (_tabs$items = tabs.items) === null || _tabs$items === void 0 ? void 0 : _tabs$items.length) && /*#__PURE__*/_react.default.createElement("div", {
118
+ className: componentName + '-tabs'
119
+ }, /*#__PURE__*/_react.default.createElement(_antd.Tabs, {
120
+ type: "card",
121
+ items: (tabs === null || tabs === void 0 ? void 0 : tabs.items) || []
122
+ }))));
131
123
  });
132
124
  var _default = exports.default = ContentHeader;
@@ -75,15 +75,14 @@ var SubfieldContent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
75
75
  style: style,
76
76
  ref: contentRef
77
77
  }, proLayoutProps !== null && proLayoutProps !== void 0 && proLayoutProps.header || header ? /*#__PURE__*/_react.default.createElement(_ContentHeader.default, _extends({
78
- ref: headerRef,
79
- getClientHeight: setHeaderHeight,
78
+ ref: headerRef
79
+ // getClientHeight={setHeaderHeight}
80
+ ,
80
81
  className: (0, _classnames.default)('spec-grid-content-header', proLayoutProps !== null && proLayoutProps !== void 0 && (_proLayoutProps$heade = proLayoutProps.header) !== null && _proLayoutProps$heade !== void 0 && _proLayoutProps$heade.fixed || header !== null && header !== void 0 && header.fixed ? 'spec-grid-content-header-fixed' : '')
81
82
  }, (proLayoutProps === null || proLayoutProps === void 0 ? void 0 : proLayoutProps.header) || {}, header || {})) : null, /*#__PURE__*/_react.default.createElement("div", {
82
- className: 'spec-grid-content-body',
83
- style: {
84
- height: "calc(100% - ".concat(headerHeight ? headerHeight + 20 : 0, "px")
85
- }
86
- }, /*#__PURE__*/_react.default.createElement(_DragContent.default, {
83
+ className: 'spec-grid-content-body'
84
+ // style={{ height: `calc(100% - ${headerHeight ? headerHeight + 20 : 0}px` }}
85
+ }, leftSiderNode && /*#__PURE__*/_react.default.createElement(_DragContent.default, {
87
86
  direction: leftSiderDragDirection,
88
87
  className: (0, _classnames.default)('spec-grid-left', leftSiderClassName),
89
88
  style: {
@@ -91,8 +90,12 @@ var SubfieldContent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
91
90
  },
92
91
  moveMaxWidth: leftSiderMoveMaxWidth,
93
92
  moveMaxHeight: leftSiderMoveMaxHeight
94
- }, leftSiderNode), /*#__PURE__*/_react.default.createElement("div", {
93
+ }, /*#__PURE__*/_react.default.createElement("div", {
94
+ className: 'spec-grid-left-cont'
95
+ }, leftSiderNode)), /*#__PURE__*/_react.default.createElement("div", {
95
96
  className: "spec-grid-right"
96
- }, children))));
97
+ }, /*#__PURE__*/_react.default.createElement("div", {
98
+ className: "spec-grid-right-cont"
99
+ }, children)))));
97
100
  });
98
101
  var _default = exports.default = SubfieldContent;
@@ -27,7 +27,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
27
27
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
28
28
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
29
29
  var WrapperContent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
30
- var _proLayoutProps$heade, _proLayoutProps$heade2;
30
+ var _proLayoutProps$heade, _proLayoutProps$heade2, _proLayoutProps$heade3;
31
31
  var InitFanContext = (0, _react.useContext)(_ConfigContext.FanContext);
32
32
  var providerConfig = InitFanContext['SubfieldContent'] || {}; // 使用上下文(全局配置)设置扩展的配置项
33
33
  var proLayoutProps = InitFanContext['proLayoutProps'] || {};
@@ -65,21 +65,22 @@ var WrapperContent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
65
65
  }
66
66
  });
67
67
  return wrapSSR( /*#__PURE__*/_react.default.createElement("div", {
68
- className: (0, _classnames.default)(componentName, className, noMargin ? 'has-margin' : '', hashId),
68
+ className: (0, _classnames.default)(componentName, className, noMargin ? 'has-margin' : '', proLayoutProps !== null && proLayoutProps !== void 0 && (_proLayoutProps$heade = proLayoutProps.header) !== null && _proLayoutProps$heade !== void 0 && _proLayoutProps$heade.fixed || header !== null && header !== void 0 && header.fixed ? componentName + '-fixed' : '', hashId),
69
69
  style: style,
70
70
  ref: contentRef
71
- }, proLayoutProps !== null && proLayoutProps !== void 0 && proLayoutProps.header || header ? /*#__PURE__*/_react.default.createElement(_ContentHeader.default, _extends({
72
- getClientHeight: setHeaderHeight,
73
- className: (0, _classnames.default)('spec-wrapper-content-header', proLayoutProps !== null && proLayoutProps !== void 0 && (_proLayoutProps$heade = proLayoutProps.header) !== null && _proLayoutProps$heade !== void 0 && _proLayoutProps$heade.fixed || header !== null && header !== void 0 && header.fixed ? 'spec-wrapper-content-header-fixed' : '')
71
+ }, proLayoutProps !== null && proLayoutProps !== void 0 && proLayoutProps.header || header ? /*#__PURE__*/_react.default.createElement(_ContentHeader.default
72
+ // getClientHeight={setHeaderHeight}
73
+ , _extends({
74
+ className: (0, _classnames.default)('spec-wrapper-content-header', proLayoutProps !== null && proLayoutProps !== void 0 && (_proLayoutProps$heade2 = proLayoutProps.header) !== null && _proLayoutProps$heade2 !== void 0 && _proLayoutProps$heade2.fixed || header !== null && header !== void 0 && header.fixed ? 'spec-wrapper-content-header-fixed' : '')
74
75
  }, (proLayoutProps === null || proLayoutProps === void 0 ? void 0 : proLayoutProps.header) || {}, header || {})) : null, light ? /*#__PURE__*/_react.default.createElement("div", {
75
76
  className: "spec-wrapper-content-block light-block"
76
77
  }, /*#__PURE__*/_react.default.createElement("div", {
77
78
  className: 'spec-wrapper-content-body'
78
79
  }, children)) : /*#__PURE__*/_react.default.createElement("div", {
79
80
  className: 'spec-wrapper-content-body',
80
- style: proLayoutProps !== null && proLayoutProps !== void 0 && (_proLayoutProps$heade2 = proLayoutProps.header) !== null && _proLayoutProps$heade2 !== void 0 && _proLayoutProps$heade2.fixed || header !== null && header !== void 0 && header.fixed ? {
81
- height: "calc(100% - ".concat(headerHeight ? headerHeight + 20 : 0, "px)"),
82
- overflow: 'auto'
81
+ style: proLayoutProps !== null && proLayoutProps !== void 0 && (_proLayoutProps$heade3 = proLayoutProps.header) !== null && _proLayoutProps$heade3 !== void 0 && _proLayoutProps$heade3.fixed || header !== null && header !== void 0 && header.fixed ? {
82
+ // height: `calc(100% - ${headerHeight ? headerHeight + 20 : 0}px)`,
83
+ // overflow: 'auto'
83
84
  } : {}
84
85
  }, children)));
85
86
  });
@@ -21,11 +21,18 @@ var SubfieldContentStyleFunc = function SubfieldContentStyleFunc(prefix) {
21
21
  return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
22
22
  var prefixCls = ".".concat(prefix);
23
23
  // console.log(' new TinyColor(token.colorPrimary).setAlpha(0.1)' ,new TinyColor(token.colorPrimary).setAlpha(0.1).toRgbString(), )
24
- return [_defineProperty({}, prefixCls, _objectSpread(_objectSpread({}, (0, _index.scrollBar)(token)), {}, {
24
+ return [_defineProperty({}, prefixCls, _objectSpread(_objectSpread({
25
+ // height: '500px',
26
+ background: 'pink',
27
+ display: 'flex',
28
+ flexDirection: 'column'
29
+ }, (0, _index.scrollBar)(token)), {}, {
25
30
  '.spec-grid-content-header + .spec-grid-content-body': {
26
31
  // height: `calc(100% - 60px)`
27
32
  },
28
33
  '.spec-grid-content-body': {
34
+ flex: 1,
35
+ overflow: 'hidden',
29
36
  display: 'flex',
30
37
  position: 'relative',
31
38
  height: '100%'
@@ -35,17 +42,23 @@ var SubfieldContentStyleFunc = function SubfieldContentStyleFunc(prefix) {
35
42
  height: '100%',
36
43
  overflow: 'auto'
37
44
  }, (0, _index.scrollBar)(token)),
38
- '& .spec-grid-left': _objectSpread({
45
+ '& .spec-grid-left': _objectSpread(_objectSpread({
39
46
  height: '100%',
40
47
  // overflow: 'hidden',
41
48
  overflow: 'auto',
42
49
  padding: token.paddingMD,
43
50
  background: token.colorBgBase,
44
51
  boxSizing: 'border-box'
45
- }, (0, _index.scrollBar)(token)),
52
+ }, (0, _index.scrollBar)(token)), {}, {
53
+ '+ .spec-grid-right': {
54
+ marginLeft: token.marginMD
55
+ },
56
+ '.spec-grid-left-cont': {
57
+ marginRight: '-8px'
58
+ }
59
+ }),
46
60
  '& .spec-grid-right': _objectSpread({
47
- padding: 0,
48
- marginLeft: token.marginMD
61
+ padding: 0
49
62
  }, (0, _index.scrollBar)(token))
50
63
  }))];
51
64
  }, prepareComponentToken // 当前组件扩展的变量
@@ -20,7 +20,7 @@ var WrapperContentStyleFunc = function WrapperContentStyleFunc(prefix) {
20
20
  };
21
21
  return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
22
22
  var prefixCls = ".".concat(prefix);
23
- return [_defineProperty(_defineProperty(_defineProperty({}, prefixCls, _objectSpread(_objectSpread({
23
+ return [_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, prefixCls, _objectSpread(_objectSpread({
24
24
  position: 'relative',
25
25
  // padding: token.paddingMD,
26
26
  // margin: -token.marginMD,
@@ -32,7 +32,18 @@ var WrapperContentStyleFunc = function WrapperContentStyleFunc(prefix) {
32
32
  padding: token.paddingMD,
33
33
  background: token.colorBgBase
34
34
  }
35
- })), '.spec-wrapper-content-header', {}), '.spec-wrapper-content-body', {})];
35
+ })), '&.spec-wrapper-content-fixed', {
36
+ display: 'flex',
37
+ flexDirection: 'column',
38
+ '.spec-wrapper-content-header': {
39
+ width: '100%'
40
+ },
41
+ '.spec-wrapper-content-body': {
42
+ width: '100%',
43
+ flex: 1,
44
+ overflow: 'auto'
45
+ }
46
+ }), '.spec-wrapper-content-header', {}), '.spec-wrapper-content-body', {})];
36
47
  }, prepareComponentToken // 当前组件扩展的变量
37
48
  );
38
49
  };
@@ -59,10 +59,16 @@
59
59
  .spec-grid-right {
60
60
  flex: 1;
61
61
  height: 100%;
62
+ overflow: auto;
62
63
  //height: calc(100vh - @layout-header-height);
63
64
  //padding: @padding-lg;
64
- overflow-y: auto;
65
- overflow-x: hidden;
65
+ //overflow-y: auto;
66
+ //overflow-x: auto;
66
67
  //margin-left: 200px
67
68
  }
69
+
70
+ .spec-grid-right-cont {
71
+ width: 100%;
72
+ overflow: auto;
73
+ }
68
74
  }