-- 开课学员bug

This commit is contained in:
yuping
2022-12-19 21:37:23 +08:00
parent 66464fee6a
commit 83a0ae8e18
2 changed files with 47 additions and 40 deletions

View File

@@ -4,9 +4,9 @@
<a-col> <a-col>
<a-form-item title="姓名:" @click="getStuList"> <a-form-item title="姓名:" @click="getStuList">
<a-input <a-input
class="cus-input" class="cus-input"
v-model:value="tableParam.studentName" v-model:value="tableParam.studentName"
placeholder="请输入姓名" placeholder="请输入姓名"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -14,15 +14,16 @@
<a-button class="cus-btn" style="width: 100px"> <a-button class="cus-btn" style="width: 100px">
<template #icon> <template #icon>
<img <img
style="margin-right: 10px" style="margin-right: 10px"
src="../../assets/images/courseManage/search0.png" src="../../assets/images/courseManage/search0.png"
/></template> /></template>
搜索 搜索
</a-button> </a-button>
</a-col> </a-col>
<a-col :span="2"> <a-col :span="2">
<a-button class="cus-btn white" style="width: 100px" @click="reset" <a-button class="cus-btn white" style="width: 100px" @click="reset"
>重置</a-button >重置
</a-button
> >
</a-col> </a-col>
</a-row> </a-row>
@@ -30,14 +31,14 @@
<a-row type="flex" gutter="12" style="padding-left: 20px"> <a-row type="flex" gutter="12" style="padding-left: 20px">
<a-col :span="1.5"> <a-col :span="1.5">
<CommonStudent <CommonStudent
:type="type" :type="type"
:id="id" :id="id"
@finash="submitCall" @finash="submitCall"
:stage="stage" :stage="stage"
> >
<a-button class="cus-btn"> <a-button class="cus-btn">
<template #icon <template #icon
><img ><img
style="margin-right: 10px" style="margin-right: 10px"
src="../../assets/images/courseManage/add0.png" src="../../assets/images/courseManage/add0.png"
/></template> /></template>
@@ -48,7 +49,7 @@
<a-col :span="1.5"> <a-col :span="1.5">
<a-button class="cus-btn white" @click="bathDel"> <a-button class="cus-btn white" @click="bathDel">
<template #icon <template #icon
><img ><img
style="margin-right: 10px" style="margin-right: 10px"
src="../../assets/images/projectadd/delete.png" src="../../assets/images/projectadd/delete.png"
/></template> /></template>
@@ -58,17 +59,17 @@
</a-row> </a-row>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<a-table <a-table
:columns="tablecolumns" :columns="tablecolumns"
:data-source="tableData.list" :data-source="tableData.list"
:pagination="stuPagination" :pagination="stuPagination"
:loading="tableData.loading" :loading="tableData.loading"
row-key="id" row-key="id"
:row-selection="stuRowSelection" :row-selection="stuRowSelection"
> >
<template #action="{ record }"> <template #action="{ record }">
<div <div
@click="del(record.id)" @click="del(record.id)"
style="color: #4ea6ff; font-size: 14px; text-align: center" style="color: #4ea6ff; font-size: 14px; text-align: center"
> >
删除 删除
</div> </div>
@@ -96,8 +97,8 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { computed, defineProps, onMounted, ref } from "vue"; import {computed, defineProps, onMounted, ref, watch} from "vue";
import { delStudentList, getStuPage } from "@/api/index1"; import {delStudentList, getStuPage} from "@/api/index1";
import CommonStudent from "@/components/student/CommonStudent"; import CommonStudent from "@/components/student/CommonStudent";
const props = defineProps({ const props = defineProps({
@@ -145,8 +146,8 @@ const tablecolumns = ref([
key: "source", key: "source",
width: "10%", width: "10%",
align: "center", align: "center",
customRender: ({ record: { source } }) => customRender: ({record: {source}}) =>
({ 1: "快速添加", 2: "组织", 3: "受众" }[source]), ({1: "快速添加", 2: "组织", 3: "受众"}[source]),
}, },
...props.columns, ...props.columns,
{ {
@@ -155,7 +156,7 @@ const tablecolumns = ref([
key: "operation", key: "operation",
width: "25%", width: "25%",
align: "center", align: "center",
slots: { customRender: "action" }, slots: {customRender: "action"},
}, },
]); ]);
const tableParam = ref({ const tableParam = ref({
@@ -183,6 +184,11 @@ onMounted(() => {
getStuList(); getStuList();
}); });
watch(props, () => {
tableParam.value.pid= props.id
getStuList();
})
function onStuSelectChange(e) { function onStuSelectChange(e) {
stuSelectKeys.value = e; stuSelectKeys.value = e;
} }
@@ -209,25 +215,26 @@ function getStuList() {
}); });
} }
function reset() {} function reset() {
}
function bathDel() { function bathDel() {
stuSelectKeys.value && stuSelectKeys.value &&
stuSelectKeys.value.length && stuSelectKeys.value.length &&
delStudentList({ delStudentList({
ids: stuSelectKeys.value, ids: stuSelectKeys.value,
}).then(() => { }).then(() => {
getStuList(); getStuList();
}); });
} }
function del(id) { function del(id) {
id && id &&
delStudentList({ delStudentList({
ids: [id], ids: [id],
}).then(() => { }).then(() => {
getStuList(); getStuList();
}); });
} }
function submitCall(flag) { function submitCall(flag) {

View File

@@ -2278,7 +2278,7 @@
<span>{{ currentPlanItem.teacher }}</span> <span>{{ currentPlanItem.teacher }}</span>
</div> </div>
<div class="stmm_i5"> <div class="stmm_i5">
<TableStudent :type="3" :id="offcourseId" :columns="stuColumns"> <TableStudent :type="3" :id="offcoursePlanId" :columns="stuColumns">
<!-- <template #extension = "data">--> <!-- <template #extension = "data">-->
<!-- <div style="display: flex">--> <!-- <div style="display: flex">-->
<!-- <button @click="handlJoinStu(data)">成绩录入</button>--> <!-- <button @click="handlJoinStu(data)">成绩录入</button>-->
@@ -4982,7 +4982,7 @@ export default defineComponent({
console.log(state.currentPlanItem); console.log(state.currentPlanItem);
state.sm_hs = true; state.sm_hs = true;
getTableDate2(); // getTableDate2();
}; };
const sm_exit = () => { const sm_exit = () => {
state.sm_hs = false; state.sm_hs = false;