65 lines
2.5 KiB
JavaScript
65 lines
2.5 KiB
JavaScript
import React from 'react'
|
||
import { systemItemColumns, dataSource } from './columns'
|
||
import { WeaInputSearch } from 'ecCom'
|
||
import { Modal, Button, Table } from 'antd'
|
||
import { inject, observer } from 'mobx-react';
|
||
import { WeaTableNew } from "comsMobx"
|
||
const WeaTable = WeaTableNew.WeaTable;
|
||
|
||
@inject('salaryItemStore')
|
||
@observer
|
||
export default class SystemSalaryItemModal extends React.Component {
|
||
constructor(props) {
|
||
super(props);
|
||
this.state = {
|
||
searchValue: ""
|
||
}
|
||
}
|
||
|
||
// 搜索改变事件
|
||
handleSearchChange(value) {
|
||
this.setState({searchValue: value})
|
||
}
|
||
|
||
// 搜索
|
||
handleSearch(value) {
|
||
const { salaryItemStore } = this.props;
|
||
const { getSysItemList } = salaryItemStore
|
||
getSysItemList({name: value})
|
||
}
|
||
|
||
render() {
|
||
const { salaryItemStore } = this.props;
|
||
const { sysListTableStore } = salaryItemStore
|
||
const { searchValue } = this.state;
|
||
|
||
const handleAdd = () => {
|
||
const { salaryItemStore: { saveSysItem } } = this.props;
|
||
saveSysItem();
|
||
}
|
||
|
||
return (
|
||
<Modal footer={null} visible={this.props.visible} onCancel={() => {this.props.onCancel()}} width={800}>
|
||
<div style={{height: "47px", lineHeight: '47px'}}>
|
||
<span style={{marginLeft: "10px", fontSize: '14px'}}>添加系统薪资项目</span>
|
||
<div style={{float: "right", marginRight: "40px"}}>
|
||
<Button type="primary" style={{marginRight: '10px'}} onClick={() => {handleAdd()}}>添加</Button>
|
||
<WeaInputSearch value={searchValue} onChange={(value) => {this.handleSearchChange(value)}} onSearch={(value) => {
|
||
this.handleSearch(value)
|
||
}}/>
|
||
</div>
|
||
</div>
|
||
<div style={{margin: "10px"}}>
|
||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||
comsWeaTableStore={sysListTableStore} // table store
|
||
hasOrder={true} // 是否启用排序
|
||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||
|
||
// getColumns={this.getColumns}
|
||
// onOperatesClick={this.onOperatesClick.bind(this)}
|
||
/>
|
||
</div>
|
||
</Modal>
|
||
)
|
||
}
|
||
} |