refactor: add button view detail

This commit is contained in:
Methapon2001 2024-04-11 09:42:26 +07:00
parent f435b5b71b
commit 72bfa30a87

View file

@ -47,7 +47,7 @@ const filter = ref('');
</script> </script>
<template> <template>
<div style="width: 100%"> <div v-if="rows.length > 0">
<q-table <q-table
:rows-per-page-options="[4]" :rows-per-page-options="[4]"
flat flat
@ -80,23 +80,32 @@ const filter = ref('');
</q-item-section> </q-item-section>
<q-item-section> <q-item-section>
<div class="row"> <div class="row items-center">
<div v-if="k !== 'type'"> <div>
{{ v }} {{
</div> k !== 'type'
<div v-else> ? v
{{ (v && $t('branchHQLabel')) || $t('branchLabel') }} : (v && $t('branchHQLabel')) || $t('branchLabel')
}}
</div> </div>
<q-space /> <q-space />
<q-btn
v-if="i === 0"
outline
no-caps
class="q-px-md"
dense
:label="$t('viewDetail')"
@click.stop="$emit('showInfo', prop.row)"
>
<Icon <Icon
icon="mdi:navigate-next" icon="mdi:navigate-next"
class="cursor-pointer" class="cursor-pointer"
v-if="i === 0" v-if="i === 0"
width="20px" width="20px"
@click.stop="$emit('show-info', prop.row)"
/> />
</q-btn>
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>
@ -105,6 +114,17 @@ const filter = ref('');
</template> </template>
</q-table> </q-table>
</div> </div>
<div
v-else
class="column items-center justify-center q-pb-xl"
style="opacity: 0.3; height: 40vh"
>
<q-img
src="/no-data.png"
style="object-fit: cover; width: 128px; height: 128px"
/>
<span class="text-body1">{{ $t('noData') }}</span>
</div>
</template> </template>
<style scoped> <style scoped>