Editing of the project's Kariz page
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import UiIcon from '@/components/UiIcon.vue';
|
||||
import type { PipelineDeal, PipelineStage } from '@/lib/pipeline-board';
|
||||
import type { PipelineDeal, PipelineStage, PipelineUiCopy } from '@/lib/pipeline-board';
|
||||
import {
|
||||
DEAL_BOARD_COPY,
|
||||
formatCurrencyParts,
|
||||
PIPELINE_ACCENT,
|
||||
} from '@/lib/pipeline-board';
|
||||
|
||||
const props = defineProps<{
|
||||
stages: PipelineStage[];
|
||||
}>();
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
stages: PipelineStage[];
|
||||
copy?: PipelineUiCopy;
|
||||
}>(),
|
||||
{ copy: () => DEAL_BOARD_COPY },
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
openDeal: [dealId: string];
|
||||
@@ -27,21 +32,23 @@ const rows = computed(() =>
|
||||
);
|
||||
|
||||
function money(deal: PipelineDeal) {
|
||||
return formatCurrencyParts(deal.amount, deal.currencyUnit ?? 'تومان');
|
||||
return formatCurrencyParts(deal.amount ?? 0, deal.currencyUnit ?? 'تومان');
|
||||
}
|
||||
|
||||
const hideAmount = computed(() => Boolean(props.copy.hideAmount));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="list" dir="rtl">
|
||||
<p v-if="!rows.length" class="empty">معاملهای نیست</p>
|
||||
<p v-if="!rows.length" class="empty">{{ copy.empty }}</p>
|
||||
|
||||
<div v-else class="table-wrap">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>معامله</th>
|
||||
<th>{{ copy.listColTitle }}</th>
|
||||
<th>مرحله</th>
|
||||
<th>مبلغ</th>
|
||||
<th v-if="!hideAmount">مبلغ</th>
|
||||
<th>تاریخ</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@@ -79,7 +86,7 @@ function money(deal: PipelineDeal) {
|
||||
{{ row.stageTitle }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<td v-if="!hideAmount">
|
||||
<span class="amount" dir="ltr">
|
||||
<strong>{{ money(row.deal).number }}</strong>
|
||||
<small>{{ money(row.deal).unit }}</small>
|
||||
@@ -95,7 +102,7 @@ function money(deal: PipelineDeal) {
|
||||
<button
|
||||
type="button"
|
||||
class="menu"
|
||||
aria-label="گزینههای معامله"
|
||||
:aria-label="copy.itemMenuAria"
|
||||
@click="emit('menuDeal', row.deal.id)"
|
||||
>
|
||||
<UiIcon name="dots-v" :size="18" />
|
||||
@@ -145,7 +152,7 @@ function money(deal: PipelineDeal) {
|
||||
<UiIcon name="calendar" :size="14" />
|
||||
{{ row.deal.date }}
|
||||
</span>
|
||||
<span class="amount" dir="ltr">
|
||||
<span v-if="!hideAmount" class="amount" dir="ltr">
|
||||
<strong>{{ money(row.deal).number }}</strong>
|
||||
<small>{{ money(row.deal).unit }}</small>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user