| | |
| | | lineMarks: PropTypes.array, // 行标记 |
| | | fields: PropTypes.array, // 组件字段集 |
| | | ContainerId: PropTypes.any, // 标签页外层Id |
| | | BData: PropTypes.any, // 主表数据 |
| | | data: PropTypes.any, // 表格数据 |
| | | total: PropTypes.any, // 总数 |
| | | loading: PropTypes.bool, // 表格加载中 |
| | |
| | | MKEmitter.removeListener('resetTable', this.resetTable) |
| | | } |
| | | |
| | | mkCheckTopLine = (menuId) => { |
| | | mkCheckTopLine = (menuId, id) => { |
| | | const { MenuID, data, setting } = this.props |
| | | |
| | | if (MenuID !== menuId || !data || data.length === 0) return |
| | | if (data[0].$disabled) return |
| | | |
| | | this.changedata(0) |
| | | this.setState({ selectedRowKeys: [0], activeIndex: 0 }) |
| | | this.props.chgSelectData([data[0]]) |
| | | let index = 0 |
| | | if (id) { |
| | | index = data.findIndex(item => item.$$uuid === id) |
| | | if (index === -1) { |
| | | index = 0 |
| | | } |
| | | } |
| | | |
| | | if (data[index].$disabled) return |
| | | |
| | | this.changedata(index) |
| | | this.setState({ selectedRowKeys: [index], activeIndex: index }) |
| | | this.props.chgSelectData([data[index]]) |
| | | |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', MenuID, [data[0]], data.length === 1) |
| | | MKEmitter.emit('syncBalconyData', MenuID, [data[index]], data.length === 1) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | changedata = (index) => { |
| | | const { MenuID, data, setting } = this.props |
| | | const { MenuID, data } = this.props |
| | | |
| | | let _id = '' |
| | | let _data = '' |
| | | |
| | | if (data && data.length > 0 && index !== '') { |
| | | _id = data[index][setting.primaryKey] || '' |
| | | _id = data[index].$$uuid || '' |
| | | _data = data[index] || '' |
| | | } |
| | | |