Merge branch 'master' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage

This commit is contained in:
songwc
2022-11-07 16:33:27 +08:00
2 changed files with 87 additions and 3 deletions

View File

@@ -4,9 +4,16 @@ import http from "./config";
export const editChapter = (obj) => http.post('/admin/router/editChapter', obj);
//编辑关卡
export const updateChapter = (obj) => http.post('/admin/router/editChapter', obj);
//删除任务
export const deleteTask = (obj) => http.delete('/admin/router/deleteTask',{params: obj});
//移动任务到关卡
export const moveTask = (obj) => http.post('/admin/router/moveTask',obj);
// 学员路径图进度明细(概览)
export const studentProcess = (obj) => http.get(`admin/router/studentProcess?routerId=${obj.routerId}&studentId=${obj.studentId}`);
// 学员关卡设置
// 添加学员
export const addStudent = (obj) => http.post('/admin/router/addStudent',obj);
// 删除学员
export const deleteStudent = (obj) => http.post('/admin/router/deleteStudent',obj);

View File

@@ -886,7 +886,7 @@
</div>
</template>
<script>
import { ref, reactive, toRefs } from "vue";
import { ref, reactive, toRefs, onMounted } from "vue";
import AddStu from "../../components/drawers/AddLevelAddStu";
import ImpStu from "../../components/drawers/AddLevelImportStu";
import CheckStu from "../../components/drawers/CheckStu";
@@ -900,6 +900,8 @@ import WorkManage from "../../components/drawers/WorkManage";
// import { useStore } from "vuex";
import * as api from "../../api/index1";
import { storage } from "../../api/storage";
import { message } from "ant-design-vue";
import { studentProcess, deleteStudent, addStudent } from "@/api/indexLevel";
export default {
name: "LevelAdd",
@@ -1456,6 +1458,26 @@ export default {
getStudent();
}
};
onMounted(() => {
getBriefIntroduction()
});
// 获取简介
const getBriefIntroduction = () => {
let obj = {
routerId: state.routerId,
studentId:0,
};
studentProcess(obj)
.then((res) => {
console.log("获取简介", res);
})
.catch((err) => {
console.log("获取简介失败", err);
});
}
//学员管理------------------------------------------------
//获取学员列表
const getStudent = () => {
@@ -1474,6 +1496,56 @@ export default {
});
};
// 添加学员
const adStudent = () => {
let obj = {
"deptList": [
{
"id": 0,
"name": ""
}
],
"groupList": [
{
"id": 0,
"name": ""
}
],
"routerId": 0,
"studentList": [
{
"id": 0,
"name": ""
}
]
}
addStudent(obj)
.then((res) => {
console.log("添加学员成功", res);
message.success("添加学员成功");
})
.catch((err) => {
console.log("添加学员失败", err);
message.error("添加学员失败");
});
}
// 删除学员
const delStudent = () => {
let obj = {
"routerId": 0,
"studentIds": []
}
deleteStudent(obj)
.then((res) => {
console.log("删除学员成功", res);
message.success("删除学员成功");
})
.catch((err) => {
console.log("删除学员失败", err);
message.error("删除学员失败");
});
}
//学员管理------------------------------------------------
return {
...toRefs(state),
@@ -1505,6 +1577,11 @@ export default {
closehuodModal,
closezhibModal,
changeTabs,
getBriefIntroduction, // 获取简介
// settingControls, // 设置
delStudent, // 删除学员
adStudent, // 添加学员
// pathingController, // 路径管理{ ... }
};
},
};