|
@@ -89,7 +89,12 @@
|
|
<div class="disposition-title" style="margin-top: 0px">已选设备</div>
|
|
<div class="disposition-title" style="margin-top: 0px">已选设备</div>
|
|
<div class="selected-list-c">
|
|
<div class="selected-list-c">
|
|
<template v-for="(item,index) in copiedCustomizeColumns" :key="item.se_type">
|
|
<template v-for="(item,index) in copiedCustomizeColumns" :key="item.se_type">
|
|
- <div :class="selectedItemIndex===index?'selected-item-tag-active':'selected-item-tag'" @click="changeSelected(index)">{{item.se_name}}</div>
|
|
|
|
|
|
+ <div :class="selectedItemIndex===index?'selected-item-tag-active':'selected-item-tag'" @click="changeSelected(index)"
|
|
|
|
+ draggable="true"
|
|
|
|
+ @dragstart="dragStart($event, index)"
|
|
|
|
+ @dragover.prevent
|
|
|
|
+ @drop="drop($event, index)"
|
|
|
|
+ >{{item.se_name}}</div>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
<div class="button-container">
|
|
<div class="button-container">
|
|
@@ -230,6 +235,18 @@ const columns = reactive<ColumnProps[]>([
|
|
{ prop: "sta_remark", label: "备注" },
|
|
{ prop: "sta_remark", label: "备注" },
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
+const dragStart = (event, index) => {
|
|
|
|
+ event.dataTransfer.effectAllowed = 'move';
|
|
|
|
+ // 保存当前拖动的元素索引
|
|
|
|
+ event.dataTransfer.setData('text/plain', index.toString());
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const drop = (event, index) => {
|
|
|
|
+ const draggedIndex = parseInt(event.dataTransfer.getData('text/plain'));
|
|
|
|
+ // 移动数组中的元素来更新顺序
|
|
|
|
+ const draggedItem = copiedCustomizeColumns.value.splice(draggedIndex, 1)[0];
|
|
|
|
+ copiedCustomizeColumns.value.splice(index, 0, draggedItem);
|
|
|
|
+};
|
|
|
|
|
|
const handlePlatform = (item) => {
|
|
const handlePlatform = (item) => {
|
|
if (!item || typeof item !== 'object') {
|
|
if (!item || typeof item !== 'object') {
|