mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-18 23:36:46 +08:00
--fix 排序
This commit is contained in:
@@ -12,7 +12,8 @@
|
|||||||
<Draggable v-model="routerInfo.chapterList" chosenClass="chosen" ghostClass="ghost" forceFallback="true"
|
<Draggable v-model="routerInfo.chapterList" chosenClass="chosen" ghostClass="ghost" forceFallback="true"
|
||||||
item-key="id" group="stage" animation="500">
|
item-key="id" group="stage" animation="500">
|
||||||
<template #item="{ element,index }">
|
<template #item="{ element,index }">
|
||||||
<div class="items" v-if="!element.deleted" :class="activeIndex === index ? 'active' : ''" @click="changebgc(index)">
|
<div class="items" v-if="!element.deleted" :class="activeIndex === index ? 'active' : ''"
|
||||||
|
@click="changebgc(index)">
|
||||||
<div class="items1">
|
<div class="items1">
|
||||||
<div class="boxs_left">
|
<div class="boxs_left">
|
||||||
<a-popover placement="topLeft" trigger="click">
|
<a-popover placement="topLeft" trigger="click">
|
||||||
@@ -118,8 +119,10 @@
|
|||||||
<div class="select" style="margin-right:90px;">
|
<div class="select" style="margin-right:90px;">
|
||||||
<span>学习模式:</span>
|
<span>学习模式:</span>
|
||||||
<span
|
<span
|
||||||
style="border: 1px solid rgba(0, 0, 0, 0.25);width: 120px;height: 38px; border-radius: 10px;text-align: center;line-height: 38px;">
|
style="border: 1px solid rgba(0, 0, 0, 0.25);width: 120px;height: 38px; border-radius: 10px;text-align: center;line-height: 38px;">
|
||||||
{{ routerInfo.routerInfo.unlockMode == 1 ? '自由学习模式': routerInfo.routerInfo.unlockMode == 2 || routerInfo.routerInfo.unlockMode == 3 ? '闯关模式': '' }}
|
{{
|
||||||
|
routerInfo.routerInfo.unlockMode == 1 ? '自由学习模式' : routerInfo.routerInfo.unlockMode == 2 || routerInfo.routerInfo.unlockMode == 3 ? '闯关模式' : ''
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
<!-- <a-select v-model:value="routerInfo.routerInfo.unlockMode" ref="select" size="small"
|
<!-- <a-select v-model:value="routerInfo.routerInfo.unlockMode" ref="select" size="small"
|
||||||
style="width: 150px" disabled>
|
style="width: 150px" disabled>
|
||||||
@@ -128,7 +131,8 @@
|
|||||||
<a-select-option :value="3">闯关模式</a-select-option>
|
<a-select-option :value="3">闯关模式</a-select-option>
|
||||||
</a-select> -->
|
</a-select> -->
|
||||||
<unlock-mode :routerInfo="routerInfo.routerInfo" :types="types">
|
<unlock-mode :routerInfo="routerInfo.routerInfo" :types="types">
|
||||||
<a-button type="primary" size="large" style="border-radius: 8px;margin-left: 24px;">切换模式</a-button>
|
<a-button type="primary" size="large" style="border-radius: 8px;margin-left: 24px;">切换模式
|
||||||
|
</a-button>
|
||||||
</unlock-mode>
|
</unlock-mode>
|
||||||
</div>
|
</div>
|
||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
@@ -444,7 +448,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {computed, onMounted, onUnmounted, ref} from "vue";
|
import {computed, onMounted, onUnmounted, ref, watch} from "vue";
|
||||||
import {GetRouterDraftDetail, releaseRouter} from "@/api/indexTask";
|
import {GetRouterDraftDetail, releaseRouter} from "@/api/indexTask";
|
||||||
import {message} from "ant-design-vue";
|
import {message} from "ant-design-vue";
|
||||||
import {editTask} from "@/api/indexTaskadd";
|
import {editTask} from "@/api/indexTaskadd";
|
||||||
@@ -484,6 +488,16 @@ const selectAll = computed(() => {
|
|||||||
}
|
}
|
||||||
return 2
|
return 2
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(() => routerInfo.value.chapterList, () => {
|
||||||
|
routerInfo.value.chapterList.forEach((t, i) => {
|
||||||
|
t.sort = i;
|
||||||
|
t.draftTaskList?.forEach((s, j) => {
|
||||||
|
s.sort = j
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}, {deep: true})
|
||||||
|
|
||||||
const showModal = () => {
|
const showModal = () => {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
};
|
};
|
||||||
@@ -542,7 +556,7 @@ const closedeleteAll = () => {
|
|||||||
deleteAll.value = false
|
deleteAll.value = false
|
||||||
};
|
};
|
||||||
const subdeleteAll = () => {
|
const subdeleteAll = () => {
|
||||||
routerInfo.value.chapterList[activeIndex.value].draftTaskList.filter(t => t.checked).forEach(t=>{
|
routerInfo.value.chapterList[activeIndex.value].draftTaskList.filter(t => t.checked).forEach(t => {
|
||||||
t.checked = false;
|
t.checked = false;
|
||||||
t.deleted = true;
|
t.deleted = true;
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
<Draggable v-model="projectInfo.stageList" chosenClass="chosen" ghostClass="ghost" forceFallback="true"
|
<Draggable v-model="projectInfo.stageList" chosenClass="chosen" ghostClass="ghost" forceFallback="true"
|
||||||
group="stage" animation="500">
|
group="stage" animation="500">
|
||||||
<template #item="{ element,index }">
|
<template #item="{ element,index }">
|
||||||
<div class="items" v-if="element.id !=='0' && !element.deleted" :class="activeIndex === index ? 'active' : ''"
|
<div class="items" v-if="element.id !=='0' && !element.deleted"
|
||||||
|
:class="activeIndex === index ? 'active' : ''"
|
||||||
@click="changeStageIndex(index)">
|
@click="changeStageIndex(index)">
|
||||||
<div class="items1">
|
<div class="items1">
|
||||||
<div class="boxs_left">
|
<div class="boxs_left">
|
||||||
@@ -180,7 +181,8 @@
|
|||||||
操作
|
操作
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Draggable v-model="projectInfo.stageList[activeIndex].taskDraftDtoList" chosenClass="chosen" ghostClass="ghost"
|
<Draggable v-model="projectInfo.stageList[activeIndex].taskDraftDtoList" chosenClass="chosen"
|
||||||
|
ghostClass="ghost"
|
||||||
forceFallback="true" group="task" animation="500">
|
forceFallback="true" group="task" animation="500">
|
||||||
<template #item="{ element,index }">
|
<template #item="{ element,index }">
|
||||||
<div style="
|
<div style="
|
||||||
@@ -518,7 +520,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {computed, onMounted, onUnmounted, ref,} from "vue";
|
import {computed, onMounted, onUnmounted, ref, watch,} from "vue";
|
||||||
import {message} from "ant-design-vue";
|
import {message} from "ant-design-vue";
|
||||||
import * as api from "../../api/indexTaskadd";
|
import * as api from "../../api/indexTaskadd";
|
||||||
import UnlockMode from "../../components/drawers/UnlockMode.vue";
|
import UnlockMode from "../../components/drawers/UnlockMode.vue";
|
||||||
@@ -558,13 +560,22 @@ const selectAll = computed(() => {
|
|||||||
return 2
|
return 2
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(() => projectInfo.value.stageList, () => {
|
||||||
|
projectInfo.value.stageList.forEach((t, i) => {
|
||||||
|
t.sort = i;
|
||||||
|
t.taskDraftDtoList?.forEach((s, j) => {s.sort = j})
|
||||||
|
})
|
||||||
|
}, {deep: true})
|
||||||
|
|
||||||
function changeStageIndex(index) {
|
function changeStageIndex(index) {
|
||||||
activeIndex.value = index
|
activeIndex.value = index
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取任务列表
|
//获取任务列表
|
||||||
const getTask = async () => {
|
const getTask = async () => {
|
||||||
await api.getDraftTask({projectId: route.query.projectId}).then((res) => {projectInfo.value = res.data.data});
|
await api.getDraftTask({projectId: route.query.projectId}).then((res) => {
|
||||||
|
projectInfo.value = res.data.data
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const editTaskForType = (ele, index) => {
|
const editTaskForType = (ele, index) => {
|
||||||
@@ -596,7 +607,7 @@ const moveTask = () => {
|
|||||||
};
|
};
|
||||||
//批量删除
|
//批量删除
|
||||||
const deleteTaskAll = () => {
|
const deleteTaskAll = () => {
|
||||||
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.filter(t => t.checked).forEach(t=>{
|
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.filter(t => t.checked).forEach(t => {
|
||||||
t.checked = false;
|
t.checked = false;
|
||||||
t.deleted = true;
|
t.deleted = true;
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user