feat:合并

This commit is contained in:
lixg
2022-12-19 21:44:44 +08:00
6 changed files with 77 additions and 86 deletions

View File

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