| | |
| | | import { BackTop, notification} from 'antd' |
| | | import Api from '@/api' |
| | | import MainSearch from './mainSearch' |
| | | // import MainAction from './mainAction' |
| | | // import MainTable from './mainTable' |
| | | import MainAction from './mainAction' |
| | | import MainTable from './mainTable' |
| | | import NotFount from '@/components/404' |
| | | import Loading from '@/components/loading' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | // import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | export default class NormalTable extends Component { |
| | |
| | | select: null, |
| | | data: null, |
| | | total: 0, |
| | | loading: true, |
| | | loading: false, |
| | | param: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | |
| | | }) |
| | | } |
| | | this.setState({config}) |
| | | console.log(config.columns) |
| | | } else { |
| | | this.setState({ |
| | | loadingview: false, |
| | |
| | | |
| | | refreshbysearch = (searches) => { |
| | | // 搜索条件变化 |
| | | this.loadmaindata(this.state.param.pageIndex, this.state.param.pageSize, this.state.param.orderColumn, this.state.param.orderType, searches) |
| | | let param = Object.assign({}, this.state.param, { |
| | | search: searches |
| | | }) |
| | | this.setState({ |
| | | loading: true, |
| | | param: param |
| | | }) |
| | | console.log(searches) |
| | | // searches = Utils.jointsearchkey(searches) |
| | | // this.loadmaindata(this.state.param.pageIndex, this.state.param.pageSize, this.state.param.orderColumn, this.state.param.orderType, searches) |
| | | // let param = Object.assign({}, this.state.param, { |
| | | // search: searches |
| | | // }) |
| | | // this.setState({ |
| | | // loading: true, |
| | | // param: param |
| | | // }) |
| | | } |
| | | |
| | | refreshbytable = (pagination, filters, sorter) => { |
| | | // 表格查询条件修改 |
| | | console.log(pagination) |
| | | console.log(filters) |
| | | if (sorter.order) { |
| | | let _chg = { |
| | | ascend: 'asc', |
| | | descend: 'desc' |
| | | } |
| | | sorter.order = _chg[sorter.order] |
| | | } |
| | | this.loadmaindata(pagination.current, pagination.pageSize, sorter.field, sorter.order, this.state.param.search) |
| | | let param = Object.assign({}, this.state.param, { |
| | | pageIndex: pagination.current, |
| | | pageSize: pagination.pageSize, |
| | | orderColumn: sorter.field, |
| | | orderType: sorter.order |
| | | }) |
| | | this.setState({ |
| | | loading: true, |
| | | param: param |
| | | }) |
| | | console.log(sorter) |
| | | // if (sorter.order) { |
| | | // let _chg = { |
| | | // ascend: 'asc', |
| | | // descend: 'desc' |
| | | // } |
| | | // sorter.order = _chg[sorter.order] |
| | | // } |
| | | // this.loadmaindata(pagination.current, pagination.pageSize, sorter.field, sorter.order, this.state.param.search) |
| | | // let param = Object.assign({}, this.state.param, { |
| | | // pageIndex: pagination.current, |
| | | // pageSize: pagination.pageSize, |
| | | // orderColumn: sorter.field, |
| | | // orderType: sorter.order |
| | | // }) |
| | | // this.setState({ |
| | | // loading: true, |
| | | // param: param |
| | | // }) |
| | | } |
| | | |
| | | refreshbyaction = () => { |
| | |
| | | // 组件加载时,获取菜单数据 |
| | | this.loadconfig() |
| | | // this.loadmaindata() |
| | | |
| | | this.setState({ |
| | | data: [1,2,3,4,5,6,7,8,9,10].map(item => { |
| | | return { |
| | | key: item, |
| | | ID: item + 'mainkey', |
| | | ExRateName: '$', |
| | | SupplierName: '阿里巴巴' + item + '店', |
| | | SupShortName: '阿里巴巴', |
| | | SupplierCode: '201922' + item, |
| | | OrgName: '阿里巴巴', |
| | | OrgCode: '302999', |
| | | PlanDate: '2019-11-' + (item < 10 ? '0' + item : item) |
| | | } |
| | | }), |
| | | total: 329 |
| | | }) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | dict={this.state.dict} |
| | | /> : null |
| | | } |
| | | {/* {this.state.actions && |
| | | {config.action && |
| | | <MainAction |
| | | MenuNo={this.props.MenuNo} |
| | | fixed={this.state.fixed.fixaction} |
| | | MenuID={this.props.MenuID} |
| | | fixed={config.setting && config.setting.actionfixed} |
| | | refreshdata={this.refreshbyaction} |
| | | gettableselected={this.gettableselected} |
| | | actions={this.state.actions} |
| | | actions={config.action} |
| | | dict={this.state.dict} |
| | | /> |
| | | } |
| | | {this.state.columns && |
| | | {config.columns && |
| | | <MainTable |
| | | ref="mainTable" |
| | | MenuNo={this.props.MenuNo} |
| | | fixed={this.state.fixed} |
| | | MenuID={this.props.MenuID} |
| | | setting={config.setting} |
| | | refreshdata={this.refreshbytable} |
| | | columns={this.state.columns} |
| | | columns={config.columns} |
| | | data={this.state.data} |
| | | select={this.state.select} |
| | | total={this.state.total} |
| | | loading={this.state.loading} |
| | | dict={this.state.dict} |
| | | /> |
| | | } */} |
| | | } |
| | | <BackTop> |
| | | <div className="ant-back-top"> |
| | | <div className="ant-back-top-content"> |