mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-17 14:56:46 +08:00
'补充取消暂存的逻辑'
This commit is contained in:
@@ -861,8 +861,8 @@ import AddRef from "../../components/drawers/AddRef.vue";
|
||||
import AddProject from "../../components/drawers/AddProject.vue";
|
||||
import AddFaceteach from "../../components/drawers/AddFaceteach.vue";
|
||||
import * as api from "../../api/indexLevel";
|
||||
import { GetRouterDetail, changeChapterSort, changeTasklistSort, releaseRouter } from "../../api/indexTask";
|
||||
import { message } from "ant-design-vue";
|
||||
import { GetRouterDetail, changeChapterSort, changeTasklistSort, releaseRouter, cancelRouterTask } from "../../api/indexTask";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { storage } from "../../api/storage";
|
||||
import { deleteStudyTask } from "../../api/indexStudy";
|
||||
import draggable from "vuedraggable";
|
||||
@@ -1758,8 +1758,9 @@ export default {
|
||||
const submitStorage = () => {
|
||||
// 发布'
|
||||
// let obj = {}
|
||||
console.log(state.routerDetail)
|
||||
releaseRouter(state.routerDetail).then(res => {
|
||||
console.log(state.routerDetail, state.routerId)
|
||||
// state.routerDetail
|
||||
releaseRouter(state.routerId).then(res => {
|
||||
// console.log("发布",res.data.data)
|
||||
if (res.data.code === 200) {
|
||||
message.success("关卡和任务数据已保存,将返回上一页")
|
||||
@@ -1775,9 +1776,44 @@ export default {
|
||||
};
|
||||
//取消
|
||||
const cancelStorage = () => {
|
||||
router.push({
|
||||
path: "/leveladd",
|
||||
});
|
||||
// 查询所有数据中是否有status===0的,有的话说明数据未保存,
|
||||
let bool = state.routerDetail.chapterList.some(s => s.status === 0 || s.taskList.some(t => t.status === 0))
|
||||
if (bool) {
|
||||
Modal.confirm({
|
||||
content: () => "有未保存的草稿,确定舍弃草稿吗?",
|
||||
onOk() {
|
||||
cancelRouterTask(state.routerId).then(res => {
|
||||
if (res.data.code === 200) {
|
||||
message.success("取消草稿")
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: "/leveladd",
|
||||
});
|
||||
}, 5000)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
// Modal.confirm("有未保存的草稿,确定舍弃草稿吗?").then(() => {
|
||||
// cancelRouterTask(state.routerId).then(res => {
|
||||
// if (res.data.code === 200) {
|
||||
// message.success("取消草稿")
|
||||
// setTimeout(() => {
|
||||
// router.push({
|
||||
// path: "/leveladd",
|
||||
// });
|
||||
// }, 5000);
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
} else {
|
||||
router.push({
|
||||
path: "/leveladd",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
|
||||
Reference in New Issue
Block a user