| | |
| | | } |
| | | }) |
| | | |
| | | let _actions = config.action.filter(item => item.position === 'toolbar') |
| | | let _operation = config.action.filter(item => item.position === 'grid') |
| | | |
| | | if (_operation.length > 0) { |
| | | _columns.push({ |
| | | Align: 'center', |
| | | uuid: Utils.getuuid(), |
| | | IsSort: 'false', |
| | | Width: 120, |
| | | type: 'operation', |
| | | style: 'button', |
| | | label: this.state.dict['main.column.operation'], |
| | | operations: _operation |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | config: config, |
| | | setting: config.setting, |
| | | searchlist: config.search, |
| | | actions: config.action, |
| | | actions: _actions, |
| | | columns: _columns, |
| | | arr_field: _arrField.join(','), |
| | | search: _search ? 'where (' + _search + ')' : '', |
| | |
| | | |
| | | let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderColumn} ${orderType}) as rows from ${setting.dataresource} ${search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` |
| | | let DateCount = `select count(1) as total from ${setting.dataresource} ${search}` |
| | | console.log(LText) |
| | | console.log(DateCount) |
| | | |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.DateCount = Utils.formatOptions(DateCount) |
| | | let result = await Api.genericInterface(param) |
| | |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | data: [1,2,3,4,5,6,7,8,9,10].map((item, index) => { |
| | | let cell = {} |
| | | this.state.config.columns.forEach(column => { |
| | | if (!column.field) return |
| | | cell[column.field] = 'test' + item |
| | | }) |
| | | cell.key = index |
| | | return cell |
| | | }), |
| | | total: 329, |
| | | loading: false |
| | | }) |
| | | notification.error({ |