code refactor

This commit is contained in:
MaysWind
2023-07-20 01:37:45 +08:00
parent 2cbd8684cf
commit b561948030
4 changed files with 15 additions and 11 deletions
+5 -4
View File
@@ -102,7 +102,7 @@
<v-row class="pl-4 pr-8" v-if="categorizedAccounts[activeAccountCategory.id] && categorizedAccounts[activeAccountCategory.id].accounts && categorizedAccounts[activeAccountCategory.id].accounts.length">
<v-col cols="12">
<draggable
<draggable-list
class="list-group"
item-key="id"
handle=".drag-handle"
@@ -197,7 +197,7 @@
</v-card>
</div>
</template>
</draggable>
</draggable-list>
</v-col>
</v-row>
</v-card>
@@ -417,7 +417,8 @@ export default {
accountId: moveEvent.element.id,
from: moveEvent.oldIndex,
to: moveEvent.newIndex,
onlyUpdateGlobalList: true
updateListOrder: false,
updateGlobalListOrder: true
}).then(() => {
self.displayOrderModified = true;
}).catch(error => {
@@ -440,7 +441,7 @@ export default {
self.loading = false;
if (!error.processed) {
self.$toast(error.message || error);
self.$refs.snackbar.showError(error);
}
});
},
+3 -1
View File
@@ -338,7 +338,9 @@ export default {
self.accountsStore.changeAccountDisplayOrder({
accountId: id,
from: event.from - 1, // first item in the list is title, so the index need minus one
to: event.to - 1
to: event.to - 1,
updateListOrder: true,
updateGlobalListOrder: true
}).then(() => {
self.displayOrderModified = true;
}).catch(error => {