Skip to content

Commit 0ab64d7

Browse files
committed
__LAB40_PROTABLE_EXTCONFIG
1 parent b1bc7ed commit 0ab64d7

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/main/resources/web/assets/js/general/rb-forms.js

-3
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,6 @@ class RbForm extends React.Component {
453453
$$$main={this}
454454
transDetails={transDetails39 ? transDetails39[detailMeta.entity] : null}
455455
transDetailsDelete={transDetails39 ? transDetails39[detailMeta.entity + '$DELETED'] : null}
456-
showCheckbox
457-
showCounts
458-
treeConfig={{}}
459456
/>
460457
)
461458
} else {

src/main/resources/web/assets/js/general/rb-forms.protable.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const _PT_COLUMN_MAX_WIDTH = 500
1414
const _PT_COLUMN_DEF_WIDTH = 200
1515
const _PT_COLUMN_WIDTH_PLUS = ['REFERENCE', 'N2NREFERENCE', 'CLASSIFICATION']
1616

17+
const _EXTCONFIG = window.__LAB40_PROTABLE_EXTCONFIG || {}
18+
1719
class ProTable extends React.Component {
1820
constructor(props) {
1921
super(props)
@@ -34,14 +36,15 @@ class ProTable extends React.Component {
3436
const formFields = this.state.formFields
3537
const details = this.state.details || [] // 编辑时有
3638
const fixedWidth = formFields.length <= 5
39+
const extConf40 = _EXTCONFIG[this.props.entity.entity] || {}
3740

3841
return (
3942
<div className={`protable rb-scroller ${!fixedWidth && 'column-fixed-pin'}`} ref={(c) => (this._$scroller = c)}>
4043
<table className={`table table-sm ${fixedWidth && 'table-fixed'}`}>
4144
<thead>
4245
<tr>
4346
<th className="col-index" />
44-
{props.showCheckbox && (
47+
{extConf40.showCheckbox && (
4548
<th className="col-checkbox">
4649
<label className="custom-control custom-control-sm custom-checkbox custom-control-inline">
4750
<input
@@ -55,7 +58,7 @@ class ProTable extends React.Component {
5558
</label>
5659
</th>
5760
)}
58-
{props.treeConfig && <th className="col-tree"></th>}
61+
{extConf40.showTreeConfig && <th className="col-tree" />}
5962
{formFields.map((item) => {
6063
if (item.field === TYPE_DIVIDER || item.field === TYPE_REFFORM) return null
6164

@@ -98,15 +101,15 @@ class ProTable extends React.Component {
98101
</a>
99102
)}
100103
</th>
101-
{props.showCheckbox && (
104+
{extConf40.showCheckbox && (
102105
<td className="col-checkbox">
103106
<label className="custom-control custom-control-sm custom-checkbox custom-control-inline">
104107
<input className="custom-control-input" type="checkbox" />
105108
<i className="custom-control-label" />
106109
</label>
107110
</td>
108111
)}
109-
{props.treeConfig && (
112+
{extConf40.treeConfig && (
110113
<td className="col-tree">
111114
<a className={`col-tree-level-${idx}`}>
112115
<i className="zmdi zmdi-chevron-right " />
@@ -128,12 +131,12 @@ class ProTable extends React.Component {
128131
)
129132
})}
130133
</tbody>
131-
{props.showCounts && (
134+
{extConf40.showCounts && (
132135
<tfoot>
133136
<tr>
134137
<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" />}
137140
{formFields.map((item) => {
138141
if (item.field === TYPE_DIVIDER || item.field === TYPE_REFFORM) return null
139142

@@ -203,7 +206,8 @@ class ProTable extends React.Component {
203206
// prevProps, prevState, snapshot
204207
componentDidUpdate = () => this._componentDidUpdate()
205208
_componentDidUpdate() {
206-
if (!this.props.showCounts || this._countsStateUpdate) return
209+
const extConf40 = _EXTCONFIG[this.props.entity.entity] || {}
210+
if (!extConf40.showCounts || this._countsStateUpdate) return
207211

208212
// 计算合计
209213
if (this._countsTimer) clearTimeout(this._countsTimer)

0 commit comments

Comments
 (0)