--fix bug 添加学员异步加载刷新

This commit is contained in:
yuping
2023-03-24 16:53:11 +08:00
parent 7d26c2dfcf
commit 7b98178e34
4 changed files with 6 additions and 6 deletions

View File

@@ -131,7 +131,6 @@ const { start } = useTimeout(async ({ uuid, file }) => {
const closeDrawer = () => {
visible.value = false;
fileList.value = [];
emit("change", "end");
};
function openDrawer() {

View File

@@ -663,7 +663,6 @@ function handleStageOk() {
groupId: props.groupId,
}).then(() => {
deleteDepSelect();
emit("finash", true);
});
}

View File

@@ -77,7 +77,7 @@
@finash="submitCall"
:stage="stage"
>
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff">
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff" :loading="stuAsyncLoading">
<template #icon><img style="margin-right: 10px" src="../../assets/images/courseManage/add0.png"/>
</template>
添加学员
@@ -120,7 +120,7 @@ import {checkPer} from "@/utils/utils";
import dialog from "@/utils/dialog";
import {ONLINE_COURSE_DEL} from "@/api/ThirdApi";
import {useStore} from "vuex";
import {useResetRef} from "@/utils/useCommon";
import {useAsyncStu, useResetRef} from "@/utils/useCommon";
const props = defineProps({
permissions: {
@@ -268,6 +268,7 @@ const sysTypeOption2 = computed(() => sysTypeOption1.value?.children.find(({ cod
const sysTypeOption3 = computed(() => sysTypeOption2.value?.children.find(({ code }) => code == formData.value.sysType2));
const { data: studentList, fetch: searchStu, total, loading } = usePage(STUDENT_LIST, searchParams, false);
const { loading: stuAsyncLoading, start } = useAsyncStu(formData.value.id, props.type, searchStu);
const stuPagination = computed(() => ({
total: total.value,
@@ -302,6 +303,7 @@ function del(id) {
}
function submitCall(flag) {
flag && start({ id: formData.value.id });
flag && searchStu();
}

View File

@@ -58,8 +58,8 @@ export function useTimeout(asyncFun, time) {
export function useAsyncStu(id, type, func) {
const loading = ref(false);
const { start } = useTimeout(async () => {
const { data } = await request(ASYNC_STUDENT_STATUS, { id, type });
const { start } = useTimeout(async (d = {}) => {
const { data } = await request(ASYNC_STUDENT_STATUS, { ...{ id, type }, ...d });
if (!data) {
loading.value = false;
throw Error("查询任务结束");