Files
fe-manage/src/components/student/OnlineClassModelStudent.vue
2023-02-12 19:02:06 +08:00

604 lines
14 KiB
Vue

<template>
<a-modal
:visible="visiable"
:centered="true"
:width="1000"
title="学员管理"
@cancel="closeDrawer"
>
<div class="header-content">
<div>
xxxxxxxx课程
</div>
<div>
内容分类:12312
</div>
<div>
授课教师:12312
</div>
<div>
状态审核:12312
</div>
</div>
<div class="TableStudent">
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
>
<a-col>
<a-form-item title="学员名称:">
<a-input
class="cus-input"
v-model:value="searchParams.studentName"
placeholder="请输入学员名称"
/>
</a-form-item>
</a-col>
<a-col>
<a-button
class="cus-btn"
style="background: #4ea6ff; color: #fff; width: 100px"
@click="searchStu"
>
<template #icon>
<img
style="margin-right: 10px"
src="../../assets/images/courseManage/search0.png"
/></template>
搜索
</a-button>
</a-col>
<a-col :span="2">
<a-button class="cus-btn white" style="width: 100px" @click="reset">
<template #icon>
<img
style="margin-right: 10px"
src="../../assets/images/leveladd/reset.png"
/></template>
重置
</a-button>
</a-col>
</a-row>
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
v-if="checkPer(permissions)"
>
<a-col :span="1.5">
<CommonStudent
:type="type"
:id="id"
@finash="submitCall"
:stage="stage"
>
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff">
<template #icon
><img
style="margin-right: 10px"
src="../../assets/images/courseManage/add0.png"
/></template>
添加学员
</a-button>
</CommonStudent>
</a-col>
<!-- 新加导入学员 批量换组 导出学习信息 -->
<a-col :span="1.5" v-if="type === 1 || type === 2">
<a-button class="cus-btn white" @click="showImpStu">
<template #icon
><img
style="margin-right: 10px"
src="../../assets/images/basicinfo/in2.png"
/></template>
导入学员
</a-button>
</a-col>
<!--
<a-col :span="1.5" v-if="type === 1">
<a-button class="cus-btn white"> 批量换组 </a-button>
</a-col>-->
<a-col :span="1.5" v-if="type === 1">
<a-button class="cus-btn white" @click="exportTaskStu">
导出学习信息
</a-button>
</a-col>
<a-col :span="1.5" v-if="type === 2">
<a-button class="cus-btn white" @click="exportTaskStuRouter">
导出学习信息
</a-button>
</a-col>
<a-col :span="1.5">
<a-button class="cus-btn white" @click="bathDel">
<template #icon
><img
style="margin-right: 10px"
src="../../assets/images/projectadd/delete.png"
/></template>
批量删除
</a-button>
</a-col>
<a-col :span="1.5" v-if="type === 2">
<a-button class="cus-btn white" @click="showChangeModal">
<template #icon></template>
批量调整关卡
</a-button>
</a-col>
<!-- 新加批量操作导出导出作业 -->
<a-col :span="1.5" v-if="type === 3" class="batchOpera">
<div class="stmm_btn btn4" @click="hideShow">
<div class="btn4_sub">
<span style="color: #4ea6ff; margin-right: 4px"> 批量操作 </span>
<div
class="b_zk"
:style="{ display: hideshow ? 'block' : 'none' }"
></div>
<div
class="b_sq"
:style="{ display: hideshow ? 'none' : 'block' }"
></div>
</div>
<div
class="btn4_sup"
:style="{ display: hideshow ? 'none' : 'block' }"
>
<div class="btnsbox">
<div class="btn4_tit" @click="showEScoreModal">
<span>批量录入成绩</span>
</div>
<div class="btn4_op1" @click="updateStatus(1)">
<span>批量结业</span>
</div>
<div class="btn4_op2" @click="updateStatus(0)">
<span>批量通过</span>
</div>
<div class="btn4_op3" @click="updateStatus(2)">
<span>批量拒绝</span>
</div>
</div>
</div>
</div>
<div class="stmm_btn btn5" @click="exportStu">
<div class="export"></div>
<div class="btnText">导出</div>
</div>
<div
class="stmm_btn btn5"
style="margin-left: 15px"
@click="exportHomeWorkShow"
>
<div class="btnText">导出作业</div>
</div>
</a-col>
</a-row>
<div style="margin-top: 20px">
<a-table
:columns="columns"
:data-source="studentList"
:pagination="stuPagination"
:loading="loading"
row-key="id"
:row-selection="stuRowSelection"
>
<template #action="{ record }">
<a-space :size="2">
<slot name="extension" v-bind:data="{ record }"></slot>
<a-button v-if="checkPer(permissions)" @click="del(record.id)" type="link" danger>删除</a-button>
</a-space>
</template>
</a-table>
</div>
</div>
</a-modal>
</template>
<script setup>
import {computed, createVNode, defineProps, defineExpose, ref, watch} from "vue";
import {usePage} from "@/api/request";
import {STUDENT_LIST} from "@/api/apis";
import {delStudentList} from "@/api/index1";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
import {Modal} from "ant-design-vue";
import CommonStudent from "@/components/student/CommonStudent";
import {checkPer} from "@/utils/utils";
const props = defineProps({
permissions: {
type: String,
default: ''
},
type: Number,
id: String,
stage: {
type: Array,
default: () => [],
},
types: {
type: Array,
default: () => [],
},
});
const visiable = ref(false);
const initParams = {
studentName: "",
pageNo: 1,
pageSize: 10,
type: props.type || '',
types: props.types,
pid: props.id || '',
}
const searchParams = ref(initParams)
const searchName = ref('')
const columns = ref([
{
title: "姓名",
dataIndex: "studentName",
key: "studentName",
width: 30,
align: "center",
ellipsis: true,
},
{
title: "工号",
dataIndex: "studentUserNo",
key: "studentUserNo",
width: 50,
align: "center",
ellipsis: true,
},
{
title: "部门",
dataIndex: "studentDepartName",
key: "studentDepartName",
width: 80,
align: "center",
ellipsis: true,
},
{
title: "操作",
dataIndex: "operation",
key: "operation",
width: 50,
align: "center",
slots: {customRender: "action"},
},
])
const {data: studentList, fetch: searchStu, total, loading} = usePage(STUDENT_LIST, searchParams)
const stuPagination = computed(() => ({
total: total.value,
showSizeChanger: false,
current: searchParams.value.pageNo,
pageSize: searchParams.value.pageSize,
onChange: changePagination
}));
const stuSelectKeys = ref([]);
const stuRowSelection = computed(() => ({
columnWidth: 20,
selectedRowKeys: stuSelectKeys.value,
onChange: onStuSelectChange,
preserveSelectedRowKeys: true,
}));
function onStuSelectChange(e) {
stuSelectKeys.value = e;
}
const openDrawer = () => {
visiable.value = true;
};
const changePagination = (page) => {
searchParams.value.pageNo = page;
};
function del(id) {
Modal.confirm({
title: () => '确定删除?',
icon: () => createVNode(ExclamationCircleOutlined),
content: () => '数据删除后不可恢复!',
okText: () => '确定',
okType: 'danger',
cancelText: () => '取消',
onOk() {
if (id) {
loading.value = true
delStudentList({ids: [id]}).then(() => searchStu())
}
},
});
}
const closeDrawer = () => {
visiable.value = false;
};
function reset() {
searchParams.value = initParams
searchName.value = ''
}
watch(visiable, () => {
visiable.value && searchStu()
searchParams.value = initParams
});
defineExpose({
searchStu,
loading,
closeDrawer,
openDrawer
})
</script>
<style lang="scss">
.header-content{
padding:20px;
border:1px solid #eef9f3;
margin-bottom: 20px;
div{
margin-top: 10px;
}
}
.cus-btn {
width: 100%;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16px;
border: 1px solid #4ea6ff;
border-radius: 8px;
background: #4ea6ff;
cursor: pointer;
color: #fff;
}
.white {
background: #fff;
color: #4ea6ff;
}
.cus-input {
height: 40px;
border-radius: 8px;
}
.cus-select {
height: 40px;
border-radius: 8px;
}
.CommonStudent {
.ant-btn-primary {
background-color: #4ea6ff !important;
}
.cus-select {
height: 40px;
border-radius: 8px;
}
.tableBox .ant-table-row .ant-table-cell {
height: 48px;
font-size: 14px;
font-weight: 400;
color: #4f5156;
line-height: 29px;
padding: 0px;
}
.tableBox .ant-table-thead tr th {
font-size: 14px;
}
.ant-tabs-tabpane {
height: 100%;
}
.ant-tabs {
overflow: visible;
}
.right1 {
border-left: 1px solid #f2f6fe;
margin-left: 20px;
.onerow {
display: flex;
justify-content: space-between;
align-items: center;
margin-right: 40px;
flex-wrap: wrap;
width: 100%;
.onleft {
display: flex;
text-align: center;
.already {
color: rgba(51, 51, 51, 1);
font-size: 16px;
font-weight: 500;
margin-left: 32px;
white-space: nowrap;
// margin-bottom: 20px;
}
.count {
color: #4ea6ff;
font-size: 16px;
margin: 0 6px;
}
.peo {
color: rgba(51, 51, 51, 1);
font-size: 16px;
font-weight: 500;
}
}
.clbox {
margin-right: 50px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
width: 104px;
height: 32px;
border-radius: 4px;
background: #4ea6ff;
.colose {
width: 16px;
height: 16px;
// border-radius: 8px;
// background: #ffffff;
// position: relative;
background-image: url(../../assets/images/basicinfo/ch.png);
background-size: 100%;
margin-right: 4px;
}
.allclear {
color: rgba(255, 255, 255, 1);
font-size: 14px;
}
}
}
.selecteds {
display: flex;
flex-wrap: wrap;
margin-left: 32px;
.person {
width: 100%;
margin-top: 20px;
border-top: 1px solid #f2f6fe;
}
.chose {
width: 64px;
height: 24px;
margin-top: 25px;
margin-right: 25px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
border: 1px solid rgba(56, 139, 225, 1);
color: rgba(56, 139, 225, 1);
font-size: 12px;
position: relative;
.ch {
position: absolute;
width: 18px;
height: 18px;
background-image: url(../../assets/images/basicinfo/ch.png);
right: -8px;
top: -8px;
}
}
.ifsw {
display: flex;
align-items: end;
justify-content: center;
color: #4ea6ff;
}
.sw {
display: flex;
align-items: center;
justify-content: center;
text-align: justify;
color: #4ea6ff;
margin-top: 23px;
margin-left: 10px;
}
.dept {
width: 100%;
margin-top: 30px;
border-top: 1px solid #f2f6fe;
}
.chose1 {
//width: 90px;
height: 24px;
margin-top: 25px;
margin-right: 25px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
border: 1px solid rgba(56, 139, 225, 1);
color: rgba(56, 139, 225, 1);
font-size: 12px;
position: relative;
.span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.ch1 {
position: absolute;
width: 18px;
height: 18px;
background-image: url(../../assets/images/basicinfo/ch.png);
right: -8px;
top: -8px;
}
}
.group {
width: 100%;
margin-top: 30px;
border-top: 1px solid #f2f6fe;
}
.chose2 {
//width: 120px;
height: 24px;
margin-top: 25px;
margin-right: 25px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
border: 1px solid rgba(56, 139, 225, 1);
color: rgba(56, 139, 225, 1);
font-size: 12px;
position: relative;
.span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.ch2 {
position: absolute;
width: 18px;
height: 18px;
background-image: url(../../assets/images/basicinfo/ch.png);
right: -8px;
top: -8px;
}
}
}
}
}
</style>