|
@@ -1,19 +1,40 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <draggable :list="myArray" item-key="id" chosen-class="chosen" style="height: 100%" @start="dragging = true" @end="endDraggableEv">
|
|
|
|
- <template #item="{ element }">
|
|
|
|
|
|
+ <draggable v-bind="dragOptions" v-model="myArray" handle=".group_header" item-key="categoryId" @update:model-value="update_item_categoryList">
|
|
|
|
+ <template #item="{ element: item }">
|
|
<div class="group_list">
|
|
<div class="group_list">
|
|
<div class="group_header flex flex-pack-justify flex-align-center">
|
|
<div class="group_header flex flex-pack-justify flex-align-center">
|
|
- <div class="group_header_title disabled">{{ element.categoryName }}</div>
|
|
|
|
|
|
+ <div class="group_header_title disabled">{{ item.categoryName }}</div>
|
|
<div class="group_header_nameOperate">
|
|
<div class="group_header_nameOperate">
|
|
<el-tooltip effect="dark" content="删除" placement="top">
|
|
<el-tooltip effect="dark" content="删除" placement="top">
|
|
- <el-icon><Delete @click="deleteItem(element)" /></el-icon>
|
|
|
|
|
|
+ <el-icon><Delete @click="deleteItem(item)" /></el-icon>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</draggable>
|
|
</draggable>
|
|
|
|
+
|
|
|
|
+ <!-- <draggable-->
|
|
|
|
+ <!-- :list="myArray"-->
|
|
|
|
+ <!-- item-key="id"-->
|
|
|
|
+ <!-- chosen-class="chosen"-->
|
|
|
|
+ <!-- style="height: 100%"-->
|
|
|
|
+ <!-- @start="dragging = true"-->
|
|
|
|
+ <!-- @end="endDraggableEv">-->
|
|
|
|
+ <!-- <template #item="{ element }">-->
|
|
|
|
+ <!-- <div class="group_list">-->
|
|
|
|
+ <!-- <div class="group_header flex flex-pack-justify flex-align-center">-->
|
|
|
|
+ <!-- <div class="group_header_title disabled">{{ element.categoryName }}</div>-->
|
|
|
|
+ <!-- <div class="group_header_nameOperate">-->
|
|
|
|
+ <!-- <el-tooltip effect="dark" content="删除" placement="top">-->
|
|
|
|
+ <!-- <el-icon><Delete @click="deleteItem(element)" /></el-icon>-->
|
|
|
|
+ <!-- </el-tooltip>-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </template>-->
|
|
|
|
+ <!-- </draggable>-->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -24,9 +45,16 @@ import { ref, nextTick, onMounted } from 'vue'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import flowGroup from '@/api/flow/group'
|
|
import flowGroup from '@/api/flow/group'
|
|
import flowDefinition from '@/api/flow/definition'
|
|
import flowDefinition from '@/api/flow/definition'
|
|
|
|
+import { debounce } from '@/utils'
|
|
const dragging = ref(false)
|
|
const dragging = ref(false)
|
|
const myArray = ref([])
|
|
const myArray = ref([])
|
|
const sortFinallyValue = ref([])
|
|
const sortFinallyValue = ref([])
|
|
|
|
+const dragOptions = {
|
|
|
|
+ animation: 200,
|
|
|
|
+ group: 'processId',
|
|
|
|
+ disabled: false,
|
|
|
|
+ ghostClass: 'ghost'
|
|
|
|
+}
|
|
|
|
|
|
const endDraggableEv = () => {
|
|
const endDraggableEv = () => {
|
|
dragging.value = false
|
|
dragging.value = false
|
|
@@ -74,6 +102,13 @@ const deleteFlowGroup = async item => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const update_categoryListSort = debounce(() => {
|
|
|
|
+ flowDefinition.updateProcessSortApi(myArray.value.map(v => ({ categoryId: v.categoryId, processIds: v.processList.map(_v => _v.processId) })))
|
|
|
|
+}, 50)
|
|
|
|
+const update_item_categoryList = (values: any[]) => {
|
|
|
|
+ update_categoryListSort()
|
|
|
|
+}
|
|
|
|
+
|
|
// 流程组列表
|
|
// 流程组列表
|
|
const flowGroupListAll = async (item = {}) => {
|
|
const flowGroupListAll = async (item = {}) => {
|
|
try {
|
|
try {
|