From e388e2cb1dfa75e359f0bdcce963c130561f867a Mon Sep 17 00:00:00 2001 From: ThrRip Date: Sun, 24 Dec 2023 02:49:03 +0800 Subject: [PATCH] admin: Improve changes display (styling, conditions, etc.) --- packages/admin/components/PlaylistList.vue | 40 +++++++++++++++++----- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/packages/admin/components/PlaylistList.vue b/packages/admin/components/PlaylistList.vue index 723d2c1..2069da7 100644 --- a/packages/admin/components/PlaylistList.vue +++ b/packages/admin/components/PlaylistList.vue @@ -248,7 +248,11 @@ v-if="props.type === 'changes' && props.data.find(unmodified => unmodified.$id === song.$id)?.name !== song.name" class="flex flex-row gap-x-1.5" > - + {{ props.data.find(unmodified => unmodified.$id === song.$id)?.name }} @@ -301,7 +305,11 @@ v-if="props.type === 'changes' && props.data.find(unmodified => unmodified.$id === song.$id)?.artist !== song.artist" class="flex flex-row gap-x-1.5" > - + {{ props.data.find(unmodified => unmodified.$id === song.$id)?.artist }} @@ -328,8 +336,11 @@ class="z-10 w-full h-2/3 text-center bg-white rounded focus:outline-none ring-2 ring-blue ring-offset-[4.5px] ring-offset-white" :value="song.payment_amount" - @blur="// @ts-ignore - modifyFinish({ $id: song.$id, payment_amount: $event.target.value === '' ? null : $event.target.value })" + @blur="modifyFinish({ + $id: song.$id, + // @ts-ignore + payment_amount: ($event.target.value === '' || $event.target.value === '0') ? null : Number($event.target.value) + })" @keydown.enter="// @ts-ignore $event.target.blur()" @keydown.esc="// @ts-ignore @@ -338,15 +349,22 @@ > - + unmodified.$id === song.$id)?.language !== song.language" class="flex flex-col gap-y-1 py-0.5" > - + {{ props.data.find(unmodified => unmodified.$id === song.$id)?.language }} - + {{ song.language }}