| | |
| | | config.setting.selected = 'false' |
| | | } else if (config.setting.selected === 'init' && config.setting.onload === 'false') { |
| | | config.setting.selected = 'false' |
| | | } else { |
| | | config.setting.orisel = true |
| | | } |
| | | |
| | | if (config.setting.controlField) { |
| | |
| | | } |
| | | } |
| | | |
| | | loadData = () => { |
| | | loadData = (id) => { |
| | | const { setting, search, hasReqFields, loadCustomApi } = this.state |
| | | |
| | | let searches = fromJS(search).toJS() |
| | |
| | | |
| | | this.loadOutResource(searches) |
| | | if (setting.execType === 'async') { |
| | | this.loadmaindata() |
| | | this.loadmaindata(id) |
| | | } |
| | | } else { |
| | | this.loadmaindata() |
| | | this.loadmaindata(id) |
| | | } |
| | | } |
| | | |
| | |
| | | Sort: index + 1 |
| | | })) |
| | | |
| | | if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) { |
| | | if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { |
| | | let sql = lines.map(item => (` |
| | | ${item.insert} |
| | | ${item.selects.join(` union all |
| | |
| | | /** |
| | | * @description 子表数据加载 |
| | | */ |
| | | async loadmaindata () { |
| | | async loadmaindata (id) { |
| | | const { BID } = this.props |
| | | const { setting, arr_field, search, orderBy, pageIndex, pageSize, absFields } = this.state |
| | | |
| | |
| | | start = pageSize * (pageIndex - 1) + 1 |
| | | } |
| | | |
| | | if (setting.selected !== 'false') { |
| | | if (setting.selected !== 'false' || (setting.orisel && id)) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID) |
| | | MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID, id) |
| | | }, 200) |
| | | if (setting.selected === 'init') { |
| | | this.setState({setting: {...setting, selected: 'false'}}) |
| | |
| | | /** |
| | | * @description 表格刷新 |
| | | */ |
| | | reloadtable = (btn) => { |
| | | reloadtable = (btn, id) => { |
| | | if (!btn || btn.resetPageIndex !== 'false') { |
| | | MKEmitter.emit('resetTable', this.props.Tab.uuid) // 列表重置 |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData() |
| | | this.loadData(id) |
| | | }) |
| | | } else { |
| | | MKEmitter.emit('resetTable', this.props.Tab.uuid, 'false') // 列表重置 |
| | | this.loadData() |
| | | this.loadData(id) |
| | | } |
| | | |
| | | } |
| | |
| | | * @param {*} position // 刷新位置 |
| | | * @param {*} btn // 执行的按钮 |
| | | */ |
| | | refreshByButtonResult = (menuId, position, btn, id, lines) => { |
| | | refreshByButtonResult = (menuId, position, btn, id = '', lines) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | |
| | | if (position === 'line' && lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | this.reloadtable(btn, id) |
| | | } |
| | | MKEmitter.emit('refreshPopButton', this.props.Tab.uuid) |
| | | } |