@@ -103,7 +103,7 @@ import {
103103
104104import { RouteNames } from " @/router" ;
105105
106- import BigNumber , { type IBigNumber } from " @/common/components/BigNumber.vue" ;
106+ import BigNumber from " @/common/components/BigNumber.vue" ;
107107import ListHeader from " @/common/components/ListHeader.vue" ;
108108import EmptyState from " @/common/components/EmptyState.vue" ;
109109import SharePnLDialog from " @/modules/leases/components/single-lease/SharePnLDialog.vue" ;
@@ -133,6 +133,7 @@ import { useRouter } from "vue-router";
133133import type { IAction } from " ./single-lease/Action.vue" ;
134134import Action from " ./single-lease/Action.vue" ;
135135import TableNumber from " @/common/components/TableNumber.vue" ;
136+ import TablePnl from " @/common/components/TablePnl.vue" ;
136137import type { LeaseInfo } from " @/common/api" ;
137138
138139const leasesStore = useLeasesStore ();
@@ -174,13 +175,13 @@ const columns = computed<TableColumnProps[]>(() =>
174175 { label: " " , class: " !flex-none w-[40px]" }
175176 ]
176177 : [
177- { label: i18n .t (" message.lease" ), variant: " left" , class: " max-w-[150px ]" },
178- { label: i18n .t (" message.asset" ), variant: " left" },
179- { label: i18n .t (" message.type" ), variant: " left" , class: " max-w-[45px ]" },
180- { label: i18n .t (" message.pnl" ), class: " max-w-[200px ]" },
181- { label: i18n .t (" message.lease-size" ) },
182- { label: i18n .t (" message.liquidation-lease-table" ), class: " max-w-[200px ]" },
183- { label: " " , class: " max-w-[220px ]" }
178+ { label: i18n .t (" message.lease" ), variant: " left" , class: " flex-[1.1_1_0% ]" },
179+ { label: i18n .t (" message.asset" ), variant: " left" , class: " flex-[1.7_1_0%] " },
180+ { label: i18n .t (" message.type" ), variant: " left" , class: " flex-[0.6_1_0% ]" },
181+ { label: i18n .t (" message.pnl" ), class: " flex-[1.6_1_0% ]" },
182+ { label: i18n .t (" message.lease-size" ), class: " flex-[1.7_1_0%] " },
183+ { label: i18n .t (" message.liquidation-lease-table" ), class: " flex-[1.5_1_0% ]" },
184+ { label: " " , class: " flex-[1.8_1_0% ]" }
184185 ]
185186);
186187
@@ -294,10 +295,13 @@ const leasesData = computed<TableRowItemProps[]>(() => {
294295 }
295296
296297 const liquidation = loading
297- ? { component : () => h (" div" , { class: " skeleton-box mb-2 rounded-[4px] w-[70px] h-[20px]" }) }
298+ ? {
299+ component : () => h (" div" , { class: " skeleton-box mb-2 rounded-[4px] w-[70px] h-[20px]" }),
300+ class: " flex-[1.5_1_0%]"
301+ }
298302 : {
299303 value: formatPriceUsd (displayData .liquidationPrice .toString ()),
300- class: " max-w-[200px ]"
304+ class: " flex-[1.5_1_0% ]"
301305 };
302306
303307 const actions: Component [] = getActions (item , displayData );
@@ -311,36 +315,32 @@ const leasesData = computed<TableRowItemProps[]>(() => {
311315 click : () => {
312316 router .push (` /${RouteNames .LEASES }/${item .address } ` );
313317 },
314- class: " text-typography-link font-semibold max-w-[150px ] cursor-pointer"
318+ class: " text-typography-link font-semibold flex-[1.1_1_0% ] cursor-pointer"
315319 },
316320 {
317321 image: getAssetIcon (item ),
318322 imageClass: " w-[32px] h-[32px]" ,
319323 value: asset ?.shortName ?? " " ,
320324 subValue: asset ?.name ?? " " ,
321325 variant: " left" ,
322- textClass: " line-clamp-1 [display:-webkit-box]"
326+ textClass: " line-clamp-1 [display:-webkit-box]" ,
327+ class: " flex-[1.7_1_0%]"
323328 },
324329 {
325330 value: positionType ,
326331 variant: " left" ,
327- class: " max-w-[45px ]"
332+ class: " flex-[0.6_1_0% ]"
328333 },
329334 {
330335 component : () =>
331336 loading
332337 ? h (" div" , { class: " skeleton-box mb-2 rounded-[4px] w-[70px] h-[20px]" })
333- : h <IBigNumber >(BigNumber , {
334- pnlStatus: {
335- positive: pnlData .status ,
336- value: ` ${pnlData .status ? " +" : " " }${pnlData .percent }% (${hide .value ? " ****" : pnlData .amount }) ` ,
337- badge: {
338- content: pnlData .percent ,
339- base: false
340- }
341- }
338+ : h (TablePnl , {
339+ percent: ` ${pnlData .status ? " +" : " " }${pnlData .percent }% ` ,
340+ amount: hide .value ? " ****" : pnlData .amount ,
341+ positive: pnlData .status
342342 }),
343- class: " max-w-[200px] "
343+ class: " flex-[1.6_1_0%] [&>div]:w-full [&>div>div]:w-full "
344344 },
345345 {
346346 component : () =>
@@ -351,12 +351,12 @@ const leasesData = computed<TableRowItemProps[]>(() => {
351351 subValue: value .subValue ,
352352 tooltip: value .tooltip
353353 }),
354- class: " font-semibold break-all"
354+ class: " flex-[1.7_1_0%] font-semibold break-all [&>div]:w-full [&>div>div]:w-full "
355355 },
356356 liquidation ,
357357 {
358358 component : () => [... actions ],
359- class: " max-w-[220px ] pr-4 cursor-pointer"
359+ class: " flex-[1.8_1_0% ] pr-4 cursor-pointer"
360360 }
361361 ]
362362 };
0 commit comments