|
@@ -110,10 +110,10 @@
|
|
<div class="index-box">{{ index + 1 }}</div>
|
|
<div class="index-box">{{ index + 1 }}</div>
|
|
<div class="title-box">{{ setCheckboxUserName(element) }}</div>
|
|
<div class="title-box">{{ setCheckboxUserName(element) }}</div>
|
|
<div class="icon-box">
|
|
<div class="icon-box">
|
|
- <span class="icon" @click="downSortClick(index)">
|
|
|
|
|
|
+ <span class="icon" @click="downSortClick(index, element)">
|
|
<HcIcon name="arrow-down" ui="text-lg" />
|
|
<HcIcon name="arrow-down" ui="text-lg" />
|
|
</span>
|
|
</span>
|
|
- <span class="icon" @click="upSortClick(index)">
|
|
|
|
|
|
+ <span class="icon" @click="upSortClick(index, element)">
|
|
<HcIcon name="arrow-up" ui="text-lg" />
|
|
<HcIcon name="arrow-up" ui="text-lg" />
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
@@ -133,7 +133,7 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { onMounted, ref, watch } from 'vue'
|
|
import { onMounted, ref, watch } from 'vue'
|
|
import tasksFlowApi from '~api/tasks/flow'
|
|
import tasksFlowApi from '~api/tasks/flow'
|
|
-import { arrToKey, deepClone, getArrValue } from 'js-fast-way'
|
|
|
|
|
|
+import { arrIndex, arrToKey, deepClone, getArrValue } from 'js-fast-way'
|
|
import Draggable from 'vuedraggable'
|
|
import Draggable from 'vuedraggable'
|
|
import { hasDuplicates } from '~uti/tools'
|
|
import { hasDuplicates } from '~uti/tools'
|
|
|
|
|
|
@@ -375,7 +375,7 @@ const delCheckboxUser = (item, index) => {
|
|
//排序
|
|
//排序
|
|
const sortNodeDrag = ref(false)
|
|
const sortNodeDrag = ref(false)
|
|
//向下
|
|
//向下
|
|
-const downSortClick = (index) => {
|
|
|
|
|
|
+const downSortClick = (index, elemnt) => {
|
|
const indexs = index + 1
|
|
const indexs = index + 1
|
|
const data = checkboxUserList.value
|
|
const data = checkboxUserList.value
|
|
if (indexs !== data.length) {
|
|
if (indexs !== data.length) {
|
|
@@ -384,9 +384,30 @@ const downSortClick = (index) => {
|
|
} else {
|
|
} else {
|
|
window?.$message?.warning('已经处于置底,无法下移')
|
|
window?.$message?.warning('已经处于置底,无法下移')
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let curUser = curItem.value.users.split(',')
|
|
|
|
+ let curUserIds = curItem.value.userIds.split(',')
|
|
|
|
+ let userIndex = arrIndex(curUser, elemnt) // 1
|
|
|
|
+ let userIdsIndex = arrIndex(curUserIds, elemnt.split('-')[1]) // 1
|
|
|
|
+ const userIndexs = userIndex + 1
|
|
|
|
+ if (userIndexs !== curUser.length) {
|
|
|
|
+ const tmp = curUser.splice(userIndexs, 1)
|
|
|
|
+ curUser.splice(userIndex, 0, tmp[0])
|
|
|
|
+ curItem.value.users = curUser.join(',')
|
|
|
|
+ }
|
|
|
|
+ const userIdsIndexs = userIdsIndex + 1
|
|
|
|
+ if (userIdsIndexs !== curUserIds.length) {
|
|
|
|
+ const tmp = curUserIds.splice(userIdsIndexs, 1)
|
|
|
|
+ curUserIds.splice(userIdsIndex, 0, tmp[0])
|
|
|
|
+ curItem.value.userIds = curUserIds.join(',')
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
//向上
|
|
//向上
|
|
-const upSortClick = (index) => {
|
|
|
|
|
|
+const upSortClick = (index, elemnt) => {
|
|
const data = checkboxUserList.value || []
|
|
const data = checkboxUserList.value || []
|
|
if (index !== 0) {
|
|
if (index !== 0) {
|
|
const tmp = data.splice(index - 1, 1)
|
|
const tmp = data.splice(index - 1, 1)
|
|
@@ -394,6 +415,26 @@ const upSortClick = (index) => {
|
|
} else {
|
|
} else {
|
|
window?.$message?.warning('已经处于置顶,无法上移')
|
|
window?.$message?.warning('已经处于置顶,无法上移')
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ let curUser = curItem.value.users.split(',')
|
|
|
|
+ let curUserIds = curItem.value.userIds.split(',')
|
|
|
|
+ let userIndex = arrIndex(curUser, elemnt) // 1
|
|
|
|
+ let userIdsIndex = arrIndex(curUserIds, elemnt.split('-')[1]) // 1
|
|
|
|
+ const userIndexs = userIndex - 1
|
|
|
|
+ if (userIndexs !== curUser.length) {
|
|
|
|
+ const tmp = curUser.splice(userIndexs, 1)
|
|
|
|
+ curUser.splice(userIndex, 0, tmp[0])
|
|
|
|
+ curItem.value.users = curUser.join(',')
|
|
|
|
+ }
|
|
|
|
+ const userIdsIndexs = userIdsIndex - 1
|
|
|
|
+ if (userIdsIndexs !== curUserIds.length) {
|
|
|
|
+ const tmp = curUserIds.splice(userIdsIndexs, 1)
|
|
|
|
+ curUserIds.splice(userIdsIndex, 0, tmp[0])
|
|
|
|
+ curItem.value.userIds = curUserIds.join(',')
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
//确认选择
|
|
//确认选择
|