import { computed, nextTick, ref } from 'vue';
-import {
- HolderOutlined,
- MoreOutlined,
- PlusOutlined,
-} from '@ant-design/icons-vue';
+import { HolderOutlined, MoreOutlined } from '@ant-design/icons-vue';
import {
Button as AButton,
Dropdown as ADropdown,
@@ -17,7 +13,7 @@ import {
import AddDealButton from './AddDealButton.vue';
import DealCard from './DealCard.vue';
import type { PipelineDeal, PipelineStage, PipelineUiCopy } from '@/lib/pipeline-board';
-import { DEAL_BOARD_COPY, PIPELINE_ACCENT, toFaItemCount } from '@/lib/pipeline-board';
+import { DEAL_BOARD_COPY, PIPELINE_ACCENT } from '@/lib/pipeline-board';
const props = withDefaults(
defineProps<{
@@ -67,8 +63,8 @@ const columnStyle = computed(() => ({
display: 'flex',
flexDirection: 'column' as const,
gap: '12px',
- flex: '0 0 280px',
- width: '280px',
+ flex: '0 0 310px',
+ width: '310px',
alignSelf: 'stretch' as const,
minHeight: 0,
padding: 0,
@@ -154,15 +150,21 @@ function onColumnDragStart(event: DragEvent) {
}
const menuItems = computed(() => [
+ { key: 'add', label: 'افزودن' },
{ key: 'rename', label: 'تغییر نام' },
{ key: 'right', label: 'انتقال به راست', disabled: props.isFirst },
{ key: 'left', label: 'انتقال به چپ', disabled: props.isLast },
{ key: 'delete', label: 'حذف ستون', danger: true },
]);
+const itemCountLabel = computed(() =>
+ new Intl.NumberFormat('fa-IR').format(props.stage.total ?? props.stage.deals.length),
+);
+
function onMenuClick({ key }: { key: string | number }) {
menuOpen.value = false;
- if (key === 'rename') startRename();
+ if (key === 'add') emit('addDeal', props.stage.id);
+ else if (key === 'rename') startRename();
else if (key === 'right') emit('move', props.stage.id, -1);
else if (key === 'left') emit('move', props.stage.id, 1);
else if (key === 'delete') emit('delete', props.stage.id);
@@ -224,12 +226,13 @@ function onMenuClick({ key }: { key: string | number }) {
/>
-
- {{ toFaItemCount(stage.total ?? stage.deals.length, copy.itemNoun) }}
-
-
-
-
-
-
@@ -311,7 +301,12 @@ function onMenuClick({ key }: { key: string | number }) {