+ {!this.state.list &&
}
+ {(this.state.list && this.state.list.length === 0) &&
}
+ {_list.map((item) => {
+ return
+ })}
+ {this.state.showMores
+ &&
}
+
+ }
+
+ componentDidMount = () => this.loadList()
+ loadList(plus) {
+ this.__pageNo = this.__pageNo || 1
+ if (plus) this.__pageNo += plus
+ const pageSize = 20
+ $.get(`${rb.baseUrl}/app/entity/related-list?masterId=${this.props.master}&related=${this.props.entity}&pageNo=${this.__pageNo}&pageSize=${pageSize}`, (res) => {
+ let _data = res.data.data || []
+ let _list = this.state.list || []
+ _list = _list.concat(_data)
+ this.setState({ list: _list, showMores: _data.length >= pageSize })
})
}
+
+ _handleView = (e) => {
+ e.preventDefault()
+ RbViewPage.clickView(e.currentTarget)
+ }
}
// 视图页操作类
@@ -296,90 +339,48 @@ const RbViewPage = {
},
// 相关项
+
+ // 列表
initVTabs(config) {
let that = this
- let rs = []
+ that.__vtabEntities = []
$(config).each(function () {
let entity = this[0]
- $('