-- fix bug

This commit is contained in:
yuping
2023-03-03 19:23:23 +08:00
parent 55b0c887b4
commit 8b6e5201ce
4 changed files with 144 additions and 88 deletions

View File

@@ -1,14 +1,15 @@
//学员列表带分页
export const USER_LIST_PAGE = '/userbasic/user/list post'
export const USER_LIST_PAGE = "/userbasic/user/list post";
//学员列表 没有分页数据 只能通过名称检索 速度较快
export const USER_LIST = '/userbasic/user/searchList post'
export const ORG_LIST = '/userbasic/org/list post'
export const ORG_CHILD_LIST = '/userbasic/org/info post'
export const USER_LIST = "/userbasic/user/searchList post";
export const ORG_LIST = "/userbasic/org/list post";
export const ORG_CHILD_LIST = "/userbasic/org/info post";
// export const AUDIENCE_LIST = '/userbasic/audience/list post'
//当前用户可以查看的受众接口
export const AUDIENCE_LIST = '/userbasic/audience/userAudiencesFilter post'
export const USER_PERMISSION = '/userbasic/permission/listByUser post'
export const CASE_PAGE = '/systemapi/xboe/m/boe/cases/pagelist post formData'
export const EXAM_PAPER_PAGE = '/systemapi/xboe/m/exam/paper/querylist post formData'
export const TEST_PAGE = '/api/b1/system/quiz/quiz-list post formData'
export const ONLINE_PAGE = '/systemapi/xboe/m/course/manage/pagelist post formData'
export const AUDIENCE_LIST = "/userbasic/audience/userAudiencesFilter post";
export const USER_PERMISSION = "/userbasic/permission/listByUser post";
export const CASE_PAGE = "/systemapi/xboe/m/boe/cases/pagelist post formData";
export const EXAM_PAPER_PAGE = "/systemapi/xboe/m/exam/paper/querylist post formData";
export const TEST_PAGE = "/api/b1/system/quiz/quiz-list post formData";
export const ONLINE_PAGE = "/systemapi/xboe/m/course/manage/pagelist post formData";
export const ONLINE_COURSE_DEL = (id, courseId) => `/systemapi/xboe/school/study/course/delete-signup?id=${id}&couserId=${courseId} post`;

View File

