公司/分部分页修改
This commit is contained in:
parent
786bac5aa1
commit
5f478dcbfd
|
|
@ -0,0 +1,61 @@
|
|||
import {
|
||||
WeaNewScroll,
|
||||
WeaSearchGroup,
|
||||
WeaMoreButton,
|
||||
WeaTable
|
||||
} from 'ecCom'
|
||||
|
||||
import {
|
||||
Spin,
|
||||
Button,
|
||||
Pagination
|
||||
} from 'antd'
|
||||
|
||||
import {
|
||||
WeaSwitch
|
||||
} from 'comsMobx'
|
||||
|
||||
import {
|
||||
i18n
|
||||
} from '../public/i18n';
|
||||
|
||||
import '../style/common.less';
|
||||
|
||||
|
||||
export default class NewWeaTable extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const {
|
||||
dataSource,
|
||||
columns,
|
||||
rowSelection,
|
||||
pagination,
|
||||
loading,
|
||||
indentSize
|
||||
} = this.props
|
||||
|
||||
|
||||
return (
|
||||
loading ? <div className='hrm-new-weatable-spin'>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={loading}></Spin>
|
||||
</div> :
|
||||
<WeaTable rowKey={record => record.id}
|
||||
dataSource={dataSource} childrenColumnName="children"
|
||||
columns={columns}
|
||||
rowSelection={rowSelection}
|
||||
pagination={false}
|
||||
loading={loading}
|
||||
// onChange={(pagination, filters, sorter) => {
|
||||
// debugger
|
||||
// company.getTableInfo();
|
||||
// }}
|
||||
indentSize={indentSize}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-18 16:23:32
|
||||
* @LastEditTime: 2022-05-23 18:54:44
|
||||
* @LastEditTime: 2022-05-24 14:29:44
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
|
||||
*/
|
||||
|
|
@ -39,6 +39,7 @@ import '../../style/common.less';
|
|||
|
||||
import NewTableDialog from '../NewTableDialog';
|
||||
import NewAndEditDialog from '../NewAndEditDialog';
|
||||
import NewWeaTable from '../NewWeaTable';
|
||||
import { renderLoading } from '../../util'; // 从util文件引入公共的方法
|
||||
|
||||
|
||||
|
|
@ -134,7 +135,7 @@ export default class Company extends React.Component {
|
|||
company.setNeDialogTitle(i18n.label.companyName());
|
||||
company.setVisible(true);
|
||||
company.getDeptTable(id);
|
||||
company.setDialogLoadingStatus(false);
|
||||
company.setDialogLoadingStatus(true);
|
||||
}
|
||||
|
||||
batchDelete() {
|
||||
|
|
@ -359,7 +360,7 @@ export default class Company extends React.Component {
|
|||
const {
|
||||
isPanelShow, companyName, conditionNum, visible, condition, form,
|
||||
tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading,
|
||||
form1, isEdit, newVisible, deptDataSource, deptColumns, selectedRowKeys, total
|
||||
form1, isEdit, newVisible, deptDataSource, deptColumns, selectedRowKeys, total,current,pageSize,init
|
||||
} = company;
|
||||
|
||||
|
||||
|
|
@ -370,16 +371,18 @@ export default class Company extends React.Component {
|
|||
};
|
||||
|
||||
const pagination = {
|
||||
current:current,
|
||||
pageSize:pageSize,
|
||||
total: total,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
onShowSizeChange(current, pageSize) {
|
||||
company.setCurrent(current);
|
||||
company.setPageSize(pageSize);
|
||||
},
|
||||
onChange(current) {
|
||||
company.setCurrent(current);
|
||||
},
|
||||
showTotal(total){
|
||||
return `共 ${total} 条`
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -413,21 +416,30 @@ export default class Company extends React.Component {
|
|||
onSearchChange={val => this.onSearchChange(val)}
|
||||
/>
|
||||
{
|
||||
loading ? <div className='hrm-loading-center-small'>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={loading}></Spin>
|
||||
init ? <div className='hrm-new-weatable-spin'>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4ygl4a`} spinning={init}></Spin>
|
||||
</div> :
|
||||
<WeaTable rowKey={record => record.id}
|
||||
loading={loading}
|
||||
dataSource={dataSource} childrenColumnName="children"
|
||||
columns={this.reRenderColumns(columns)}
|
||||
rowSelection={rowSelection}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
// onChange={(pagination, filters, sorter) => {
|
||||
// debugger
|
||||
// company.getTableInfo();
|
||||
// }}
|
||||
onChange={(pagination, filters, sorter) => {
|
||||
company.setCurrent(pagination.current);
|
||||
company.setPageSize(pagination.pageSize);
|
||||
company.getTableInfo();
|
||||
}}
|
||||
indentSize={15}
|
||||
/>
|
||||
// <NewWeaTable ecId={`${this && this.props && this.props.ecId || ''}_NewWeaTable@q4rrwm`}
|
||||
// dataSource={dataSource}
|
||||
// columns={this.reRenderColumns(columns)}
|
||||
// rowSelection={rowSelection}
|
||||
// pagination={pagination}
|
||||
// loading={loading}
|
||||
// indentSize={15}
|
||||
// />
|
||||
}
|
||||
|
||||
</WeaTop>
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ export class CompanyStore {
|
|||
@observable companyId = '';
|
||||
@observable selectedRowKeys = '';
|
||||
@observable date = '';
|
||||
@observable init = true; //是否首次加载
|
||||
@observable total = 0;
|
||||
@observable current = 1;
|
||||
@observable pageSize = 10;
|
||||
|
|
@ -81,10 +82,11 @@ export class CompanyStore {
|
|||
return response.json()
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list);
|
||||
res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns);
|
||||
res.data.pageInfo.total && this.setTotal(res.data.pageInfo.total )
|
||||
this.setLoading(false);
|
||||
res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list);
|
||||
res.data.pageInfo.columns && this.setColumns(res.data.pageInfo.columns);
|
||||
res.data.pageInfo.total && this.setTotal(res.data.pageInfo.total);
|
||||
this.setLoading(false);
|
||||
this.init = false
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
|
|
@ -103,14 +105,13 @@ export class CompanyStore {
|
|||
let params = {
|
||||
parentComp:id
|
||||
}
|
||||
this.setLoading(true);
|
||||
Api.getDeptListByPid(params).then(response => {
|
||||
return response.json()
|
||||
}).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.list && this.setDeptDataSource(res.data.list);
|
||||
res.data.columns && this.setDeptColumns(res.data.columns);
|
||||
this.setLoading(false);
|
||||
this.setDialogLoadingStatus(false);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ export class JobLevelStore {
|
|||
@action
|
||||
getTableInfo() {
|
||||
let params;
|
||||
//获取tab信息
|
||||
this.getTabInfo();
|
||||
this.tableStore = new TableStore();
|
||||
if (this.isEmptyObject(this.form2.getFormParams())) {
|
||||
params = {
|
||||
|
|
@ -75,9 +77,7 @@ export class JobLevelStore {
|
|||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
//获取tab信息
|
||||
this.getTabInfo();
|
||||
|
||||
|
||||
}
|
||||
|
||||
//删除
|
||||
|
|
|
|||
|
|
@ -18,7 +18,12 @@
|
|||
width: 400px !important;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hrm-new-weatable-spin {
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -47,4 +52,6 @@
|
|||
padding-left: 25%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue