完成公司/分部页面

This commit is contained in:
Chengliang 2022-05-25 11:50:31 +08:00
parent 5f478dcbfd
commit bb8920e3a0
3 changed files with 22 additions and 12 deletions

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-05-18 16:23:32
* @LastEditTime: 2022-05-24 14:29:44
* @LastEditTime: 2022-05-25 11:00:00
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
*/
@ -286,7 +286,7 @@ export default class Company extends React.Component {
} = company;
const btn = [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { company.getTableInfo(); company.setPanelStatus(false) }}>{i18n.button.search()}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { company.setCurrent(1); company.setPageSize(10);company.getTableInfo(); company.setPanelStatus(false) }}>{i18n.button.search()}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} onClick={() => form.reset()}>{i18n.button.reset()}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5u9mfz`} onClick={() => company.setPanelStatus(false)}>{i18n.button.cancel()}</Button>),
];
@ -362,7 +362,7 @@ export default class Company extends React.Component {
tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading,
form1, isEdit, newVisible, deptDataSource, deptColumns, selectedRowKeys, total,current,pageSize,init
} = company;
console.log("init",total)
const rowSelection = {
onChange(selectedRowKeys, selectedRows) {
@ -370,7 +370,7 @@ export default class Company extends React.Component {
},
};
const pagination = {
let pagination = {
current:current,
pageSize:pageSize,
total: total,
@ -412,14 +412,18 @@ export default class Company extends React.Component {
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
hasMask={false}
buttonsAd={this.getTabBtn()}
onSearch={() => company.getTableInfo()}
onSearch={() => {
company.setCurrent(1);
company.setPageSize(10);
company.getTableInfo()
}}
onSearchChange={val => this.onSearchChange(val)}
/>
{
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}
<WeaTable rowKey={record => record.id} ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
loading={loading}
dataSource={dataSource} childrenColumnName="children"
columns={this.reRenderColumns(columns)}

View File

@ -52,7 +52,7 @@ export class CompanyStore {
@observable selectedRowKeys = '';
@observable date = '';
@observable init = true; //是否首次加载
@observable total = 0;
@observable total = '';
@observable current = 1;
@observable pageSize = 10;
@ -70,7 +70,7 @@ export class CompanyStore {
params = {
...params,
...this.form.getFormParams(),
compName: this.companyName,
compName: this.companyName
};
} else {
params = {
@ -82,11 +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.setTotal(res.data.pageInfo.total);
res.data.pageInfo.list && this.setDataSource(res.data.pageInfo.list);
this.setLoading(false);
this.init = false
this.setInit(false);
} else {
message.warning(res.msg);
}
@ -362,4 +362,8 @@ save() {
this.pageSize = pageSize;
}
setInit(bool) {
this.init = bool;
}
}

View File

@ -123,7 +123,8 @@ export class CompanyExtendStore {
this.setLoading(true);
let params = {
viewAttr: this.isEditor ? 2 : 1,
id: this.id
id: this.id,
viewCondition:this.selectedKey
}
Api.getCompanyExtendForm(params).then((res) => {
if (res.code === 200) {
@ -215,6 +216,7 @@ export class CompanyExtendStore {
changeData(key) {
this.setSelectedKey(key);
this.getData();
}
setId(id) {