diff --git a/pc4mobx/organization/apis/company.js b/pc4mobx/organization/apis/company.js index 9ab3932..ccc6838 100644 --- a/pc4mobx/organization/apis/company.js +++ b/pc4mobx/organization/apis/company.js @@ -41,6 +41,7 @@ export const getAdvanceSearchCondition = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/getSearchCondition', 'GET', params); } + export const add = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/saveBaseComp', 'POST', params); } @@ -49,6 +50,10 @@ export const version = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/version/subcompanyfielddefined/save', 'POST', params); } +export const selectVersions = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/version/subcompanyfielddefined/getVersion', 'GET', params); +} + export const editResource = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/updateComp', 'POST', params); } diff --git a/pc4mobx/organization/apis/department.js b/pc4mobx/organization/apis/department.js index c0f15eb..3a0f813 100644 --- a/pc4mobx/organization/apis/department.js +++ b/pc4mobx/organization/apis/department.js @@ -45,6 +45,10 @@ export const version = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/save', 'POST', params); } +export const selectVersions = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/getVersion', 'GET', params); +} + export const getTransferForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/dept/getMoveForm', 'GET', params); } diff --git a/pc4mobx/organization/apis/job.js b/pc4mobx/organization/apis/job.js index 4a5e8ef..0230814 100644 --- a/pc4mobx/organization/apis/job.js +++ b/pc4mobx/organization/apis/job.js @@ -37,6 +37,10 @@ export const getCopyForm = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/job/getCopyForm', 'GET', params); } +export const refresh = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/job/refresh', 'GET', params); +} + export const add = (params) => { return fetch('/api/bs/hrmorganization/job/saveBaseForm', { method: 'POST', diff --git a/pc4mobx/organization/apis/resource.js b/pc4mobx/organization/apis/resource.js index f90612d..ae91703 100644 --- a/pc4mobx/organization/apis/resource.js +++ b/pc4mobx/organization/apis/resource.js @@ -43,7 +43,9 @@ export const version = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/save', 'POST', params); } - +export const selectVersions = (params) => { + return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/getVersion', 'GET', params); +} export const exportResource = (ids) => { fetch('/api/bs/hrmorganization/common/resource/export?ids='+ids).then(res => res.blob().then(blob => { diff --git a/pc4mobx/organization/components/VersionsSlider.js b/pc4mobx/organization/components/VersionsSlider.js index a1770e8..442ddda 100644 --- a/pc4mobx/organization/components/VersionsSlider.js +++ b/pc4mobx/organization/components/VersionsSlider.js @@ -22,6 +22,14 @@ export default class VersionsSlider extends React.Component { } + isEmptyObject(obj) { + for (let key in obj) { + return false; + } + return true; + } + + render() { const { versionList, @@ -32,54 +40,54 @@ export default class VersionsSlider extends React.Component { return ( -
- - -

操作人: {versionList.operateName}

- - -

操作时间: {versionList.operateTime}

- - -
版本: + { + versionList.versions.map((item) => { + return () + }) + } -
- -
- -
- {newData.map((item, index) => { - return ( -
- {item.map((subItem) => { +
+ + +
+ {newData.map((item, index) => { return ( -
- {subItem.fieldId} - {subItem.fieldValue.length > 10 ? - {subItem.fieldValue} - : {subItem.fieldValue}} +
+ {item.map((subItem) => { + return ( +
+ {subItem.fieldId} + {subItem.fieldValue.length > 10 ? + {subItem.fieldValue} + : {subItem.fieldValue}} +
+ + ); + })}
- ); })}
- ); - })} -
-
+
) } } diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js index a7968b6..6dbd8c4 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-18 14:52:39 - * @LastEditTime: 2022-12-09 17:45:16 + * @LastEditTime: 2022-12-15 19:29:14 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js */ @@ -235,7 +235,7 @@ export default class CompanyExtend extends React.Component { view = () => { const { companyExtend } = this.props; - companyExtend.open = true; + companyExtend.selectVersions(); } onClose = () => { @@ -305,7 +305,7 @@ export default class CompanyExtend extends React.Component { height={94} direction={'right'} measure={'%'} - content={ companyExtend.changeVersion(val)}/>} + content={!isEmpty(versionList) ? companyExtend.changeVersion(val)}/> :
暂无历史版本
} onClose={this.onClose} onAnimationEnd={() => console.log('onAnimationEnd')} /> diff --git a/pc4mobx/organization/components/department/departmentExtend.js b/pc4mobx/organization/components/department/departmentExtend.js index 6c20f50..cbba14c 100644 --- a/pc4mobx/organization/components/department/departmentExtend.js +++ b/pc4mobx/organization/components/department/departmentExtend.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:20:03 - * @LastEditTime: 2022-12-09 17:46:00 + * @LastEditTime: 2022-12-15 19:28:54 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js */ @@ -43,7 +43,7 @@ export default class DepartmentExtendStore extends React.Component { view = () => { const { departmentExtend } = this.props; - departmentExtend.open = true; + departmentExtend.selectVersions(); } getTabChildren = () => { @@ -296,7 +296,7 @@ export default class DepartmentExtendStore extends React.Component { height={94} direction={'right'} measure={'%'} - content={!isEmpty(versionList) ? departmentExtend.changeVersion(val)}/> : ''} + content={!isEmpty(versionList) ? departmentExtend.changeVersion(val)}/> :
暂无历史版本
} onClose={this.onClose} onAnimationEnd={() => console.log('onAnimationEnd')} /> diff --git a/pc4mobx/organization/components/job/Job.js b/pc4mobx/organization/components/job/Job.js index 2329e16..d9d7e4b 100644 --- a/pc4mobx/organization/components/job/Job.js +++ b/pc4mobx/organization/components/job/Job.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-05-26 14:05:59 - * @LastEditTime: 2022-12-13 16:01:40 + * @LastEditTime: 2022-12-15 17:09:27 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js */ @@ -127,9 +127,18 @@ export default class Job extends React.Component { job.setNeDialogTitle(i18n.label.newPost()); job.setNewVisible(true); job.getJobForm(); - } + + refresh() { + const { + job + } = this.props; + + job.refresh(); + } + + //联查人员 select(id) { const { diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index ddb4d46..97614f8 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -26,10 +26,11 @@ export class CompanyExtendStore { @observable tabkey = '0'; @observable open = false; - + @observable version = '1.0'; @observable selectedRowKeys = []; @observable selectedRows = []; + @observable versionList = {}; @action onRowSelect = (keys) => { this.setSelectedRowKeys(keys); @@ -47,6 +48,23 @@ export class CompanyExtendStore { this.detailSelectedKey = '0' } + @action selectVersions = () => { + let params = { + id:this.id, + version:this.version + } + Api.selectVersions(params).then((res) => { + this.open = true; + if (res.code === 200) { + this.setVersionList(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + init = () => { this.detailSelectedKey = '0' this.isEditor = false; @@ -177,7 +195,8 @@ export class CompanyExtendStore { } changeVersion = data => { - debugger + this.version = data; + this.selectVersions(); } setLoading(val) { @@ -245,49 +264,53 @@ export class CompanyExtendStore { this.date = date; } - //历史版本 - @observable versionList = { - operateName: '史永成', - operateTime: '2022-12-31', - versions: [ - { value: "1.0" }, - { value: "1.1" }, - { value: "1.2" }, - { value: "1.3" } - ], - datas: [ - { - fieldId: '简称', - fieldValue: '泛微' - }, { - fieldId: '全称', - fieldValue: '泛微' - }, { - fieldId: '上级分部', - fieldValue: '泛微北京' - }, { - fieldId: '网站', - fieldValue: '1546875925@qq.com' - }, { - fieldId: '分部ID', - fieldValue: '8' - }, { - fieldId: '显示顺序', - fieldValue: '9' - }, { - fieldId: '分部编号', - fieldValue: '分部1-1' - }, { - fieldId: '限制用户数', - fieldValue: '产品运营' - }, { - fieldId: '在职离职人数', - fieldValue: '产品运营' - } - ] - - - + setVersionList(obj) { + this.versionList = obj; } + //历史版本 + // @observable versionList = { + // operateName: '史永成', + // operateTime: '2022-12-31', + // versions: [ + // { value: "1.0" }, + // { value: "1.1" }, + // { value: "1.2" }, + // { value: "1.3" } + // ], + // datas: [ + // { + // fieldId: '简称', + // fieldValue: '泛微' + // }, { + // fieldId: '全称', + // fieldValue: '泛微' + // }, { + // fieldId: '上级分部', + // fieldValue: '泛微北京' + // }, { + // fieldId: '网站', + // fieldValue: '1546875925@qq.com' + // }, { + // fieldId: '分部ID', + // fieldValue: '8' + // }, { + // fieldId: '显示顺序', + // fieldValue: '9' + // }, { + // fieldId: '分部编号', + // fieldValue: '分部1-1' + // }, { + // fieldId: '限制用户数', + // fieldValue: '产品运营' + // }, { + // fieldId: '在职离职人数', + // fieldValue: '产品运营' + // } + // ] + + + + // } + } diff --git a/pc4mobx/organization/stores/departmentextend.js b/pc4mobx/organization/stores/departmentextend.js index 1371ac9..2ca96e0 100644 --- a/pc4mobx/organization/stores/departmentextend.js +++ b/pc4mobx/organization/stores/departmentextend.js @@ -29,6 +29,8 @@ export class DepartmentExtendStore { @observable selectedRows = []; @observable open = false; + @observable version = '1.0'; + @observable versionList = {}; @action onRowSelect = (keys) => { this.setSelectedRowKeys(keys); @@ -39,8 +41,7 @@ export class DepartmentExtendStore { } - @action - edit = () => { + @action edit = () => { this.isEditor = true; this.getData(); this.getTabInfo(); @@ -77,6 +78,23 @@ export class DepartmentExtendStore { }) } + @action("历史版本") selectVersions = () => { + let params = { + id:this.id, + version:this.version + } + Api.selectVersions(params).then((res) => { + this.open = true; + if (res.code === 200) { + this.setVersionList(res.data); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + editResource = () => { let pDatas = this.form.getFormParams(); Api.editResource({ ...{ @@ -240,50 +258,8 @@ export class DepartmentExtendStore { this.date = date; } - //历史版本 - @observable versionList = { - operateName: '史永成', - operateTime: '2022-12-31', - versions: [ - { value: "1.0" }, - { value: "1.1" }, - { value: "1.2" }, - { value: "1.3" } - ], - datas: [ - { - fieldId: '简称', - fieldValue: '泛微' - }, { - fieldId: '全称', - fieldValue: '泛微' - }, { - fieldId: '上级分部', - fieldValue: '泛微北京' - }, { - fieldId: '网站', - fieldValue: '1546875925@qq.com' - }, { - fieldId: '分部ID', - fieldValue: '8' - }, { - fieldId: '显示顺序', - fieldValue: '9' - }, { - fieldId: '分部编号', - fieldValue: '分部1-1' - }, { - fieldId: '限制用户数', - fieldValue: '产品运营' - }, { - fieldId: '在职离职人数', - fieldValue: '产品运营' - } - ] - - - + setVersionList(obj) { + this.versionList = obj; } - } diff --git a/pc4mobx/organization/stores/job.js b/pc4mobx/organization/stores/job.js index 3e4ab51..3900625 100644 --- a/pc4mobx/organization/stores/job.js +++ b/pc4mobx/organization/stores/job.js @@ -155,6 +155,19 @@ export class JobStore { }) } + @action("刷新") refresh() { + Api.refresh().then(res => { + if (res.code === 200) { + this.getTableInfo(); + message.success(res.msg); + } else { + message.warning(res.msg); + } + }, error => { + message.warning(error.msg); + }) + } + updateForbiddenTag(checked, id) { let params = { forbiddenTag: checked,