@cqsjjb/jjb-react-admin-component 3.0.3 → 3.0.5

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.
@@ -37,10 +37,25 @@ class searchForm extends React.Component {
37
37
  }, this.state.isOpen ? '收起' : '展开'));
38
38
  }
39
39
  groupsList() {
40
+ const arr = [];
41
+ this.props.formLine.forEach(i => {
42
+ arr.push({
43
+ show: true,
44
+ node: i
45
+ });
46
+ });
40
47
  if (this.props.expand && this.state.isOpen) {
41
- return this.props.formLine;
48
+ return arr;
42
49
  }
43
- return this.props.formLine.slice(0, this.props.colSize);
50
+ if (!this.props.expand && arr.length > 3) {
51
+ return arr;
52
+ }
53
+ arr.forEach((i, index) => {
54
+ if (index > 2) {
55
+ i.show = false;
56
+ }
57
+ });
58
+ return arr;
44
59
  }
45
60
  componentDidMount() {
46
61
  if (this.props.onRef) {
@@ -63,9 +78,12 @@ class searchForm extends React.Component {
63
78
  }, /*#__PURE__*/React.createElement(Row, {
64
79
  gutter: [16, 16]
65
80
  }, formItemList.map((item, index) => /*#__PURE__*/React.createElement(Col, {
81
+ style: {
82
+ display: item.show ? 'block' : 'none'
83
+ },
66
84
  key: index,
67
85
  span: 24 / colSize
68
- }, item)), /*#__PURE__*/React.createElement(Col, {
86
+ }, item.node)), /*#__PURE__*/React.createElement(Col, {
69
87
  span: 24 / colSize
70
88
  }, /*#__PURE__*/React.createElement(Form.Item, {
71
89
  noStyle: true
@@ -58,10 +58,25 @@ class searchForm extends React.Component {
58
58
  }
59
59
 
60
60
  groupsList () {
61
+ const arr = []
62
+ this.props.formLine.forEach(i=>{
63
+ arr.push({
64
+ show: true,
65
+ node: i
66
+ })
67
+ })
61
68
  if (this.props.expand && this.state.isOpen) {
62
- return this.props.formLine;
69
+ return arr;
63
70
  }
64
- return this.props.formLine.slice(0, this.props.colSize);
71
+ if(!this.props.expand && arr.length>3){
72
+ return arr;
73
+ }
74
+ arr.forEach((i,index)=> {
75
+ if(index>2){
76
+ i.show=false
77
+ }
78
+ })
79
+ return arr;
65
80
  }
66
81
 
67
82
  componentDidMount () {
@@ -88,10 +103,11 @@ class searchForm extends React.Component {
88
103
  <Row gutter={[ 16, 16 ]}>
89
104
  {formItemList.map((item, index) => (
90
105
  <Col
106
+ style={{display:item.show?'block':'none'}}
91
107
  key={index}
92
108
  span={24 / colSize}
93
109
  >
94
- {item}
110
+ {item.node}
95
111
  </Col>
96
112
  ))}
97
113
  <Col span={24 / colSize}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqsjjb/jjb-react-admin-component",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "jjb-react-admin-组件库@new",
5
5
  "main": "index.js",
6
6
  "author": "jjb-front-team",