From 17063a3f10d6b584ff869cc81fd7e778a8782437 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 9 Dec 2022 17:51:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/organization/apis/company.js | 3 +- .../organization/components/VersionsSlider.js | 85 ++++++++++++ .../components/company/CompanyExtend.js | 130 +++++++++--------- .../components/department/departmentExtend.js | 31 ++++- pc4mobx/organization/stores/company.js | 1 + pc4mobx/organization/stores/companyextend.js | 60 +++++++- .../organization/stores/departmentextend.js | 52 +++++++ 7 files changed, 289 insertions(+), 73 deletions(-) create mode 100644 pc4mobx/organization/components/VersionsSlider.js diff --git a/pc4mobx/organization/apis/company.js b/pc4mobx/organization/apis/company.js index fc06b9c..9ab3932 100644 --- a/pc4mobx/organization/apis/company.js +++ b/pc4mobx/organization/apis/company.js @@ -91,4 +91,5 @@ export const getCompanyExtendForm = (params) => { export const getHasRight = (params) => { return WeaTools.callApi('/api/bs/hrmorganization/comp/getHasRight', 'GET', params); -} \ No newline at end of file +} + diff --git a/pc4mobx/organization/components/VersionsSlider.js b/pc4mobx/organization/components/VersionsSlider.js new file mode 100644 index 0000000..a1770e8 --- /dev/null +++ b/pc4mobx/organization/components/VersionsSlider.js @@ -0,0 +1,85 @@ +import { + WeaFormItem, + WeaTab, + WeaTableEdit +} from 'ecCom' + +import { + Spin, + Button, + Tooltip, + Row, Col, Select +} from 'antd' + + +import { chunk, isEmpty } from 'lodash'; +import { toJS } from "mobx"; +const Option = Select.Option; + +export default class VersionsSlider extends React.Component { + + componentDidMount() { + + } + + render() { + const { + versionList, + handleChange + } = this.props; + + const newData = chunk(versionList.datas, 2); + + + return ( +
+ + +

操作人: {versionList.operateName}

+ + +

操作时间: {versionList.operateTime}

+ + +
版本:
+ +
+ +
+ {newData.map((item, index) => { + return ( +
+ {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 97c53b7..a7968b6 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -1,20 +1,21 @@ /** * @Author: 程亮 * @Date: 2022-05-18 14:52:39 - * @LastEditTime: 2022-12-09 11:08:06 + * @LastEditTime: 2022-12-09 17:45:16 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js */ -import { Button, Modal, message, Row, Col, Spin } from 'antd'; -import isEmpty from 'lodash/isEmpty' +import { Button, Modal, message, Row, Col, Spin, Select,Tooltip } from 'antd'; +import { chunk,isEmpty } from 'lodash'; import cloneDeep from 'lodash/cloneDeep' import forEach from 'lodash/forEach' -import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop,WeaSlideModal } from 'ecCom' +import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop, WeaSlideModal } from 'ecCom' import { WeaSwitch } from 'comsMobx'; import { inject, observer } from 'mobx-react'; import * as mobx from 'mobx'; import { i18n } from '../../public/i18n'; import '../../style/common.less'; +import VersionsSlider from '../VersionsSlider'; const toJS = mobx.toJS; import '../../style/common.less'; @@ -184,7 +185,7 @@ export default class CompanyExtend extends React.Component { content: i18n.button.version(), key: 'view', onClick: key => { - this.editCard(); + this.view(); } } ] @@ -242,6 +243,7 @@ export default class CompanyExtend extends React.Component { companyExtend.open = false; } + changeData(key) { const { companyExtend @@ -251,69 +253,69 @@ export default class CompanyExtend extends React.Component { render() { const { companyExtend } = this.props; - const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey, isEditor, open } = companyExtend; + const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey, isEditor, open, versionList } = companyExtend; - //try { - return ( -
- - } - iconBgcolor='#217346' - buttons={this.getTopButtons()} - showDropIcon={true} - dropMenuDatas={this.getRightMenu()} + try { + return ( +
+ - - - {this.getSearchs()} - { - !isEmpty(tabInfo) &&
- { - companyExtend.updateDetailSelectedKey(v); - }} - /> - {this.getTabChildren()} -
- } -
- - - + } + iconBgcolor='#217346' + buttons={this.getTopButtons()} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + > + + + {this.getSearchs()} + { + !isEmpty(tabInfo) &&
+ { + companyExtend.updateDetailSelectedKey(v); + }} + /> + {this.getTabChildren()} +
+ } +
-
- console.log('onAnimationEnd')}/> - -
- ) - //} - // catch (e) { - // return - //
{i18n.message.authFailed()}
- //
- // } +
+ +
+ + companyExtend.changeVersion(val)}/>} + onClose={this.onClose} + onAnimationEnd={() => console.log('onAnimationEnd')} /> +
+ ) + } + catch (e) { + return +
{i18n.message.authFailed()}
+
+ } } } diff --git a/pc4mobx/organization/components/department/departmentExtend.js b/pc4mobx/organization/components/department/departmentExtend.js index a310b69..6c20f50 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-06-29 17:42:27 + * @LastEditTime: 2022-12-09 17:46:00 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/departmentExtend.js */ @@ -11,12 +11,13 @@ import { Button, Modal, message, Row, Col, Spin } from 'antd'; import isEmpty from 'lodash/isEmpty' import cloneDeep from 'lodash/cloneDeep' import forEach from 'lodash/forEach' -import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop } from 'ecCom' +import { WeaAlertPage, WeaTools, WeaTableEdit, WeaSearchGroup, WeaRightMenu, WeaFormItem, WeaTab, WeaTop,WeaSlideModal } from 'ecCom' import { WeaSwitch } from 'comsMobx'; import { inject, observer } from 'mobx-react'; import * as mobx from 'mobx'; import { i18n } from '../../public/i18n'; import AttachToNumberField from "../NewNumberField"; +import VersionsSlider from '../VersionsSlider'; const toJS = mobx.toJS; import '../../style/common.less'; @@ -40,6 +41,11 @@ export default class DepartmentExtendStore extends React.Component { departmentExtend.getData(); } + view = () => { + const { departmentExtend } = this.props; + departmentExtend.open = true; + } + getTabChildren = () => { const { departmentExtend } = this.props; let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = departmentExtend; @@ -179,6 +185,13 @@ export default class DepartmentExtendStore extends React.Component { onClick: key => { this.editCard(); } + }, { + icon: , + content: i18n.button.version(), + key: 'view', + onClick: key => { + this.view(); + } } ] } @@ -193,6 +206,8 @@ export default class DepartmentExtendStore extends React.Component { const save = ; const back = ; const edit = ; + const view = ; + const btns = []; try { if (isEditor) { @@ -203,6 +218,7 @@ export default class DepartmentExtendStore extends React.Component { } else { if (buttons.hasEdit) { btns.push(edit); + btns.push(view); } } } catch (e) { } @@ -232,7 +248,7 @@ export default class DepartmentExtendStore extends React.Component { render() { const { departmentExtend } = this.props; - const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey,isEditor } = departmentExtend; + const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey,isEditor,open, versionList } = departmentExtend; try { return ( @@ -274,6 +290,15 @@ export default class DepartmentExtendStore extends React.Component { + departmentExtend.changeVersion(val)}/> : ''} + onClose={this.onClose} + onAnimationEnd={() => console.log('onAnimationEnd')} /> ) diff --git a/pc4mobx/organization/stores/company.js b/pc4mobx/organization/stores/company.js index 813a65e..077cc2c 100644 --- a/pc4mobx/organization/stores/company.js +++ b/pc4mobx/organization/stores/company.js @@ -312,6 +312,7 @@ export class CompanyStore { return true; } + setIds(ids) { this.ids = ids; } diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index 7729e26..ddb4d46 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -79,9 +79,10 @@ export class CompanyExtendStore { editResource = () => { let pDatas = this.form.getFormParams(); - Api.editResource({ ...{ + Api.editResource({ + ...{ id: this.id, - viewCondition:this.selectedKey + viewCondition: this.selectedKey }, ...pDatas, ...this.getTableEditParams() @@ -125,7 +126,7 @@ export class CompanyExtendStore { let params = { viewAttr: this.isEditor ? 2 : 1, id: this.id, - viewCondition:this.selectedKey + viewCondition: this.selectedKey } Api.getCompanyExtendForm(params).then((res) => { if (res.code === 200) { @@ -145,7 +146,7 @@ export class CompanyExtendStore { message.warning(error.msg); }) - + } @@ -175,6 +176,10 @@ export class CompanyExtendStore { if (!isEmpty(this.tabInfo)) this.detailSelectedKey = this.tabInfo[0].key; } + changeVersion = data => { + debugger + } + setLoading(val) { this.loading = val; } @@ -184,7 +189,7 @@ export class CompanyExtendStore { this.tabKey = key; } - updateDetailSelectedKey =(key) => { + updateDetailSelectedKey = (key) => { this.detailSelectedKey = key; } @@ -240,4 +245,49 @@ 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: '产品运营' + } + ] + + + + } + } diff --git a/pc4mobx/organization/stores/departmentextend.js b/pc4mobx/organization/stores/departmentextend.js index 806607d..1371ac9 100644 --- a/pc4mobx/organization/stores/departmentextend.js +++ b/pc4mobx/organization/stores/departmentextend.js @@ -28,6 +28,8 @@ export class DepartmentExtendStore { @observable selectedRowKeys = []; @observable selectedRows = []; + @observable open = false; + @action onRowSelect = (keys) => { this.setSelectedRowKeys(keys); } @@ -168,6 +170,11 @@ export class DepartmentExtendStore { if (!isEmpty(this.tabInfo)) this.detailSelectedKey = this.tabInfo[0].key; } + changeVersion = data => { + debugger + } + + setLoading(val) { this.loading = val; } @@ -233,5 +240,50 @@ 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: '产品运营' + } + ] + + + + } + } From a7094709215fb8f11fd8821c320072a5d04a1de6 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 13 Dec 2022 17:25:28 +0800 Subject: [PATCH 2/2] test --- pc4mobx/organization/components/department/department.js | 5 ++--- pc4mobx/organization/components/job/Job.js | 6 +++--- pc4mobx/organization/public/i18n.js | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pc4mobx/organization/components/department/department.js b/pc4mobx/organization/components/department/department.js index 62b9228..341678b 100644 --- a/pc4mobx/organization/components/department/department.js +++ b/pc4mobx/organization/components/department/department.js @@ -1,7 +1,7 @@ /** * @Author: 程亮 * @Date: 2022-06-02 09:19:37 - * @LastEditTime: 2022-12-09 11:47:53 + * @LastEditTime: 2022-12-13 16:00:41 * @Description: * @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js */ @@ -535,8 +535,7 @@ export default class Department extends React.Component { let tree = ( getLabel(386246, '新建人员资料类型'), editResourceBasicInfo: () => getLabel(386246, '编辑人员资料'), editResourceBasicType: () => getLabel(386246, '编辑人员资料类型'), - forbidden: () => getLabel(531114, '已禁用'), + forbidden: () => getLabel(531114, '已封存'), mangerDetachName: () => getLabel(385936, '模块管理分权'), newManagerDetach: () => getLabel(386246, '新建模块管理分权'), editManagerDetach: () => getLabel(386247, '编辑模块管理分权'),