--fix 排序

This commit is contained in:
yuping
2023-02-17 16:12:01 +08:00
parent 6f25303a58
commit 70f6d01594
2 changed files with 36 additions and 11 deletions

View File

@@ -12,7 +12,8 @@
<Draggable v-model="routerInfo.chapterList" chosenClass="chosen" ghostClass="ghost" forceFallback="true"
item-key="id" group="stage" animation="500">
<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="boxs_left">
<a-popover placement="topLeft" trigger="click">
@@ -118,8 +119,10 @@
<div class="select" style="margin-right:90px;">
<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;">
{{ routerInfo.routerInfo.unlockMode == 1 ? '自由学习模式': routerInfo.routerInfo.unlockMode == 2 || routerInfo.routerInfo.unlockMode == 3 ? '闯关模式': '' }}
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 ? '闯关模式' : ''
}}
</span>
<!-- <a-select v-model:value="routerInfo.routerInfo.unlockMode" ref="select" size="small"
style="width: 150px" disabled>
@@ -128,7 +131,8 @@
<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>
<a-button type="primary" size="large" style="border-radius: 8px;margin-left: 24px;">切换模式
</a-button>
</unlock-mode>
</div>
<div class="line"></div>
@@ -444,7 +448,7 @@
</div>
</template>
<script setup>
import {computed, onMounted, onUnmounted, ref} from "vue";
import {computed, onMounted, onUnmounted, ref, watch} from "vue";
import {GetRouterDraftDetail, releaseRouter} from "@/api/indexTask";
import {message} from "ant-design-vue";
import {editTask} from "@/api/indexTaskadd";
@@ -484,6 +488,16 @@ const selectAll = computed(() => {
}
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 = () => {
modal.value = true;
};
@@ -542,7 +556,7 @@ const closedeleteAll = () => {
deleteAll.value = false
};
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.deleted = true;
})