forked from huge/frontEnd/hugeOA

..
liyj
2020-06-24 d896af364e0be1c2e0a48402ed59d00e0804f931
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* eslint-disable */
/**liuwh
 * 5/29/2020, 2:34:37 PM
 * doc comment for the file goes here
 */
 
/** Happy Coding */
import React, { ReactNode, ReactEventHandler, Component } from 'react';
import { Input } from 'antd';
import TableView from '../../../common/TableView';
import SearchFormView from '../../../common/SearchFormView';
import './index.scss';
 
 
export default class MeritsExamine extends Component {
  constructor(props) {
    super(props);
    this.config = {
    };
    this.state = {
      formData: {
        __key: Date.now(),
        page: 1,
        size: 10,
        keyWord: ''
      },
    };
  }
 
  componentWillMount() { }
 
  componentDidMount() { }
 
  setFormData = data => {
    console.log('form', data);
    this.setState({
      formData: data,
    });
  }
 
  renderColumns = () => {
    return [
      { title: '序号', dataIndex: 'index' },
      { title: '评分项目', dataIndex: 'name' },
      // { title: '评分目标', dataIndex: 'bumen' },
      { title: '定义与标准', dataIndex: 'gangwei' },
      { title: '系统取数指标', dataIndex: 'month' },
      // { title: '数据来源', dataIndex: 'renwu' },
      { title: '取值范围', dataIndex: 'quexian' },
      { title: '计算方式', dataIndex: 'score' },
      {
        title: '权重', dataIndex: 'quanzhogn', width: '10%', render: (cur, item, index) => {
          return <Input size="small" onChange={() => {
            console.log(this.refs);
            this.refs['table-view'].onSetDataSource({ index, data: item })
          }} />
        }
      },
      {
        title: '配分', dataIndex: 'peifen', width: '10%', render: (cur, item) => {
          return <Input size="small" />
        }
      },
      {
        title: '操作', dataIndex: 'operation', render: (cur, item, ) => {
          return null
        }
      },
    ];
  }
 
  render() {
    const { formData } = this.state;
    let tableParams = {
      url: `api/log/queryLog`,
      formData,
      key: formData.__key,
      columns: this.renderColumns(),
      extraFromData: {
        logType: '1',
      },
      setFormData: this.setFormData,
      showPagination: false,
    }
 
    return (
      <div className="merits-examine-main">
        <TableView {...tableParams} ref={'table-view'} />
      </div>
    )
  }
}