300300 </template >
301301 </el-table-column >
302302
303- <el-table-column label =" Email" width =" 240" >
303+ <el-table-column
304+ label =" Emails"
305+ :width =" emailsColumnWidth"
306+ >
304307 <template #default =" scope " >
305308 <router-link
306309 :to =" {
309312 }"
310313 class =" block"
311314 >
312- <div class =" text-sm cursor-auto" >
315+ <div
316+ v-if =" scope.row.emails.length"
317+ class =" text-sm cursor-auto flex flex-wrap gap-1"
318+ >
313319 <el-tooltip
314- v-if =" scope.row.email"
315- :disabled =" !scope.row.email"
320+ v-for =" email of scope.row.emails"
321+ :key =" email"
322+ :disabled =" !email"
316323 popper-class =" custom-identity-tooltip"
317324 placement =" top"
318325 >
319326 <template #content
320327 ><span
321328 >Send email
322329 <i
323- v-if =" scope.row. email"
330+ v-if =" email"
324331 class =" ri-external-link-line text-gray-400"
325332 ></i ></span
326333 ></template >
327334 <div @click.prevent >
328335 <a
329336 target =" _blank"
330- class =" text-gray-500 hover:!text-brand-500 "
331- :href =" `mailto:${scope.row. email}`"
337+ class =" badge--interactive "
338+ :href =" `mailto:${email}`"
332339 @click.stop =" trackEmailClick"
333- >{{ scope.row. email }}</a
340+ >{{ email }}</a
334341 >
335342 </div >
336343 </el-tooltip >
337- <span v-else class =" text-gray-500"
338- >-</span
339- >
340344 </div >
345+ <span v-else class =" text-gray-500"
346+ >-</span
347+ >
341348 </router-link >
342349 </template >
343350 </el-table-column >
344351
345352 <el-table-column
346- :width =" maxTabWidth "
353+ :width =" tagsColumnWidth "
347354 :label ="
348355 translate('entities.member.fields.tag')
349356 "
@@ -498,7 +505,7 @@ const loading = computed(
498505 store .state .member .list .loading || props .isPageLoading
499506)
500507
501- const maxTabWidth = computed (() => {
508+ const tagsColumnWidth = computed (() => {
502509 let maxTabWidth = 0
503510 for (const row of rows .value ) {
504511 if (row .tags ) {
@@ -515,6 +522,21 @@ const maxTabWidth = computed(() => {
515522 return Math .min (maxTabWidth + 100 , 500 )
516523})
517524
525+ const emailsColumnWidth = computed (() => {
526+ let maxTabWidth = 0
527+ for (const row of rows .value ) {
528+ const tabWidth = row .emails
529+ .map ((email ) => email .length * 12 )
530+ .reduce ((a , b ) => a + b, 0 )
531+
532+ if (tabWidth > maxTabWidth) {
533+ maxTabWidth = tabWidth > 400 ? 400 : tabWidth
534+ }
535+ }
536+
537+ return maxTabWidth
538+ })
539+
518540const selectedRows = computed (
519541 () => store .getters [' member/selectedRows' ]
520542)
0 commit comments