trunk/pc4mobx/organization/components/NewWeaTableDialog.js

85 lines
2.1 KiB
JavaScript

import {
WeaNewScroll,
WeaSearchGroup,
WeaMoreButton,
WeaDialog
} from 'ecCom'
import {
Spin,
Button,
Pagination
} from 'antd'
import {
WeaSwitch,
WeaTableNew
} from 'comsMobx'
import {
i18n
} from '../public/i18n';
import '../style/common.less';
const WeaTable = WeaTableNew.WeaTable;
export default class NewWeaTableDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
width: 800,
}
}
reRenderColumns(columns) {
let _this = this;
columns.forEach((c, index) => {
if (c.dataIndex == 'lastname') {
c.render = function (text, record) {
return <a href='javascript:void(0);' onClick={() => {
window.open(`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${record.id}`);
}}>{text}</a>
}
};
})
}
render() {
const {
title,
visible,
onCancel,
height,
tableStore
} = this.props, {
width,
} = this.state;
const buttons = [
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@e4f4n1`} />)
];
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1txk5f`}
title={title}
icon="icon-coms-hrm"
iconBgcolor="#217346"
visible={visible}
closable={true}
hasScroll={true}
onCancel={() => onCancel()}
buttons={buttons}
style={{ width: width, height: height }}
>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@pgmg3x`}
comsWeaTableStore={tableStore}
getColumns={c => this.reRenderColumns(c)}
hasOrder={true}
needScroll={true}
/>
</WeaDialog>
)
}
}