import {
inject,
observer,
} from 'mobx-react';
import {
Row,
Col,
Spin,
Form,
Modal,
Table,
Button,
message,
} from 'antd';
import {
WeaTab,
WeaInput,
WeaScope,
WeaSelect,
WeaUpload,
WeaDialog,
WeaBrowser,
WeaFormItem,
WeaCheckbox,
WeaNewScroll,
WeaRightMenu,
WeaSearchGroup,
WeaMoreButton,
WeaLocaleProvider,
WeaButtonIcon,
} from 'ecCom';
import React from 'react';
import * as mobx from 'mobx';
import {
WeaSwitch,
WeaTableNew,
WeaLogView,
} from 'comsMobx';
import {
i18n,
} from '../../hrm/i18n';
const getLabel = WeaLocaleProvider.getLabel;
import './style/index.css';
const toJS = mobx.toJS;
const WeaTable = WeaTableNew.WeaTable;
const confirm = Modal.confirm;
const FormItem = Form.Item;
const WeaLogViewComp = WeaLogView.Component;
import Import from '../importRelatedComponet/index';
@inject('weahrm_group_store')
@observer
class WeaHrmGroup extends React.Component {
constructor(props) {
super(props);
}
componentWillMount() {
const {
weahrm_group_store,
} = this.props;
const {
form1,
} = weahrm_group_store;
let bool = window.location.href.indexOf('/spa/hrm/index_mobx.html') > -1;
if (bool) {
document.title = i18n.module.personalization();
weahrm_group_store.setWeaTopStatus(true);
}
form1.reset();
}
componentDidMount() {
this.init();
}
componentWillUnmount() {
this.props.weahrm_group_store.showCanceled = false;
}
componentWillReceiveProps(nextProps) {
const {
weahrm_group_store,
} = this.props;
const {
form1,
} = weahrm_group_store;
// if(this.props.location.key !== nextProps.location.key) {
/* form1.reset();
this.init(); */
// }
}
init() {
const {
weahrm_group_store,
} = this.props;
weahrm_group_store.getPanelForm('1');
weahrm_group_store.getTableInfo('1');
weahrm_group_store.hasSuggestHint();
weahrm_group_store.setSourceStore();
}
getPanelComponents(condition, form, arg) {
const { weahrm_group_store } = this.props;
let arr = [];
let formParams = form.getFormParams();
const {
isFormInit,
} = form;
isFormInit && condition.map((c) => {
c.items.map((field, index) => {
arr.push(
{ }
,
);
});
});
return ( {
if (e.keyCode == 13 && e.target.tagName === 'INPUT') {
const func = (arg === '3') ? 'setPanelThreeStatus' : 'setPanelTwoStatus';
weahrm_group_store[func](false);
const _arg = (arg === '3') ? '7' : arg;
weahrm_group_store.getTableInfo(_arg);
}
}}
>{arr}
);
}
getNewAndShareComponents(condition, form, isLinkage, formname) {
let arr = [];
let formParams = form.getFormParams();
const {
isFormInit,
} = form;
isFormInit && condition.map((c) => {
let items = c.items;
for (let i = 0; i < items.length; i++) {
let field = items[i];
let dom;
if (isLinkage && this.fieldFilter(field)) continue;
if (isLinkage) {
dom = this.getShareDom(field, form, formParams);
} else {
dom = ;
}
arr.push(
{dom}
,
);
}
});
return {arr}
;
}
fieldFilter(field) {
const {
weahrm_group_store,
} = this.props;
const {
form6,
} = weahrm_group_store;
let sharetype;
let jobtitlelevel;
let formParams = form6.getFormParams();
if (formParams.sharetype) sharetype = formParams.sharetype;
if (formParams.jobtitlelevel) jobtitlelevel = formParams.jobtitlelevel;
let domkey = (field.domkey)[0];
if (sharetype == '1' && (domkey == 'sbid' || domkey == 'did' || domkey == 'rid' || domkey == 'rolelevel' || domkey == 'jobtitle' || domkey == 'jobtitlelevel' || domkey == 'seclevel' || domkey == 'jobtitledepartment' || domkey == 'jobtitlesubcompany' || domkey == 'customid' || domkey == 'alllevel')) return true;
if (sharetype == '2' && (domkey == 'rsid' || domkey == 'did' || domkey == 'rid' || domkey == 'rolelevel' || domkey == 'jobtitle' || domkey == 'jobtitlelevel' || domkey == 'jobtitledepartment' || domkey == 'jobtitlesubcompany' || domkey == 'customid')) return true;
if (sharetype == '3' && (domkey == 'rsid' || domkey == 'sbid' || domkey == 'rid' || domkey == 'rolelevel' || domkey == 'jobtitle' || domkey == 'jobtitlelevel' || domkey == 'jobtitledepartment' || domkey == 'jobtitlesubcompany' || domkey == 'customid')) return true;
if (sharetype == '4' && (domkey == 'rsid' || domkey == 'sbid' || domkey == 'did' || domkey == 'jobtitle' || domkey == 'jobtitlelevel' || domkey == 'jobtitledepartment' || domkey == 'jobtitlesubcompany' || domkey == 'customid' || domkey == 'alllevel')) return true;
if ((sharetype == '7' && (jobtitlelevel == '0' || !jobtitlelevel)) && (domkey == 'rsid' || domkey == 'sbid' || domkey == 'did' || domkey == 'rid' || domkey == 'rolelevel' || domkey == 'seclevel' || domkey == 'jobtitledepartment' || domkey == 'jobtitlesubcompany' || domkey == 'customid' || domkey == 'alllevel')) return true;
if ((sharetype == '7' && jobtitlelevel == '1') && (domkey == 'rsid' || domkey == 'sbid' || domkey == 'did' || domkey == 'rid' || domkey == 'rolelevel' || domkey == 'seclevel' || domkey == 'jobtitlesubcompany' || domkey == 'customid' || domkey == 'alllevel')) return true;
if ((sharetype == '7' && jobtitlelevel == '2') && (domkey == 'rsid' || domkey == 'sbid' || domkey == 'did' || domkey == 'rid' || domkey == 'rolelevel' || domkey == 'seclevel' || domkey == 'jobtitledepartment' || domkey == 'customid' || domkey == 'alllevel')) return true;
if (sharetype == '8' && (domkey == 'sbid' || domkey == 'rsid' || domkey == 'did' || domkey == 'rid' || domkey == 'rolelevel' || domkey == 'jobtitle' || domkey == 'jobtitlelevel' || domkey == 'jobtitledepartment' || domkey == 'jobtitlesubcompany' || domkey == 'alllevel')) return true;
if (sharetype == '5' && (domkey == 'sbid' || domkey == 'rsid' || domkey == 'did' || domkey == 'rid' || domkey == 'rolelevel' || domkey == 'jobtitle' || domkey == 'jobtitlelevel' || domkey == 'jobtitledepartment' || domkey == 'jobtitlesubcompany' || domkey == 'customid' || domkey == 'alllevel')) return true;
}
getShareDom(field, form, formParams) {
const {
weahrm_group_store,
} = this.props;
const {
checkBoxVal,
selectvalue,
scopeValue,
} = weahrm_group_store;
let dom;
const options = [{
key: '1',
selected: true,
showname: i18n.label.department(),
}, {
key: '2',
showname: i18n.label.subcompany(),
}, {
key: '3',
showname: i18n.label.company(),
}];
if (formParams.jobtitlelevel === '') {
form.updateFields({
jobtitlelevel: '0',
});
}
if (field.domkey[0] == 'alllevel') {
dom = (
weahrm_group_store.setCheckBoxVal(val)} />
{i18n.label.includeLower()}
);
} else if (field.domkey[0] == 'rolelevel') {
dom = (
{i18n.label.level()}
weahrm_group_store.setSelectValue(val)}
/>
);
} else if (field.domkey[0] == 'seclevel') {
dom = ( weahrm_group_store.setScopeValue(val)}
/>);
} else {
dom = ;
}
return dom;
}
getImportComponents(condition, form, arg) {
let _arr = [];
const {
isFormInit,
} = form;
const str = getLabel(131396, '覆盖时将替换原人员列表');
isFormInit && condition.map((c, i) => {
let arr = [];
c.items.map((field, index) => {
if (field.domkey) {
let dom = this.getDOM(field, arg);
arr.push({
com: (
{dom}
{ field.domkey[0] == 'importlx' && this.getImportTypeValue() ? ({str.length > 20 ? `${str.slice(0, 20)}...` : str }
) : '' }
),
colSpan: 1,
});
}
if (!field.domkey) {
let dom = this.getParagraph(field, arg);
arr.push({
com: ({dom}
),
colSpan: 1,
});
}
});
_arr.push(
);
});
return _arr;
}
getDOM(field, arg) {
const {
weahrm_group_store,
} = this.props;
const {
excelfile,
list,
upStatus,
form4,
form5,
} = weahrm_group_store;
let dom;
let form;
if (arg == '1') form = form4;
if (arg == '2') form = form5;
let formParams = form.getFormParams();
if (field.domkey[0] == 'templet') {
let link;
let arr = field.value.split(';');
if (formParams.keyField == 'workcode') link = arr[0];
if (formParams.keyField == 'loginid') link = arr[1];
if (formParams.keyField == 'lastname') link = arr[2];
dom = {i18n.label.groupTemplet()} ;
} else if (field.domkey[0] == 'excelfile') {
dom = (
{ weahrm_group_store.setExcelfile(id[0]); weahrm_group_store.setList(l); weahrm_group_store.updateFormFields((parseInt(arg) + 2).toString(), id[0]); }}
onUploading={s => this.onUploading(s)}
>
{i18n.button.selectFile()}
{ list.length == 0 ?
{i18n.label.noFileSelected()}
: list.map(file =>
{file.filename}
) }
);
} else {
dom = ( );
}
return dom;
}
getImportTypeValue() {
const {
weahrm_group_store,
} = this.props;
const {
form5,
} = weahrm_group_store;
let formParams = form5.getFormParams();
if (formParams.importlx == 'update') {
return true;
}
return false;
}
getParagraph(field, arg) {
const {
weahrm_group_store,
} = this.props;
const {
form4,
form5,
} = weahrm_group_store;
let dom;
let form;
if (arg == '1') form = form4;
if (arg == '2') form = form5;
let formParams = form.getFormParams();
if (field.index == '1') {
let link;
let arr;
if (field.link) {
arr = field.link.split(';');
if (formParams.keyField == 'workcode') link = arr[0];
if (formParams.keyField == 'loginid') link = arr[1];
}
dom = (
{ (arg == '1') ? {`${field.value}: `} {i18n.label.groupTemplet()}
: {field.value}
}
);
} else {
dom = (
{field.value}
);
}
return dom;
}
onUploading(s) {
const {
weahrm_group_store,
} = this.props;
const {
list,
} = weahrm_group_store;
weahrm_group_store.setUpStatus(s);
if (s == 'uploading') {
weahrm_group_store.setList([]);
} else {
weahrm_group_store.setList(list);
}
}
getSuggestIcon(arg) {
const {
weahrm_group_store,
} = this.props;
const {
hasTrumpet,
hasHint,
} = weahrm_group_store;
if (arg !== '1') {
return false;
}
return (
{hasTrumpet ? weahrm_group_store.setSuggestDialogStatus(true)} style={{ cursor: 'pointer' }} /> : ''}
{hasHint ? : ''}
);
}
getImportIcon(arg) {
if (arg == '3' || arg == '4') {
return false;
}
return (
this.handleImportClick(arg)}
/>
);
}
getAddIcon(arg) {
const {
weahrm_group_store,
} = this.props;
if (arg == '1' || arg == '3') {
return (
{ arg == '3' ? weahrm_group_store.getForm((parseInt(arg) + 2).toString()) : weahrm_group_store.getForm(arg); }}
/>
);
}
if (arg == '2') {
return (
{
// 【清除】按钮触发的回调
if (args[2].length === 0) {
return;
}
weahrm_group_store.setMemberId(args[0]);
weahrm_group_store.save('3');
}
}
>
);
}
}
getBatchDeleteIcon(arg) {
const {
weahrm_group_store,
} = this.props;
if (arg == '4') {
return false;
}
let len;
if (arg == '2') len = weahrm_group_store.tableStore2.selectedRowKeys.length;
if (arg == '3') len = weahrm_group_store.tableStore3.selectedRowKeys.length;
return (
this.handleBatchDelete(arg)}
/>
);
}
getAuthorityIcon() {
return (
{i18n.message.authFailed()}
);
}
handleImportClick(arg) {
const {
weahrm_group_store,
} = this.props;
arg == '1' && weahrm_group_store.getForm('3');
// arg == '2' && weahrm_group_store.getForm('4');
if (arg === '2') {
const {
weahrm_group_store,
} = this.props,
{
hrmImportCommon,
groupid,
} = weahrm_group_store,
{
setTempletName,
setImportDialogTitle,
setImportType,
setImportDialogVisible,
setOtherParams,
} = hrmImportCommon;
setTempletName(getLabel(129833, '导入模板'));
setImportDialogTitle(getLabel(511074, '常用组成员导入'));
setImportType('groupMember');
setImportDialogVisible(true);
setOtherParams({ groupid });
}
}
handleBatchDelete(arg) {
const {
weahrm_group_store,
} = this.props;
const {
tableStore1,
tableStore2,
tableStore3,
} = weahrm_group_store;
let store;
if (arg == '1') store = tableStore1;
if (arg == '2') store = tableStore2;
if (arg == '3') store = tableStore3;
let srk = this.getSelectedRow(toJS(store));
if (srk.length == 0) {
// message.warning('请选择需要删除的数据!');
return false;
}
this.doDel(srk, arg);
}
getSelectedRow(store) {
return store.selectedRowKeys;
}
handleSearch(arg) {
const {
weahrm_group_store,
} = this.props;
if (arg == '1') {
weahrm_group_store.getTableInfo('1');
weahrm_group_store.setPanelOneStatus(false);
}
if (arg == '2') {
weahrm_group_store.getTableInfo('2');
weahrm_group_store.setPanelTwoStatus(false);
}
if (arg == '3') {
weahrm_group_store.getTableInfo('7');
weahrm_group_store.setPanelThreeStatus(false);
}
}
handleSubmit(arg) {
const {
weahrm_group_store,
} = this.props;
const {
excelfile,
} = weahrm_group_store;
if (!excelfile) {
message.warning(i18n.message.pleaseUploadFile());
return false;
}
if (arg == '1') {
weahrm_group_store.setImportInfoDialogStatus(true);
weahrm_group_store.save('5');
}
if (arg == '2') {
weahrm_group_store.setImportMemInfoDialogStatus(true);
weahrm_group_store.save('6');
}
}
handleImportHistory() {
const {
weahrm_group_store,
} = this.props;
weahrm_group_store.setImportHistoryDialogStatus(true);
weahrm_group_store.getTableInfo('5');
}
handleOneDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
if (key == '0') this.handleImportClick('1');
if (key == '1') weahrm_group_store.getForm('1');
if (key == '2') this.handleBatchDelete('1');
}
handleTwoDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
if (key == '3') weahrm_group_store.save('1');
if (key == '4') weahrm_group_store.save('2');
}
handleThreeDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
if (key == '5') this.handleSubmit('1');
if (key == '6') this.handleImportHistory();
}
handleFourDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
if (key == '5') this.handleSubmit('2');
if (key == '7') {}
}
handleFiveDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
if (key == '3') weahrm_group_store.save('4');
if (key == '7') {}
}
handleSixDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
weahrm_group_store.setSuggestDialogStatus(false);
}
handleSevenDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
if (key == '0') this.handleImportClick('2');
if (key == '1') this.refs.weabrowser.openModal();
if (key == '2') this.handleBatchDelete('2');
}
handleEightDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
if (key == '1') weahrm_group_store.getForm('5');
if (key == '2') this.handleBatchDelete('3');
}
handleNineDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
if (key == '3') weahrm_group_store.save('9');
if (key == '7') {}
}
handleDropMenuClick(key) {
const {
weahrm_group_store,
} = this.props;
const {
editTabKey,
} = weahrm_group_store;
if (editTabKey == '0') this.handleNineDropMenuClick(key);
if (editTabKey == '1') this.handleSevenDropMenuClick(key);
if (editTabKey == '2') this.handleEightDropMenuClick(key);
}
getTable(params) {
let tableStore = params.tableStore;
// let loading = params.loading;
let title = params.title;
let customComponent = params.customComponent;
let isNeedScroll = params.isNeedScroll;
let isNeedRerender = params.isNeedRerender;
let tag = params.tag;
let height = params.height;
let isNeedSearchGroup = params.isNeedSearchGroup;
if (isNeedSearchGroup) {
if (isNeedScroll) {
return (
this.reRenderColumns(c, isNeedRerender)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate, tag)}
/>
);
}
return (
this.reRenderColumns(c, isNeedRerender)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate, tag)}
/>
);
}
return (
this.reRenderColumns(c, isNeedRerender)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate, tag)}
/>
);
}
getAntTable(params, isWrapBySearchgroup) {
let col = params.col;
let ds = params.ds;
let loading = params.loading;
let isPagination = params.isPagination;
let action = params.action;
let num = params.num;
let height;
if (isWrapBySearchgroup) {
height = params.height - 85;
} else {
height = params.height - 48;
}
if (col.length > 0 && !this.isEmptyObject(action)) {
col[num].render = (text, record) => (
{action.download}
this.delImportHistory(record)}>{action.delete}
);
return (
);
}
return (
);
}
delImportHistory(record) {
const {
weahrm_group_store,
} = this.props;
const {
dataSource,
} = weahrm_group_store;
let num = this.getNumFromString(record.fileName);
weahrm_group_store.setDelFileNum(num);
let index = this.getRowIndex(record.key, toJS(dataSource));
this.showConfirm('4', [], index);
}
getNumFromString(str) {
return str.replace(/[^0-9]+/g, '');
}
getRowIndex(key, dataSource) {
let arr = [];
if (dataSource instanceof Array) {
for (let i = 0; i < dataSource.length; i++) {
arr.push(dataSource[i].key);
}
}
return arr.indexOf(key);
}
reRenderColumns(columns, isNeedRerender) {
const {
weahrm_group_store,
} = this.props;
let _this = this;
if (isNeedRerender) {
columns.forEach((c, index) => {
let obj = {};
if (c.dataIndex == 'name') {
c.render = function (text, record) {
let rowData = toJS(record);
let id;
if (rowData.id) id = rowData.id;
if (rowData.groupid) id = rowData.groupid;
return _this.rowDataClick(id)} dangerouslySetInnerHTML={{ __html: rowData.namespan }} />;
};
} else if (c.dataIndex == 'result') {
c.render = function (text, record) {
let rowData = toJS(record);
return { weahrm_group_store.setGroupId(rowData.id); weahrm_group_store.getForm('2'); weahrm_group_store.tabClick('1'); }} dangerouslySetInnerHTML={{ __html: record.resultspan }} />;
};
} else if (c.dataIndex == 'dsporder') {
c.render = function (text, record) {
let rowData = toJS(record);
if (rowData.dsporder < 0) {
rowData.dsporder = 1;
}
return (
weahrm_group_store.setDsporderArr(val, rowData)}
/>
);
};
} else {
c.render = function (text, record) {
let valueSpan = record[`${c.dataIndex}span`] !== undefined ? record[`${c.dataIndex}span`] : record[c.dataIndex];
return ;
};
}
});
}
return columns;
}
rowDataClick(id) {
const {
weahrm_group_store,
} = this.props;
weahrm_group_store.setGroupId(id);
weahrm_group_store.getForm('2');
weahrm_group_store.tabClick('0');
}
doCancel(id) {
const {
weahrm_group_store,
} = this.props;
weahrm_group_store.doCancel({
id,
});
}
doISCanceled(id) {
const {
weahrm_group_store,
} = this.props;
weahrm_group_store.doISCanceled({
id,
});
}
onOperatesClick(record, index, operate, tag) {
const {
weahrm_group_store,
} = this.props;
let funcIndex = operate.index;
if (tag == 'base') {
const func = operate.href ? operate.href.split(':')[1].split('(')[0] : '';
weahrm_group_store.setGroupId(record.id);
if (funcIndex == '0') weahrm_group_store.tabClick('0');
if (funcIndex == '1') weahrm_group_store.tabClick('1');
if (funcIndex == '2') weahrm_group_store.tabClick('2');
if (funcIndex == '0' || funcIndex == '1' || funcIndex == '2') {
weahrm_group_store.getForm('2');
}
if (func == 'doDel') this.doDel([], '1');
if (func == 'doCancel' || func == 'doISCanceled') {
weahrm_group_store[func] && weahrm_group_store[func]({ id: record.id });
}
}
if (tag == 'member') {
weahrm_group_store.setMemberId(record.id);
if (funcIndex == '0') this.doDel([], '2');
}
if (tag == 'share') {
weahrm_group_store.setTypeId(record.id);
weahrm_group_store.getTableInfo('3');
if (funcIndex == '0') this.doDel([], '3');
}
if (tag == 'suggest') {
weahrm_group_store.setSuggestId(record.randomFieldId);
if (funcIndex == '0') {
weahrm_group_store.save('7');
}
if (funcIndex == '1') {
weahrm_group_store.delete('5');
}
if (funcIndex == '2') {
weahrm_group_store.save('8');
}
}
}
doDel(arr, arg) {
const {
weahrm_group_store,
} = this.props;
if (arg == '1') {
this.showConfirm('1', arr);
}
if (arg == '2') {
this.showConfirm('2', arr);
}
if (arg == '3') {
this.showConfirm('3', arr);
}
}
getCustomComponent(arg) {
const {
weahrm_group_store,
} = this.props;
return (
[
this.getSuggestIcon(arg),
this.getImportIcon(arg),
this.getAddIcon(arg),
this.getBatchDeleteIcon(arg),
]
);
}
showConfirm(arg, arr, index) {
let _this = this;
confirm({
title: i18n.confirm.defaultTitle(),
content: arr.length == 0 ? i18n.confirm.delete() : i18n.confirm.batchDeleteConfirm(),
okText: i18n.button.ok(),
cancelText: i18n.button.cancel(),
onOk() {
_this.ok(arg, arr, index);
},
onCancel() {
return false;
},
});
}
ok(arg, arr, index) {
const {
weahrm_group_store,
} = this.props;
const {
dataSource,
} = weahrm_group_store;
if (arr.length !== 0) {
for (let i = 0; i < arr.length; i++) {
arg == '1' && weahrm_group_store.setGroupId(arr[i]);
arg == '2' && weahrm_group_store.setMemberId(arr[i]);
arg == '3' && weahrm_group_store.setTypeId(arr[i]);
weahrm_group_store.delete(arg, 'batch');
i == (arr.length - 1) && weahrm_group_store.delete(arg, 'batch', 'last');
}
} else {
arg == '4' && dataSource.splice(index, 1);
weahrm_group_store.delete(arg);
}
}
isEmptyObject(obj) {
for (let key in obj) {
return false;
}
return true;
}
getGroupSettingBtns(key) {
let btns;
if (key == '0') {
btns = [];
} else if (key == '1') {
btns = this.getCustomComponent('2');
} else if (key == '2') {
btns = this.getCustomComponent('3');
}
return btns;
}
render() {
const {
weahrm_group_store,
} = this.props;
const {
isSuggestDialogShow,
isPanelOneShow,
isPanelTwoShow,
isPanelThreeShow,
isNewDialogShow,
isEditDialogShow,
isImportBaseDialogShow,
isImportMemberDialogShow,
isShareDialogShow,
isImportInfoDialogShow,
isImportHistoryDialogShow,
isImportMemInfoDialogShow,
} = weahrm_group_store;
const {
form1,
form2,
form3,
form4,
form5,
form6,
form7,
} = weahrm_group_store;
const {
tableStore1,
tableStore2,
tableStore3,
tableStore4,
} = weahrm_group_store;
const {
editTabKey,
suggestTabKey,
} = weahrm_group_store;
const {
columns,
dataSource,
loading,
action,
logFilePath,
height,
} = weahrm_group_store;
const {
condition1,
condition2,
condition3,
condition4,
condition5,
condition6,
condition7,
} = weahrm_group_store;
const {
orderArr,
hasWeaTop,
hasAuthority,
date,
} = weahrm_group_store;
const {
logView,
} = weahrm_group_store,
{
visible,
logSmallType,
targetId,
logStore,
} = logView;
let searchsBaseValue1 = form1.getFormParams().name;
let searchsBaseValue2 = form2.getFormParams().resourcename;
let searchsBaseValue3 = form7.getFormParams().suggesttitle;
let type = form3.getFormParams().type;
let tbParams1 = {
tableStore: tableStore1,
loading: tableStore1.loading,
title: i18n.label.groupList(),
customComponent: this.getCustomComponent('1'),
isNeedScroll: true,
isNeedRerender: true,
isNeedSearchGroup: true,
tag: 'base',
};
let tbParams2 = {
tableStore: tableStore2,
loading: tableStore2.loading,
title: i18n.label.memberList(),
customComponent: this.getCustomComponent('2'),
height,
isNeedRerender: true,
isNeedSearchGroup: true,
tag: 'member',
};
let tbParams3 = {
tableStore: tableStore3,
loading: tableStore3.loading,
title: i18n.label.shareScopeList(),
customComponent: this.getCustomComponent('3'),
height,
isNeedRerender: false,
isNeedSearchGroup: true,
tag: 'share',
};
let tbParams4 = {
tableStore: tableStore4,
loading: tableStore4.loading,
height,
isNeedRerender: true,
isNeedSearchGroup: false,
tag: 'suggest',
};
let paramsForAntTable = {
col: columns,
ds: dataSource,
loading,
isPagination: false,
action,
height,
num: 2,
};
const tabName = [{
key: '0',
title: i18n.label.basicInfo(),
}, {
key: '1',
title: i18n.label.member(),
}, {
key: '2',
title: i18n.label.shareScope(),
}, {
key: '3',
title: i18n.label.tobeTreated(),
}, {
key: '4',
title: i18n.label.alreadyProcessed(),
}];
const dropMenuDatas = [{
key: '0',
content: i18n.button.import(),
icon: ,
}, {
key: '1',
content: i18n.button.add(),
icon: ,
}, {
key: '2',
content: i18n.button.multiDelete(),
icon: ,
}, {
key: '3',
content: i18n.button.save(),
icon: ,
}, {
key: '4',
content: i18n.button.saveAndSetting(),
icon: ,
}, {
key: '5',
content: i18n.button.submit(),
icon: ,
}, {
key: '6',
content: i18n.button.importHistoryQuery(),
icon: ,
}];
const dropMenuDatas1 = dropMenuDatas.slice(0, 3);
const dropMenuDatas2 = dropMenuDatas.slice(3, 5);
const dropMenuDatas3 = dropMenuDatas.slice(5, 7);
const dropMenuDatas4 = dropMenuDatas.slice(5, 6);
const dropMenuDatas5 = dropMenuDatas.slice(3, 4);
const dropMenuDatas6 = dropMenuDatas.slice(7, 8);
const dropMenuDatas7 = dropMenuDatas.slice(1, 3);
const btn1 = [
( this.handleSearch('1')}>{i18n.button.search()} ),
( form1.reset()}>{i18n.button.reset()} ),
( weahrm_group_store.setPanelOneStatus(false)}>{i18n.button.cancel()} ),
];
const btn2 = [
( weahrm_group_store.save('1')}>{i18n.button.save()} ),
( weahrm_group_store.save('2')}>{i18n.button.saveAndSetting()} ),
( ),
];
const btn = [
( weahrm_group_store.save('9')}>{i18n.button.save()} ),
( weahrm_group_store.save('10')}>{i18n.button.save()} ),
( ),
];
let btn3;
let datas;
if (editTabKey == '0') {
btn3 = btn.slice(0, 1).concat(btn.slice(2, 3));
datas = dropMenuDatas5;
}
if (editTabKey == '1') {
btn3 = btn.slice(1, 2).concat(btn.slice(2, 3));
datas = dropMenuDatas1;
}
if (editTabKey == '2') {
btn3 = btn.slice(2, 3);
datas = dropMenuDatas7;
}
const {
toggleLog,
} = weahrm_group_store;
if (['1', '2'].includes(editTabKey)) {
datas.push({
key: '7',
content: getLabel('83', '日志'),
icon: ,
onClick: () => {
toggleLog({
visible: true,
logSmallType: (editTabKey == '1') ? '3003' : '3004',
});
},
});
}
const btn4 = [
( this.handleSearch('2')}>{i18n.button.search()} ),
( form2.reset()}>{i18n.button.reset()} ),
( weahrm_group_store.setPanelTwoStatus(false)}>{i18n.button.cancel()} ),
];
const btn5 = [
( this.handleSubmit('1')}>{i18n.button.submit()} ),
( this.handleImportHistory()}>{i18n.button.importHistoryQuery()} ),
( ),
];
const btn6 = [
( this.handleSubmit('2')}>{i18n.button.submit()} ),
( ),
];
const btn7 = [
( weahrm_group_store.save('4')}>{i18n.button.save()} ),
( ),
];
const btn8 = [
({i18n.label.logDownload() } ),
( ),
];
const btn9 = [
( ),
];
const btn10 = [
( ),
];
const btn11 = [
( ),
];
const btn12 = [
( this.handleSearch('3')}>{i18n.button.search()} ),
( form7.reset()}>{i18n.button.reset()} ),
( weahrm_group_store.setPanelThreeStatus(false)}>{i18n.button.cancel()} ),
];
const {
hrmImportCommon,
} = this.props.weahrm_group_store,
{
importDialog,
} = hrmImportCommon;
return (
weahrm_group_store.onRightMenuClick(key)}
collectParams={{ favname: i18n.module.personalization(), favouritetype: 5 }}
>
{this.getTable(tbParams1)}
toggleLog({ visible: false })}
logStore={logStore}
logType="4"
logSmallType={logSmallType}
targetId={targetId}
/>
{ weahrm_group_store.setSuggestDialogStatus(false); weahrm_group_store.setPanelThreeStatus(false); }}
buttons={btn11}
style={{ width: 890, height: 510 }}
onChangeHeight={height => weahrm_group_store.changeHeight(height)}
>
weahrm_group_store.suggestTabClick(key)}
searchType={['base', 'advanced']}
setShowSearchAd={bool => weahrm_group_store.setPanelThreeStatus(bool)}
hideSearchAd={() => weahrm_group_store.setPanelThreeStatus(false)}
showSearchAd={isPanelThreeShow}
searchsAd={this.getPanelComponents(condition7, form7, '3')}
advanceHeight={120}
buttonsAd={btn12}
hasMask={false}
onSearch={() => weahrm_group_store.getTableInfo('7')}
onSearchChange={val => weahrm_group_store.updateFormFields('5', val)}
/>
this.handleSixDropMenuClick(key)}>
{this.getTable(tbParams4)}
weahrm_group_store.setImportBaseDialogStatus(false)}
buttons={btn5}
style={{ width: 870, height: 510 }}
>
this.handleThreeDropMenuClick(key)}>
{this.getImportComponents(condition4, form4, '1')}
weahrm_group_store.setImportInfoDialogStatus(false)}
buttons={btn8}
style={{ width: 700, height: 510 }}
onChangeHeight={height => weahrm_group_store.changeHeight(height)}
>
{this.getAntTable(paramsForAntTable, true)}
weahrm_group_store.setImportHistoryDialogStatus(false)}
buttons={btn9}
style={{ width: 750, height: 510 }}
onChangeHeight={height => weahrm_group_store.changeHeight(height)}
>
{ hasAuthority ? this.getAntTable(paramsForAntTable, false) : this.getAuthorityIcon()}
weahrm_group_store.setImportMemberDialogStatus(false)}
buttons={btn6}
style={{ width: 750, height: 430 }}
>
this.handleFourDropMenuClick(key)}>
{this.getImportComponents(condition5, form5, '2')}
weahrm_group_store.setImportMemInfoDialogStatus(false)}
buttons={btn10}
style={{ width: 700, height: 510 }}
onChangeHeight={height => weahrm_group_store.changeHeight(height)}
>
{this.getAntTable(paramsForAntTable, true)}
weahrm_group_store.setNewDialogStatus(false)}
buttons={btn2}
style={{ width: 650 }}
>
this.handleTwoDropMenuClick(key)}>
{this.getNewAndShareComponents(condition3, form3, false, 'form3')}
{
weahrm_group_store.setEditDialogStatus(false);
weahrm_group_store.setPanelTwoStatus(false);
weahrm_group_store.tabReset();
}}
buttons={btn3}
style={{ width: 780, height: 510 }}
onChangeHeight={height => weahrm_group_store.changeHeight(height)}
>
this.handleDropMenuClick(key)}>
weahrm_group_store.tabClick(key)}
searchType={(editTabKey == '1') ? ['base', 'advanced'] : ''}
setShowSearchAd={bool => weahrm_group_store.setPanelTwoStatus(bool)}
hideSearchAd={() => weahrm_group_store.setPanelTwoStatus(false)}
showSearchAd={isPanelTwoShow}
searchsAd={(editTabKey == '1') ? this.getPanelComponents(condition2, form2, '2') : []}
advanceHeight={120}
buttonsAd={btn4}
buttons={this.getGroupSettingBtns(editTabKey)}
onSearch={() => weahrm_group_store.getTableInfo('2')}
onSearchChange={val => weahrm_group_store.updateFormFields('2', val)}
/>
{this.getNewAndShareComponents(condition3, form3, false, 'form3')}
{this.getTable(tbParams2)}
{this.getTable(tbParams3)}
weahrm_group_store.setShareDialogStatus(false)}
buttons={btn7}
style={{ width: 700, height: 250 }}
>
this.handleFiveDropMenuClick(key)}>
{this.getNewAndShareComponents(condition6, form6, true, 'form6')}
{importDialog.visible && }
);
}
}
WeaHrmGroup = Form.create({})(WeaHrmGroup);
export default WeaHrmGroup;