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(
          <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@5cqack@${index}`} span={10} offset={1}>
          <div style={{ marginTop: 20 }}>
          <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@r78tbk@${index}`}
            label={`${field.label}`}
            labelCol={{ span: `${field.labelcol}` }}
            wrapperCol={{ span: `${field.fieldcol}` }}
          >
          {<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@9hoqzd@${index}`} fieldConfig={field} form={form} formParams={formParams} />}
          </WeaFormItem>
          </div>
          </Col>,
          );
      });
    });
    return (<div className="hrm-group-datepicker"><Row ecId={`${this && this.props && this.props.ecId || ''}_Row@3jwc9v`}
      onKeyDown={(e) => {
                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}</Row></div>);
  }

  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 = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@22g4ad@${i}`} fieldConfig={field} form={form} formParams={formParams} />;
        }

        arr.push(
          <div style={{ marginTop: 15 }} className="hrm-group-browser">
          <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@iipgns@${formname}${field.domkey[0]}`}>
          <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@xw3dqq@${formname}${field.domkey[0]}`} span={18} offset={3}>
          <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@kbsa1q@${formname}${field.domkey[0]}`}
            label={(field.domkey[0] !== 'alllevel' && field.domkey[0] !== 'rolelevel') ? `${field.label}` : ''}
            labelCol={{ span: 7 }}
            wrapperCol={{ span: 14 }}
            error={form.getError(field)}
            tipPosition="bottom"
            colon={!!((field.domkey[0] !== 'alllevel' && field.domkey[0] !== 'rolelevel'))}
          >
          {dom}
          </WeaFormItem>
          </Col>
          </Row>
          </div>,
          );
      }
    });

    return <div style={{ padding: '25px 0 40px 0', position: 'relative' }}>{arr}</div>;
  }

  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 = (<div style={{ position: 'absolute', top: -88, right: -100 }} className="hrm-group-wcb">
        <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@q9982u`} style={{ marginTop: 0 }} value={checkBoxVal} onChange={val => weahrm_group_store.setCheckBoxVal(val)} />
        <span style={{ marginLeft: 10 }}>{i18n.label.includeLower()}</span>
        </div>);
    } else if (field.domkey[0] == 'rolelevel') {
      dom = (<div style={{ position: 'absolute', top: -95, right: -125 }}>
        <span style={{ float: 'left', marginTop: 6 }}>{i18n.label.level()}</span>
        <div style={{ float: 'left' }} className="hrm-group-level">
        <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@v2ffty`}
          value={selectvalue}
          options={options}
          onChange={val => weahrm_group_store.setSelectValue(val)}
        />
        </div>
        </div>);
    } else if (field.domkey[0] == 'seclevel') {
      dom = (<WeaScope ecId={`${this && this.props && this.props.ecId || ''}_WeaScope@302v9t`}
        isMobx
        viewAttr={3}
        value={scopeValue}
        onChange={val => weahrm_group_store.setScopeValue(val)}
      />);
    } else {
      dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@xeo101`} fieldConfig={field} form={form} formParams={formParams} />;
    }

    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: (
              <div className="hrm-group-import  hrm-group-import-item">
              <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ama3j3@${index}`}>
              <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@z4n6fv@${index}`} span={2} offset={4}>
              <div className="hrm-group-box">
              <div className="hrm-group-circle hrm-group-radius" style={{ marginTop: 20 }}>{index + 1}</div>
              </div>
              </Col>
              <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@azr12s@${index}`} span={14}>
              <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@3plq87@${index}`}
                label={`${field.label}`}
                labelCol={{ span: `${field.labelcol}` }}
                wrapperCol={(arg == '2' && index == 2) ? { span: 24 - `${field.labelcol}` } : { span: `${field.fieldcol}` }}
                style={{ margin: '5px 0' }}
              >
              {dom}
              { field.domkey[0] == 'importlx' && this.getImportTypeValue() ? (<p style={{ position: 'absolute', top: 0, right: -145, color: '#4D7AD8' }} title={str}>{str.length > 20 ? `${str.slice(0, 20)}...` : str }</p>) : '' }
              </WeaFormItem>
              </Col>
              </Row>
              </div>
              ),
            colSpan: 1,
          });
        }

        if (!field.domkey) {
          let dom = this.getParagraph(field, arg);

          arr.push({
            com: (<div style={{ marginTop: 15 }}>{dom}</div>),
            colSpan: 1,
          });
        }
      });
      _arr.push(<div style={{ color: '#666666', position: 'relative' }}><WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@k22k8q@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={arr} col={1} fontSize={13} /></div>);
    });
    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 = <a href={link} className="hrm-group-linkStyle">{i18n.label.groupTemplet()}</a>;
    } else if (field.domkey[0] == 'excelfile') {
      dom = (<div>
       <div>
       <WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@oh2txy`}
         uploadUrl="/api/doc/upload/uploadFile"
         category="string"
         limitType="xls"
         datas={upStatus === 'uploaded' ? list : []}
         onChange={(id, l) => { 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)}
       >
       <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@1g6kb5`}>{i18n.button.selectFile()}</Button>
       </WeaUpload>
       </div>
       <div style={{ marginTop: -30, marginLeft: 90 }}>
       { list.length == 0 ? <p>{i18n.label.noFileSelected()}</p> : list.map(file => <p>{file.filename}</p>) }
       </div>
       </div>);
    } else {
      dom = (<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@69l7gg`} fieldConfig={field} form={form} formParams={formParams} />);
    }
    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 = (<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@nfd5gy`}>
       <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@vut3sy`} span={2} offset={4}>
       <div className="hrm-group-box">
       <div className="hrm-group-circle hrm-group-radius">{field.index}</div>
       </div>
       </Col>
       <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@tdlqg1`} span={14}>{ (arg == '1') ? <p><span>{`${field.value}: `}</span><a href={link} className="hrm-group-linkStyle">{i18n.label.groupTemplet()}</a></p> : <p>{field.value}</p>}</Col>
       </Row>);
    } else {
      dom = (<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@dxloo4`}>
        <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@uinw14`} span={2} offset={4}>
        <div className="hrm-group-box">
        <div className="hrm-group-circle hrm-group-radius">{field.index}</div>
        </div>
        </Col>
        <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@kbhzab`} span={14}><p>{field.value}</p></Col>
        </Row>);
    }
    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 (
      <i style={{ position: 'absolute', right: '95%', top: 5 }}>
      {hasTrumpet ? <img src="/hrm/hrm_e9/image/u30775.png" alt="" onClick={() => weahrm_group_store.setSuggestDialogStatus(true)} style={{ cursor: 'pointer' }} /> : ''}
      {hasHint ? <img src="/hrm/hrm_e9/image/u30777.png" alt="" style={{ cursor: 'pointer', position: 'absolute', left: 15, top: 8 }} /> : ''}
      </i>
      );
  }

  getImportIcon(arg) {
    if (arg == '3' || arg == '4') {
      return false;
    }
    return (
      <WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@r6d80h`}
        buttonType="import"
        type="primary"
        title={i18n.button.import()}
        onClick={() => this.handleImportClick(arg)}
      />
      );
  }

  getAddIcon(arg) {
    const {
      weahrm_group_store,
    } = this.props;

    if (arg == '1' || arg == '3') {
      return (
        <WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@hca35t`}
          buttonType="add"
          type="primary"
          title={i18n.button.create()}
          onClick={() => { arg == '3' ? weahrm_group_store.getForm((parseInt(arg) + 2).toString()) : weahrm_group_store.getForm(arg); }}
        />
        );
    }
    if (arg == '2') {
      return (
        <div style={{ display: 'inline' }}>
        <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@6tmncn`}
          ref="weabrowser"
          type={17}
          title={getLabel('83496', '多人力资源')}
          customized={true}
          hasAdvanceSerach={true}
          isSingle={false}
          tabs={[{
          isSearch: false,
          key: '1',
          name: getLabel('24515', '最近'),
          selected: false,
          showOrder: 0,
        }, {
          isSearch: false,
          key: '2',
          name: getLabel('18511', '同部门'),
          selected: false,
          showOrder: 0,
        }, {
          isSearch: false,
          key: '3',
          name: getLabel('15089', '我的下属'),
          selected: false,
          showOrder: 0,
        }, {
          isSearch: false,
          key: '4',
          name: getLabel('18770', '按组织结构'),
          selected: false,
          showOrder: 0,
        }, {
          isSearch: false,
          key: '5',
          name: getLabel('81554', '常用组'),
          selected: false,
          showOrder: 0,
        }]}
          onChange={(...args) => {
                        // 【清除】按钮触发的回调
                        if (args[2].length === 0) {
                          return;
                        }
                        weahrm_group_store.setMemberId(args[0]);
                        weahrm_group_store.save('3');
}
                      }
        >
                      <WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@nxkp5x`}
                        buttonType="add"
                        type="primary"
                        title={i18n.button.create()}
                      />
                      </WeaBrowser>
                      </div>
                      );
    }
  }

  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 (
      <WeaButtonIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaButtonIcon@0ex74p`}
        buttonType="del"
        type="primary"
        title={i18n.button.multiDelete()}
        disabled={len === 0}
        onClick={() => this.handleBatchDelete(arg)}
      />
      );
  }

  getAuthorityIcon() {
    return (
      <div style={{ paddingTop: 200, textAlign: 'center', color: '#666' }}>
      <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@3esatf`}>
      <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@g8mpur`} span={10} offset={7}>
      <img src="/hrm/hrm_e9/image/noauthority.png" alt="" />
      </Col>
      </Row>
      <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@1l9ks6`}>
      <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@pc3y7s`} span={10} offset={7}>
      <p>{i18n.message.authFailed()}</p>
      </Col>
      </Row>
      </div>
      );
  }

  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 (
          <div className="hrm-group-table hrm-group-form">
          <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@07y8rs`}
            comsWeaTableStore={tableStore}
            hasOrder={true}
            needScroll={isNeedScroll}
            getColumns={c => this.reRenderColumns(c, isNeedRerender)}
            onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate, tag)}
          />
          </div>
          );
      }
        return (
          <div className="hrm-group-table hrm-group-form">
          <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@oqlhfi`}
            comsWeaTableStore={tableStore}
            hasOrder={true}
            scroll={{ y: height - 150 }}
            getColumns={c => this.reRenderColumns(c, isNeedRerender)}
            onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate, tag)}
          />
          </div>
          );
    }
      return (
        <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@bk7gdm`}
          comsWeaTableStore={tableStore}
          hasOrder={true}
          scroll={{ y: height - 130 }}
          getColumns={c => 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) => (
        <span>
        <a href={`/api/hrm/group/getImportHistoryFile?filename=${this.getNumFromString(record.fileName)}`}>{action.download}</a>
        <span className="ant-divider" />
        <a onClick={() => this.delImportHistory(record)}>{action.delete}</a>
        </span>
        );
      return (
        <div className="hrm-group-antTable">
        <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@260w8o`}
          columns={col}
          dataSource={ds}
          loading={loading}
          pagination={isPagination}
          scroll={{ y: height }}
        />
        </div>
        );
    }
    return (
      <div className="hrm-group-antable">
      <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@c2y6s9`}
        columns={col}
        dataSource={ds}
        loading={loading}
        pagination={isPagination}
        scroll={{ y: height }}
      />
      </div>
      );
  }


  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 <a onClick={() => _this.rowDataClick(id)} dangerouslySetInnerHTML={{ __html: rowData.namespan }} />;
          };
        } else if (c.dataIndex == 'result') {
          c.render = function (text, record) {
            let rowData = toJS(record);
            return <a onClick={() => { 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 (
              <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@r493c4`}
                value={rowData.dsporder}
                onBlur={val => 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 <span dangerouslySetInnerHTML={{ __html: valueSpan }} />;
          };
        }
      });
    }
    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: <i className="icon-coms-download2" />,
    }, {
      key: '1',
      content: i18n.button.add(),
      icon: <i className="icon-coms-New-Flow" />,
    }, {
      key: '2',
      content: i18n.button.multiDelete(),
      icon: <i className="icon-coms-Batch-delete" />,
    }, {
      key: '3',
      content: i18n.button.save(),
      icon: <i className="icon-coms-Preservation" />,
    }, {
      key: '4',
      content: i18n.button.saveAndSetting(),
      icon: <i className="icon-coms-Flow-setting" />,
    }, {
      key: '5',
      content: i18n.button.submit(),
      icon: <i className="icon-coms-export" />,
    }, {
      key: '6',
      content: i18n.button.importHistoryQuery(),
      icon: <i className="icon-coms-Print-log" />,
    }];

    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 = [
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@2w79ey`} type="primary" onClick={() => this.handleSearch('1')}>{i18n.button.search()}</Button>),
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3on9ur`} type="primary" onClick={() => form1.reset()}>{i18n.button.reset()}</Button>),
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ce1nnz`} type="primary" onClick={() => weahrm_group_store.setPanelOneStatus(false)}>{i18n.button.cancel()}</Button>),
    ];

    const btn2 = [
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@lav849`} type="primary" onClick={() => weahrm_group_store.save('1')}>{i18n.button.save()}</Button>),
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@biumit`} type="primary" onClick={() => weahrm_group_store.save('2')}>{i18n.button.saveAndSetting()}</Button>),
    (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@uxpv6d`} />),
    ];

    const btn = [
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@v2vjym`} type="primary" onClick={() => weahrm_group_store.save('9')}>{i18n.button.save()}</Button>),
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@79xnx3`} type="primary" onClick={() => weahrm_group_store.save('10')}>{i18n.button.save()}</Button>),
    (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@gmuio7`} />),
    ];

    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: <i className="icon-coms-Print-log" />,
        onClick: () => {
          toggleLog({
            visible: true,
            logSmallType: (editTabKey == '1') ? '3003' : '3004',
          });
        },
      });
    }

    const btn4 = [
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@s9402j`} type="primary" onClick={() => this.handleSearch('2')}>{i18n.button.search()}</Button>),
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@e1guyz`} type="primary" onClick={() => form2.reset()}>{i18n.button.reset()}</Button>),
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@67tu2y`} type="primary" onClick={() => weahrm_group_store.setPanelTwoStatus(false)}>{i18n.button.cancel()}</Button>),
    ];

    const btn5 = [
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@0hls6z`} type="primary" onClick={() => this.handleSubmit('1')}>{i18n.button.submit()}</Button>),
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ufflf2`} type="primary" onClick={() => this.handleImportHistory()}>{i18n.button.importHistoryQuery()}</Button>),
    (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@gwgnqg`} />),
    ];

    const btn6 = [
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vs6oxv`} type="primary" onClick={() => this.handleSubmit('2')}>{i18n.button.submit()}</Button>),
    (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@3s8x9a`} />),
    ];

    const btn7 = [
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@frjw44`} type="primary" onClick={() => weahrm_group_store.save('4')}>{i18n.button.save()}</Button>),
    (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@wvhs1r`} />),
    ];

    const btn8 = [
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@1gcn1d`} type="primary" disabled={!logFilePath}><a href={`/api/hrm/group/getImportHistoryFile?filename=${logFilePath}`}>{i18n.label.logDownload() }</a></Button>),
    (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@6ehroh`} />),
    ];

    const btn9 = [
    (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@hfvl9a`} />),
    ];

    const btn10 = [
    (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@r040vk`} />),
    ];

    const btn11 = [
    (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@6b6as4`} />),
    ];

    const btn12 = [
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bw1z1k`} type="primary" onClick={() => this.handleSearch('3')}>{i18n.button.search()}</Button>),
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@gjgt7z`} type="primary" onClick={() => form7.reset()}>{i18n.button.reset()}</Button>),
    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@r0r5vn`} type="primary" onClick={() => weahrm_group_store.setPanelThreeStatus(false)}>{i18n.button.cancel()}</Button>),
    ];

    const {
      hrmImportCommon,
    } = this.props.weahrm_group_store,
{
      importDialog,
    } = hrmImportCommon;

    return (
      <div>
      <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@u3y4ij`}
        datas={weahrm_group_store.getRightMenu()}
        onClick={key => weahrm_group_store.onRightMenuClick(key)}
        collectParams={{ favname: i18n.module.personalization(), favouritetype: 5 }}
      >
      {this.getTable(tbParams1)}
      </WeaRightMenu>

      <WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@to5sij`}
        visible={visible}
        onCancel={() => toggleLog({ visible: false })}
        logStore={logStore}
        logType="4"
        logSmallType={logSmallType}
        targetId={targetId}
      />
      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@pyza17`}
        title={i18n.label.recommand()}
        icon="icon-coms-hrm"
        iconBgcolor="#217346"
        visible={isSuggestDialogShow}
        hasScroll
        onCancel={() => { weahrm_group_store.setSuggestDialogStatus(false); weahrm_group_store.setPanelThreeStatus(false); }}
        buttons={btn11}
        style={{ width: 890, height: 510 }}
        onChangeHeight={height => weahrm_group_store.changeHeight(height)}
      >
      <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@3zwf1a`}
        selectedKey={suggestTabKey}
        datas={tabName.slice(3, 5)}
        keyParam="key"
        searchsBaseValue={searchsBaseValue3}
        onChange={key => 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)}
      />
      <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@a9odyc`} datas={dropMenuDatas6} onClick={key => this.handleSixDropMenuClick(key)}>
      {this.getTable(tbParams4)}
      </WeaRightMenu>
      </WeaDialog>

      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@unvs37`}
        title={i18n.label.infoImport()}
        icon="icon-coms-hrm"
        iconBgcolor="#217346"
        visible={isImportBaseDialogShow}
        hasScroll
        onCancel={() => weahrm_group_store.setImportBaseDialogStatus(false)}
        buttons={btn5}
        style={{ width: 870, height: 510 }}
      >
      <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@3nwzj6`} datas={dropMenuDatas3} onClick={key => this.handleThreeDropMenuClick(key)}>
      <div className="hrm-group-form">
      {this.getImportComponents(condition4, form4, '1')}
      </div>
      </WeaRightMenu>
      </WeaDialog>

      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@gbpgt4`}
        title={i18n.label.infoImport()}
        icon="icon-coms-hrm"
        iconBgcolor="#217346"
        visible={isImportInfoDialogShow}
        hasScroll
        onCancel={() => weahrm_group_store.setImportInfoDialogStatus(false)}
        buttons={btn8}
        style={{ width: 700, height: 510 }}
        onChangeHeight={height => weahrm_group_store.changeHeight(height)}
      >
      <div className="hrm-group-table hrm-group-form">
      <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@6up6oj`} needTigger={false} title={i18n.label.importInfo()} showGroup={true} fontSize={13}>
      {this.getAntTable(paramsForAntTable, true)}
      </WeaSearchGroup>
      </div>
      </WeaDialog>

      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@hczl7o`}
        title={i18n.button.importHistoryQuery()}
        icon="icon-coms-hrm"
        iconBgcolor="#217346"
        visible={isImportHistoryDialogShow}
        hasScroll
        onCancel={() => 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()}
      </WeaDialog>

      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@fwgdti`}
        title={i18n.label.importMember()}
        icon="icon-coms-hrm"
        iconBgcolor="#217346"
        visible={isImportMemberDialogShow}
        hasScroll
        onCancel={() => weahrm_group_store.setImportMemberDialogStatus(false)}
        buttons={btn6}
        style={{ width: 750, height: 430 }}
      >
      <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@te73d9`} datas={dropMenuDatas4} onClick={key => this.handleFourDropMenuClick(key)}>
      <div className="hrm-group-form">
      {this.getImportComponents(condition5, form5, '2')}
      </div>
      </WeaRightMenu>
      </WeaDialog>

      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@uel1og`}
        title={i18n.label.staffImport()}
        icon="icon-coms-hrm"
        iconBgcolor="#217346"
        visible={isImportMemInfoDialogShow}
        hasScroll
        onCancel={() => weahrm_group_store.setImportMemInfoDialogStatus(false)}
        buttons={btn10}
        style={{ width: 700, height: 510 }}
        onChangeHeight={height => weahrm_group_store.changeHeight(height)}
      >
      <div className="hrm-group-table hrm-group-form">
      <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@ocgav3`} needTigger={false} title={i18n.label.importInfo()} showGroup={true} fontSize={13}>
      {this.getAntTable(paramsForAntTable, true)}
      </WeaSearchGroup>
      </div>
      </WeaDialog>

      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@7pllmm`}
        title={i18n.label.newGroup()}
        icon="icon-coms-hrm"
        iconBgcolor="#217346"
        visible={isNewDialogShow}
        hasScroll
        onCancel={() => weahrm_group_store.setNewDialogStatus(false)}
        buttons={btn2}
        style={{ width: 650 }}
      >
      <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@eznpf7`} datas={dropMenuDatas2} onClick={key => this.handleTwoDropMenuClick(key)}>
      {this.getNewAndShareComponents(condition3, form3, false, 'form3')}
      </WeaRightMenu>
      </WeaDialog>


      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@qoh7qg`}
        title={i18n.label.groupSetting()}
        icon="icon-coms-hrm"
        iconBgcolor="#217346"
        visible={isEditDialogShow}
        hasScroll
        onCancel={() => {
        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)}
      >
      <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@o07cxh`} datas={datas} onClick={key => this.handleDropMenuClick(key)}>
      <div className="hrm-group-tab">
      <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@5c8tul`}
        selectedKey={editTabKey}
        datas={type == '0' ? tabName.slice(0, 2) : tabName.slice(0, 3)}
        keyParam="key"
        searchsBaseValue={searchsBaseValue2}
        onChange={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)}
      />
      </div>
      <div className="hrm-resource-edit-content" style={(editTabKey == '0') ? { display: 'block' } : { display: 'none' }}>
      {this.getNewAndShareComponents(condition3, form3, false, 'form3')}
      </div>
      <div style={(editTabKey == '1') ? { display: 'block' } : { display: 'none' }} className="hrm-group-weatable">
      {this.getTable(tbParams2)}
      </div>
      <div style={(editTabKey == '2') ? { display: 'block' } : { display: 'none' }}>
      {this.getTable(tbParams3)}
      </div>
      </WeaRightMenu>
      </WeaDialog>

      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@xmib3y`}
        title={i18n.label.addShare()}
        icon="icon-coms-hrm"
        iconBgcolor="#217346"
        visible={isShareDialogShow}
        hasScroll
        onCancel={() => weahrm_group_store.setShareDialogStatus(false)}
        buttons={btn7}
        style={{ width: 700, height: 250 }}
      >
      <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@8r997l`} datas={dropMenuDatas5} onClick={key => this.handleFiveDropMenuClick(key)}>
      {this.getNewAndShareComponents(condition6, form6, true, 'form6')}
      </WeaRightMenu>
      </WeaDialog>

      {importDialog.visible && <Import ecId={`${this && this.props && this.props.ecId || ''}_Import@j4ufdh`} hrmImportCommon={hrmImportCommon} />}
      </div>
      );
}
}

WeaHrmGroup = Form.create({})(WeaHrmGroup);

export default WeaHrmGroup;
