${i18n.label.organization()}`}
treeNodeClick={this.treeNodeClick}
expandAllChildrenOnSearch={true}
renderNode={item => this.renderNode(item)}
/>
)
return tree;
}
renderNode(item) {
return
{item.name}
{item.canceled && ({i18n.label.forbidden()})}
}
treeNodeClick = (event, ids, nodeids, nodes) => {
const {
staff
} = this.props;
const {
form2,
companysId
} = staff;
const type = event.node.props.type || '0';
const id = event.node.props.id || '';
let params = {};
form2.resetConditionValue();
if (type == '0') {
params['virtualtype'] = companysId;
}
if (type == '1') {
params['compId'] = id;
}
if (type == '2') {
params['deptId'] = id;
}
staff.doSearch(params);
}
replaceLeft() {
const {
staff
} = this.props;
const {
leftCondition,
form1,
} = staff;
let formParams = form1.getFormParams();
const {
isFormInit
} = form1;
let arr = [];
isFormInit && leftCondition.map(c => {
c.items.map((field, index) => {
arr.push(
{}
)
})
})
return arr;
}
onChange = data => {
const {
staff
} = this.props;
staff.setPlanId(data.planId.value)
};
onOperatesClick(record, rowIndex, operate) {
const {
index
} = operate;
(index == '0') && this.doEdit(record.randomFieldId);
(index == '1') && this.doDel(record.randomFieldId);
(index == '2') && this.doChange(record.randomFieldId);
}
doEdit(id) {
const {
staff
} = this.props;
staff.setNeDialogTitle(i18n.label.editStaff());
staff.setStaffId(id);
staff.setOperateType("1");
staff.setIsNew(false);
staff.setVisible(true);
staff.getForm();
}
doChange(id) {
const {
staff
} = this.props;
staff.setNeDialogTitle(i18n.label.changeStaff());
staff.setStaffId(id);
staff.setOperateType("2");
staff.setIsNew(false);
staff.setVisible(true);
staff.getForm();
}
custom = () => {
const {
staff
} = this.props, {
tableStore,
} = staff;
tableStore.setColSetVisible(true);
tableStore.tableColSet(true);
}
doDel(id) {
const {
staff
} = this.props;
staff.setIds(id);
this.showConfirm('del');
}
handleSave() {
const {
staff
} = this.props;
const {
isNew
} = staff;
isNew && staff.save();
!isNew && staff.edit();
}
getPanelComponents() {
const {
staff
} = this.props;
const {
searchCondition,
form2,
searchConditionLoading
} = staff;
let arr = [];
let formParams = form2.getFormParams();
const {
isFormInit
} = form2;
isFormInit && searchCondition.map(c => {
c.items.map((field, index) => {
arr.push(
{}
)
})
})
if (searchConditionLoading) {
return (
)
} else {
return {
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
staff.getTableInfo();
staff.setPanelStatus(false)
}
}}>{arr}
}
}
//非空判断
isEmptyObject(obj) {
for (let key in obj) {
return false;
}
return true;
}
render() {
const {
staff,importDialog
} = this.props;
const {
isPanelShow, form2, staffName, conditionNum, tableStore, nEdialogTitle, visible, condition,
form, dialogLoading, isEdit, date, hasRight,exSpinning
} = staff;
const {importVisible} = importDialog;
if (hasRight === false) {
return renderNoright();
}
return (
hasRight &&
this.handleMenuClick(key)}
>
}
iconBgcolor='#217346'
loading={true}
buttons={this.getTopMenuBtns()}
showDropIcon={true}
dropMenuDatas={this.getDropMenuDatas()}
onDropMenuClick={(e) => this.handleMenuClick(e)}
>
staff.setPanelStatus(bool)}
hideSearchAd={() => staff.setPanelStatus(false)}
searchsAd={isPanelShow ? this.getPanelComponents() : }
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
hasMask={false}
buttonsAd={this.getTabBtn()}
onSearch={() => staff.getTableInfo()}
onSearchChange={val => this.onSearchChange(val)}
replaceLeft={this.replaceLeft()}
/>
this.reRenderColumns(c)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
/>
this.handleSave()}
onCancel={() => staff.setVisible(false)}
moduleName={"staff"}
bindChangeEnvent={val => staff.updateConditions(val)}
/>
{importVisible && }
)
}
}