mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 03:46:45 +08:00
--fix bug 添加学员异步加载刷新
This commit is contained in:
@@ -131,7 +131,6 @@ const { start } = useTimeout(async ({ uuid, file }) => {
|
|||||||
const closeDrawer = () => {
|
const closeDrawer = () => {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
fileList.value = [];
|
fileList.value = [];
|
||||||
emit("change", "end");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function openDrawer() {
|
function openDrawer() {
|
||||||
|
|||||||
@@ -663,7 +663,6 @@ function handleStageOk() {
|
|||||||
groupId: props.groupId,
|
groupId: props.groupId,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
deleteDepSelect();
|
deleteDepSelect();
|
||||||
|
|
||||||
emit("finash", true);
|
emit("finash", true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
@finash="submitCall"
|
@finash="submitCall"
|
||||||
:stage="stage"
|
: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 #icon><img style="margin-right: 10px" src="../../assets/images/courseManage/add0.png"/>
|
||||||
</template>
|
</template>
|
||||||
添加学员
|
添加学员
|
||||||
@@ -120,7 +120,7 @@ import {checkPer} from "@/utils/utils";
|
|||||||
import dialog from "@/utils/dialog";
|
import dialog from "@/utils/dialog";
|
||||||
import {ONLINE_COURSE_DEL} from "@/api/ThirdApi";
|
import {ONLINE_COURSE_DEL} from "@/api/ThirdApi";
|
||||||
import {useStore} from "vuex";
|
import {useStore} from "vuex";
|
||||||
import {useResetRef} from "@/utils/useCommon";
|
import {useAsyncStu, useResetRef} from "@/utils/useCommon";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
permissions: {
|
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 sysTypeOption3 = computed(() => sysTypeOption2.value?.children.find(({ code }) => code == formData.value.sysType2));
|
||||||
|
|
||||||
const { data: studentList, fetch: searchStu, total, loading } = usePage(STUDENT_LIST, searchParams, false);
|
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(() => ({
|
const stuPagination = computed(() => ({
|
||||||
total: total.value,
|
total: total.value,
|
||||||
@@ -302,6 +303,7 @@ function del(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function submitCall(flag) {
|
function submitCall(flag) {
|
||||||
|
flag && start({ id: formData.value.id });
|
||||||
flag && searchStu();
|
flag && searchStu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ export function useTimeout(asyncFun, time) {
|
|||||||
export function useAsyncStu(id, type, func) {
|
export function useAsyncStu(id, type, func) {
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
const { start } = useTimeout(async () => {
|
const { start } = useTimeout(async (d = {}) => {
|
||||||
const { data } = await request(ASYNC_STUDENT_STATUS, { id, type });
|
const { data } = await request(ASYNC_STUDENT_STATUS, { ...{ id, type }, ...d });
|
||||||
if (!data) {
|
if (!data) {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
throw Error("查询任务结束");
|
throw Error("查询任务结束");
|
||||||
|
|||||||
Reference in New Issue
Block a user