1
0
forked from test/crm

fix: show company logo in listview

This commit is contained in:
Shariq Ansari 2023-07-25 16:32:45 +05:30
parent d346247e57
commit 99d0f682d5
3 changed files with 15 additions and 4 deletions

View File

@ -30,6 +30,7 @@
"section_break_uixv", "section_break_uixv",
"organization_name", "organization_name",
"no_of_employees", "no_of_employees",
"organization_logo",
"column_break_dbsv", "column_break_dbsv",
"annual_revenue", "annual_revenue",
"industry" "industry"
@ -167,11 +168,16 @@
"fieldtype": "Link", "fieldtype": "Link",
"label": "Industry", "label": "Industry",
"options": "CRM Industry" "options": "CRM Industry"
},
{
"fieldname": "organization_logo",
"fieldtype": "Attach Image",
"label": "Organization Logo"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2023-07-24 19:43:16.008607", "modified": "2023-07-25 16:20:30.468169",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "CRM", "module": "CRM",
"name": "CRM Lead", "name": "CRM Lead",

View File

@ -78,6 +78,7 @@
<div v-else-if="column.type === 'logo'"> <div v-else-if="column.type === 'logo'">
<Avatar <Avatar
class="flex items-center" class="flex items-center"
:image="getValue(row[column.key]).logo"
:label="getValue(row[column.key]).label" :label="getValue(row[column.key]).label"
size="md" size="md"
shape="square" shape="square"
@ -167,8 +168,8 @@ const viewsDropdownOptions = [
function getValue(value) { function getValue(value) {
if (typeof value === 'object') { if (typeof value === 'object') {
value.label = value.full_name value.label = value.full_name || value.label
value.image = value.user_image value.image = value.user_image || value.logo
return value return value
} }
return { return {

View File

@ -19,6 +19,7 @@ const leads = createListResource({
'first_name', 'first_name',
'last_name', 'last_name',
'organization_name', 'organization_name',
'organization_logo',
'status', 'status',
'email', 'email',
'mobile_no', 'mobile_no',
@ -74,7 +75,10 @@ const rows = computed(() => {
return leads.data?.map((lead) => { return leads.data?.map((lead) => {
return { return {
full_name: lead.first_name + ' ' + lead.last_name, full_name: lead.first_name + ' ' + lead.last_name,
organization_name: lead.organization_name, organization_name: {
label: lead.organization_name,
logo: lead.organization_logo,
},
status: { status: {
label: lead.status, label: lead.status,
color: indicatorColor[lead.status], color: indicatorColor[lead.status],