mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
-- fix bug
This commit is contained in:
@@ -6,3 +6,4 @@ export const ROUTER_DETAIL_MODIFY = '/admin/router/routerInfoTemp post';
|
||||
export const PROJECT_DETAIL_MODIFY = '/admin/project/projectInfoTemp post';
|
||||
export const PROJECT_TEMPLATE_DETAIL_MODIFY = '/admin/project/template/editStageAndTask post';
|
||||
export const PROJECT_RELEASE = '/admin/project/realease';
|
||||
export const ASYNC_STUDENT_STATUS = '/admin/cache/getStudentAsyncStatus';
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<div><span>{{ content }}</span></div>
|
||||
</div>
|
||||
<div class="del_btnbox">
|
||||
<div class="del_btn btn2" @click="close">
|
||||
<div class="del_btn btn2" @click="close" v-if="cancel">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="del_btn btn2" @click="handleConfirm">
|
||||
@@ -34,9 +34,9 @@
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup>
|
||||
import notide from '@/assets/images/coursewareManage/notice.png'
|
||||
import infoPng from '@/assets/images/coursewareManage/QR.png'
|
||||
import {defineProps, ref} from "vue";
|
||||
import notide from "@/assets/images/coursewareManage/notice.png";
|
||||
import infoPng from "@/assets/images/coursewareManage/QR.png";
|
||||
import {defineProps, onMounted, ref} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
close: {
|
||||
@@ -50,22 +50,34 @@ const props = defineProps({
|
||||
content: String,
|
||||
title: {
|
||||
type: String,
|
||||
default: '提示'
|
||||
default: "提示"
|
||||
},
|
||||
cancel: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
duration: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
type: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
})
|
||||
});
|
||||
const types = {
|
||||
1: infoPng,
|
||||
2: notide
|
||||
}
|
||||
const type = ref(1)
|
||||
};
|
||||
const type = ref(1);
|
||||
|
||||
onMounted(() => {
|
||||
props.duration && setTimeout(() => props.close(), props.duration)
|
||||
});
|
||||
|
||||
function handleConfirm() {
|
||||
props.ok()
|
||||
props.close()
|
||||
props.ok();
|
||||
props.close();
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
class="cus-btn"
|
||||
style="background: #4ea6ff; color: #fff; width: 100px"
|
||||
@click="search"
|
||||
:loading="stuAsyncLoading"
|
||||
>
|
||||
<template #icon
|
||||
><img
|
||||
@@ -131,7 +132,6 @@
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
// createVNode,
|
||||
defineProps,
|
||||
defineExpose,
|
||||
ref,
|
||||
@@ -140,8 +140,7 @@ import {
|
||||
import { 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 {useAsyncStu} from "@/utils/useCommon";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
@@ -231,6 +230,9 @@ const {
|
||||
loading,
|
||||
} = usePage(STUDENT_LIST, searchParams);
|
||||
|
||||
const { loading: stuAsyncLoading } = useAsyncStu(props.id, props.types.join(","), searchStu);
|
||||
|
||||
|
||||
const stuPagination = computed(() => ({
|
||||
total: total.value,
|
||||
showSizeChanger: false,
|
||||
@@ -250,6 +252,7 @@ const changePagination = (page) => {
|
||||
function search() {
|
||||
searchParams.value.studentName = searchName.value;
|
||||
searchParams.value.pageNo = 1;
|
||||
searchStu()
|
||||
}
|
||||
|
||||
const deleteModalVisible = ref(false);
|
||||
@@ -257,20 +260,6 @@ const deleteId = ref(null);
|
||||
function del(id) {
|
||||
deleteModalVisible.value = true;
|
||||
deleteId.value = id;
|
||||
// Modal.confirm({
|
||||
// title: () => "确定删除?",
|
||||
// icon: () => createVNode(ExclamationCircleOutlined),
|
||||
// content: () => "数据删除后不可恢复!",
|
||||
// okText: () => "确定",
|
||||
// okType: "danger",
|
||||
// cancelText: () => "取消",
|
||||
// onOk() {
|
||||
// if (id) {
|
||||
// loading.value = true;
|
||||
// delStudentList({ ids: [id] }).then(() => searchStu());
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
}
|
||||
|
||||
//确定删除
|
||||
@@ -294,6 +283,8 @@ const closeDrawer = () => {
|
||||
function reset() {
|
||||
searchParams.value = initParams;
|
||||
searchName.value = "";
|
||||
searchParams.value.pageNo = 1;
|
||||
searchStu()
|
||||
}
|
||||
|
||||
watch(visiable, () => {
|
||||
|
||||
@@ -42,9 +42,7 @@
|
||||
style="width: 260px; height: 40px"
|
||||
placeholder="是否为优秀学员"
|
||||
:options="topFlagList"
|
||||
@change="selectProjectName"
|
||||
allowClear
|
||||
showSearch
|
||||
></a-select>
|
||||
</div>
|
||||
</a-form-item>
|
||||
@@ -54,6 +52,7 @@
|
||||
class="cus-btn"
|
||||
style="background: #4ea6ff; color: #fff; width: 100px"
|
||||
@click="getStuList"
|
||||
:loading="stuAsyncLoading"
|
||||
>
|
||||
<template #icon>
|
||||
<img
|
||||
@@ -223,13 +222,15 @@
|
||||
v-if="type === 3 && record.status !== 0 && checkPer(permissions)"
|
||||
@click="updateStatus(0, record.id)"
|
||||
type="link"
|
||||
>通过</a-button
|
||||
>通过
|
||||
</a-button
|
||||
>
|
||||
<a-button
|
||||
v-if="type === 3 && record.status !== 0 && checkPer(permissions)"
|
||||
@click="updateStatus(2, record.id)"
|
||||
type="link"
|
||||
>拒绝</a-button
|
||||
>拒绝
|
||||
</a-button
|
||||
>
|
||||
<a-button
|
||||
v-if="checkPer(permissions)"
|
||||
@@ -237,7 +238,8 @@
|
||||
@click="del(record.id, record)"
|
||||
type="link"
|
||||
danger
|
||||
>删除</a-button
|
||||
>删除
|
||||
</a-button
|
||||
>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -387,21 +389,20 @@
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, defineProps, onMounted, ref, watch } from "vue";
|
||||
import { delStudentList, getStuPage, batchUpdateStatus } from "@/api/index1";
|
||||
import {computed, defineProps, onMounted, ref, watch} from "vue";
|
||||
import {delStudentList, getStuPage, batchUpdateStatus} from "@/api/index1";
|
||||
import ChangeGroupModal from "@/components/student/ChangeGroupModal.vue";
|
||||
import CommonStudent from "@/components/student/CommonStudent";
|
||||
import ChangeLevelModal from "./ChangeLevelModal.vue";
|
||||
import { message } from "ant-design-vue";
|
||||
// import { topStudent } from "../../api/indexProjStu";
|
||||
import {message} from "ant-design-vue";
|
||||
import SeeStu from "../../components/drawers/SeeStu";
|
||||
import EScore from "../drawers/ExportScore.vue";
|
||||
import OrgClass from "@/components/project/OrgClass";
|
||||
import ExportHomeWork from "../Modals/ExportHomeWork.vue";
|
||||
import * as api from "../../api/index1";
|
||||
import ImpStu from "../drawers/AddLevelImportStu";
|
||||
// import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import { checkPer } from "@/utils/utils";
|
||||
import {checkPer} from "@/utils/utils";
|
||||
import {useAsyncStu} from "@/utils/useCommon";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
@@ -435,6 +436,9 @@ const props = defineProps({
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const { loading: stuAsyncLoading, start } = useAsyncStu(props.id, props.type, getStuList);
|
||||
|
||||
const topFlagList = ref([
|
||||
{
|
||||
id: 0,
|
||||
@@ -680,11 +684,12 @@ function bathDel() {
|
||||
);
|
||||
}
|
||||
tableData.value.loading = true;
|
||||
delStudentList({ ids: stuSelectKeys.value,type:props.type,targetId:props.id }).then(() => getStuList());
|
||||
delStudentList({ ids: stuSelectKeys.value, type: props.type, targetId: props.id }).then(() => getStuList());
|
||||
}
|
||||
|
||||
const deleteModalVisible = ref(false);
|
||||
const deleteId = ref(null);
|
||||
|
||||
function del(id, row) {
|
||||
if (row.isLeader === "1") {
|
||||
return message.warning("" + row.name + "是小组长,请勿删除!");
|
||||
@@ -707,6 +712,7 @@ function del(id, row) {
|
||||
// },
|
||||
// });
|
||||
}
|
||||
|
||||
//确定删除
|
||||
const sureSameModal = () => {
|
||||
if (deleteId.value) {
|
||||
@@ -724,6 +730,7 @@ const closeSameModal = () => {
|
||||
function submitCall(flag) {
|
||||
tableData.value.loading = true;
|
||||
flag && getStuList();
|
||||
flag && start();
|
||||
}
|
||||
|
||||
// 调整关卡;
|
||||
@@ -885,9 +892,11 @@ const AddImpStuvisibleClose = (isget) => {
|
||||
getStuList();
|
||||
}
|
||||
};
|
||||
|
||||
function startLoading() {
|
||||
tableData.value.loading = true;
|
||||
}
|
||||
|
||||
defineExpose({ getStuList, startLoading });
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@@ -1194,11 +1203,13 @@ defineExpose({ getStuList, startLoading });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-modal-close-x {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*.delete {
|
||||
z-index: 9999;
|
||||
width: 424px;
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
import {ref} from "vue";
|
||||
import {onMounted, ref, watch} from "vue";
|
||||
import {message} from "ant-design-vue";
|
||||
import {ASYNC_STUDENT_STATUS} from "@/api/apis";
|
||||
import {request} from "@/api/request";
|
||||
import dialog from "@/utils/dialog";
|
||||
|
||||
export function useInterval(fun, time) {
|
||||
const timer = ref();
|
||||
|
||||
function start(d) {
|
||||
clearInterval(timer.value)
|
||||
clearInterval(timer.value);
|
||||
timer.value = setInterval(async () => {
|
||||
if (await fun(d)) {
|
||||
clearInterval(timer.value)
|
||||
clearInterval(timer.value);
|
||||
}
|
||||
}, time);
|
||||
}
|
||||
|
||||
return {start}
|
||||
return { start };
|
||||
}
|
||||
|
||||
export function useTimeout(asyncFun, time) {
|
||||
@@ -21,25 +24,56 @@ export function useTimeout(asyncFun, time) {
|
||||
const maxCount = ref(0);
|
||||
|
||||
function start(d) {
|
||||
clearTimeout(timer.value)
|
||||
maxCount.value = 0
|
||||
execute(d)
|
||||
clearTimeout(timer.value);
|
||||
maxCount.value = 0;
|
||||
execute(d);
|
||||
}
|
||||
|
||||
async function execute(d) {
|
||||
if (maxCount.value > 300) {
|
||||
message.error("等待超时,请联系管理员!")
|
||||
throw Error("等待超时 查询任务结束")
|
||||
message.error("等待超时,请联系管理员!");
|
||||
throw Error("等待超时 查询任务结束");
|
||||
}
|
||||
try {
|
||||
await asyncFun(d)
|
||||
maxCount.value = maxCount.value + 1
|
||||
await asyncFun(d);
|
||||
maxCount.value = maxCount.value + 1;
|
||||
timer.value = setTimeout(() => execute(d), time);
|
||||
} catch (e) {
|
||||
clearTimeout(timer.value)
|
||||
console.log(e)
|
||||
clearTimeout(timer.value);
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
return {start}
|
||||
return { start };
|
||||
}
|
||||
|
||||
export function useAsyncStu(id, type, func) {
|
||||
const loading = ref(false);
|
||||
|
||||
const { start } = useTimeout(async () => {
|
||||
const { data } = await request(ASYNC_STUDENT_STATUS, { id, type });
|
||||
if (!data) {
|
||||
loading.value = false;
|
||||
throw Error("查询任务结束");
|
||||
}
|
||||
loading.value = true;
|
||||
}, 10000);
|
||||
|
||||
watch(loading, () => {
|
||||
loading.value && dialog({
|
||||
duration: 3500,
|
||||
cancel: false,
|
||||
content: "您选择的学员正在添加中,请耐心等待,进行其他操作不影响此次添加"
|
||||
});
|
||||
loading.value || (func && func());
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
console.log(22222222);
|
||||
console.log(id);
|
||||
console.log(type);
|
||||
id && type && start();
|
||||
});
|
||||
return { loading, start };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user