From a859b8d276dcdc0a9a806498f4a6af845858e3a9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 24 十二月 2019 15:32:11 +0800 Subject: [PATCH] 2019-12-24 --- src/tabviews/subtable/index.jsx | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index ad1d646..d4cffb1 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -15,7 +15,8 @@ export default class NormalTable extends Component { static propTpyes = { - BID: PropTypes.string, // 涓婄骇鏁版嵁ID + Tab: PropTypes.object, // 鏍囩淇℃伅 + BIDs: PropTypes.string, // 涓婄骇鏁版嵁ID MenuID: PropTypes.string, // 鑿滃崟Id SupMenuID: PropTypes.string // 涓婄骇鑿滃崟Id } @@ -31,7 +32,7 @@ columns: null, arr_field: '', setting: null, - data: null, + data: [], total: 0, loading: false, pageIndex: 1, @@ -40,6 +41,12 @@ orderType: 'asc', search: '', configMap: {} + } + + UNSAFE_componentWillReceiveProps(nextProps) { + if (this.props.Tab.supMenu && !is(fromJS(this.props.BIDs[this.props.Tab.supMenu]), fromJS(nextProps.BIDs[this.props.Tab.supMenu]))) { + this.loadmaindata() + } } /** @@ -63,15 +70,9 @@ // 椤甸潰閰嶇疆瑙f瀽閿欒鏃舵彁绀� if (!config) { - // notification.warning({ - // top: 92, - // message: this.state.dict['main.page.settingerror'], - // duration: 10 - // }) this.setState({ loadingview: false, viewlost: true - // lostmsg: this.state.dict['main.page.settingerror'] }) return } @@ -303,7 +304,8 @@ let param = { func: 'sPC_Get_TableData', obj_name: 'data', - arr_field: arr_field + arr_field: arr_field, + BID: this.props.BIDs[this.props.Tab.supMenu] || '' } let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order @@ -488,7 +490,7 @@ <SubAction ref="subButton" MenuID={this.props.MenuID} - BID={this.props.BID} + BID={this.props.BIDs[this.props.Tab.supMenu] || ''} setting={setting} refreshdata={this.refreshbyaction} gettableselected={this.gettableselected} -- Gitblit v1.8.0