diff --git a/pc4mobx/organization/apis/staff.js b/pc4mobx/organization/apis/staff.js index c3fff25..adc688e 100644 --- a/pc4mobx/organization/apis/staff.js +++ b/pc4mobx/organization/apis/staff.js @@ -4,11 +4,11 @@ import { } from 'ecCom' export const getSearchList = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTable', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/staff/getTable', 'GET', params); } export const deleteTableData = (params) => { - return fetch('/api/bs/hrmorganization/scheme/deleteByIds', { + return fetch('/api/bs/hrmorganization/staff/deleteByIds', { method: 'POST', mode: 'cors', headers: { @@ -19,11 +19,11 @@ export const deleteTableData = (params) => { } export const getAdvanceSearchCondition = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSearchCondition', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/staff/getSearchCondition', 'GET', params); } export const add = (params) => { - return fetch('/api/bs/hrmorganization/scheme/save', { + return fetch('/api/bs/hrmorganization/staff/saveStaff', { method: 'POST', mode: 'cors', headers: { @@ -34,7 +34,7 @@ export const add = (params) => { } export const edit = (params) => { - return fetch('/api/bs/hrmorganization/scheme/updateScheme', { + return fetch('/api/bs/hrmorganization/staff/updateStaff', { method: 'POST', mode: 'cors', headers: { @@ -44,21 +44,10 @@ export const edit = (params) => { }) } -export const updateForbiddenTag = (params) => { - return fetch('/api/bs/hrmorganization/scheme/updateForbiddenTagById', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }) -} - -export const getSchemeForm = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSchemeForm', 'GET', params); +export const getForm = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/staff/getForm', 'GET', params); } export const getHasRight = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTableBtn', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/staff/getHasRight', 'GET', params); } \ No newline at end of file diff --git a/pc4mobx/organization/apis/staffscheme.js b/pc4mobx/organization/apis/staffscheme.js index c3fff25..4b866ba 100644 --- a/pc4mobx/organization/apis/staffscheme.js +++ b/pc4mobx/organization/apis/staffscheme.js @@ -4,11 +4,11 @@ import { } from 'ecCom' export const getSearchList = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTable', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/staffplan/getTable', 'GET', params); } export const deleteTableData = (params) => { - return fetch('/api/bs/hrmorganization/scheme/deleteByIds', { + return fetch('/api/bs/hrmorganization/staffplan/deleteByIds', { method: 'POST', mode: 'cors', headers: { @@ -19,11 +19,11 @@ export const deleteTableData = (params) => { } export const getAdvanceSearchCondition = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSearchCondition', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/staffplan/getSearchCondition', 'GET', params); } export const add = (params) => { - return fetch('/api/bs/hrmorganization/scheme/save', { + return fetch('/api/bs/hrmorganization/staffplan/saveStaffPlan', { method: 'POST', mode: 'cors', headers: { @@ -34,7 +34,7 @@ export const add = (params) => { } export const edit = (params) => { - return fetch('/api/bs/hrmorganization/scheme/updateScheme', { + return fetch('/api/bs/hrmorganization/staffplan/updateStaffPlan', { method: 'POST', mode: 'cors', headers: { @@ -45,7 +45,7 @@ export const edit = (params) => { } export const updateForbiddenTag = (params) => { - return fetch('/api/bs/hrmorganization/scheme/updateForbiddenTagById', { + return fetch('/api/bs/hrmorganization/staffplan/updateForbiddenTagById', { method: 'POST', mode: 'cors', headers: { @@ -56,9 +56,9 @@ export const updateForbiddenTag = (params) => { } export const getSchemeForm = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getSchemeForm', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/staffplan/getForm', 'GET', params); } export const getHasRight = (params) => { - return WeaTools.callApi('/api/bs/hrmorganization/scheme/getTableBtn', 'GET', params); + return WeaTools.callApi('/api/bs/hrmorganization/staffplan/getHasRight', 'GET', params); } \ No newline at end of file diff --git a/pc4mobx/organization/components/NewTableDialog.js b/pc4mobx/organization/components/NewTableDialog.js index ff7f1da..992150b 100644 --- a/pc4mobx/organization/components/NewTableDialog.js +++ b/pc4mobx/organization/components/NewTableDialog.js @@ -43,6 +43,19 @@ export default class NewTableDialog extends React.Component { width, } = this.state; + const pagination = { + total: dataSource.length, + showSizeChanger: true, + showQuickJumper: true, + onShowSizeChange(current, pageSize) { + }, + onChange(current) { + }, + showTotal(total) { + return `共 ${total} 条` + } + }; + const buttons = [ //(), () @@ -60,13 +73,18 @@ export default class NewTableDialog extends React.Component { buttons={buttons} style={{ width: width, height: height }} > - record.id} - dataSource={dataSource} childrenColumnName="children" - columns={columns} - indentSize={15} - loading={loading} - defaultExpandedRowKeys={[1, 2]} - /> + { + loading ?
+ +
: record.id} + dataSource={dataSource} childrenColumnName="children" + columns={columns} + loading={loading} + pagination={pagination} + indentSize={15} + /> + } + ) } diff --git a/pc4mobx/organization/components/NewWeaTable.js b/pc4mobx/organization/components/NewWeaTable.js index c6934c8..f0d651c 100644 --- a/pc4mobx/organization/components/NewWeaTable.js +++ b/pc4mobx/organization/components/NewWeaTable.js @@ -34,11 +34,23 @@ export default class NewWeaTable extends React.Component { dataSource, columns, rowSelection, - pagination, loading, indentSize } = this.props + const pagination = { + total: dataSource.length, + showSizeChanger: true, + showQuickJumper: true, + onShowSizeChange(current, pageSize) { + }, + onChange(current) { + }, + showTotal(total){ + return `共 ${total} 条` + } + }; + return ( loading ?
@@ -48,12 +60,8 @@ export default class NewWeaTable extends React.Component { dataSource={dataSource} childrenColumnName="children" columns={columns} rowSelection={rowSelection} - pagination={false} + pagination={pagination} loading={loading} - // onChange={(pagination, filters, sorter) => { - // debugger - // company.getTableInfo(); - // }} indentSize={indentSize} /> ) diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index 5f0a65f..1f9df79 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 16:23:32 - * @LastEditTime: 2022-05-25 13:52:21 + * @LastEditTime: 2022-05-26 09:12:59 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js */ @@ -134,8 +134,8 @@ export default class Company extends React.Component { company.setNeDialogTitle(i18n.label.companyName()); company.setVisible(true); - company.getDeptTable(id); company.setDialogLoadingStatus(true); + company.getDeptTable(id); } batchDelete() { @@ -369,7 +369,7 @@ export default class Company extends React.Component { }, }; - let pagination = { + const pagination = { current:current, pageSize:pageSize, total: total, diff --git a/pc4mobx/organization/components/staff/Staff.js b/pc4mobx/organization/components/staff/Staff.js index 2a28493..b482a38 100644 --- a/pc4mobx/organization/components/staff/Staff.js +++ b/pc4mobx/organization/components/staff/Staff.js @@ -217,11 +217,11 @@ export default class Staff extends React.Component { reRenderColumns(columns) { let _this = this; columns.forEach((c, index) => { - if (c.dataIndex == 'forbidden_tag') { - c.render = function(text, record) { - return _this.updateForbiddenTag(checked,record.id)} /> - } - }; + // if (c.dataIndex == 'forbidden_tag') { + // c.render = function(text, record) { + // return _this.updateForbiddenTag(checked,record.id)} /> + // } + // }; }) } diff --git a/pc4mobx/organization/stores/staff.js b/pc4mobx/organization/stores/staff.js index d22ec9a..9a1b4f7 100644 --- a/pc4mobx/organization/stores/staff.js +++ b/pc4mobx/organization/stores/staff.js @@ -36,7 +36,7 @@ export class StaffStore { @observable form = new WeaForm(); @observable form1 = new WeaForm(); @observable staffName = ''; - @observable conditionNum = 2; + @observable conditionNum = 10; @observable ids = ''; //选择行id @observable searchConditionLoading = true; @observable nEdialogTitle = ''; @@ -145,24 +145,6 @@ export class StaffStore { }); } - updateForbiddenTag(checked, id) { - let params = { - forbiddenTag: checked, - id: id - } - Api.updateForbiddenTag(params).then(response => { - return response.json() - }).then(data => { - if (data.code === 200) { - message.success(data.msg); - } else { - message.warning(data.msg); - } - }).catch(error => { - message.warning(error.msg); - }) - - } getForm() { let params = this.isNew ? {} : { @@ -170,7 +152,7 @@ export class StaffStore { } this.setDialogLoadingStatus(true); - Api.getSchemeForm(params).then(res => { + Api.getForm(params).then(res => { if (res.code === 200) { this.setDialogLoadingStatus(false); res.data.condition && this.setCondition(res.data.condition); diff --git a/pc4mobx/organization/stores/staffscheme.js b/pc4mobx/organization/stores/staffscheme.js index 8e47db1..00b4a61 100644 --- a/pc4mobx/organization/stores/staffscheme.js +++ b/pc4mobx/organization/stores/staffscheme.js @@ -36,7 +36,7 @@ export class StaffSchemeStore { @observable form = new WeaForm(); @observable form1 = new WeaForm(); @observable schemeName = ''; - @observable conditionNum = 2; + @observable conditionNum = 8; @observable ids = ''; //选择行id @observable searchConditionLoading = true; @observable nEdialogTitle = '';