import React from 'react';
import ReactDom from 'react-dom';
import ajax from 'jquery/src/ajax/xhr.js';
import $ from 'jquery/src/ajax';
import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload } from 'antd';
import Newuser from "./newUser.jsx"
import './userMangagement.less'
import {techAuditStatusList, station,post } from '../../../dataDic.js';
const User=Form.create()(React.createClass({
loadData(pageNo) {
this.state.data = [];
this.setState({
loading: true
});
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + '/api/admin/supervise/adminLi',
data: {
pageNo: pageNo || 1,
pageSize: this.state.pagination.pageSize,
userName:this.state.userNameSearch,
organization:this.state.organizationSearch,
role:this.state.rolesSearch,
post:this.state.postSearch,
station:this.state.stationSearch,
status:this.state.statusSeach,
signName:this.state.signNameSearch,
mobile:this.state.mobileSearch,
proName:this.state.proNameSearch
},
success: function (data) {
let theArr = [];
if (!data.data || !data.data.list) {
if (data.error && data.error.length) {
message.warning(data.error[0].message);
};
} else {
for (let i = 0; i < data.data.list.length; i++) {
let thisdata = data.data.list[i];
theArr.push({
key: i,
id: thisdata.id,
mobile: thisdata.mobile,
name: thisdata.name,
email: thisdata.email,
createTime: thisdata.createTime,
number: thisdata.number,
province: thisdata.province,
position: thisdata.position,
superior: thisdata.superior,
superiorId: thisdata.superiorId,
createTimeFormattedDate: thisdata.createTimeFormattedDate
});
};
};
this.state.pagination.current = data.data.pageNo?data.data.pageNo:'0';
this.state.pagination.total = data.data.totalCount?data.data.totalCount:'0';
this.setState({
dataSource: theArr,
pagination: this.state.pagination
});
}.bind(this),
}).always(function () {
this.setState({
loading: false
});
}.bind(this));
},
getInitialState() {
return {
datauser:{},
searchMore: true,
selectedRowKeys: [],
selectedRows: [],
loading: false,
pagination: {
defaultCurrent: 1,
defaultPageSize: 10,
showQuickJumper: true,
pageSize: 10,
onChange: function (page) {
this.loadData(page);
}.bind(this),
showTotal: function (total) {
return '共' + total + '条数据';
}
},
columns: [
{
title: '用户编号',
dataIndex: 'key',
key: 'key',
}, {
title: '登录用户名',
dataIndex: 'name',
key: 'name',
}, {
title: '角色',
dataIndex: 'email',
key: 'email',
}, {
title: '用户姓名',
dataIndex: 'createTime',
key: 'createTime',
}, {
title: '组织机构',
dataIndex: 'number',
key: 'number',
}, {
title: '职务',
dataIndex: 'auditStatus',
key: 'auditStatus',
},
{
title: '岗位',
dataIndex: 'boutique',
key: 'boutique',
},
{
title: '联系手机',
dataIndex: 'mobile',
key: 'mobile',
},
{
title: '上级主管姓名',
dataIndex: 'province',
key: 'province',
},
{
title: '状态',
dataIndex: 'a',
key: 'a',
}
],
dataSource: [],
};
},
componentWillMount() {
let organizationArr = [];
techAuditStatusList.map(function (item) {
organizationArr.push(