!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 => { onChange = data => {
const {
bindChangeEnvent,
} = this.props;
if(this.state.enable && data.schemeId) { if(this.state.enable && data.schemeId) {
const {
condition,
form,
bindChangeEnvent,
} = this.props;
bindChangeEnvent(data.schemeId.value); 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, isEdit,
height, height,
conditionLen, conditionLen,
saveAndSetting
} = this.props, { } = this.props, {
width, width,
} = this.state; } = this.state;
const buttons = [ const buttons = [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jd6baw`} type="primary" onClick={() => save()} disabled={loading}>{i18n.button.save()}</Button>), (<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`} />) (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@e4f4n1`} />)
]; ];

View File

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

View File

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

View File

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

View File

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

View File

@ -9,6 +9,8 @@ import {
WeaTab, WeaTab,
WeaFormItem, WeaFormItem,
WeaRightMenu, WeaRightMenu,
WeaLeftRightLayout,
WeaOrgTree
} from 'ecCom' } from 'ecCom'
import { import {
Row, Row,
@ -222,6 +224,36 @@ export default class Staff extends React.Component {
// }) // })
} }
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) { onOperatesClick(record, rowIndex, operate) {
const { const {
@ -310,28 +342,28 @@ export default class Staff extends React.Component {
isFormInit && searchCondition.map(c => { isFormInit && searchCondition.map(c => {
c.items.map((field, index) => { 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}> 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}}> <div style={{ marginTop: 20 }}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`} <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u6ex85@${index}`}
label={`${field.label}`} label={`${field.label}`}
labelCol={{span: `${field.labelcol}`}} labelCol={{ span: `${field.labelcol}` }}
wrapperCol={{span: `${field.fieldcol}`}}> wrapperCol={{ span: `${field.fieldcol}` }}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />} {<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@p7d3td@${index}`} fieldConfig={field} form={form2} formParams={formParams} />}
</WeaFormItem> </WeaFormItem>
</div> </div>
</Col>) </Col>)
}) })
}) })
if (searchConditionLoading) { if (searchConditionLoading) {
return ( 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> <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@lbktzb`} spinning={searchConditionLoading}></Spin>
</div> </div>
) )
} else { } else {
return <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ppeb6z`} onKeyDown={(e) => { return <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ppeb6z`} onKeyDown={(e) => {
if ( e.keyCode == 13 && e.target.tagName === "INPUT") { if (e.keyCode == 13 && e.target.tagName === "INPUT") {
staff.getTableInfo(); staff.getTableInfo();
staff.setPanelStatus(false) staff.setPanelStatus(false)
} }
@ -357,8 +389,8 @@ export default class Staff extends React.Component {
staff staff
} = this.props; } = this.props;
const { const {
isPanelShow, form2, staffName, conditionNum, tableStore,nEdialogTitle,visible,condition, isPanelShow, form2, staffName, conditionNum, tableStore, nEdialogTitle, visible, condition,
form,dialogLoading,isEdit,date,hasRight form, dialogLoading, isEdit, date, hasRight
} = staff; } = staff;
if (hasRight === false) { if (hasRight === false) {
@ -381,26 +413,29 @@ export default class Staff extends React.Component {
dropMenuDatas={this.getDropMenuDatas()} dropMenuDatas={this.getDropMenuDatas()}
onDropMenuClick={(e) => this.handleMenuClick(e)} onDropMenuClick={(e) => this.handleMenuClick(e)}
> >
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`} <WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@7muhhb`} isNew={true} showLeft={true} leftCom={this.getTree()}>
searchType={['base', 'advanced']}
showSearchAd={isPanelShow} <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? staffName : form2.getFormParams().staffName} searchType={['base', 'advanced']}
setShowSearchAd={bool => staff.setPanelStatus(bool)} showSearchAd={isPanelShow}
hideSearchAd={() => staff.setPanelStatus(false)} searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? staffName : form2.getFormParams().staffName}
searchsAd= {isPanelShow ? this.getPanelComponents() : <div></div>} setShowSearchAd={bool => staff.setPanelStatus(bool)}
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} hideSearchAd={() => staff.setPanelStatus(false)}
hasMask={false} searchsAd={isPanelShow ? this.getPanelComponents() : <div></div>}
buttonsAd={this.getTabBtn()} advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
onSearch={() => staff.getTableInfo()} hasMask={false}
onSearchChange={val => this.onSearchChange(val)} buttonsAd={this.getTabBtn()}
/> onSearch={() => staff.getTableInfo()}
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`} onSearchChange={val => this.onSearchChange(val)}
comsWeaTableStore={tableStore} />
hasOrder={true} <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
needScroll={true} comsWeaTableStore={tableStore}
getColumns={c => this.reRenderColumns(c)} hasOrder={true}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)} needScroll={true}
/> getColumns={c => this.reRenderColumns(c)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
/>
</WeaLeftRightLayout>
</WeaTop> </WeaTop>
</WeaRightMenu> </WeaRightMenu>
<NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`} <NewAndEditDialog ecId={`${this && this.props && this.props.ecId || ''}_NewAndEditDialog@q4rrwm`}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,6 +17,9 @@ import {
import { import {
i18n i18n
} from '../public/i18n'; } from '../public/i18n';
import {
findIndex
} from 'lodash';
const toJS = mobx.toJS; const toJS = mobx.toJS;
const { 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) { updateFields(val) {
this.form2.updateFields({ this.form2.updateFields({
planName: { planName: {