2023-03-14 09:11:54 +08:00
|
|
|
import {
|
|
|
|
|
inject,
|
|
|
|
|
observer
|
|
|
|
|
} from 'mobx-react';
|
|
|
|
|
import {
|
|
|
|
|
WeaTab,
|
|
|
|
|
WeaDialog,
|
|
|
|
|
WeaFormItem,
|
|
|
|
|
WeaMoreButton,
|
|
|
|
|
} from 'ecCom'
|
|
|
|
|
import {
|
|
|
|
|
Row,
|
|
|
|
|
Col,
|
|
|
|
|
Spin,
|
|
|
|
|
Button,
|
|
|
|
|
} from 'antd'
|
|
|
|
|
import {
|
|
|
|
|
WeaSwitch,
|
|
|
|
|
WeaTableNew
|
|
|
|
|
} from 'comsMobx'
|
|
|
|
|
import {
|
|
|
|
|
jumpToHrmCard
|
2023-09-22 14:01:42 +08:00
|
|
|
} from '../../public/pulic-func'
|
|
|
|
|
import {
|
|
|
|
|
i18n
|
|
|
|
|
} from '../../public/i18nbk';
|
2023-03-14 09:11:54 +08:00
|
|
|
const WeaTable = WeaTableNew.WeaTable;
|
|
|
|
|
|
|
|
|
|
@inject('hrmImportCommon')
|
|
|
|
|
@observer
|
|
|
|
|
export default class ImportLog extends React.Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
width: 870,
|
|
|
|
|
height: 510,
|
|
|
|
|
isPanelShow: false,
|
|
|
|
|
num: 5,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-22 14:01:42 +08:00
|
|
|
getPanelComponents = () => {
|
2023-03-14 09:11:54 +08:00
|
|
|
const {
|
|
|
|
|
hrmImportCommon
|
|
|
|
|
} = this.props, {
|
|
|
|
|
logDialog
|
|
|
|
|
} = hrmImportCommon, {
|
|
|
|
|
form,
|
|
|
|
|
condition,
|
|
|
|
|
loading
|
|
|
|
|
} = logDialog, {
|
|
|
|
|
isFormInit
|
|
|
|
|
} = form;
|
|
|
|
|
|
|
|
|
|
let arr = [];
|
|
|
|
|
isFormInit && condition.map(c => {
|
|
|
|
|
c.items.map((field, index) => {
|
|
|
|
|
arr.push(
|
2023-09-22 14:01:42 +08:00
|
|
|
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@f21exb@${index}`} span={(index + 1) / 2 == 1 ? 13 : 9} offset={1}>
|
2023-03-14 09:11:54 +08:00
|
|
|
<div style={{marginTop: 10}} className='hrm-date-group'>
|
2023-09-22 14:01:42 +08:00
|
|
|
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@osq1ux@${index}`}
|
2023-03-14 09:11:54 +08:00
|
|
|
label={`${field.label}`}
|
|
|
|
|
labelCol={{span: index == 1 ? 5: `${field.labelcol}`}}
|
|
|
|
|
wrapperCol={{span: `${field.fieldcol}`}}>
|
2023-09-22 14:01:42 +08:00
|
|
|
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@awbwzy@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} />}
|
2023-03-14 09:11:54 +08:00
|
|
|
</WeaFormItem>
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
2023-09-22 14:01:42 +08:00
|
|
|
return <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@wot9li`} spinning={loading}><Row ecId={`${this && this.props && this.props.ecId || ''}_Row@mr5pe2`}
|
2023-03-14 09:11:54 +08:00
|
|
|
onKeyDown={(e) =>{
|
2023-09-22 14:01:42 +08:00
|
|
|
if( e.keyCode == 13 && e.target.tagName === "INPUT") {
|
|
|
|
|
hrmImportCommon.searchLogInfo();
|
|
|
|
|
hrmImportCommon.setLogPanelStatus(false)
|
|
|
|
|
} }
|
2023-03-14 09:11:54 +08:00
|
|
|
}
|
|
|
|
|
>{arr}</Row></Spin>
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-22 14:01:42 +08:00
|
|
|
reRenderColumns = (c) => {
|
|
|
|
|
c.forEach((item, i) => {
|
2023-03-14 09:11:54 +08:00
|
|
|
if (item.dataIndex == 'operator') {
|
|
|
|
|
item.render = function(text, record) {
|
|
|
|
|
return <span><a style={{cursor:'pointer', color: '#4D7AD8'}} onClick={ () => jumpToHrmCard(record.operator)}>{record.operatorspan}</a></span>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item.dataIndex == 'status') {
|
|
|
|
|
item.render = function(text, record) {
|
2023-09-22 14:01:42 +08:00
|
|
|
return <span>{record.status == '1' ? <span style={{color: 'rgb(84, 211, 162)'}}>{i18n.label.success()}</span> : <span style={{color: 'rgb(255, 0, 0)'}}>{i18n.label.fail()}</span>}</span>
|
2023-03-14 09:11:54 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDialogButtons = () => {
|
|
|
|
|
const buttons = [
|
2023-09-22 14:01:42 +08:00
|
|
|
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@dhp5rz@1`} />)
|
2023-03-14 09:11:54 +08:00
|
|
|
];
|
|
|
|
|
return buttons
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getSearchPanelButtons = () => {
|
|
|
|
|
const {
|
|
|
|
|
hrmImportCommon
|
|
|
|
|
} = this.props, {
|
|
|
|
|
searchLogInfo,
|
|
|
|
|
setLogPanelStatus,
|
|
|
|
|
logDialog,
|
|
|
|
|
} = hrmImportCommon, {
|
|
|
|
|
form
|
|
|
|
|
} = logDialog;
|
|
|
|
|
|
|
|
|
|
return [
|
2023-09-22 14:01:42 +08:00
|
|
|
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@1im1mb@1`} type="primary" onClick={() => {searchLogInfo(); setLogPanelStatus(false)}}>{i18n.button.search()}</Button>),
|
|
|
|
|
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@kwzalq@2`} onClick={() => form.reset()}>{i18n.button.reset()}</Button>),
|
|
|
|
|
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@qwyez5@3`} onClick={() => setLogPanelStatus(false)}>{i18n.button.cancel()}</Button>),
|
2023-03-14 09:11:54 +08:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-22 14:01:42 +08:00
|
|
|
getRowKey = (record,index) => index
|
|
|
|
|
|
2023-03-14 09:11:54 +08:00
|
|
|
render() {
|
|
|
|
|
const {
|
|
|
|
|
hrmImportCommon
|
|
|
|
|
} = this.props, {
|
|
|
|
|
logDialog,
|
|
|
|
|
setLogDialogVisible,
|
|
|
|
|
setLogPanelStatus,
|
|
|
|
|
} = hrmImportCommon, {
|
|
|
|
|
title,
|
|
|
|
|
visible,
|
|
|
|
|
isPanelShow,
|
|
|
|
|
tableStore,
|
|
|
|
|
} = logDialog, {
|
|
|
|
|
width,
|
|
|
|
|
height,
|
|
|
|
|
num
|
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
return (
|
2023-09-22 14:01:42 +08:00
|
|
|
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@jvqq5g`}
|
2023-03-14 09:11:54 +08:00
|
|
|
title={title}
|
|
|
|
|
icon="icon-coms-hrm"
|
|
|
|
|
iconBgcolor="#217346"
|
|
|
|
|
visible={visible}
|
|
|
|
|
closable={true}
|
|
|
|
|
onCancel={() => setLogDialogVisible(false)}
|
|
|
|
|
buttons={this.getDialogButtons()}
|
|
|
|
|
style={{width: width, height: height}}
|
|
|
|
|
onChangeHeight={h => this.setState({height: h})}
|
|
|
|
|
>
|
2023-09-22 14:01:42 +08:00
|
|
|
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@kz5pkf`}
|
2023-03-14 09:11:54 +08:00
|
|
|
searchType={['advanced']}
|
|
|
|
|
showSearchAd={isPanelShow}
|
|
|
|
|
setShowSearchAd={ bool => setLogPanelStatus(bool) }
|
|
|
|
|
hideSearchAd={ () => setLogPanelStatus(false) }
|
|
|
|
|
searchsAd= {this.getPanelComponents()}
|
|
|
|
|
advanceHeight={ Math.ceil(num / 2) * 42 + 10}
|
|
|
|
|
hasMask={false}
|
|
|
|
|
buttonsAd={this.getSearchPanelButtons()}
|
|
|
|
|
/>
|
2023-09-22 14:01:42 +08:00
|
|
|
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@vx7etm`}
|
2023-03-14 09:11:54 +08:00
|
|
|
comsWeaTableStore={tableStore}
|
|
|
|
|
hasOrder={true}
|
|
|
|
|
needScroll={true}
|
|
|
|
|
scroll={{y: height-125}}
|
2023-09-22 14:01:42 +08:00
|
|
|
rowKey={this.getRowKey}
|
|
|
|
|
getColumns={this.reRenderColumns}
|
2023-03-14 09:11:54 +08:00
|
|
|
/>
|
|
|
|
|
</WeaDialog>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|