fix:修改添加作业接口判断

This commit is contained in:
lixg
2022-12-20 15:59:23 +08:00
parent e1e0622296
commit 22356826b8
7 changed files with 289 additions and 257 deletions

View File

@@ -1,12 +1,16 @@
<template>
<div>
<a-row type="flex" gutter="12" style="padding-left: 20px">
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
>
<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,31 +18,34 @@
<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>
<a-row type="flex" gutter="12" style="padding-left: 20px">
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
>
<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>
@@ -49,7 +56,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>
@@ -59,17 +66,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>
@@ -97,8 +104,8 @@
</div>
</template>
<script setup>
import {computed, defineProps, onMounted, ref, watch} 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({
@@ -135,7 +142,7 @@ const tablecolumns = ref([
title: "部门",
dataIndex: "studentDepartName",
key: "studentDepartName",
width: "20%",
width: "15%",
align: "center",
className: "h",
ellipsis: true,
@@ -144,19 +151,19 @@ const tablecolumns = ref([
title: "加入方式",
dataIndex: "source",
key: "source",
width: "20%",
width: 100,
align: "center",
customRender: ({record: {source}}) =>
({1: "快速添加", 2: "组织", 3: "受众"}[source]),
customRender: ({ record: { source } }) =>
({ 1: "快速添加", 2: "组织", 3: "受众" }[source]),
},
...props.columns,
{
title: "操作",
dataIndex: "operation",
key: "operation",
width: "25%",
width: "20%",
align: "center",
slots: {customRender: "action"},
slots: { customRender: "action" },
},
]);
const tableParam = ref({
@@ -185,9 +192,9 @@ onMounted(() => {
});
watch(props, () => {
tableParam.value.pid= props.id
tableParam.value.pid = props.id;
getStuList();
})
});
function onStuSelectChange(e) {
stuSelectKeys.value = e;
@@ -216,26 +223,25 @@ 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) {