1
0
forked from test/crm

fix: added user avatar, logo, status indicator in list view

This commit is contained in:
Shariq Ansari 2023-07-25 12:58:33 +05:30
parent 16fb41e609
commit 8e18312d78
4 changed files with 44 additions and 3 deletions

View File

@ -0,0 +1,20 @@
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
>
<rect width="16" height="16" rx="4.5" :fill="color" />
<circle cx="8" cy="8" r="3" fill="white" />
</svg>
</template>
<script setup>
const props = defineProps({
color: {
type: String,
default: 'currentColor',
},
})
</script>

View File

@ -63,10 +63,21 @@
<div
v-for="column in columns"
:key="column.key"
class="text-base text-gray-900 truncate"
class="flex items-center space-x-2.5"
:class="[column.size, column.align]"
>
{{ row[column.key] }}
<div v-if="column.type === 'user'">
<Avatar v-if="row[column.key]" :label="row[column.key]" size="md" />
</div>
<div v-else-if="column.type === 'logo'">
<Avatar :label="row[column.key]" size="md" shape="square" />
</div>
<div v-else-if="column.type === 'status'">
<IndicatorIcon />
</div>
<div class="text-base text-gray-900 truncate">
{{ row[column.key] }}
</div>
</div>
</div>
</div>
@ -74,9 +85,10 @@
</div>
</template>
<script setup>
import { FeatherIcon, Dropdown, Checkbox } from 'frappe-ui'
import { FeatherIcon, Dropdown, Checkbox, Avatar } from 'frappe-ui'
import SortIcon from './Icons/SortIcon.vue'
import FilterIcon from './Icons/FilterIcon.vue'
import IndicatorIcon from './Icons/IndicatorIcon.vue'
import { ref } from 'vue'
const props = defineProps({

View File

@ -24,16 +24,19 @@ const columns = [
{
label: 'Full Name',
key: 'full_name',
type: 'user',
size: 'w-44',
},
{
label: 'Email',
key: 'email',
type: 'email',
size: 'w-44',
},
{
label: 'Phone',
key: 'phone',
type: 'phone',
size: 'w-44',
},
]

View File

@ -34,31 +34,37 @@ const columns = [
{
label: 'Full name',
key: 'full_name',
type: 'user',
size: 'w-44',
},
{
label: 'Organization',
key: 'organization_name',
type: 'logo',
size: 'w-44',
},
{
label: 'Status',
key: 'status',
type: 'status',
size: 'w-44',
},
{
label: 'Email',
key: 'email',
type: 'email',
size: 'w-44',
},
{
label: 'Mobile no',
key: 'mobile_no',
type: 'phone',
size: 'w-44',
},
{
label: 'Lead owner',
key: 'lead_owner',
type: 'user',
size: 'w-44',
},
]