import React from "react"; import { Button, Input, message, Modal, Popconfirm, Spin, Table, Tooltip, } from "antd"; import $ from "jquery/src/ajax"; const ChangeLog = React.createClass({ getInitialState() { return { visible: false, enterpriseName: "", loading: false, colunmn: [ { title: "操作人名称", dataIndex: "adminName", key: "adminName", }, { title: "客户名称", dataIndex: "name", key: "name", render: (text) => { return ( {text} ); }, }, { title: "操作时间", dataIndex: "createTimes", key: "createTimes", }, ], dataSource: [], }; }, loadData() { this.setState({ loading: true, }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/customer/listUserName", data: { uid: this.props.id, }, success: function (data) { if (data.error.length || data.data.list == "") { if (data.error && data.error.length) { message.warning(data.error[0].message); } } else { this.setState({ initialName: data.data[0] ? data.data[0].name : "", }); data.data.splice(0, 1); this.setState({ dataSource: data.data, }); } }.bind(this), }).always( function () { this.setState({ loading: false, }); }.bind(this) ); }, componentWillMount() { this.loadData(); }, render() { return ( {this.state.initialName ? ( 初始客户名称:{this.state.initialName} ) : null} ); }, }); export default ChangeLog;