!45 需求优化

Merge pull request !45 from reset/feature/cl
This commit is contained in:
reset 2022-06-23 03:55:20 +00:00 committed by Gitee
commit 8de8feb216
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
12 changed files with 178 additions and 63 deletions

View File

@ -54,14 +54,15 @@ export default class NewAndEditDialog extends React.Component {
}
onChange = data => {
const {
bindChangeEnvent,
} = this.props;
if(this.state.enable && data.schemeId) {
const {
condition,
form,
bindChangeEnvent,
} = this.props;
bindChangeEnvent(data.schemeId.value);
}
if(this.state.enable && data.planYear){
bindChangeEnvent(data.planYear.value);
}
};
@ -118,12 +119,14 @@ export default class NewAndEditDialog extends React.Component {
isEdit,
height,
conditionLen,
saveAndSetting
} = this.props, {
width,
} = this.state;
const buttons = [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jd6baw`} type="primary" onClick={() => save()} disabled={loading}>{i18n.button.save()}</Button>),
(saveAndSetting && <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jd6baw`} type="primary" onClick={() => save()} disabled={loading}>{i18n.button.saveAndSetting()}</Button>),
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@e4f4n1`} />)
];

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-05-18 16:23:32
* @LastEditTime: 2022-06-22 15:13:10
* @LastEditTime: 2022-06-23 11:49:05
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
*/
@ -47,7 +47,6 @@ import { renderNoright } from '../../util';
const toJS = mobx.toJS;
const confirm = Modal.confirm;
//const WeaTable = WeaTableNew.WeaTable
@inject('company')
@ -132,13 +131,17 @@ export default class Company extends React.Component {
const {
company
} = this.props;
company.setNeDialogTitle(i18n.label.companyName());
company.setVisible(true);
company.setDialogLoadingStatus(true);
company.getDeptTable(id);
}
//查看
view(id) {
window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${id}`, "_blank")
}
batchDelete() {
const {
company
@ -277,6 +280,9 @@ export default class Company extends React.Component {
<Menu.Item key="2">
<a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查部门</a>
</Menu.Item>
<Menu.Item key="3">
<a href='javascript:void(0);' onClick={() => { _this.view(record.id) }}>查看</a>
</Menu.Item>
</Menu>
)
return <Dropdown overlay={menu}>
@ -324,6 +330,13 @@ export default class Company extends React.Component {
company.save();
}
handleSaveAndSetting() {
const {
company
} = this.props;
company.save();
}
getTabBtn() {
const {
company
@ -516,6 +529,7 @@ export default class Company extends React.Component {
save={() => this.handleSave()}
onCancel={() => company.setNewVisible(false)}
enable={false} //是否开启字段联动
saveAndSetting = {() => this.handleSaveAndSetting()}
/>
</div>
)

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-06-02 09:19:37
* @LastEditTime: 2022-06-22 16:42:37
* @LastEditTime: 2022-06-23 11:49:38
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/department/department.js
*/
@ -162,7 +162,6 @@
const {
department
} = this.props;
department.setNeDialogTitle(i18n.label.transferDept());
department.setConfirmVisible(true);
department.setIds(id);
@ -170,6 +169,11 @@
department.getTransferForm(id);
}
//查看
view(id) {
window.open(`/spa/organization/static/index.html#/main/organization/departmentExtend/${id}`, "_blank")
}
copy() {
const {
@ -348,6 +352,9 @@
c.render = function (text, record) {
const menu = (
<Menu>
<Menu.Item key="0">
<a href='javascript:void(0);' onClick={() => { _this.view(record.id) }}>查看</a>
</Menu.Item>
<Menu.Item key="1" disabled={record.isUsed === 0 ? false : true} style={record.isUsed === 0 ? {display:'block'} : {display:'none'}}>
<a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
</Menu.Item>
@ -388,6 +395,10 @@
department.save();
}
handleSaveAndSetting() {
}
PopconfirmSave() {
const {
department
@ -648,6 +659,7 @@
save={() => this.handleSave()}
onCancel={() => department.setNewVisible(false)}
enable={false} //是否开启字段联动
saveAndSetting = {() => this.handleSaveAndSetting()}
/>
<NewPopconfirm ecId={`${this && this.props && this.props.ecId || ''}_NewPopconfirm@q4rrwm`}
title={nEdialogTitle}

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-05-26 14:05:59
* @LastEditTime: 2022-06-22 16:43:08
* @LastEditTime: 2022-06-23 11:50:44
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/Job.js
*/
@ -321,10 +321,13 @@ export default class Job extends React.Component {
c.render = function (text, record) {
const menu = (
<Menu>
<Menu.Item key="0">
<a href='javascript:void(0);' onClick={() => { _this.view(record.id) }}>查看</a>
</Menu.Item>
<Menu.Item key="1" disabled={record.isUsed === 0 ? false : true} style={record.isUsed === 0 ? {display:'block'} : {display:'none'}}>
<a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
</Menu.Item>
<Menu.Item>
<Menu.Item key="2">
<a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查人员</a>
</Menu.Item>
</Menu>
@ -347,6 +350,10 @@ export default class Job extends React.Component {
this.showConfirm('del');
}
view(id) {
window.open(`/spa/organization/static/index.html#/main/organization/jobExtend/${id}`, "_blank")
}
handleSave() {
const {
@ -355,6 +362,10 @@ export default class Job extends React.Component {
job.save();
}
handleSaveAndSetting() {
}
getTabBtn() {
const {
job
@ -604,6 +615,7 @@ export default class Job extends React.Component {
save={() => this.handleSave()}
onCancel={() => job.setNewVisible(false)}
enable={false} //是否开启字段联动
saveAndSetting = {() => this.handleSaveAndSetting()}
/>
</div>
)

View File

@ -321,6 +321,10 @@ export default class Resource extends React.Component {
!isNew && resource.edit();
}
handleSaveAndSetting() {
}
getPanelComponents() {
const {
resource
@ -448,6 +452,7 @@ export default class Resource extends React.Component {
save={() => this.handleSave()}
onCancel={() => resource.setVisible(false)}
enable={false} //是否开启字段联动
saveAndSetting = {() => this.handleSaveAndSetting()}
/>
</div>
)

View File

@ -9,6 +9,8 @@ import {
WeaTab,
WeaFormItem,
WeaRightMenu,
WeaLeftRightLayout,
WeaOrgTree
} from 'ecCom'
import {
Row,
@ -218,10 +220,40 @@ export default class Staff extends React.Component {
reRenderColumns(columns) {
let _this = this;
// columns.forEach((c, index) => {
// })
}
getTree = () => {
const {
staff
} = this.props;
const {
companysId,
} = staff
let tree = (
<WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@dhi1ro`}
ref='WeaOrgTree'
dataUrl={"/api/bs/hrmorganization/job/getSearchTree"}
loading
needSearch
noCache={true}
needDropMenu={false}
//onSelect={this.selectVirtual} //组织维度回调函数
isLoadSubDepartment={true}
topPrefix={'hrmSearch'}
companysId={companysId}
inputLeftDom={`<b>${i18n.label.organization()}</b>`}
treeNodeClick={this.treeNodeClick}
expandAllChildrenOnSearch={true}
/>
)
return tree;
}
onOperatesClick(record, rowIndex, operate) {
const {
@ -236,7 +268,7 @@ export default class Staff extends React.Component {
const {
staff
} = this.props;
staff.setNeDialogTitle(i18n.label.editStaff());
staff.setStaffId(id);
staff.setOperateType("1");
@ -249,7 +281,7 @@ export default class Staff extends React.Component {
const {
staff
} = this.props;
staff.setNeDialogTitle(i18n.label.changeStaff());
staff.setStaffId(id);
staff.setOperateType("2");
@ -310,29 +342,29 @@ export default class Staff extends React.Component {
isFormInit && searchCondition.map(c => {
c.items.map((field, index) => {
arr.push(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} span={(index%2 == 0) ? 10 : 11} offset={1}>
<div style={{marginTop: 20}}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
label={`${field.label}`}
labelCol={{span: `${field.labelcol}`}}
wrapperCol={{span: `${field.fieldcol}`}}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
</WeaFormItem>
</div>
</Col>)
arr.push(<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4cc308@${index}`} span={(index % 2 == 0) ? 10 : 11} offset={1}>
<div style={{ marginTop: 20 }}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
label={`${field.label}`}
labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{ span: `${field.fieldcol}` }}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
</WeaFormItem>
</div>
</Col>)
})
})
if (searchConditionLoading) {
return (
<div className='hrm-loading-center-small' style={{top:'25%'}}>
<div className='hrm-loading-center-small' style={{ top: '25%' }}>
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@lbktzb`} spinning={searchConditionLoading}></Spin>
</div>
)
} else {
return <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ppeb6z`} onKeyDown={(e) => {
if ( e.keyCode == 13 && e.target.tagName === "INPUT") {
staff.getTableInfo();
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
staff.getTableInfo();
staff.setPanelStatus(false)
}
}}>{arr}</Row>
@ -357,8 +389,8 @@ export default class Staff extends React.Component {
staff
} = this.props;
const {
isPanelShow, form2, staffName, conditionNum, tableStore,nEdialogTitle,visible,condition,
form,dialogLoading,isEdit,date,hasRight
isPanelShow, form2, staffName, conditionNum, tableStore, nEdialogTitle, visible, condition,
form, dialogLoading, isEdit, date, hasRight
} = staff;
if (hasRight === false) {
@ -381,29 +413,32 @@ export default class Staff extends React.Component {
dropMenuDatas={this.getDropMenuDatas()}
onDropMenuClick={(e) => this.handleMenuClick(e)}
>
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
searchType={['base', 'advanced']}
showSearchAd={isPanelShow}
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? staffName : form2.getFormParams().staffName}
setShowSearchAd={bool => staff.setPanelStatus(bool)}
hideSearchAd={() => staff.setPanelStatus(false)}
searchsAd= {isPanelShow ? this.getPanelComponents() : <div></div>}
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
hasMask={false}
buttonsAd={this.getTabBtn()}
onSearch={() => staff.getTableInfo()}
onSearchChange={val => this.onSearchChange(val)}
/>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
comsWeaTableStore={tableStore}
hasOrder={true}
needScroll={true}
getColumns={c => this.reRenderColumns(c)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
/>
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@7muhhb`} isNew={true} showLeft={true} leftCom={this.getTree()}>
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
searchType={['base', 'advanced']}
showSearchAd={isPanelShow}
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? staffName : form2.getFormParams().staffName}
setShowSearchAd={bool => staff.setPanelStatus(bool)}
hideSearchAd={() => staff.setPanelStatus(false)}
searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
hasMask={false}
buttonsAd={this.getTabBtn()}
onSearch={() => staff.getTableInfo()}
onSearchChange={val => this.onSearchChange(val)}
/>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
comsWeaTableStore={tableStore}
hasOrder={true}
needScroll={true}
getColumns={c => this.reRenderColumns(c)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
/>
</WeaLeftRightLayout>
</WeaTop>
</WeaRightMenu>
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}
title={nEdialogTitle}
visible={visible}
condition={toJS(condition)}

View File

@ -435,7 +435,8 @@ export default class StaffScheme extends React.Component {
conditionLen={3}
save={() => this.handleSave()}
onCancel={() => staffScheme.setVisible(false)}
enable={false} //是否开启字段联动
enable={true} //是否开启字段联动
bindChangeEnvent={val => staffScheme.updateConditions(val)}
/>
</div>
)

View File

@ -65,12 +65,14 @@ export class DepartmentStore {
@observable isMerge = true;
@observable hasRight = '';
@observable selectTreeNodeInfo;
@action
getTableInfo(params) {
getTableInfo() {
this.setLoading(true);
params = {
...params,
let params = {
...this.selectTreeNodeInfo,
current: this.current,
pageSize: this.pageSize
}
@ -106,8 +108,11 @@ export class DepartmentStore {
@action("nodetree事件")
doSearch(params) {
this.selectTreeNodeInfo = params;
this.setCurrent(1);
this.setPageSize(10);
this.setInit(true);
this.getTableInfo(params);
this.getTableInfo();
}
@action("联查岗位")
@ -371,7 +376,7 @@ export class DepartmentStore {
updateFields(val) {
this.form.updateFields({
compName: {
departmentName: {
value: val
}
});

View File

@ -1,7 +1,7 @@
/**
* @Author: 程亮
* @Date: 2022-06-09 10:16:00
* @LastEditTime: 2022-06-20 11:07:43
* @LastEditTime: 2022-06-23 09:58:27
* @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/stores/fieldDefined.js
*/

View File

@ -60,12 +60,14 @@ export class JobStore {
@observable companysId = 1
@observable hasRight = '';
@observable selectTreeNodeInfo;
@action
getTableInfo(params) {
getTableInfo() {
this.setLoading(true);
params = {
...params,
let params = {
...this.selectTreeNodeInfo,
current: this.current,
pageSize: this.pageSize
}
@ -101,8 +103,11 @@ export class JobStore {
@action("nodetree事件")
doSearch(params) {
this.selectTreeNodeInfo = params;
this.setCurrent(1);
this.setPageSize(10);
this.setInit(true);
this.getTableInfo(params);
this.getTableInfo();
}
@action("联查人员")

View File

@ -46,7 +46,7 @@ export class StaffStore {
@observable date = '';
@observable hasRight = '';
@observable operateType = ''; //1 编辑 2 变更
@observable companysId = 1;
@action

View File

@ -17,6 +17,9 @@ import {
import {
i18n
} from '../public/i18n';
import {
findIndex
} from 'lodash';
const toJS = mobx.toJS;
const {
@ -216,6 +219,26 @@ export class StaffSchemeStore {
})
}
updateConditions(val) {
const timeStartValue = val+'-01-01';
const timeEndValue = val+'-12-31'
// const label = "年度"
// let item = findIndex(this.condition[0].items,{label});
this.form.updateFields({
timeStart: {
value: timeStartValue
}
});
this.form.updateFields({
timeEnd: {
value: timeEndValue
}
});
}
updateFields(val) {
this.form2.updateFields({
planName: {