初始化
This commit is contained in:
70
src/page/Dashboard/DataManager/ManageTableColumn.js
Normal file
70
src/page/Dashboard/DataManager/ManageTableColumn.js
Normal file
@ -0,0 +1,70 @@
|
||||
import {Button, Space} from "antd";
|
||||
import CourseTypeTag from "../../../component/Workload/CourseTypeTag";
|
||||
|
||||
const ManageTableColumn = (commonAxios, messageApi, fetchWorkload) => [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
responsive: ['lg'],
|
||||
render: (text) => <span key={text}>{text}</span>
|
||||
},
|
||||
{
|
||||
title: '授课名称',
|
||||
dataIndex: 'courseName',
|
||||
key: 'courseName',
|
||||
render: (text) => <span key={text}>{text}</span>
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'teacherName',
|
||||
key: 'teacherName',
|
||||
responsive: ['lg'],
|
||||
render: (text) => <span key={text}>{text}</span>
|
||||
},
|
||||
{
|
||||
title: '课程性质',
|
||||
dataIndex: 'courseNature',
|
||||
key: 'courseNature',
|
||||
responsive: ['lg'],
|
||||
render: (text) => <CourseTypeTag key={text} courseNature={text}/>,
|
||||
},
|
||||
{
|
||||
title: '授课专业',
|
||||
dataIndex: 'teachingMajor',
|
||||
key: 'teachingMajor',
|
||||
responsive: ['lg'],
|
||||
render: (text) => <span key={text}>{text}</span>
|
||||
},
|
||||
{
|
||||
title: '工作量',
|
||||
dataIndex: 'totalClassHours',
|
||||
key: 'totalClassHours',
|
||||
render: (text) => <span key={text}>{text}</span>
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'operation',
|
||||
key: 'operation',
|
||||
render: (_, record) => (
|
||||
<Space size={"middle"}>
|
||||
<Button danger onClick={() => {
|
||||
let id = record.id;
|
||||
let param = [];
|
||||
param.push(id);
|
||||
let url = `/api/v1/workload/delete`
|
||||
commonAxios.delete(url, {data: param}).then(res => {
|
||||
if (res.data.data && res.data.data === true) {
|
||||
messageApi.success("删除成功");
|
||||
fetchWorkload()
|
||||
} else {
|
||||
messageApi.warning('您要删除的数据不存在或已被删除!');
|
||||
}
|
||||
})
|
||||
}}>删除</Button>
|
||||
</Space>
|
||||
)
|
||||
},
|
||||
];
|
||||
|
||||
export default ManageTableColumn;
|
||||
Reference in New Issue
Block a user