import React from 'react';
import { Link } from 'react-router-dom';
import './index.less';
import Page from '@src/containers/Page';
import Block from '@src/components/Block';
import FilterLayout from '@src/layouts/FilterLayout';
// import ActionLayout from '@src/layouts/ActionLayout';
import TableLayout from '@src/layouts/TableLayout';
import { getMap, formatDate } from '@src/services/Tools';
// import { SwitchSelect, ServiceKey } from '../../../../Constant';
import { User } from '../../../stores/user';
import { Course } from '../../../stores/course';
export default class extends Page {
constructor(props) {
super(props);
this.filterF = null;
this.courseMap = {};
}
init() {
this.filterForm = [
{
key: 'keyword',
type: 'input',
name: 'ID/手机号',
placeholder: '请输入',
},
{
key: 'courseId',
type: 'select',
allowClear: true,
name: '课程',
select: [],
placeholder: '请选择',
number: true,
},
];
this.columns = [
{
title: '手机号',
dataIndex: 'mobile',
},
{
title: '用户姓名',
dataIndex: 'realName',
},
{
title: '开通科目',
dataIndex: 'classes',
render: (text, record) => {
return (record.classes || []).map(row => {
return this.courseMap[row.courseId];
}).join(
);
},
},
{
title: '开通时间',
dataIndex: 'time',
render: (text, record) => {
return (record.classes || []).map(row => {
return `${formatDate(row.startTime, 'YYYY-MM-DD HH:mm:ss')} - ${formatDate(row.expireTime, 'YYYY-MM-DD HH:mm:ss')}`;
}).join(
);
},
},
{
title: '创建时间',
dataIndex: 'createTime',
render: (text) => {
return formatDate(text, 'YYYY-MM-DD HH:mm:ss');
},
}, {
title: '操作',
dataIndex: 'handler',
render: (text, record) => {
return