mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 22:06:45 +08:00
--fix 排序
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" 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)">
|
||||
<div class="items1">
|
||||
<div class="boxs_left">
|
||||
@@ -180,7 +181,8 @@
|
||||
操作
|
||||
</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">
|
||||
<template #item="{ element,index }">
|
||||
<div style="
|
||||
@@ -518,7 +520,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {computed, onMounted, onUnmounted, ref,} from "vue";
|
||||
import {computed, onMounted, onUnmounted, ref, watch,} from "vue";
|
||||
import {message} from "ant-design-vue";
|
||||
import * as api from "../../api/indexTaskadd";
|
||||
import UnlockMode from "../../components/drawers/UnlockMode.vue";
|
||||
@@ -558,13 +560,22 @@ const selectAll = computed(() => {
|
||||
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) {
|
||||
activeIndex.value = index
|
||||
}
|
||||
|
||||
//获取任务列表
|
||||
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) => {
|
||||
@@ -596,7 +607,7 @@ const moveTask = () => {
|
||||
};
|
||||
//批量删除
|
||||
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.deleted = true;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user