| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction } = this.props |
| | | const { permAction, Tab, BID } = this.props |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | actions: _actions, |
| | | columns: _columns, |
| | | arr_field: _arrField.join(','), |
| | | search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化) |
| | | loading: true |
| | | search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化) |
| | | }, () => { |
| | | this.improveSearch() |
| | | |
| | | if (config.setting.onload !== 'false' && (!Tab.supMenu || BID)) { // 初始化可加载 |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | this.loadmaindata() |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | if (setting.queryType === 'statistics') { // 统计数据源,内容替换 |
| | | let fieldmap = new Map() |
| | | search.forEach(item => { |
| | | let _field = item.key |
| | | |
| | | if (fieldmap.has(_field)) { |
| | | _field = _field + '1' |
| | | } |
| | | |
| | | fieldmap.set(item.key, true) |
| | | |
| | | let reg = new RegExp('@' + _field, 'ig') |
| | | _dataresource = _dataresource.replace(reg, `'${item.value}'`) |
| | | }) |
| | | } |
| | | |
| | | let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` |
| | |
| | | type="sub" |
| | | setting={setting} |
| | | actions={actions} |
| | | Tab={this.props.Tab} |
| | | BID={this.props.BID} |
| | | dict={this.state.dict} |
| | | MenuID={this.props.SupMenuID} |