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 ,Checkbox,Tabs} from 'antd'; import Newrole from "./newRole.jsx" import './userMangagement.less' import {roleResources} from '../../../dataDic.js'; import {ChooseList} from "../../order/orderNew/chooseList"; const CheckboxGroup = Checkbox.Group; const {TabPane} = Tabs const Roles=Form.create()(React.createClass({ loadData(pageNo) { this.state.data = []; this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/roles', data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, roleName:this.state.roleNameSearch, }, success: function (data) { let theArr = []; if (!data.data) { 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, roleName: thisdata.roleName, creater:thisdata.creater, createTime:thisdata.createTimez, }); }; this.setState({ page: data.data.pageNo }) this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; }; if(!data.data.list.length){ this.state.pagination.current=0 this.state.pagination.total=0 } this.setState({ dataSource: theArr, pagination: this.state.pagination, selectedRowKeys:[] }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, getInitialState() { return { datauser:{}, selectedRowKeys: [], selectedRows: [], loading: false, page: 1, 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: 'roleName', key: 'roleName', width:'300px' }, { title: '创建人', dataIndex: 'creater', key: 'creater', width:'300px' }, { title: '创建时间', dataIndex: 'createTime', key: 'createTime', },{ title: '离职转交配置', dataIndex: 'ee', key: 'ee', render: (text, record, index) => { return