-- 批量跳转关卡

This commit is contained in:
yuping
2022-12-22 18:16:36 +08:00
parent 13e27ae3ca
commit f33f2cd99a
3 changed files with 88 additions and 42 deletions

View File

@@ -132,6 +132,7 @@ export const addStudentCourse = (obj) => http.post("/admin/offcourse/addStudent"
// 获取组织结构树
export const orgtree = () => http.get("/org/tree");
export const saveStu = obj => http.post("/admin/student/addStudent", obj);
export const moveStudent = obj => http.post("/admin/student/moveStudent", obj);
export const getStuPage = obj => http.get("/admin/student/getStudent", {params: obj});
export const delStudentList = obj => http.post("/admin/student/delStudent", obj);
export const validateName = obj => http.post("/admin/validate/validateName", obj);

View File

@@ -8,12 +8,12 @@
-->
<template>
<a-modal
style="padding: 0"
:closable="sh"
:visible="visiblene"
:footer="null"
centered="true"
wrapClassName="changeModal"
style="padding: 0"
:closable="true"
:visible="visiblene"
:footer="null"
centered="true"
wrapClassName="changeModal"
>
<div class="con">
<div class="header">
@@ -28,27 +28,25 @@
<!-- <div class="cur">当前关卡关卡2</div> -->
<div class="select">
<a-select
v-model:value="curLevel"
style="width: 100%"
placeholder="请选择关卡"
:options="projectNameList4"
@change="selectProjectName4"
allowClear
showSearch
v-model:value="selectStage"
style="width: 100%"
placeholder="请选择关卡"
:options="option"
allowClear
></a-select>
</div>
<div class="btn">
<button
class="sameb btn1"
@click="closeChangeModal"
style="cursor: pointer"
class="sameb btn1"
@click="closeChangeModal"
style="cursor: pointer"
>
取消
</button>
<button
class="sameb btn2"
@click="changelevel"
style="cursor: pointer"
class="sameb btn2"
@click="changelevel"
style="cursor: pointer"
>
确定
</button>
@@ -58,28 +56,47 @@
</div>
</a-modal>
</template>
<script>
export default {
name: "ChangeLevelModal",
props: {
visiblene: {
type: Boolean,
default: false,
},
},
setup(props, ctx) {
const closeChangeModal = () => {
ctx.emit("update:visiblene", false);
};
const changelevel = () => {
console.log("点击调整关卡");
};
//获取关卡列表
<script setup>
import {computed, defineEmits, defineProps, ref} from "vue";
import {moveStudent} from "@/api/index1";
import {message} from "ant-design-vue";
return {
closeChangeModal,
changelevel,
};
const props = defineProps({
visiblene: {
type: Boolean,
default: false,
},
stage: {
type: Array,
default: () => [],
},
ids: {
type: Array,
default: () => [],
},
});
const option = computed(() => {
return props.stage.map(e => ({label: e.name, value: e.id}))
})
const selectStage = ref()
const emit = defineEmits({})
const closeChangeModal = () => {
emit("update:visiblene", false);
};
const changelevel = () => {
if(!selectStage.value){
message.error("请选择关卡")
return
}
emit("update:visiblene", false);
emit('finash', false)
moveStudent({targetId: selectStage.value, ids: props.ids}).then(()=>{
emit('finash', true)
})
};
//获取关卡列表
</script>

View File

@@ -63,7 +63,7 @@
批量删除
</a-button>
</a-col>
<a-col :span="1.5" v-if="type == 2">
<a-col :span="1.5" v-if="type === 2">
<a-button class="cus-btn white" @click="showChangeModal">
<template #icon></template>
批量调整关卡
@@ -109,7 +109,7 @@
</div>
</div>
<!-- 批量调整关卡弹窗 -->
<ChangeLevelModal v-model:visiblene="visiblene" />
<ChangeLevelModal v-model:visiblene="visiblene" :stage="stage" :ids="stuSelectKeys" @finash="submitCall"/>
<!-- 批量调整关卡弹窗 -->
</template>
<script setup>
@@ -117,6 +117,7 @@ import { computed, defineProps, onMounted, ref, watch } from "vue";
import { delStudentList, getStuPage } from "@/api/index1";
import CommonStudent from "@/components/student/CommonStudent";
import ChangeLevelModal from "./ChangeLevelModal.vue";
import {message} from "ant-design-vue";
const props = defineProps({
type: Number,
id: String,
@@ -261,6 +262,10 @@ function submitCall(flag) {
//调整关卡
const visiblene = ref(false);
const showChangeModal = () => {
if(!stuSelectKeys.value.length){
message.error("请选择学员")
return
}
visiblene.value = true;
};
</script>
@@ -274,4 +279,27 @@ const showChangeModal = () => {
border-right: 1px solid #e9e9e9;
cursor: pointer;
}
.cus-btn {
width: 100%;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16px;
border: 1px solid #4ea6ff;
border-radius: 8px;
background: #4ea6ff;
cursor: pointer;
color: #fff;
}
.white {
background: #fff;
color: #4ea6ff;
}
.cus-input {
height: 40px;
border-radius: 8px;
}
</style>