--fix bug

This commit is contained in:
yuping
2023-02-18 11:42:51 +08:00
parent 88ed4b5ed9
commit 49510991e6
2 changed files with 17 additions and 44 deletions

View File

@@ -566,24 +566,7 @@
<a-tab-pane key="3" tab="学员管理" force-render>
<TableStudent
:permissions="permissions"
v-if="isreload"
:type="2"
:id="routerId"
:stage="stage"
:columns="tableDataFunc()"
>
<template #extension="{ data: { record } }">
<a-button type="link" @click="showStudent(record)">查看</a-button>
<a-button
type="link"
@click="setLevels(record)"
v-if="checkPer(permissions)"
>调整</a-button
>
</template>
</TableStudent>
<TableStudent
v-else
ref="stuRef"
:type="2"
:id="routerId"
:stage="stage"
@@ -1428,7 +1411,7 @@ export default {
setup() {
const router = useRouter();
const route = useRoute();
const stuRef = ref()
// const store = useStore();
const state = reactive({
permissions: "",
@@ -2810,7 +2793,6 @@ export default {
// 调整关卡
function setLevels(record) {
console.log(record);
state.curLevelName = record.currentStageName;
state.curStuID = record.id;
state.visiblene = true;
@@ -2823,33 +2805,19 @@ export default {
}
// 点击确定 调整关卡
function changeLevel() {
state.isreload = false;
async function changeLevel() {
if (!state.curLevel) {
message.error("请选择关卡");
return;
}
moveStudent({ targetId: state.curLevel, ids: [state.curStuID] })
.then((res) => {
console.log(res);
state.visiblene = false;
message.destroy();
state.isreload = true;
message.success("调整关卡成功");
state.curLevel = undefined;
state.curStuID = "";
state.curLevelName = "";
getStudent();
})
.catch((err) => {
console.log(err);
state.visiblene = false;
message.error("调整关卡失败");
state.isreload = true;
state.curLevel = undefined;
state.curStuID = "";
state.curLevelName = "";
});
state.visiblene = false;
message.success("调整关卡成功");
stuRef.value.startLoading()
await moveStudent({targetId: state.curLevel, ids: [state.curStuID]})
state.curLevel = undefined;
state.curStuID = "";
state.curLevelName = "";
stuRef.value.getStuList()
}
// 面授课学员报名弹框
@@ -2861,6 +2829,7 @@ export default {
return {
...toRefs(state),
...toRefs(levelList),
stuRef,
clearChooseStu,
showDeleteALLModal,
closeDeleteALLModal,