2026-09-05 00:18:39 +03:30
|
|
|
<script setup lang="ts">
|
|
|
|
|
import UiIcon from '@/components/UiIcon.vue';
|
|
|
|
|
|
|
|
|
|
export type PipelineViewMode = 'kanban' | 'list';
|
|
|
|
|
|
2026-09-09 13:12:13 +03:30
|
|
|
withDefaults(
|
|
|
|
|
defineProps<{
|
|
|
|
|
pipelineName: string;
|
|
|
|
|
pipelineOptions: Array<{ id: string; name: string }>;
|
|
|
|
|
selectedPipelineId: string;
|
|
|
|
|
viewMode: PipelineViewMode;
|
|
|
|
|
search: string;
|
|
|
|
|
canCreate?: boolean;
|
|
|
|
|
}>(),
|
|
|
|
|
{ canCreate: false },
|
|
|
|
|
);
|
2026-09-05 00:18:39 +03:30
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
|
'update:viewMode': [PipelineViewMode];
|
|
|
|
|
'update:search': [string];
|
|
|
|
|
'update:selectedPipelineId': [string];
|
|
|
|
|
filter: [];
|
2026-09-09 13:12:13 +03:30
|
|
|
create: [];
|
2026-09-05 00:18:39 +03:30
|
|
|
}>();
|
2026-09-09 13:12:13 +03:30
|
|
|
|
|
|
|
|
function onPick(value: string) {
|
|
|
|
|
if (value === '__create__') {
|
|
|
|
|
emit('create');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
emit('update:selectedPipelineId', value);
|
|
|
|
|
}
|
2026-09-05 00:18:39 +03:30
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<header class="toolbar" dir="rtl">
|
|
|
|
|
<div class="title-block">
|
|
|
|
|
<span class="brand-ico" aria-hidden="true">
|
|
|
|
|
<UiIcon name="briefcase" :size="18" />
|
|
|
|
|
</span>
|
2026-09-09 13:12:13 +03:30
|
|
|
<h1>{{ pipelineName }}</h1>
|
2026-09-05 00:18:39 +03:30
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="view-toggle" role="group" aria-label="نوع نمایش">
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="seg"
|
|
|
|
|
:class="{ on: viewMode === 'kanban' }"
|
|
|
|
|
:aria-pressed="viewMode === 'kanban'"
|
|
|
|
|
@click="emit('update:viewMode', 'kanban')"
|
|
|
|
|
>
|
|
|
|
|
<UiIcon name="grid" :size="16" />
|
2026-09-09 13:12:13 +03:30
|
|
|
<span class="seg-label">نمای کاریز</span>
|
2026-09-05 00:18:39 +03:30
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="seg"
|
|
|
|
|
:class="{ on: viewMode === 'list' }"
|
|
|
|
|
:aria-pressed="viewMode === 'list'"
|
|
|
|
|
@click="emit('update:viewMode', 'list')"
|
|
|
|
|
>
|
|
|
|
|
<UiIcon name="list" :size="16" />
|
2026-09-09 13:12:13 +03:30
|
|
|
<span class="seg-label">نمای لیست</span>
|
2026-09-05 00:18:39 +03:30
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<label class="pipeline-pick">
|
|
|
|
|
<span class="sr">انتخاب کاریز</span>
|
|
|
|
|
<select
|
|
|
|
|
:value="selectedPipelineId"
|
2026-09-09 13:12:13 +03:30
|
|
|
@change="onPick(($event.target as HTMLSelectElement).value)"
|
2026-09-05 00:18:39 +03:30
|
|
|
>
|
|
|
|
|
<option
|
|
|
|
|
v-for="opt in pipelineOptions"
|
|
|
|
|
:key="opt.id"
|
|
|
|
|
:value="opt.id"
|
|
|
|
|
>
|
|
|
|
|
{{ opt.name }}
|
|
|
|
|
</option>
|
2026-09-09 13:12:13 +03:30
|
|
|
<option v-if="canCreate" value="__create__">کاریز جدید…</option>
|
2026-09-05 00:18:39 +03:30
|
|
|
</select>
|
|
|
|
|
<UiIcon class="chev" name="chevron" :size="16" />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label class="search">
|
|
|
|
|
<UiIcon name="search" :size="16" />
|
|
|
|
|
<span class="sr">جستجو</span>
|
|
|
|
|
<input
|
|
|
|
|
:value="search"
|
|
|
|
|
type="search"
|
|
|
|
|
placeholder="جستجو..."
|
|
|
|
|
@input="emit('update:search', ($event.target as HTMLInputElement).value)"
|
|
|
|
|
/>
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<button type="button" class="filter-btn" aria-label="فیلترها" @click="emit('filter')">
|
|
|
|
|
<UiIcon name="filter" :size="16" />
|
|
|
|
|
فیلترها
|
|
|
|
|
</button>
|
|
|
|
|
</header>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.toolbar {
|
|
|
|
|
display: flex;
|
2026-09-09 13:12:13 +03:30
|
|
|
flex-wrap: nowrap;
|
2026-09-05 00:18:39 +03:30
|
|
|
align-items: center;
|
2026-09-09 13:12:13 +03:30
|
|
|
gap: 0.55rem;
|
|
|
|
|
margin-bottom: 0.85rem;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
width: 100%;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title-block {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 0.55rem;
|
2026-09-09 13:12:13 +03:30
|
|
|
flex: 0 0 auto;
|
|
|
|
|
min-width: 0;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.brand-ico {
|
|
|
|
|
width: 2.15rem;
|
|
|
|
|
height: 2.15rem;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
display: grid;
|
|
|
|
|
place-items: center;
|
|
|
|
|
background: #0f766e;
|
|
|
|
|
color: #fff;
|
2026-09-09 13:12:13 +03:30
|
|
|
flex: 0 0 auto;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
|
margin: 0;
|
2026-09-09 13:12:13 +03:30
|
|
|
font-size: 1.2rem;
|
2026-09-05 00:18:39 +03:30
|
|
|
font-weight: 800;
|
|
|
|
|
color: var(--ink);
|
2026-09-09 13:12:13 +03:30
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.view-toggle {
|
|
|
|
|
display: inline-flex;
|
2026-09-09 13:12:13 +03:30
|
|
|
background: #e8eef1;
|
2026-09-05 00:18:39 +03:30
|
|
|
border-radius: 12px;
|
2026-09-09 13:12:13 +03:30
|
|
|
padding: 0.18rem;
|
|
|
|
|
gap: 0.12rem;
|
|
|
|
|
flex: 0 0 auto;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.seg {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
2026-09-09 13:12:13 +03:30
|
|
|
justify-content: center;
|
2026-09-05 00:18:39 +03:30
|
|
|
gap: 0.35rem;
|
|
|
|
|
border: 0;
|
|
|
|
|
background: transparent;
|
2026-09-09 13:12:13 +03:30
|
|
|
color: #7b8794;
|
2026-09-05 00:18:39 +03:30
|
|
|
font-weight: 700;
|
|
|
|
|
font-size: 0.82rem;
|
2026-09-09 13:12:13 +03:30
|
|
|
padding: 0.42rem 0.7rem;
|
2026-09-05 00:18:39 +03:30
|
|
|
border-radius: 10px;
|
|
|
|
|
cursor: pointer;
|
2026-09-09 13:12:13 +03:30
|
|
|
white-space: nowrap;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.seg.on {
|
|
|
|
|
background: #fff;
|
|
|
|
|
color: var(--accent);
|
|
|
|
|
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.seg:focus-visible {
|
|
|
|
|
outline: 2px solid var(--accent);
|
|
|
|
|
outline-offset: 1px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.pipeline-pick {
|
|
|
|
|
position: relative;
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
2026-09-09 13:12:13 +03:30
|
|
|
min-width: 8.5rem;
|
|
|
|
|
flex: 0 1 13rem;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.pipeline-pick select {
|
|
|
|
|
appearance: none;
|
|
|
|
|
border: 1px solid var(--line);
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 12px;
|
2026-09-09 13:12:13 +03:30
|
|
|
padding: 0.52rem 2rem 0.52rem 0.85rem;
|
2026-09-05 00:18:39 +03:30
|
|
|
font: inherit;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: var(--ink);
|
2026-09-09 13:12:13 +03:30
|
|
|
width: 100%;
|
|
|
|
|
min-width: 0;
|
2026-09-05 00:18:39 +03:30
|
|
|
cursor: pointer;
|
2026-09-09 13:12:13 +03:30
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.pipeline-pick .chev {
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0.65rem;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
color: var(--muted);
|
|
|
|
|
transform: rotate(-90deg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 0.45rem;
|
2026-09-09 13:12:13 +03:30
|
|
|
flex: 1 1 8rem;
|
|
|
|
|
min-width: 6.5rem;
|
2026-09-05 00:18:39 +03:30
|
|
|
background: #fff;
|
|
|
|
|
border: 1px solid var(--line);
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
padding: 0.45rem 0.75rem;
|
|
|
|
|
color: var(--muted);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search input {
|
|
|
|
|
border: 0;
|
|
|
|
|
outline: none;
|
|
|
|
|
background: transparent;
|
|
|
|
|
width: 100%;
|
2026-09-09 13:12:13 +03:30
|
|
|
min-width: 0;
|
2026-09-05 00:18:39 +03:30
|
|
|
color: var(--ink);
|
|
|
|
|
font: inherit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
2026-09-09 13:12:13 +03:30
|
|
|
justify-content: center;
|
2026-09-05 00:18:39 +03:30
|
|
|
gap: 0.35rem;
|
|
|
|
|
border: 0;
|
|
|
|
|
border-radius: 12px;
|
2026-09-09 13:12:13 +03:30
|
|
|
padding: 0.52rem 0.95rem;
|
2026-09-05 00:18:39 +03:30
|
|
|
background: var(--accent);
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
white-space: nowrap;
|
2026-09-09 13:12:13 +03:30
|
|
|
flex: 0 0 auto;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn:focus-visible,
|
|
|
|
|
.pipeline-pick select:focus-visible,
|
|
|
|
|
.search:focus-within {
|
|
|
|
|
outline: 2px solid var(--accent-soft);
|
|
|
|
|
outline-offset: 1px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sr {
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 1px;
|
|
|
|
|
height: 1px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
clip: rect(0 0 0 0);
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-09 13:12:13 +03:30
|
|
|
@container pipeline (max-width: 720px) {
|
2026-09-05 00:18:39 +03:30
|
|
|
.toolbar {
|
2026-09-09 13:12:13 +03:30
|
|
|
flex-wrap: wrap;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title-block {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-09 13:12:13 +03:30
|
|
|
.view-toggle {
|
|
|
|
|
width: 100%;
|
2026-09-05 00:18:39 +03:30
|
|
|
}
|
|
|
|
|
|
2026-09-09 13:12:13 +03:30
|
|
|
.seg {
|
|
|
|
|
flex: 1 1 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.pipeline-pick {
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search {
|
|
|
|
|
flex: 1 1 12rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@container pipeline (max-width: 520px) {
|
|
|
|
|
.seg-label {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn,
|
|
|
|
|
.pipeline-pick {
|
2026-09-05 00:18:39 +03:30
|
|
|
width: 100%;
|
2026-09-09 13:12:13 +03:30
|
|
|
flex: 1 1 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn {
|
2026-09-05 00:18:39 +03:30
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|