| | |
| | | /** |
| | | * @description 获取单行数据 |
| | | */ |
| | | async loadmainLinedata (id) { |
| | | async loadLinedata (id, position) { |
| | | const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state |
| | | |
| | | if (config.forbidLine) { |
| | |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | if (position === 'line_grid' && (!result.data || !result.data[0])) { |
| | | this.loadmaindata(true, 'false') |
| | | return |
| | | } |
| | | |
| | | if (!result.data || !result.data[0]) { |
| | | let data = fromJS(this.state.data).toJS() |
| | | let selectedData = fromJS(this.state.selectedData).toJS() |
| | | |
| | | data = data.filter(item => item.$$uuid !== id) |
| | | selectedData = selectedData.filter(item => item.$$uuid !== id) |
| | | |
| | | MKEmitter.emit('transferData' + setting.tableId, id, 'delete') |
| | | |
| | | this.setState({ |
| | | data, |
| | | selectedData, |
| | | loading: false |
| | | }) |
| | | |
| | | return |
| | | } |
| | | |
| | |
| | | if (!id) { |
| | | this.reloadtable() |
| | | } else { |
| | | this.loadmainLinedata(id) |
| | | this.loadLinedata(id) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | if (position === 'line') { |
| | | if (position === 'line' || position === 'line_grid') { |
| | | if (lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | this.loadLinedata(lines[0].$$uuid, position) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | } |