mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 22:06:45 +08:00
-- fix bug
This commit is contained in:
@@ -33,11 +33,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-popover>
|
||||
|
||||
<div class="imgIcon" @click="showModal(element)"></div>
|
||||
</div>
|
||||
<div class="boxs_right">
|
||||
<div class="imgIcon" @click="showDeleteChapter"></div>
|
||||
<div class="imgIcon" @click="deleteChapter"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items2">
|
||||
@@ -124,12 +123,6 @@
|
||||
routerInfo.routerInfo.unlockMode == 1 ? '自由学习模式' : routerInfo.routerInfo.unlockMode == 2 || routerInfo.routerInfo.unlockMode == 3 ? '闯关模式' : ''
|
||||
}}
|
||||
</span>
|
||||
<!-- <a-select v-model:value="routerInfo.routerInfo.unlockMode" ref="select" size="small"
|
||||
style="width: 150px" disabled>
|
||||
<a-select-option :value="1">自由学习模式</a-select-option>
|
||||
<a-select-option :value="2">闯关模式</a-select-option>
|
||||
<a-select-option :value="3">闯关模式</a-select-option>
|
||||
</a-select> -->
|
||||
<unlock-mode :routerInfo="routerInfo.routerInfo" :types="types">
|
||||
<a-button type="primary" size="large" style="border-radius: 8px;margin-left: 24px;">切换模式
|
||||
</a-button>
|
||||
@@ -172,7 +165,7 @@
|
||||
<div class="btn btn1" @click="showChangeModal">
|
||||
<div class="btnText">移动任务到关卡</div>
|
||||
</div>
|
||||
<div class="btn btn2" @click="showDeleteALLModal">
|
||||
<div class="btn btn2" @click="subdeleteAll">
|
||||
<div class="imgIcon"></div>
|
||||
<div class="btnText">批量删除</div>
|
||||
</div>
|
||||
@@ -281,10 +274,6 @@
|
||||
<div style="width: 87px; text-align: center">
|
||||
{{ element.duration ? element.duration + "分钟" : "-" }}
|
||||
</div>
|
||||
|
||||
<!-- <div style="width: 87px; text-align: center">-->
|
||||
<!-- {{ element.status === 0 ? '草稿' : element.status === 1 ? '已发布' : '' }}-->
|
||||
<!-- </div>-->
|
||||
<div style="
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
@@ -298,7 +287,7 @@
|
||||
@click="editTaskForType(element,index)">
|
||||
编辑
|
||||
</span>
|
||||
<span style="color: #4ea6ff; cursor: pointer" @click="showDeleteModal(element,index)">
|
||||
<span style="color: #4ea6ff; cursor: pointer" @click="deleteTask(element,index)">
|
||||
删除
|
||||
</span>
|
||||
</div>
|
||||
@@ -337,56 +326,6 @@
|
||||
<a-button class="btn btn1" @click="cancelStorage" :loading="cancleLoading">取消</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 批量删除学员弹窗 -->
|
||||
<a-modal v-model:visible="deleteAll" :footer="null" :closable="closedeleteAll" wrapClassName="CopyModal"
|
||||
:centered="true">
|
||||
<div class="delete">
|
||||
<div class="del_header"></div>
|
||||
<div class="del_main">
|
||||
<div class="header">
|
||||
<div class="icon"></div>
|
||||
<span>提示</span>
|
||||
<div class="close_exit" @click="closedeleteAll"></div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<span>请确认是否批量删除任务</span>
|
||||
</div>
|
||||
<div class="del_btnbox">
|
||||
<div class="del_btn btn1" @click="closedeleteAll">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="del_btn btn2" @click="subdeleteAll">
|
||||
<div class="btnText">确定</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 是否确认删除任务弹窗 -->
|
||||
<!-- 确认删除阶段弹窗 -->
|
||||
<a-modal v-model:visible="deleteModal" :footer="null" wrapClassName="ConfirmModal" :centered="true">
|
||||
<div class="delete">
|
||||
<div class="del_header"></div>
|
||||
<div class="del_main">
|
||||
<div class="header">
|
||||
<div class="icon"></div>
|
||||
<span>提示</span>
|
||||
<div class="close_exit" @click="closeConfirm"></div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<span>您确定要删除此任务吗</span>
|
||||
</div>
|
||||
<div class="del_btnbox">
|
||||
<div class="del_btn btn1" @click="closeConfirm">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="del_btn btn2" @click="deleteLevelTask">
|
||||
<div class="btnText">确定</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 移动任务到阶段 -->
|
||||
<a-modal style="padding: 0" v-model:visible="visiblene" :footer="null" :centered="true"
|
||||
wrapClassName="moveModal">
|
||||
@@ -419,36 +358,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
|
||||
<!-- 是否删除关卡弹窗 -->
|
||||
<a-modal v-model:visible="deleteChapterModal" :footer="null" :closable="cC" wrapClassName="ConfirmModal"
|
||||
centered="true">
|
||||
<div class="delete">
|
||||
<div class="del_header"></div>
|
||||
<div class="del_main">
|
||||
<div class="header">
|
||||
<div class="icon"></div>
|
||||
<span>提示</span>
|
||||
<div class="close_exit" @click="closeDeleteChapter"></div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<span>您确定要删除此关卡</span>
|
||||
</div>
|
||||
<div class="del_btnbox">
|
||||
<div class="del_btn btn1" @click="closeDeleteChapter">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="del_btn btn2" @click="deleteChapter">
|
||||
<div class="btnText">确定</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {computed, onMounted, onUnmounted, ref, watch} from "vue";
|
||||
import {computed, onMounted, ref, watch} from "vue";
|
||||
import {GetRouterDraftDetail, releaseRouter} from "@/api/indexTask";
|
||||
import {message} from "ant-design-vue";
|
||||
import {useRoute} from "vue-router";
|
||||
@@ -457,19 +370,16 @@ import {TASK_TYPE} from "@/utils/const";
|
||||
import Draggable from "vuedraggable";
|
||||
import {ROUTER_DETAIL_MODIFY} from "@/api/apis";
|
||||
import {request} from "@/api/request";
|
||||
import dialog from "@/utils/dialog";
|
||||
|
||||
const {query: {routerId}} = useRoute();
|
||||
const modal = ref(false)
|
||||
const visiblene = ref(false)
|
||||
const deleteAll = ref(false)
|
||||
const deleteModal = ref(false)
|
||||
const deleteChapterModal = ref(false)
|
||||
const cancleLoading = ref(false)
|
||||
const templateLoading = ref(false)
|
||||
const confirmLoading = ref(false)
|
||||
const moveChapterIndex = ref('')
|
||||
const activeIndex = ref(0)
|
||||
const deleteIndex = ref(0)
|
||||
const types = 1 // 1 路径图 2 项目
|
||||
|
||||
const courseRef = ref({})
|
||||
@@ -513,23 +423,20 @@ const editChapter = () => {
|
||||
formValue.value = {draftTaskList: []}
|
||||
closeModal()
|
||||
};
|
||||
//打开删除关卡弹窗
|
||||
const showDeleteChapter = () => {
|
||||
deleteChapterModal.value = true;
|
||||
};
|
||||
//关闭删除关卡弹窗
|
||||
const closeDeleteChapter = () => {
|
||||
deleteChapterModal.value = false;
|
||||
};
|
||||
//删除关卡
|
||||
const deleteChapter = () => {
|
||||
dialog({
|
||||
content: '确定要删除关卡吗?',
|
||||
ok: () => {
|
||||
if (routerInfo.value.chapterList.length === 1) {
|
||||
message.warning("至少保留一个关卡");
|
||||
return
|
||||
}
|
||||
routerInfo.value.chapterList.splice(activeIndex.value, 1);
|
||||
routerInfo.value.chapterList[activeIndex.value].id ? (routerInfo.value.chapterList[activeIndex.value].deleted = true) : routerInfo.value.chapterList.splice(activeIndex.value, 1);
|
||||
activeIndex.value && (activeIndex.value = activeIndex.value - 1);
|
||||
deleteChapterModal.value = false;
|
||||
message.info("删除关卡成功");
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const getDetail = async () => {
|
||||
@@ -539,46 +446,36 @@ const getDetail = async () => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
document.getElementsByTagName("main")[0].style.background = "rgb(245, 247, 250,1)";
|
||||
document.getElementsByTagName("main")[0].style.boxShadow = "none";
|
||||
getDetail();
|
||||
});
|
||||
onUnmounted(() => {
|
||||
document.getElementsByTagName("main")[0].style.background = "#ffffff";
|
||||
document.getElementsByTagName("main")[0].style.boxShadow = "0px 1px 35px 0px rgba(118, 136, 166, 0.07)";
|
||||
});
|
||||
|
||||
const changebgc = (index) => {
|
||||
activeIndex.value = index
|
||||
};
|
||||
const showDeleteALLModal = () => {
|
||||
|
||||
const subdeleteAll = () => {
|
||||
if (!routerInfo.value?.chapterList[activeIndex.value]?.draftTaskList?.filter(t => t.checked)?.length) {
|
||||
message.warning("请选择要删除的任务!");
|
||||
return
|
||||
}
|
||||
deleteAll.value = true
|
||||
};
|
||||
const closedeleteAll = () => {
|
||||
deleteAll.value = false
|
||||
};
|
||||
const subdeleteAll = () => {
|
||||
routerInfo.value.chapterList[activeIndex.value].draftTaskList.filter(t => t.checked).forEach(t => {
|
||||
dialog({
|
||||
content: '确定要删除所选任务吗?',
|
||||
ok: () => {
|
||||
for (let i = 0; i < routerInfo.value.chapterList[activeIndex.value].draftTaskList.length; i++) {
|
||||
const t = routerInfo.value.chapterList[activeIndex.value].draftTaskList[i]
|
||||
if (t.checked) {
|
||||
if (t.id) {
|
||||
t.checked = false;
|
||||
t.deleted = true;
|
||||
})
|
||||
closedeleteAll()
|
||||
};
|
||||
const showDeleteModal = (_, index) => {
|
||||
deleteModal.value = true;
|
||||
deleteIndex.value = index;
|
||||
};
|
||||
const closeConfirm = () => {
|
||||
deleteModal.value = false;
|
||||
};
|
||||
|
||||
function deleteLevelTask() {
|
||||
routerInfo.value.chapterList[activeIndex.value].draftTaskList[deleteIndex.value].deleted = true
|
||||
closeConfirm()
|
||||
} else {
|
||||
routerInfo.value.chapterList[activeIndex.value].draftTaskList.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
//全选任务或全不选任务
|
||||
const selectRowAll = () => {
|
||||
@@ -602,6 +499,16 @@ const editTaskForType = (ele, index) => {
|
||||
courseRef.value['el' + ele.type].openDrawer(index, ele)
|
||||
};
|
||||
|
||||
function deleteTask(element, index) {
|
||||
dialog({
|
||||
content: '确定要删除此任务吗?',
|
||||
ok: () => {
|
||||
message.success("删除成功");
|
||||
routerInfo.value.chapterList[activeIndex.value].draftTaskList[index].id ? (element.deleted = true) : routerInfo.value.chapterList[activeIndex.value].draftTaskList.splice(index, 1)
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const showChangeModal = () => {
|
||||
if (routerInfo.value?.chapterList?.length <= 1) {
|
||||
message.warning("请添加关卡!");
|
||||
|
||||
@@ -477,17 +477,20 @@ const deleteTaskAll = () => {
|
||||
return
|
||||
}
|
||||
dialog({
|
||||
content: '确定要批量删除任务吗?',
|
||||
content: '确定要删除所选任务吗?',
|
||||
ok: () => {
|
||||
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.filter(t => t.checked).forEach((t,i) => {
|
||||
for (let i = 0; i < projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.length; i++) {
|
||||
const t = projectInfo.value.stageList[activeIndex.value].taskDraftDtoList[i]
|
||||
if (t.checked) {
|
||||
if (t.id) {
|
||||
t.checked = false;
|
||||
t.deleted = true;
|
||||
} else {
|
||||
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.splice(i,1)
|
||||
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user