mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-08 18:36:46 +08:00
--fix bug 添加学员异步加载刷新
This commit is contained in:
@@ -131,7 +131,6 @@ const { start } = useTimeout(async ({ uuid, file }) => {
|
||||
const closeDrawer = () => {
|
||||
visible.value = false;
|
||||
fileList.value = [];
|
||||
emit("change", "end");
|
||||
};
|
||||
|
||||
function openDrawer() {
|
||||
|
||||
@@ -663,7 +663,6 @@ function handleStageOk() {
|
||||
groupId: props.groupId,
|
||||
}).then(() => {
|
||||
deleteDepSelect();
|
||||
|
||||
emit("finash", true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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("查询任务结束");
|
||||
|
||||
Reference in New Issue
Block a user