mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-19 07:46:46 +08:00
--fix bug
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
<Draggable v-model="projectInfo.stageList" chosenClass="chosen" ghostClass="ghost" forceFallback="true"
|
||||
group="stage" animation="500">
|
||||
<template #item="{ element,index }">
|
||||
<div class="items" :class="activeIndex === index ? 'active' : ''" @click="changeStageIndex(index)" >
|
||||
<div class="items" v-if="element.id !==0" :class="activeIndex === index ? 'active' : ''"
|
||||
@click="changeStageIndex(index)">
|
||||
<div class="items1">
|
||||
<div class="boxs_left">
|
||||
<a-popover placement="topLeft" trigger="click">
|
||||
@@ -45,9 +46,6 @@
|
||||
{{ element.name }}
|
||||
</div>
|
||||
</template>
|
||||
<!-- <template #title>
|
||||
<span>关卡说明</span>
|
||||
</template> -->
|
||||
<div class="nname">
|
||||
{{ element.name }}
|
||||
</div>
|
||||
@@ -76,7 +74,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="rightt">
|
||||
<!-- 2022-11-30注释 后面放开 -->
|
||||
<div class="select" style="margin-right:90px;">
|
||||
<span>学习模式:</span>
|
||||
<span
|
||||
@@ -543,6 +540,7 @@ const cancleLoading = ref(false);
|
||||
const projectInfo = ref({stageList: [{taskList: [{}]}], projectInfo: {}});
|
||||
const activeIndex = ref(0);
|
||||
const moveChapterIndex = ref(0);
|
||||
const deleteIndex = ref(0);
|
||||
const formValue = ref({taskList: []});
|
||||
|
||||
|
||||
@@ -557,7 +555,7 @@ const selectAll = computed(() => {
|
||||
return 2
|
||||
})
|
||||
|
||||
function changeStageIndex(index){
|
||||
function changeStageIndex(index) {
|
||||
activeIndex.value = index
|
||||
}
|
||||
|
||||
@@ -566,6 +564,10 @@ const getTask = async () => {
|
||||
await api.getTask({projectId: route.query.projectId}).then((res) => {
|
||||
projectInfo.value = res.data.data
|
||||
});
|
||||
//如果没有阶段就给个默认的阶段 但是并不存储
|
||||
if (!projectInfo.value.stageList.length) {
|
||||
projectInfo.value.stageList.push({id: 0, name: '', remark: '', taskList: []})
|
||||
}
|
||||
};
|
||||
|
||||
const editTaskForType = (ele, index) => {
|
||||
@@ -618,19 +620,30 @@ const closeModal = () => {
|
||||
const showModal = () => {
|
||||
stage.value = true
|
||||
};
|
||||
|
||||
//添加阶段
|
||||
const editStage = async () => {
|
||||
function editStage() {
|
||||
if (!formValue.value.name) {
|
||||
return message.warning("请输入关卡名称");
|
||||
message.warning("请输入阶段名称!");
|
||||
return
|
||||
}
|
||||
//替换 默认阶段
|
||||
if (projectInfo.value.stageList.length === 1 && projectInfo.value.stageList[0].id === 0) {
|
||||
formValue.value.taskList = [...projectInfo.value.stageList[0].taskList]
|
||||
projectInfo.value.stageList.push({...formValue.value})
|
||||
projectInfo.value.stageList.splice(0, 1)
|
||||
} else {
|
||||
projectInfo.value.stageList.push({...formValue.value})
|
||||
activeIndex.value = activeIndex.value + 1
|
||||
}
|
||||
projectInfo.value.stageList.push({...formValue.value})
|
||||
formValue.value = {taskList: []}
|
||||
stage.value = false
|
||||
};
|
||||
}
|
||||
|
||||
//打开删除阶段弹窗
|
||||
const showDeleteStage = () => {
|
||||
const showDeleteStage = (index) => {
|
||||
deleteStageModal.value = true;
|
||||
deleteIndex.value = index;
|
||||
};
|
||||
//关闭删除阶段弹窗
|
||||
const closeDeleteStage = () => {
|
||||
@@ -638,7 +651,7 @@ const closeDeleteStage = () => {
|
||||
};
|
||||
//删除阶段
|
||||
const deleteStage = () => {
|
||||
|
||||
projectInfo.value.stageList.splice(deleteIndex.value,1)
|
||||
};
|
||||
onMounted(() => {
|
||||
document.getElementsByTagName("main")[0].style.background = "rgb(245, 247, 250,1)";
|
||||
|
||||
Reference in New Issue
Block a user