Merge pull request '花名搜索修复' (#56) from feature/cl into dev

Reviewed-on: http://221.226.25.34:3000/liang.cheng/trunk/pulls/56
This commit is contained in:
liang.cheng 2024-08-20 15:29:17 +08:00
commit 9974a6e738
8 changed files with 80 additions and 19 deletions

View File

@ -72,6 +72,9 @@ export default class NewAndEditDialog extends React.Component {
if (moduleName == 'staff' && data.planId) { if (moduleName == 'staff' && data.planId) {
bindChangeEnvent(data); bindChangeEnvent(data);
} }
if (moduleName == 'managerDetach' && data.managerType) {
bindChangeEnvent(data);
}
}; };
onBlur = data => { onBlur = data => {

View File

@ -9,7 +9,8 @@ import {
WeaTab, WeaTab,
WeaFormItem, WeaFormItem,
WeaRightMenu, WeaRightMenu,
WeaAlertPage WeaAlertPage,
WeaBrowser
} from 'ecCom' } from 'ecCom'
import { import {
Row, Row,
@ -234,9 +235,13 @@ export default class ManagerDetach extends React.Component {
reRenderColumns(columns) { reRenderColumns(columns) {
let _this = this; let _this = this;
// columns.forEach((c, index) => { columns.forEach((c, index) => {
if (c.dataIndex == 'manager_type') {
// }) c.render = function (text, record) {
return record.manager_type == "0" ? '人员' : '角色'
}
};
})
} }
doDetachSwitch(checked) { doDetachSwitch(checked) {
@ -430,10 +435,12 @@ export default class ManagerDetach extends React.Component {
isFormInit={form.isFormInit} isFormInit={form.isFormInit}
loading={dialogLoading} loading={dialogLoading}
isEdit={isEdit} isEdit={isEdit}
height={200} height={220}
conditionLen={1} conditionLen={1}
save={() => this.handleSave()} save={() => this.handleSave()}
onCancel={() => managerDetach.setVisible(false)} onCancel={() => managerDetach.setVisible(false)}
moduleName='managerDetach'
bindChangeEnvent={val => managerDetach.updateConditions(val)}
/> />
</div> </div>
) )

View File

@ -333,7 +333,8 @@ export default class Resource extends React.Component {
const btn = [ const btn = [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => {
resource.selectTreeNodeInfo = {};resource.setPanelStatus(false);resource.getTableInfo(); resource.isBaseValue = false;
resource.selectTreeNodeInfo = {}; resource.setPanelStatus(false);resource.getTableInfo();
}}>{i18n.button.search()}</Button>), }}>{i18n.button.search()}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} type="primary" onClick={() => this.saveTemplate()}>{i18n.button.saveTemplate()}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} type="primary" onClick={() => this.saveTemplate()}>{i18n.button.saveTemplate()}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju7`} type="primary" onClick={() => resource.openSearchDialog()}>{i18n.button.conditionSet()}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju7`} type="primary" onClick={() => resource.openSearchDialog()}>{i18n.button.conditionSet()}</Button>),
@ -546,7 +547,7 @@ export default class Resource extends React.Component {
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`} <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9c3zts`}
searchType={['base', 'advanced']} searchType={['base', 'advanced']}
showSearchAd={isPanelShow} showSearchAd={isPanelShow}
searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? lastName : form2.getFormParams().lastName} searchsBaseValue={this.isEmptyObject(form2.getFormParams()) ? lastName : form2.getFormParams()["-1_hrm_lastname"]}
searchsBasePlaceHolder='' searchsBasePlaceHolder=''
setShowSearchAd={bool => store.setPanelStatus(bool)} setShowSearchAd={bool => store.setPanelStatus(bool)}
hideSearchAd={() => store.setPanelStatus(false)} hideSearchAd={() => store.setPanelStatus(false)}
@ -555,8 +556,9 @@ export default class Resource extends React.Component {
hasMask={false} hasMask={false}
buttonsAd={this.getTabBtn()} buttonsAd={this.getTabBtn()}
onSearch={() => { onSearch={() => {
store.hideRadioGroup();store.getTableInfo(); store.isBaseValue = true;
}} store.hideRadioGroup();store.getTableInfo();
}}
onSearchChange={val => this.onSearchChange(val)} onSearchChange={val => this.onSearchChange(val)}
/> />
<Spin size="large" spinning={exSpinning} tip={getLabel(547647,'正在导出请稍候....')} className="hrm-loading-center-small"/> <Spin size="large" spinning={exSpinning} tip={getLabel(547647,'正在导出请稍候....')} className="hrm-loading-center-small"/>

View File

@ -75,7 +75,8 @@ export class JobStore {
@action initData() { @action initData() {
this.getHasRight(); this.getHasRight();
this.refresh(); this.getTableInfo();
//this.refresh();
// this.getCopyForm(); // this.getCopyForm();
// this.getMergeForm(); // this.getMergeForm();
} }

View File

@ -69,7 +69,7 @@ export class JobGradeStore {
@action initData = () => { @action initData = () => {
this.selectedTreeNodeInfo = null; this.selectedTreeNodeInfo = null;
this.treeConfig.treeExpandKeys.length = 0; //this.treeConfig.treeExpandKeys.length = 0;
Api.getTree().then(res => { Api.getTree().then(res => {
if (res.code === 200) { if (res.code === 200) {
if (res.data.length > 0) { if (res.data.length > 0) {

View File

@ -68,7 +68,7 @@ export class JobLevelStore {
@action initData = () => { @action initData = () => {
this.selectedTreeNodeInfo = null; this.selectedTreeNodeInfo = null;
this.treeConfig.treeExpandKeys.length = 0; //this.treeConfig.treeExpandKeys.length = 0;
Api.getTree().then(res => { Api.getTree().then(res => {
if (res.code === 200) { if (res.code === 200) {
if (res.data.length > 0) { if (res.data.length > 0) {

View File

@ -28,6 +28,7 @@ export class ManagerDetachStore {
@observable topMenu = [] @observable topMenu = []
@observable rightMenu = []; @observable rightMenu = [];
@observable condition = []; @observable condition = [];
fcondition = [];
@observable searchCondition = []; @observable searchCondition = [];
@observable isEdit = true; @observable isEdit = true;
@observable isNew = true; @observable isNew = true;
@ -93,10 +94,16 @@ export class ManagerDetachStore {
}) })
} }
@action("新建删除") save() { @action("新建保存") save() {
let params = { let params = {
...this.form.getFormParams() ...this.form.getFormParams()
}; };
if (params.managerType == "0" && params.ecManager == "") {
return message.error("管理员字段必填");
}
if (params.managerType == "1" && params.roleId == "") {
return message.error("角色字段必填");
}
this.form.validateForm().then(f => { this.form.validateForm().then(f => {
if (f.isValid) { if (f.isValid) {
Api.add(params).then(response => { Api.add(params).then(response => {
@ -152,6 +159,7 @@ export class ManagerDetachStore {
Api.getForm(params).then(res => { Api.getForm(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.setDialogLoadingStatus(false); this.setDialogLoadingStatus(false);
res.data.condition && this.setFcondition(res.data.condition);
res.data.condition && this.setCondition(res.data.condition); res.data.condition && this.setCondition(res.data.condition);
res.data.condition && this.form.initFormFields(res.data.condition); res.data.condition && this.form.initFormFields(res.data.condition);
} else { } else {
@ -213,6 +221,39 @@ export class ManagerDetachStore {
}); });
} }
updateConditions(data) {
this.form.updateFields({
ecManager: {
value: ''
},
roleId: {
value: ''
}
});
const type = data.managerType.value;
debugger
this.condition = this.fcondition;
switch(type) {
case '0':
this.condition[0].items = this.condition[0].items.filter(item => {
if(item.domkey[0] == 'ecManager'){
item.viewAttr = 3;
}
return item.domkey[0] != 'roleId';
});
break;
case '1':
this.condition[0].items = this.condition[0].items.filter(item => {
if(item.domkey[0] == 'roleId'){
item.viewAttr = 3;
}
return item.domkey[0] != 'ecManager';
})
}
this.setCondition(this.condition);
this.form.initFormFields(this.condition);
}
setSearchCondition(condition) { setSearchCondition(condition) {
this.searchCondition = condition; this.searchCondition = condition;
} }
@ -299,4 +340,8 @@ export class ManagerDetachStore {
this.hasRight = bool; this.hasRight = bool;
} }
setFcondition(condition) {
this.fcondition = condition;
}
} }

View File

@ -47,6 +47,8 @@ export class ResourceStore extends HrmBaseStore{
@observable form2 = new WeaForm(); @observable form2 = new WeaForm();
@observable form = new WeaForm(); @observable form = new WeaForm();
@observable lastName = ''; @observable lastName = '';
@observable isBaseValue = true;
@observable conditionNum = 8; @observable conditionNum = 8;
@observable ids = ''; //选择行id @observable ids = ''; //选择行id
@observable searchConditionLoading = false; @observable searchConditionLoading = false;
@ -125,17 +127,18 @@ export class ResourceStore extends HrmBaseStore{
params = { params = {
isQuickSearch:false, isQuickSearch:false,
...this.selectTreeNodeInfo, ...this.selectTreeNodeInfo,
} }
//高级搜索内容为空 //外部INPUT搜索
if (this.isEmptyObject(this.form2.getFormParams())) { if (this.isBaseValue) {
params = { params = {
...params, ...params,
lastName: this.lastName, lastName: this.lastName
}; };
} else { }else {
params = { params = {
...params, ...params,
...this.form2.getFormParams() ...this.form2.getFormParams(),
}; };
} }
}else { }else {
@ -810,7 +813,7 @@ export class ResourceStore extends HrmBaseStore{
updateFields(val) { updateFields(val) {
this.form2.updateFields({ this.form2.updateFields({
lastname: { "-1_hrm_lastname": {
value: val value: val
} }
}); });