diff --git a/src/components/profile/ProfileManager.vue b/src/components/profile/ProfileManager.vue
index b6c63c3..37ef39a 100644
--- a/src/components/profile/ProfileManager.vue
+++ b/src/components/profile/ProfileManager.vue
@@ -52,47 +52,60 @@
-
-
-
-
- {{ category.name }} ({{ category.profiles?.length || 0
- }})
-
-
-
- onProfileDrop(event, categoryIndex)">
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{ dragCategory.element.name }} ({{ dragCategory.element.profiles?.length || 0
+ }})
+
+
+
+ onProfileDrop(event, dragCategory.index)">
+
+
+
+
+
+
+
+
+
+
+
+
@@ -123,7 +136,6 @@ defineProps({
})
const dragOptions = ref({
- group: 'profiles',
ghostClass: 'ghost',
animation: 150,
direction: 'vertical',
@@ -179,6 +191,15 @@ watch(showProfileConfig, value => {
// return map
// })
+const onCategoryDrop = (event) => {
+ if (event.moved) {
+ const category = event.moved.element
+ const oldIndex = event.moved.oldIndex
+ const newIndex = event.moved.newIndex
+ store.moveProfileCategory(category.name, oldIndex, newIndex)
+ }
+}
+
const onProfileDrop = (event, categoryIndex) => {
if (event.moved) {
const profile = event.moved.element
diff --git a/src/store.js b/src/store.js
index 2713879..845a037 100644
--- a/src/store.js
+++ b/src/store.js
@@ -82,6 +82,11 @@ export const useStore = defineStore('main', {
category.profiles[newIndex] = category.profiles[oldIndex]
category.profiles[newIndex] = tmpProfile
},
+ moveProfileCategory(categoryName, oldIndex, newIndex) {
+ const tmpCategory = this.profileCategories[newIndex]
+ this.profileCategories[newIndex] = this.profileCategories[oldIndex]
+ this.profileCategories[newIndex] = tmpCategory
+ },
changeProfileCategory(profileId, newCategoryIndex, newIndex) {
const profile = this.profiles.find(p => p.id === profileId)
const oldCategory = this.profileCategories.find(c => c.profiles.find(p => p.id === profileId))