@@ -237,7 +237,7 @@ export function useRequest(_url, params = {}, init = true) {
};
}
export async function boeRequest(_url, params) {
export async function boeRequest(_url, params = {}) {
const s = _url.split(' ')
let url = s[0]
const method = s[1]?.toLowerCase() || 'get'

View File

@@ -1,14 +1,14 @@
<template>
<a-modal
:visible="visiable"
:centered="true"
width="70%"
title="学员管理"
@cancel="closeDrawer"
:visible="visiable"
:centered="true"
width="70%"
title="学员管理"
@cancel="closeDrawer"
>
<div class="header-content">
<div style="font-size: 16px">
{{formData.name}} 课程
{{ formData.name }} 课程
</div>
<div>
<span style="color:#999">内容分类</span>12312
@@ -22,24 +22,24 @@
</div>
<div class="TableStudent">
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
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="请输入学员名称"
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"
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>
@@ -55,17 +55,17 @@
</a-row>
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
>
<a-col :span="1.5">
<CommonStudent
:type="type"
title="添加在线课学员"
:id="id"
@finash="submitCall"
:stage="stage"
:type="type"
title="添加在线课学员"
:id="formData.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"/>
@@ -77,17 +77,16 @@
</a-row>
<div style="margin-top: 20px">
<a-table
:columns="columns"
:data-source="studentList"
:pagination="stuPagination"
:loading="loading"
row-key="id"
:row-selection="stuRowSelection"
:columns="columns"
:data-source="studentList"
:pagination="stuPagination"
:loading="loading"
row-key="id"
>
<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-button v-if="checkPer(permissions)" @click="del(record.courseStuId)" type="link" danger>删除</a-button>
</a-space>
</template>
</a-table>
@@ -96,22 +95,20 @@
</a-modal>
</template>
<script setup>
import {computed, createVNode, defineExpose, defineProps, ref, watch} from "vue";
import {usePage} from "@/api/request";
import {computed, defineExpose, defineProps, ref, watch} from "vue";
import {boeRequest, 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";
import dialog from "@/utils/dialog";
import {ONLINE_COURSE_DEL} from "@/api/ThirdApi";
const props = defineProps({
permissions: {
type: String,
default: ''
default: ""
},
type: Number,
id: String,
stage: {
type: Array,
default: () => [],
@@ -128,20 +125,20 @@ const initParams = {
studentName: "",
pageNo: 1,
pageSize: 10,
type: props.type || '',
type: props.type || "",
types: props.types,
pid: props.id || '',
}
pid: props.id || "",
};
const searchParams = ref(initParams)
const searchName = ref('')
const searchParams = ref(initParams);
const searchName = ref("");
const columns = ref([
{
title: "姓名",
dataIndex: "studentName",
key: "studentName",
width: 30,
width: 50,
align: "center",
ellipsis: true,
},
@@ -161,19 +158,89 @@ const columns = ref([
align: "center",
ellipsis: true,
},
{
title: "岗位",
dataIndex: "studentJobName",
key: "studentJobName",
width: 80,
align: "center",
ellipsis: true,
},
{
title: "Band",
dataIndex: "studentBandDesc",
key: "studentBandDesc",
width: 80,
align: "center",
ellipsis: true,
},
{
title: "报名状态",
dataIndex: "studentDepartName",
key: "studentDepartName",
width: 80,
align: "center",
ellipsis: true,
customRender: () => "已报名",
},
{
title: "加入方式",
dataIndex: "studentDepartName",
key: "studentDepartName",
width: 80,
align: "center",
ellipsis: true,
customRender: () => "手动加入",
},
{
title: "数据来源",
dataIndex: "id",
key: "id",
width: 80,
align: "center",
ellipsis: true,
customRender: () => "-",
},
{
title: "评估状态",
dataIndex: "status",
key: "status",
width: 80,
align: "center",
ellipsis: true,
customRender: () => "-",
},
{
title: "考试成绩",
dataIndex: "score",
key: "score",
width: 80,
align: "center",
ellipsis: true,
customRender: ({ record: { score } }) => score || "-",
},
{
title: "状态",
dataIndex: "status",
key: "status",
width: 80,
align: "center",
ellipsis: true,
customRender: ({ record: { status } }) => status ? "已完成" : "未开始",
},
{
title: "操作",
dataIndex: "operation",
key: "operation",
width: 50,
align: "center",
slots: {customRender: "action"},
slots: { customRender: "action" },
},
])
]);
const formData = ref({})
const formData = ref({});
const {data: studentList, fetch: searchStu, total, loading} = usePage(STUDENT_LIST, searchParams)
const { data: studentList, fetch: searchStu, total, loading } = usePage(STUDENT_LIST, searchParams, false);
const stuPagination = computed(() => ({
total: total.value,
@@ -183,23 +250,13 @@ const stuPagination = computed(() => ({
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 = (raw) => {
console.log(raw);
formData.value = raw
searchParams.value.pid = raw.id;
formData.value = raw;
visiable.value = true;
searchStu();
};
const changePagination = (page) => {
@@ -207,20 +264,17 @@ const changePagination = (page) => {
};
function del(id) {
Modal.confirm({
title: () => '确定删除?',
icon: () => createVNode(ExclamationCircleOutlined),
content: () => '数据删除后不可恢复!',
okText: () => '确定',
okType: 'danger',
cancelText: () => '取消',
onOk() {
dialog({ content: "确定删除?", ok: async () => {
if (id) {
loading.value = true
delStudentList({ids: [id]}).then(() => searchStu())
loading.value = true;
await boeRequest(ONLINE_COURSE_DEL(id, formData.value.id))
searchStu()
}
},
});
}});
}
function submitCall(flag) {
flag && searchStu();
}
const closeDrawer = () => {
@@ -228,13 +282,13 @@ const closeDrawer = () => {
};
function reset() {
searchParams.value = initParams
searchName.value = ''
searchParams.value = initParams;
searchName.value = "";
}
watch(visiable, () => {
visiable.value && searchStu()
searchParams.value = initParams
visiable.value && searchStu();
searchParams.value = initParams;
});
defineExpose({
@@ -242,7 +296,7 @@ defineExpose({
loading,
closeDrawer,
openDrawer
})
});
</script>
<style lang="scss">
.header-content {

View File

@@ -32,6 +32,7 @@ const stuRef = ref()
onMounted(() => {
window.openSelectStu = stuRef.value.openDrawer
})
</script>
<style lang="scss">
.courseManage {