import React from 'react'; import { inject, observer, } from 'mobx-react'; import { Button, Row, Col, } from 'antd'; import { WeaSwitch,WeaLogView } from 'comsMobx'; import { WeaTop, WeaTools, WeaLocaleProvider, WeaErrorPage, WeaTab, WeaRightMenu, WeaFormItem, WeaButtonIcon, } from 'ecCom'; const getLabel = WeaLocaleProvider.getLabel; // 门户管理 import WeaPortalCustomSetting from '../../portal/wea-custom-setting/'; // 人力资源 import WeaHrmGroup from '../../hrm/hrm-group/'; import PersonalSetting from '../../hrm/personalSetting/index' // 云商店 // import WeaCloudstoreSetting from '../../cloudstore/setting'; import OtherSetting from '../../hrm/otherSetting/index'; // 其他设置 // 工作流 import UserDefaultSetting from '../../workflow/UserDefaultSetting'; // 收发文单位私人组 import PrivateGroupSetingComponent from '../../odoc/privateGroupSetingComponent'; import Import from '../../hrm/importRelatedComponet/index'; @inject('weaportal_customsetting_store') @inject('weahrm_group_store') @inject('odoc_privateGroupStore') // 收发文单位私人组 @inject('hrmOtherSetting') // 其他设置 @inject('weaworkflow_userdefault_store') @inject('addNewStore') @observer class WeaCustomSetting extends React.Component { constructor(props) { super(props); this.state = { tabKey: '1', isshow: false, }; this.getButtons = this.getButtons.bind(this); this.getRightMenu = this.getRightMenu.bind(this); this.onRightMenuClick = this.onRightMenuClick.bind(this); this.getTabContent = this.getTabContent.bind(this); } componentDidMount () { const { weaportal_customsetting_store, weahrm_group_store, addNewStore, location: { query } } = this.props, { setSourceStore, } = weaportal_customsetting_store; setSourceStore(weahrm_group_store); addNewStore.Init(); if (query.tabKey) { this.setState({ tabKey: query.tabKey }) } } getButtons () { const { tabKey, } = this.state; const { weaportal_customsetting_store, weahrm_group_store, weacloudstore_setting_store, hrmOtherSetting, odoc_privateGroupStore, weaworkflow_userdefault_store, addNewStore } = this.props; let btns = []; switch (tabKey) { case '1': // 工作流 btns = weaworkflow_userdefault_store.getButtons(); break; case '2': // 人力资源 btns = weahrm_group_store.getButtons(); break; case '3': // 门户管理 btns = weaportal_customsetting_store.getButtons(); break; case '4': // 其他设置 // btns = weacloudstore_setting_store.getButtons(); btns = hrmOtherSetting.getButtons(); break; case '5': // 收发文单位私人组 btns = []; break; case '6': //个人设置 btns = addNewStore.getButtons(); break; } return btns; } getRightMenu () { const { tabKey, } = this.state; const { weaportal_customsetting_store, weahrm_group_store, weacloudstore_setting_store, hrmOtherSetting, weaworkflow_userdefault_store, odoc_privateGroupStore, addNewStore } = this.props; let btns = []; switch (tabKey) { case '1': // 工作流 btns = weaworkflow_userdefault_store.getRightMenu(); break; case '2': // 人力资源 btns = weahrm_group_store.getRightMenu(); break; case '3': // 门户管理 btns = weaportal_customsetting_store.getRightMenu(); break; case '4': // 其他设置 // btns = weacloudstore_setting_store.getRightMenu(); btns = hrmOtherSetting.getRightMenu(); break; case '5': // 收发文单位私人组 btns = odoc_privateGroupStore.getRightMenu(); break; case '6': // 个人设置 btns = addNewStore.getRightMenu(); break; } return btns; } onRightMenuClick (key) { const { tabKey, } = this.state; const { weaportal_customsetting_store, weahrm_group_store, weacloudstore_setting_store, hrmOtherSetting, odoc_privateGroupStore } = this.props; switch (tabKey) { case '1': // 工作流 break; case '2': // 人力资源 weahrm_group_store.onRightMenuClick(key); break; case '3': // 门户管理 weaportal_customsetting_store.onRightMenuClick(key); break; case '4': // 其他设置 // weacloudstore_setting_store.onRightMenuClick(key); hrmOtherSetting.onRightMenuClick(key); break; } } getTabContent () { const { tabKey, } = this.state; let html = null; switch (tabKey) { case '1': // 工作流 html = ; break; case '2': // 人力资源 html = ; break; case '3': // 门户管理 html = ; break; case '4': // 其他设置 // html = html = ; break; case '5': // 收发文单位私人组 html = ; break; case '6': // 个人设置 html = ; break; } return html; } getPanelComponents () { const { weahrm_group_store, } = this.props; const { condition1, form1, } = weahrm_group_store; let arr = []; let formParams = form1.getFormParams(); const { isFormInit, } = form1; isFormInit && condition1.map((c) => { c.items.map((field, index) => { arr.push(
{}
, ); }); }); return (
{ if (e.keyCode == 13 && e.target.tagName === 'INPUT') { this.handleSearch('1'); } }} >{arr}
); } // 获取公文管理高级搜索面板内容 getOdocPanelComponents () { const { odoc_privateGroupStore, } = this.props; const { conditions, odoConditionForm, } = odoc_privateGroupStore; let arr = []; let formParams = odoConditionForm.getFormParams(); const { isFormInit, } = odoConditionForm; isFormInit && conditions.map((c) => { c.items.map((field, index) => { arr.push(
{}
, ); }); }); return
{arr}
; } getOdocCustomComponent () { const { odoc_privateGroupStore, } = this.props; return ( [ this.getOdocAddIcon(), this.getOdocBatchDeleteIcon(), ] ); } getOdocAddIcon () { const { odoc_privateGroupStore, } = this.props; return ( ); } getOdocBatchDeleteIcon () { const { odoc_privateGroupStore, } = this.props; const len = odoc_privateGroupStore.selectedRowKeys.length; return ( 0) ? { marginRight: 16, backgroundColor: '#34A2FF' } : { marginRight: 16, backgroundColor: '#D9D9D9' }} className="icon-coms-Loss hrm-group-clickicon" title={getLabel(32136, '批量删除')} onClick={this.onOdocBtachDelete} /> ); } handleOdocSearch = () => { const { odoc_privateGroupStore } = this.props; odoc_privateGroupStore.getTableData(); odoc_privateGroupStore.setOdocPanelStatus(false); } getCustomComponent () { const { weahrm_group_store } = this.props; return ( [ this.changeShowAll(), this.getSuggestIcon(), this.getImportIcon(), this.getAddIcon(), this.getBatchDeleteIcon(), ] ); } changeShowAll () { const { weahrm_group_store: { showCanceled } } = this.props; return ( ); } getSuggestIcon () { const { weahrm_group_store: { hasTrumpet, hasHint } } = this.props; return ( {hasTrumpet ? : ''} {hasHint ? : ''} ); } getImportIcon () { return ( ); } // 个人化设置-人力资源-常用组导入回调 handleImportClick = () => { const { weaportal_customsetting_store, } = this.props, { hrmImportCommon, } = weaportal_customsetting_store, { setTempletName, setImportDialogTitle, setImportType, setImportDialogVisible, } = hrmImportCommon; setTempletName(getLabel(129833, '导入模板')); setImportDialogTitle(getLabel(125445, '常用组信息导入')); setImportType('group'); setImportDialogVisible(true); } getAddIcon () { return ( ); } getBatchDeleteIcon () { const { weahrm_group_store } = this.props; const len = weahrm_group_store.tableStore1.selectedRowKeys.length; return ( ); } handleSearch (arg) { const { weahrm_group_store } = this.props; if (arg == '1') { weahrm_group_store.getTableInfo('1'); weahrm_group_store.setPanelOneStatus(false); } } onTabChange = tabKey => this.setState({ tabKey, isshow: true }); // htm setHrmShowSearchAd = bool => this.props.weahrm_group_store.setPanelOneStatus(bool); hideHrmSearchAd = () => this.props.weahrm_group_store.setPanelOneStatus(false); onHrmSearch = () => this.props.weahrm_group_store.getTableInfo('1'); onHrmSearchChange = val => this.props.weahrm_group_store.updateFormFields('1', val); onHrmShowAll = () => this.props.weahrm_group_store.changeShowAll(); getHrmSuggestion = () => this.props.weahrm_group_store.setSuggestDialogStatus(true); getHrmForm = () => this.props.weahrm_group_store.getForm('1'); onHrmBatchDelete = () => this.props.weahrm_group_store.onRightMenuClick('2'); onHrmBtnSearch = () => this.handleSearch('1'); onHrmBtnReset = () => this.props.weahrm_group_store.form1.reset(); onHrmBtnCancel = () => this.props.weahrm_group_store.setPanelOneStatus(false); // odoc setOdocShowSearchAd = bool => this.props.odoc_privateGroupStore.setOdocPanelStatus(bool); hideOdocSearchAd = () => this.props.odoc_privateGroupStore.setOdocPanelStatus(false); onOdocSearch = val => this.props.odoc_privateGroupStore.getTableData(val); onOdocSearchChange = val => this.props.odoc_privateGroupStore.updateOdocForm(val); onOdocBtachDelete = () => { const { odoc_privateGroupStore } = this.props; const len = odoc_privateGroupStore.selectedRowKeys.length; if (len > 0) { odoc_privateGroupStore.showConfirm(); } } onHandelChange = tabKey => this.setState({ tabKey, isshow: false }); onOdocBtnReset = () => this.props.odoc_privateGroupStore.odoConditionForm.reset(); onOdocBtnCancel = () => this.props.odoc_privateGroupStore.setOdocPanelStatus(false); onOdocAddIconClick = () => this.props.odoc_privateGroupStore.creatDialogShow(); render () { const { weahrm_group_store, odoc_privateGroupStore, } = this.props; const { odoConditionForm, isOdocPanelShow, } = odoc_privateGroupStore; const { form1, isPanelOneShow, hasLogRight, } = weahrm_group_store; const { tabKey, isshow, } = this.state; const { hrmImportCommon, } = this.props.weaportal_customsetting_store, { importDialog, } = hrmImportCommon; const { hasOtherTab } = this.props.addNewStore; const btn1 = [ (), (), (), ]; const btn2 = [ (), (), (), ]; let weaTab; let topDatas = [{ key: '1', title: getLabel(2118, '工作流程') }, { key: '2', title: getLabel(179, '人力资源') }, { key: '3', title: getLabel(20613, '门户管理') }, { key: '5', title: getLabel(27618, '公文管理') }, { key: '4', title: getLabel(20824, '其他设置') }]; if (hasOtherTab == true) { topDatas.splice(4,0,{ key: '6', title: getLabel(32496, '安全设置') }) } switch (tabKey) { case '2': weaTab = (); break; case '5': weaTab = (); break; default: weaTab = (); break; } return ( } iconBgcolor="#217346" buttons={this.getButtons()} buttonSpace={10} showDropIcon={true} dropMenuDatas={this.getRightMenu()} onDropMenuClick={this.onRightMenuClick} > {weaTab} {this.getTabContent()} {importDialog.visible && } ); } } class MyErrorHandler extends React.Component { render () { const hasErrorMsg = this.props.error && this.props.error !== ''; return (); } } WeaCustomSetting = WeaTools.tryCatch(React, MyErrorHandler, { error: '', })(WeaCustomSetting); export default WeaCustomSetting;