@@ -14,6 +14,8 @@ const _PT_COLUMN_MAX_WIDTH = 500
14
14
const _PT_COLUMN_DEF_WIDTH = 200
15
15
const _PT_COLUMN_WIDTH_PLUS = [ 'REFERENCE' , 'N2NREFERENCE' , 'CLASSIFICATION' ]
16
16
17
+ const _EXTCONFIG = window . __LAB40_PROTABLE_EXTCONFIG || { }
18
+
17
19
class ProTable extends React . Component {
18
20
constructor ( props ) {
19
21
super ( props )
@@ -34,14 +36,15 @@ class ProTable extends React.Component {
34
36
const formFields = this . state . formFields
35
37
const details = this . state . details || [ ] // 编辑时有
36
38
const fixedWidth = formFields . length <= 5
39
+ const extConf40 = _EXTCONFIG [ this . props . entity . entity ] || { }
37
40
38
41
return (
39
42
< div className = { `protable rb-scroller ${ ! fixedWidth && 'column-fixed-pin' } ` } ref = { ( c ) => ( this . _$scroller = c ) } >
40
43
< table className = { `table table-sm ${ fixedWidth && 'table-fixed' } ` } >
41
44
< thead >
42
45
< tr >
43
46
< th className = "col-index" />
44
- { props . showCheckbox && (
47
+ { extConf40 . showCheckbox && (
45
48
< th className = "col-checkbox" >
46
49
< label className = "custom-control custom-control-sm custom-checkbox custom-control-inline" >
47
50
< input
@@ -55,7 +58,7 @@ class ProTable extends React.Component {
55
58
</ label >
56
59
</ th >
57
60
) }
58
- { props . treeConfig && < th className = "col-tree" > </ th > }
61
+ { extConf40 . showTreeConfig && < th className = "col-tree" / >}
59
62
{ formFields . map ( ( item ) => {
60
63
if ( item . field === TYPE_DIVIDER || item . field === TYPE_REFFORM ) return null
61
64
@@ -98,15 +101,15 @@ class ProTable extends React.Component {
98
101
</ a >
99
102
) }
100
103
</ th >
101
- { props . showCheckbox && (
104
+ { extConf40 . showCheckbox && (
102
105
< td className = "col-checkbox" >
103
106
< label className = "custom-control custom-control-sm custom-checkbox custom-control-inline" >
104
107
< input className = "custom-control-input" type = "checkbox" />
105
108
< i className = "custom-control-label" />
106
109
</ label >
107
110
</ td >
108
111
) }
109
- { props . treeConfig && (
112
+ { extConf40 . treeConfig && (
110
113
< td className = "col-tree" >
111
114
< a className = { `col-tree-level-${ idx } ` } >
112
115
< i className = "zmdi zmdi-chevron-right " />
@@ -128,12 +131,12 @@ class ProTable extends React.Component {
128
131
)
129
132
} ) }
130
133
</ tbody >
131
- { props . showCounts && (
134
+ { extConf40 . showCounts && (
132
135
< tfoot >
133
136
< tr >
134
137
< th className = "col-idx" />
135
- { props . showCheckbox && < th className = "col-checkbox" /> }
136
- { props . treeConfig && < th className = "col-tree" /> }
138
+ { extConf40 . showCheckbox && < th className = "col-checkbox" /> }
139
+ { extConf40 . showTreeConfig && < th className = "col-tree" /> }
137
140
{ formFields . map ( ( item ) => {
138
141
if ( item . field === TYPE_DIVIDER || item . field === TYPE_REFFORM ) return null
139
142
@@ -203,7 +206,8 @@ class ProTable extends React.Component {
203
206
// prevProps, prevState, snapshot
204
207
componentDidUpdate = ( ) => this . _componentDidUpdate ( )
205
208
_componentDidUpdate ( ) {
206
- if ( ! this . props . showCounts || this . _countsStateUpdate ) return
209
+ const extConf40 = _EXTCONFIG [ this . props . entity . entity ] || { }
210
+ if ( ! extConf40 . showCounts || this . _countsStateUpdate ) return
207
211
208
212
// 计算合计
209
213
if ( this . _countsTimer ) clearTimeout ( this . _countsTimer )
0 commit comments