| | |
| | | |
| | | let _arrField = [config.setting.primaryKey] // 字段集 , 默认添加主键 |
| | | |
| | | // if (this.props.param && this.props.param.arr_field) { // 使用显示列字段查询 |
| | | // _arrField = this.props.param.arr_field |
| | | // } else { |
| | | config.groups.forEach(group => { |
| | | group.sublist.forEach(item => { |
| | | if (!item.field) return |
| | |
| | | }) |
| | | }) |
| | | _arrField = _arrField.join(',') |
| | | // } |
| | | |
| | | // 权限过滤 |
| | | if (this.props.menuType !== 'HS') { |
| | |
| | | actions: config.action, |
| | | arr_field: _arrField, |
| | | primaryId: this.props.param.primaryId || '', |
| | | data: config.setting.datatype === 'query' ? null : this.props.param.data, |
| | | data: this.props.param.data || null, |
| | | BIDs: { |
| | | mainTable: this.props.param.primaryId || '', |
| | | mainTabledata: config.setting.datatype === 'query' ? '' : this.props.param.data |
| | | mainTable: config.setting.onload === 'true' ? (this.props.param.primaryId || '') : '', |
| | | mainTabledata: config.setting.onload === 'true' ? (config.setting.datatype === 'query' ? '' : this.props.param.data) : '' |
| | | } |
| | | }, () => { |
| | | this.improveSelectOption(config.groups) |
| | | |
| | | if (config.setting.datatype === 'query' && this.props.param.primaryId) { |
| | | this.loadmaindata() |
| | | if (config.setting.datatype === 'query' && config.setting.onload === 'true') { |
| | | if (!this.props.param.primaryId) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到主键ID!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | this.loadmaindata() |
| | | } |
| | | } else if (config.setting.datatype !== 'query' && (!this.props.param.primaryId || !this.props.param.data)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到主表数据!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | * @description 主表数据加载 |
| | | */ |
| | | async loadmaindata () { |
| | | const { setting, BIDs } = this.state |
| | | const { setting, BIDs, config } = this.state |
| | | |
| | | if (setting.datatype !== 'query') { |
| | | notification.warning({ |
| | |
| | | |
| | | if (_data) { |
| | | _primaryId = _data[setting.primaryKey] || '' |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未查询到数据信息!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | mainTabledata: _data |
| | | } |
| | | }) |
| | | |
| | | if (_data && (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc))) { |
| | | let keys = Object.keys(_data) |
| | | let emptys = [] |
| | | |
| | | if (!keys.includes(config.setting.primaryKey)) { |
| | | emptys.push(config.setting.primaryKey) |
| | | } |
| | | |
| | | config.groups.forEach(group => { |
| | | group.sublist.forEach(item => { |
| | | if (!keys.includes(item.field)) { |
| | | emptys.push(item.field + '(' + item.label + ')') |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | if (emptys.length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未查询到' + emptys.join(', ') + '字段信息!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | notification.error({ |
| | | top: 92, |