import React from 'react'; import { Link } from 'react-router-dom'; import { Button, Modal, Form, Icon, Upload } from 'antd'; 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 { formatTreeData, getMap } from '@src/services/Tools'; import { asyncSMessage } from '@src/services/AsyncTools'; import { CourseModule, CourseVideoType } from '../../../../Constant'; import { System } from '../../../stores/system'; import { Course } from '../../../stores/course'; import { Exercise } from '../../../stores/exercise'; const CourseModuleMap = getMap(CourseModule, 'value', 'label'); const CourseVideoTypeMap = getMap(CourseVideoType, 'value', 'label'); export default class extends Page { init() { this.exerciseMap = {}; this.filterForm = [ { key: 'structId', type: 'tree', allowClear: true, tree: [], name: '学科', placeholder: '标题或正文', }, { key: 'courseModule', type: 'select', name: '课程种类', allowClear: true, select: CourseModule, placeholder: '请输入', }, ]; this.actionList = [{ key: 'info', name: '首页视频', }, { key: 'addVideo', type: 'primary', name: '创建视频课程', render: (item) => { return ; }, }, { key: 'addOnline', type: 'primary', name: '创建小班课程', render: (item) => { return ; }, }, { key: 'addVs', type: 'primary', name: '编辑1vs1课程', render: (item) => { return ; }, }]; this.columns = [{ title: '课程种类', dataIndex: 'courseModule', render: (text) => { return CourseModuleMap[text] || text; }, }, { title: '学科', dataIndex: 'structId', render: (text, record) => { return `${record.parentStructId ? `${this.exerciseMap[record.parentStructId]}-` : ''}${this.exerciseMap[record.structId]}`; }, }, { title: '类型', dataIndex: 'videoType', render: (text) => { return CourseVideoTypeMap[text] || text; }, }, { title: '课程名称', dataIndex: 'title', }, { title: '售价', dataIndex: 'price', }, { title: '试听人数', dataIndex: 'trailNumber', }, { title: '购买数量(含套餐)', dataIndex: 'saleNumber', render: (text, record) => { return text + record.packageSaleNumber; }, }, { title: '操作', dataIndex: 'handler', render: (text, record) => { return