fix: allow assigned_to in listview
This commit is contained in:
parent
607d7bff75
commit
2bec43244a
@ -107,6 +107,7 @@ def get_list_data(doctype: str, filters: dict, order_by: str):
|
|||||||
"value": "modified_by",
|
"value": "modified_by",
|
||||||
"options": "User",
|
"options": "User",
|
||||||
},
|
},
|
||||||
|
{"label": "Assigned To", "type": "Text", "value": "_assign"},
|
||||||
{"label": "Owner", "type": "Link", "value": "owner", "options": "User"},
|
{"label": "Owner", "type": "Link", "value": "owner", "options": "User"},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,10 @@
|
|||||||
v-slot="{ column, item }"
|
v-slot="{ column, item }"
|
||||||
:row="row"
|
:row="row"
|
||||||
>
|
>
|
||||||
<ListRowItem :item="item">
|
<div v-if="column.key === '_assign'" class="flex items-center">
|
||||||
|
<MultipleAvatar :avatars="item" />
|
||||||
|
</div>
|
||||||
|
<ListRowItem v-else :item="item">
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<div v-if="column.key === 'status'">
|
<div v-if="column.key === 'status'">
|
||||||
<IndicatorIcon :class="item.color" />
|
<IndicatorIcon :class="item.color" />
|
||||||
@ -86,6 +89,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import MultipleAvatar from '@/components/MultipleAvatar.vue'
|
||||||
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
||||||
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@ -17,7 +17,10 @@
|
|||||||
v-slot="{ column, item }"
|
v-slot="{ column, item }"
|
||||||
:row="row"
|
:row="row"
|
||||||
>
|
>
|
||||||
<ListRowItem :item="item">
|
<div v-if="column.key === '_assign'" class="flex items-center">
|
||||||
|
<MultipleAvatar :avatars="item" />
|
||||||
|
</div>
|
||||||
|
<ListRowItem v-else :item="item">
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<div v-if="column.key === 'status'">
|
<div v-if="column.key === 'status'">
|
||||||
<IndicatorIcon :class="item.color" />
|
<IndicatorIcon :class="item.color" />
|
||||||
@ -97,6 +100,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
||||||
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
||||||
|
import MultipleAvatar from '@/components/MultipleAvatar.vue'
|
||||||
import {
|
import {
|
||||||
Avatar,
|
Avatar,
|
||||||
ListView,
|
ListView,
|
||||||
|
|||||||
@ -33,7 +33,11 @@
|
|||||||
<ViewSettings doctype="CRM Deal" v-model="deals" />
|
<ViewSettings doctype="CRM Deal" v-model="deals" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<DealsListView v-if="deals.data && rows.length" :rows="rows" :columns="deals.data.columns" />
|
<DealsListView
|
||||||
|
v-if="deals.data && rows.length"
|
||||||
|
:rows="rows"
|
||||||
|
:columns="deals.data.columns"
|
||||||
|
/>
|
||||||
<div v-else-if="deals.data" class="flex h-full items-center justify-center">
|
<div v-else-if="deals.data" class="flex h-full items-center justify-center">
|
||||||
<div
|
<div
|
||||||
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
|
class="flex flex-col items-center gap-3 text-xl font-medium text-gray-500"
|
||||||
@ -193,6 +197,13 @@ const rows = computed(() => {
|
|||||||
label: deal.deal_owner && getUser(deal.deal_owner).full_name,
|
label: deal.deal_owner && getUser(deal.deal_owner).full_name,
|
||||||
...(deal.deal_owner && getUser(deal.deal_owner)),
|
...(deal.deal_owner && getUser(deal.deal_owner)),
|
||||||
}
|
}
|
||||||
|
} else if (row == '_assign') {
|
||||||
|
let assignees = JSON.parse(deal._assign) || []
|
||||||
|
_rows[row] = assignees.map((user) => ({
|
||||||
|
name: user,
|
||||||
|
image: getUser(user).user_image,
|
||||||
|
label: getUser(user).full_name,
|
||||||
|
}))
|
||||||
} else if (['modified', 'creation'].includes(row)) {
|
} else if (['modified', 'creation'].includes(row)) {
|
||||||
_rows[row] = {
|
_rows[row] = {
|
||||||
label: dateFormat(deal[row], dateTooltipFormat),
|
label: dateFormat(deal[row], dateTooltipFormat),
|
||||||
|
|||||||
@ -196,6 +196,13 @@ const rows = computed(() => {
|
|||||||
label: lead.lead_owner && getUser(lead.lead_owner).full_name,
|
label: lead.lead_owner && getUser(lead.lead_owner).full_name,
|
||||||
...(lead.lead_owner && getUser(lead.lead_owner)),
|
...(lead.lead_owner && getUser(lead.lead_owner)),
|
||||||
}
|
}
|
||||||
|
} else if (row == '_assign') {
|
||||||
|
let assignees = JSON.parse(lead._assign) || []
|
||||||
|
_rows[row] = assignees.map((user) => ({
|
||||||
|
name: user,
|
||||||
|
image: getUser(user).user_image,
|
||||||
|
label: getUser(user).full_name,
|
||||||
|
}))
|
||||||
} else if (['modified', 'creation'].includes(row)) {
|
} else if (['modified', 'creation'].includes(row)) {
|
||||||
_rows[row] = {
|
_rows[row] = {
|
||||||
label: dateFormat(lead[row], dateTooltipFormat),
|
label: dateFormat(lead[row], dateTooltipFormat),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user