另存为版本
This commit is contained in:
parent
27729bf7c0
commit
458606d1a4
|
|
@ -45,6 +45,10 @@ export const add = (params) => {
|
|||
return WeaTools.callApi('/api/bs/hrmorganization/comp/saveBaseComp', 'POST', params);
|
||||
}
|
||||
|
||||
export const version = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/version/subcompanyfielddefined/save', 'POST', params);
|
||||
}
|
||||
|
||||
export const editResource = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/comp/updateComp', 'POST', params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ export const getMergeForm = (params) => {
|
|||
return WeaTools.callApi('/api/bs/hrmorganization/dept/getMergeForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const version = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/version/departmentfielddefined/save', 'POST', params);
|
||||
}
|
||||
|
||||
export const getTransferForm = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/dept/getMoveForm', 'GET', params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ export const getResourceExtendForm = (params) => {
|
|||
return WeaTools.callApi('/api/bs/hrmorganization/hrmresource/getBaseForm', 'GET', params);
|
||||
}
|
||||
|
||||
export const version = (params) => {
|
||||
return WeaTools.callApi('/api/bs/hrmorganization/version/resourcefielddefined/save', 'POST', params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const exportResource = (ids) => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-18 14:52:39
|
||||
* @LastEditTime: 2022-10-12 18:01:56
|
||||
* @LastEditTime: 2022-12-09 11:08:06
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js
|
||||
*/
|
||||
|
|
@ -9,7 +9,7 @@ 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';
|
||||
|
|
@ -30,9 +30,9 @@ export default class CompanyExtend extends React.Component {
|
|||
this.init();
|
||||
}
|
||||
init = () => {
|
||||
const { companyExtend,company } = this.props;
|
||||
const { companyExtend, company } = this.props;
|
||||
//const {id} = company;
|
||||
let {hash} = window.location;
|
||||
let { hash } = window.location;
|
||||
hash = hash.split("?")[0];
|
||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||
companyExtend.init();
|
||||
|
|
@ -42,14 +42,14 @@ export default class CompanyExtend extends React.Component {
|
|||
|
||||
getTabChildren = () => {
|
||||
const { companyExtend } = this.props;
|
||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys,detailSelectedKey } = companyExtend;
|
||||
let { tableInfo, isEditor, tabkey, onRowSelect, selectedRowKeys, detailSelectedKey } = companyExtend;
|
||||
let tabChildren = [];
|
||||
tableInfo = toJS(tableInfo);
|
||||
tableInfo && tableInfo.map((t, i) => {
|
||||
if (detailSelectedKey == i) {
|
||||
tabChildren.push(
|
||||
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@b813my@${i}`}
|
||||
ref={(ref)=>companyExtend.setPersonalEditTables(ref)}
|
||||
ref={(ref) => companyExtend.setPersonalEditTables(ref)}
|
||||
showTitle={isEditor}
|
||||
// title={'列表信息'}
|
||||
//addFirstRow={isEditor}
|
||||
|
|
@ -128,7 +128,7 @@ export default class CompanyExtend extends React.Component {
|
|||
labelCol={{ span: `${field.labelcol}` }}
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@d4vaqk@${j}`} fieldConfig={field} form={form} />
|
||||
{field.domkey[0] == 'comp_no' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true}/>}
|
||||
{field.domkey[0] == 'comp_no' && field.viewAttr != '1' && <AttachToNumberField field={field} form={form} isEdit={true} />}
|
||||
</WeaFormItem>),
|
||||
colSpan: 1
|
||||
});
|
||||
|
|
@ -179,6 +179,13 @@ export default class CompanyExtend extends React.Component {
|
|||
onClick: key => {
|
||||
this.editCard();
|
||||
}
|
||||
}, {
|
||||
icon: <i className='icon-coms-common' />,
|
||||
content: i18n.button.version(),
|
||||
key: 'view',
|
||||
onClick: key => {
|
||||
this.editCard();
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -193,6 +200,7 @@ export default class CompanyExtend extends React.Component {
|
|||
const save = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pkes6y`} type="primary" onClick={this.saveEditCard} >{i18n.button.save()}</Button>;
|
||||
const back = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pl1fw8`} type="primary" onClick={this.backCard} >{i18n.button.back()}</Button>;
|
||||
const edit = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vkeda5`} type="primary" onClick={this.editCard} >{i18n.button.modify()}</Button>;
|
||||
const view = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vkeda5`} type="primary" onClick={this.view} >{i18n.button.version()}</Button>;
|
||||
const btns = [];
|
||||
try {
|
||||
if (isEditor) {
|
||||
|
|
@ -203,6 +211,7 @@ export default class CompanyExtend extends React.Component {
|
|||
} else {
|
||||
if (buttons.hasEdit) {
|
||||
btns.push(edit);
|
||||
btns.push(view);
|
||||
}
|
||||
}
|
||||
} catch (e) { }
|
||||
|
|
@ -223,66 +232,88 @@ export default class CompanyExtend extends React.Component {
|
|||
this.init();
|
||||
}
|
||||
|
||||
view = () => {
|
||||
const { companyExtend } = this.props;
|
||||
companyExtend.open = true;
|
||||
}
|
||||
|
||||
onClose = () => {
|
||||
const { companyExtend } = this.props;
|
||||
companyExtend.open = false;
|
||||
}
|
||||
|
||||
changeData(key) {
|
||||
const {
|
||||
companyExtend
|
||||
} = this.props;
|
||||
companyExtend.changeData(key);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { companyExtend } = this.props;
|
||||
const { loading, tabkey, tabInfo,topTab,selectedKey,date,detailSelectedKey,isEditor } = companyExtend;
|
||||
const { loading, tabkey, tabInfo, topTab, selectedKey, date, detailSelectedKey, isEditor, open } = companyExtend;
|
||||
|
||||
try {
|
||||
return (
|
||||
<div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||
datas={this.getRightMenu()}
|
||||
//try {
|
||||
return (
|
||||
<div className='hrm-my-cardInfo' style={{ height: '100%', position: 'relative' }}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
|
||||
datas={this.getRightMenu()}
|
||||
>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||
loading={true}
|
||||
title={isEditor ? i18n.label.updateCompany() : i18n.label.viewCompany()}
|
||||
icon={<i className='icon-coms-hrm' />}
|
||||
iconBgcolor='#217346'
|
||||
buttons={this.getTopButtons()}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getRightMenu()}
|
||||
>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
|
||||
loading={true}
|
||||
title={isEditor ? i18n.label.updateCompany() : i18n.label.viewCompany()}
|
||||
icon={<i className='icon-coms-hrm' />}
|
||||
iconBgcolor='#217346'
|
||||
buttons={this.getTopButtons()}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getRightMenu()}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
keyParam="viewCondition" //主键
|
||||
selectedKey={selectedKey}
|
||||
onChange={this.changeData.bind(this)}
|
||||
/>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}>
|
||||
{this.getSearchs()}
|
||||
{
|
||||
!isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`}
|
||||
type='card'
|
||||
keyParam='key'
|
||||
datas={toJS(tabInfo)}
|
||||
selectedKey={detailSelectedKey}
|
||||
onChange={v => {
|
||||
companyExtend.updateDetailSelectedKey(v);
|
||||
}}
|
||||
/>
|
||||
{this.getTabChildren()}
|
||||
</div>
|
||||
}
|
||||
</Spin>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
|
||||
datas={topTab}
|
||||
keyParam="viewCondition" //主键
|
||||
selectedKey={selectedKey}
|
||||
onChange={this.changeData.bind(this)}
|
||||
/>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4fj4z2`} spinning={loading}>
|
||||
{this.getSearchs()}
|
||||
{
|
||||
!isEmpty(tabInfo) && <div className='hrm-my-cardInfo_detial_tabs'>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vjrq63`}
|
||||
type='card'
|
||||
keyParam='key'
|
||||
datas={toJS(tabInfo)}
|
||||
selectedKey={detailSelectedKey}
|
||||
onChange={v => {
|
||||
companyExtend.updateDetailSelectedKey(v);
|
||||
}}
|
||||
/>
|
||||
{this.getTabChildren()}
|
||||
</div>
|
||||
}
|
||||
</Spin>
|
||||
|
||||
|
||||
</WeaTop>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
catch (e) {
|
||||
return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}>
|
||||
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
||||
</WeaAlertPage>
|
||||
}
|
||||
</WeaRightMenu>
|
||||
|
||||
<WeaSlideModal visible={open}
|
||||
top={6}
|
||||
width={40}
|
||||
height={94}
|
||||
direction={'right'}
|
||||
measure={'%'}
|
||||
onClose={this.onClose}
|
||||
onAnimationEnd={() => console.log('onAnimationEnd')}/>
|
||||
|
||||
</div>
|
||||
)
|
||||
//}
|
||||
// catch (e) {
|
||||
// return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}>
|
||||
// <div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
||||
// </WeaAlertPage>
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-18 16:23:32
|
||||
* @LastEditTime: 2022-12-08 14:09:12
|
||||
* @LastEditTime: 2022-12-09 11:36:44
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
|
||||
*/
|
||||
|
|
@ -174,6 +174,24 @@ export default class Company extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
version(record) {
|
||||
const {
|
||||
company
|
||||
} = this.props;
|
||||
confirm({
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
content: `确认将{${record.subCompanyDesc}}存为新版本?`,
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel(),
|
||||
onOk() {
|
||||
company.version(record);
|
||||
},
|
||||
onCancel() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getTransferForm() {
|
||||
const {
|
||||
company
|
||||
|
|
@ -348,6 +366,9 @@ export default class Company extends React.Component {
|
|||
<Menu.Item key="4">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.transfer(record.id) }}>转移</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="5">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.version(record) }}>另存为版本</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
return <Dropdown overlay={menu}>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-06-02 09:19:37
|
||||
* @LastEditTime: 2022-12-08 14:02:45
|
||||
* @LastEditTime: 2022-12-09 11:47:53
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js
|
||||
*/
|
||||
|
|
@ -338,6 +338,25 @@ export default class Department extends React.Component {
|
|||
!this.isEmptyObject(form.getFormParams()) && department.updateFields(val);
|
||||
}
|
||||
|
||||
version(record) {
|
||||
const {
|
||||
department
|
||||
} = this.props;
|
||||
confirm({
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
content: `确认将{${record.departmentMark}}存为新版本?`,
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel(),
|
||||
onOk() {
|
||||
department.version(record);
|
||||
},
|
||||
onCancel() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
reRenderColumns(columns) {
|
||||
const {
|
||||
|
|
@ -382,6 +401,9 @@ export default class Department extends React.Component {
|
|||
<Menu.Item key="5">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.copy(record.id) }}>复制</a>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="6">
|
||||
<a href='javascript:void(0);' onClick={() => { _this.version(record) }}>另存为版本</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
return <Dropdown overlay={menu}>
|
||||
|
|
|
|||
|
|
@ -335,12 +335,31 @@ export default class Resource extends React.Component {
|
|||
index
|
||||
} = operate;
|
||||
(index == '0') && this.view(record.randomFieldId);
|
||||
(index == '1') && this.version(record);
|
||||
}
|
||||
|
||||
view(id) {
|
||||
window.open(`/spa/organization/static/index.html#/main/organization/resourceCard/${id}`);
|
||||
}
|
||||
|
||||
version(record) {
|
||||
const {
|
||||
resource
|
||||
} = this.props;
|
||||
confirm({
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
content: `确认将{${record.lastname}}存为新版本?`,
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel(),
|
||||
onOk() {
|
||||
resource.version(record);
|
||||
},
|
||||
onCancel() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
handleSave() {
|
||||
const {
|
||||
resource
|
||||
|
|
|
|||
|
|
@ -873,6 +873,7 @@ export const i18n = {
|
|||
createType: () => getLabel(30131, '新建类型'),
|
||||
editTypeInfo: () => getLabel(32732, '编辑类型'),
|
||||
nextStep:() => getLabel(30131, '下一步'),
|
||||
version:() => getLabel(30131, '查看历史版本'),
|
||||
|
||||
batchOpen: () => getLabel(534249, '批量解锁'),
|
||||
collect: () => getLabel(28111, '收藏'),
|
||||
|
|
|
|||
|
|
@ -265,6 +265,18 @@ export class CompanyStore {
|
|||
})
|
||||
}
|
||||
|
||||
@action("另存为版本") version(record) {
|
||||
Api.version(record).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success(res.msg);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
this.form.updateFields({
|
||||
subCompanyDesc: {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ export class CompanyExtendStore {
|
|||
@observable id = ''; //分部id
|
||||
@observable date = '';
|
||||
@observable personalEditTables;
|
||||
@observable tabkey = '0'
|
||||
@observable tabkey = '0';
|
||||
|
||||
@observable open = false;
|
||||
|
||||
|
||||
@observable selectedRowKeys = [];
|
||||
|
|
|
|||
|
|
@ -374,6 +374,18 @@ export class DepartmentStore {
|
|||
})
|
||||
}
|
||||
|
||||
@action("另存为版本") version(record) {
|
||||
Api.version(record).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success(res.msg);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
updateFields(val) {
|
||||
this.form.updateFields({
|
||||
|
|
|
|||
|
|
@ -167,6 +167,18 @@ const {
|
|||
this.tableStore.selectedRowKeys = [];
|
||||
}
|
||||
|
||||
@action("另存为版本") version(record) {
|
||||
Api.version(record).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success(res.msg);
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
updateFields(val) {
|
||||
this.form2.updateFields({
|
||||
lastName: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue