| | |
| | | value: search.initval, |
| | | required: search.required === 'true' |
| | | } |
| | | if (item.type === 'date') { |
| | | if (item.type === 'group') { |
| | | let copy = fromJS(item).toJS() |
| | | copy.key = search.datefield |
| | | |
| | | item.value = search.initval && search.initval[0] ? search.initval[0] : '@$@' |
| | | item.match = '=' |
| | | |
| | | copy.type = 'daterange' |
| | | copy.match = 'between' |
| | | copy.value = [moment().format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')] |
| | | |
| | | if (search.transfer === 'true') { |
| | | newsearches.push(item) |
| | | } |
| | | newsearches.push(copy) |
| | | return |
| | | } else if (item.type === 'date') { |
| | | item.value = moment().format('YYYY-MM-DD') |
| | | } else if (item.type === 'datemonth') { |
| | | item.value = moment().format('YYYY-MM') |
| | |
| | | _search = '' |
| | | } |
| | | |
| | | let LText = `select ${setting.laypage !== 'false' ? 'top 10' : ''} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource} ${_search}) tmptable ${setting.laypage !== 'false' ? 'where rows > 0' : ''} order by tmptable.rows` |
| | | let LText = `select ${setting.laypage !== 'false' ? 'top @pageSize@' : ''} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by @orderBy@) as rows from ${_dataresource} ${_search}) tmptable ${setting.laypage !== 'false' ? 'where rows > (@pageSize@ * (@pageIndex@ - 1))' : ''} order by tmptable.rows` |
| | | let _scripts = fromJS(this.state.systemScripts).toJS() |
| | | _scripts[0].value = LText |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { formlist, view, setting, scriptsColumns, systemScripts } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | {view ==='custom' ? <div> |
| | | <CustomScript |
| | | dict={this.props.dict} |
| | | tableName={setting.tableName} |
| | | setting={setting} |
| | | customScripts={setting.scripts} |
| | | searches={config.search} |
| | | systemScripts={systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsForm = inst} |