123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- import React,{Component} from "react";
- import {message, Modal, Spin, Table, Tooltip} from "antd";
- import $ from "jquery/src/ajax";
- class MainBusinessLog extends Component{
- constructor(props) {
- super(props);
- this.state={
- loading: false,
- dataSource:[],
- columns:[
- {
- title: '序号',
- dataIndex: 'id',
- key: 'id',
- },
- {
- title: '内容',
- dataIndex: 'remarks',
- key: 'remarks',
- width:500,
- render: text => {
- return (
- <Tooltip title={text}>
- <div style={{
- maxWidth:'500px',
- overflow:'hidden',
- textOverflow: "ellipsis",
- whiteSpace:'nowrap',
- }}>{text}</div>
- </Tooltip>
- )
- }
- },
- {
- title: '时间',
- dataIndex: 'createTimes',
- key: 'createTimes',
- },
- ],
- }
- }
- loadData() {
- this.setState({
- loading: true,
- });
- $.ajax({
- method: 'get',
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/userDateLogList',
- data:{
- uid:this.props.uid
- },
- success: function(data) {
- if(data.error.length === 0){
- this.setState({
- dataSource: data.data,
- });
- }else{
- message.warning(data.error[0].message);
- }
- }.bind(this),
- }).always(function() {
- this.setState({
- loading: false
- });
- }.bind(this));
- }
- componentDidMount() {
- this.loadData();
- }
- render() {
- return (
- <Modal
- maskClosable={false}
- className="customeDetails"
- footer=""
- title="主营日志"
- width="800px"
- visible={this.props.visible}
- onOk={this.props.onCancel}
- onCancel={this.props.onCancel}
- >
- <div>
- <Spin spinning={this.state.loading}>
- <Table
- size="middle"
- columns={this.state.columns}
- dataSource={this.state.dataSource}
- />
- </Spin>
- </div>
- </Modal>
- )
- }
- }
- export default MainBusinessLog;
|