| | |
| | | |
| | | let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) 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) |
| | | |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | this.reloadtable() |
| | | } else if (btn.execError === 'view' && type === 'error') { |
| | | this.reloadview() |
| | | } else if (type === 'excelOut') { |
| | | this.handleExcelout() |
| | | } |
| | | } |
| | | |
| | | handleExcelout = () => { |
| | | const { arr_field, orderColumn, orderType, search, setting } = this.state |
| | | |
| | | let _search = Utils.joinMainSearchkey(search) |
| | | _search = _search ? 'where (' + _search + ')' : '' |
| | | // 获取列表数据 |
| | | let param = { |
| | | func: setting.innerFunc || 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | | arr_field: arr_field |
| | | } |
| | | |
| | | let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order |
| | | |
| | | let LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${setting.dataresource} ${_search}) tmptable order by tmptable.rows` |
| | | |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.DateCount = '' |
| | | |
| | | Api.genericInterface(param) |
| | | } |
| | | |
| | | gettableselected = () => { |
| | |
| | | data.push(this.refs.mainTable.props.data[item]) |
| | | }) |
| | | return data |
| | | } |
| | | |
| | | buttonTrigger = (btn, record) => { |
| | | this.refs.mainButton.actionTrigger(btn, record) |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | } |
| | | {actions && |
| | | <MainAction |
| | | ref="mainButton" |
| | | MenuID={this.props.MenuID} |
| | | setting={setting} |
| | | refreshdata={this.refreshbyaction} |
| | |
| | | {columns && |
| | | <MainTable |
| | | ref="mainTable" |
| | | dict={this.state.dict} |
| | | MenuID={this.props.MenuID} |
| | | setting={setting} |
| | | refreshdata={this.refreshbytable} |
| | | columns={columns} |
| | | data={this.state.data} |
| | | total={this.state.total} |
| | | loading={this.state.loading} |
| | | dict={this.state.dict} |
| | | refreshdata={this.refreshbytable} |
| | | buttonTrigger={this.buttonTrigger} |
| | | /> |
| | | } |
| | | <BackTop> |