edit business
This commit is contained in:
@@ -18,11 +18,12 @@
|
|||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="absolute bottom-1 left-1 right-1 rounded-lg bg-black/60 py-1 text-xs text-white"
|
class="absolute left-1 top-1 flex h-7 w-7 items-center justify-center rounded-full bg-black/60 text-white transition hover:bg-red-600 disabled:opacity-50"
|
||||||
:disabled="deletingId === img.id"
|
:disabled="deletingId === img.id"
|
||||||
|
aria-label="حذف تصویر"
|
||||||
@click="emit('remove-existing', img.id)"
|
@click="emit('remove-existing', img.id)"
|
||||||
>
|
>
|
||||||
حذف
|
<AppIcon name="trash" size="sm" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -36,10 +37,11 @@
|
|||||||
<img :src="src" alt="" class="h-full w-full object-cover" />
|
<img :src="src" alt="" class="h-full w-full object-cover" />
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="absolute bottom-1 left-1 right-1 rounded-lg bg-black/60 py-1 text-xs text-white"
|
class="absolute left-1 top-1 flex h-7 w-7 items-center justify-center rounded-full bg-black/60 text-white transition hover:bg-red-600"
|
||||||
|
aria-label="حذف تصویر"
|
||||||
@click="removePending(idx)"
|
@click="removePending(idx)"
|
||||||
>
|
>
|
||||||
حذف
|
<AppIcon name="trash" size="sm" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<article
|
<article
|
||||||
class="flex items-center gap-3 rounded-xl border border-border bg-surface-2 p-2.5 transition hover:border-brand-500/40 hover:shadow-sm"
|
class="flex items-start gap-3 rounded-xl border border-border bg-surface-2 p-2.5 transition hover:border-brand-500/40 hover:shadow-sm"
|
||||||
>
|
>
|
||||||
<div class="min-w-0 flex-1">
|
<div class="min-w-0 flex-1">
|
||||||
<div class="flex items-start justify-between gap-2">
|
<h3 class="truncate text-sm font-semibold text-text">{{ business.title }}</h3>
|
||||||
<div class="min-w-0 flex-1">
|
<p v-if="business.category" class="mt-0.5 truncate text-xs text-muted">
|
||||||
<h3 class="truncate text-sm font-semibold text-text">{{ business.title }}</h3>
|
{{ business.category.title }}
|
||||||
<p v-if="business.category" class="mt-0.5 truncate text-xs text-muted">
|
</p>
|
||||||
{{ business.category.title }}
|
<p v-if="ownerText" class="mt-0.5 truncate text-xs text-muted">{{ ownerText }}</p>
|
||||||
</p>
|
|
||||||
<p v-if="ownerText" class="mt-0.5 truncate text-xs text-muted">{{ ownerText }}</p>
|
<div class="mt-2 flex items-center justify-between gap-2">
|
||||||
|
<div v-if="$slots.actions" class="flex shrink-0 items-center gap-1">
|
||||||
|
<slot name="actions" />
|
||||||
</div>
|
</div>
|
||||||
<AppBadge
|
<AppBadge
|
||||||
class="shrink-0 !px-1.5 !py-0.5 text-[10px]"
|
class="shrink-0 !px-1.5 !py-0.5 text-[10px]"
|
||||||
@@ -18,14 +20,10 @@
|
|||||||
{{ activeLabel(business.isActive) }}
|
{{ activeLabel(business.isActive) }}
|
||||||
</AppBadge>
|
</AppBadge>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="$slots.actions" class="mt-2 flex flex-wrap gap-1">
|
|
||||||
<slot name="actions" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="relative h-14 w-14 shrink-0 overflow-hidden rounded-lg bg-surface-3 sm:h-16 sm:w-16"
|
class="relative h-20 w-20 shrink-0 overflow-hidden rounded-lg bg-surface-3 sm:h-24 sm:w-24"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
v-if="cover"
|
v-if="cover"
|
||||||
|
|||||||
@@ -24,13 +24,7 @@
|
|||||||
<span v-if="svc.durationMinutes"> · {{ svc.durationMinutes }} دقیقه</span>
|
<span v-if="svc.durationMinutes"> · {{ svc.durationMinutes }} دقیقه</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<AppIconButton icon="trash" label="حذف خدمت" variant="danger" @click="onDelete(svc)" />
|
||||||
type="button"
|
|
||||||
class="shrink-0 text-xs text-red-600"
|
|
||||||
@click="onDelete(svc)"
|
|
||||||
>
|
|
||||||
حذف
|
|
||||||
</button>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -76,6 +70,7 @@ import { fetchServiceTemplates } from '@/api/service-templates';
|
|||||||
import type { ServiceTemplate } from '@/api/types';
|
import type { ServiceTemplate } from '@/api/types';
|
||||||
import { ApiError } from '@/api/client';
|
import { ApiError } from '@/api/client';
|
||||||
import AppButton from '@/components/ui/AppButton.vue';
|
import AppButton from '@/components/ui/AppButton.vue';
|
||||||
|
import AppIconButton from '@/components/ui/AppIconButton.vue';
|
||||||
import AppSelect from '@/components/ui/AppSelect.vue';
|
import AppSelect from '@/components/ui/AppSelect.vue';
|
||||||
import PriceInput from '@/components/ui/PriceInput.vue';
|
import PriceInput from '@/components/ui/PriceInput.vue';
|
||||||
import { formatPriceToman, parsePriceInput } from '@/utils/price';
|
import { formatPriceToman, parsePriceInput } from '@/utils/price';
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
/>
|
/>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<img
|
<img
|
||||||
src="/brand/logo-dark.png"
|
src="/brand/logo-lite.png"
|
||||||
alt="منتایم"
|
alt="منتایم"
|
||||||
:class="['dark:hidden', imgClass]"
|
:class="['dark:hidden', imgClass]"
|
||||||
/>
|
/>
|
||||||
<img
|
<img
|
||||||
src="/brand/logo-lite.png"
|
src="/brand/logo-dark.png"
|
||||||
alt="منتایم"
|
alt="منتایم"
|
||||||
:class="['hidden dark:block', imgClass]"
|
:class="['hidden dark:block', imgClass]"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -16,16 +16,21 @@ import {
|
|||||||
Camera,
|
Camera,
|
||||||
CircleCheck,
|
CircleCheck,
|
||||||
ClipboardList,
|
ClipboardList,
|
||||||
|
Eye,
|
||||||
|
EyeOff,
|
||||||
FolderOpen,
|
FolderOpen,
|
||||||
Home,
|
Home,
|
||||||
LayoutDashboard,
|
LayoutDashboard,
|
||||||
MapPin,
|
MapPin,
|
||||||
Moon,
|
Moon,
|
||||||
Plus,
|
Plus,
|
||||||
|
Pencil,
|
||||||
Search,
|
Search,
|
||||||
Store,
|
Store,
|
||||||
Sun,
|
Sun,
|
||||||
|
Trash2,
|
||||||
User,
|
User,
|
||||||
|
UserCog,
|
||||||
Users,
|
Users,
|
||||||
X,
|
X,
|
||||||
} from '@lucide/vue';
|
} from '@lucide/vue';
|
||||||
@@ -49,6 +54,11 @@ const iconMap: Record<AppIconName, Component> = {
|
|||||||
camera: Camera,
|
camera: Camera,
|
||||||
'circle-check': CircleCheck,
|
'circle-check': CircleCheck,
|
||||||
search: Search,
|
search: Search,
|
||||||
|
pencil: Pencil,
|
||||||
|
trash: Trash2,
|
||||||
|
'user-cog': UserCog,
|
||||||
|
eye: Eye,
|
||||||
|
'eye-off': EyeOff,
|
||||||
};
|
};
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<template>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="flex h-9 w-9 shrink-0 items-center justify-center rounded-full transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/50 disabled:pointer-events-none disabled:opacity-50"
|
||||||
|
:class="variantClasses"
|
||||||
|
:aria-label="label"
|
||||||
|
:disabled="disabled"
|
||||||
|
@click="emit('click', $event)"
|
||||||
|
>
|
||||||
|
<AppIcon :name="icon" size="sm" />
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import AppIcon from '@/components/ui/AppIcon.vue';
|
||||||
|
import type { AppIconName } from '@/types/icons';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
icon: AppIconName;
|
||||||
|
label: string;
|
||||||
|
variant?: 'default' | 'danger';
|
||||||
|
disabled?: boolean;
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
variant: 'default',
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{ click: [event: MouseEvent] }>();
|
||||||
|
|
||||||
|
const variantClasses = computed(() =>
|
||||||
|
props.variant === 'danger'
|
||||||
|
? 'text-muted hover:bg-red-500/10 hover:text-red-600'
|
||||||
|
: 'text-muted hover:bg-surface-3 hover:text-text',
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -3,22 +3,40 @@
|
|||||||
<label v-if="label" :for="id" class="block text-sm font-medium text-muted">
|
<label v-if="label" :for="id" class="block text-sm font-medium text-muted">
|
||||||
{{ label }}
|
{{ label }}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<div class="relative">
|
||||||
:id="id"
|
<input
|
||||||
v-model="model"
|
:id="id"
|
||||||
class="w-full rounded-xl border border-border bg-surface-2 px-4 py-3 text-text outline-none transition placeholder:text-[var(--color-placeholder)] focus:border-brand-500 focus:ring-2 focus:ring-brand-500/30"
|
v-model="model"
|
||||||
:class="ltr ? 'text-left' : ''"
|
class="w-full rounded-xl border border-border bg-surface-2 py-3 text-text outline-none transition placeholder:text-[var(--color-placeholder)] focus:border-brand-500 focus:ring-2 focus:ring-brand-500/30"
|
||||||
v-bind="$attrs"
|
:class="inputPaddingClass"
|
||||||
/>
|
:type="resolvedType"
|
||||||
|
v-bind="inputAttrs"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
v-if="isPassword"
|
||||||
|
type="button"
|
||||||
|
class="absolute top-1/2 flex h-9 w-9 -translate-y-1/2 items-center justify-center rounded-lg text-muted transition hover:text-text"
|
||||||
|
:class="toggleButtonClass"
|
||||||
|
:aria-label="showPassword ? 'مخفی کردن رمز' : 'نمایش رمز'"
|
||||||
|
@click="showPassword = !showPassword"
|
||||||
|
>
|
||||||
|
<AppIcon :name="showPassword ? 'eye-off' : 'eye'" size="sm" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { computed, ref, useAttrs } from 'vue';
|
||||||
|
import AppIcon from '@/components/ui/AppIcon.vue';
|
||||||
|
|
||||||
defineOptions({ inheritAttrs: false });
|
defineOptions({ inheritAttrs: false });
|
||||||
|
|
||||||
const model = defineModel<string>({ default: '' });
|
const model = defineModel<string>({ default: '' });
|
||||||
|
const attrs = useAttrs();
|
||||||
|
const showPassword = ref(false);
|
||||||
|
|
||||||
withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
label?: string;
|
label?: string;
|
||||||
id?: string;
|
id?: string;
|
||||||
@@ -26,4 +44,25 @@ withDefaults(
|
|||||||
}>(),
|
}>(),
|
||||||
{ ltr: false },
|
{ ltr: false },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isPassword = computed(() => attrs.type === 'password');
|
||||||
|
|
||||||
|
const resolvedType = computed(() => {
|
||||||
|
if (!isPassword.value) return attrs.type as string | undefined;
|
||||||
|
return showPassword.value ? 'text' : 'password';
|
||||||
|
});
|
||||||
|
|
||||||
|
const inputAttrs = computed(() => {
|
||||||
|
const { type: _type, ...rest } = attrs;
|
||||||
|
return rest;
|
||||||
|
});
|
||||||
|
|
||||||
|
const inputPaddingClass = computed(() => {
|
||||||
|
if (isPassword.value) {
|
||||||
|
return props.ltr ? 'pl-4 pr-11 text-left' : 'pl-11 pr-4';
|
||||||
|
}
|
||||||
|
return props.ltr ? 'px-4 text-left' : 'px-4';
|
||||||
|
});
|
||||||
|
|
||||||
|
const toggleButtonClass = computed(() => (props.ltr ? 'right-1' : 'left-1'));
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<header
|
<header
|
||||||
class="sticky top-0 z-10 flex items-center justify-between border-b border-brand-500/30 bg-surface/95 px-4 py-3 backdrop-blur supports-[backdrop-filter]:bg-surface/80"
|
class="sticky top-0 z-10 flex items-center justify-between border-b border-brand-500/30 bg-surface/95 px-4 py-3 backdrop-blur supports-[backdrop-filter]:bg-surface/80"
|
||||||
>
|
>
|
||||||
<RouterLink :to="{ name: 'dashboard' }" class="min-w-0">
|
<RouterLink :to="{ name: 'dashboard' }" class="flex min-w-0 items-center gap-2">
|
||||||
<AppLogo variant="horizontal" class="h-8" />
|
<AppLogo variant="horizontal" class="h-10 shrink-0" />
|
||||||
<p class="truncate text-xs text-brand-600 dark:text-brand-500">پنل مدیریت</p>
|
<p class="truncate text-xs text-brand-600 dark:text-brand-500">پنل مدیریت</p>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<AppShell>
|
<AppShell>
|
||||||
<header class="flex items-center justify-between px-4 py-3">
|
<header class="flex items-center justify-between px-4 py-3">
|
||||||
<div>
|
<div>
|
||||||
<div v-if="brand" class="flex items-center gap-3">
|
<div v-if="brand" class="flex min-w-0 items-center gap-2">
|
||||||
<AppLogo variant="horizontal" class="h-7 shrink-0" />
|
<AppLogo variant="horizontal" class="h-10 shrink-0" />
|
||||||
<p v-if="subtitle" class="text-sm text-muted">{{ subtitle }}</p>
|
<p class="truncate text-xs text-brand-600 dark:text-brand-500">پنل مدیریت</p>
|
||||||
</div>
|
</div>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<p v-if="title" class="text-lg font-bold text-text">{{ title }}</p>
|
<p v-if="title" class="text-lg font-bold text-text">{{ title }}</p>
|
||||||
|
|||||||
+6
-1
@@ -15,7 +15,12 @@ export type AppIconName =
|
|||||||
| 'x'
|
| 'x'
|
||||||
| 'camera'
|
| 'camera'
|
||||||
| 'circle-check'
|
| 'circle-check'
|
||||||
| 'search';
|
| 'search'
|
||||||
|
| 'pencil'
|
||||||
|
| 'trash'
|
||||||
|
| 'user-cog'
|
||||||
|
| 'eye'
|
||||||
|
| 'eye-off';
|
||||||
|
|
||||||
export type AdminNavItem = {
|
export type AdminNavItem = {
|
||||||
to: string;
|
to: string;
|
||||||
|
|||||||
+17
-19
@@ -38,24 +38,22 @@
|
|||||||
:key="b.id"
|
:key="b.id"
|
||||||
class="rounded-2xl border border-border bg-surface-2 p-4"
|
class="rounded-2xl border border-border bg-surface-2 p-4"
|
||||||
>
|
>
|
||||||
<div class="flex items-start justify-between gap-2">
|
<div class="flex items-center justify-between gap-4">
|
||||||
<div class="min-w-0 flex-1">
|
<p class="min-w-0 truncate font-semibold text-text">
|
||||||
<p class="font-semibold text-text">
|
{{ b.business?.title ?? 'کسبوکار' }}
|
||||||
{{ b.business?.title ?? 'کسبوکار' }}
|
</p>
|
||||||
</p>
|
<p class="shrink-0 text-sm text-muted" dir="ltr">
|
||||||
<p class="mt-0.5 text-xs text-muted">
|
{{ b.customer?.mobile ?? b.customerId }}
|
||||||
{{ serviceTitle(b) }} — {{ formatDate(b.scheduledAt) }}
|
</p>
|
||||||
</p>
|
</div>
|
||||||
<p class="mt-1 text-xs text-muted" dir="ltr">
|
<p class="mt-1 text-xs text-muted">
|
||||||
{{ b.customer?.mobile ?? b.customerId }}
|
{{ serviceTitle(b) }} — {{ formatDate(b.scheduledAt) }}
|
||||||
</p>
|
</p>
|
||||||
<AppBadge class="mt-2" :tone="statusTone(b.status)">
|
<div class="mt-2 flex items-center justify-between gap-2">
|
||||||
{{ statusLabel(b.status) }}
|
<AppBadge :tone="statusTone(b.status)">
|
||||||
</AppBadge>
|
{{ statusLabel(b.status) }}
|
||||||
</div>
|
</AppBadge>
|
||||||
<AppButton variant="danger" class="!w-auto shrink-0 px-3" @click="onDelete(b)">
|
<AppIconButton icon="trash" label="حذف رزرو" variant="danger" @click="onDelete(b)" />
|
||||||
حذف
|
|
||||||
</AppButton>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -69,7 +67,7 @@ import { fetchBusinesses } from '@/api/businesses';
|
|||||||
import type { Booking, BookingStatus, Business } from '@/api/types';
|
import type { Booking, BookingStatus, Business } from '@/api/types';
|
||||||
import { ApiError } from '@/api/client';
|
import { ApiError } from '@/api/client';
|
||||||
import AppBadge from '@/components/ui/AppBadge.vue';
|
import AppBadge from '@/components/ui/AppBadge.vue';
|
||||||
import AppButton from '@/components/ui/AppButton.vue';
|
import AppIconButton from '@/components/ui/AppIconButton.vue';
|
||||||
import AppSelect from '@/components/ui/AppSelect.vue';
|
import AppSelect from '@/components/ui/AppSelect.vue';
|
||||||
import EmptyState from '@/components/ui/EmptyState.vue';
|
import EmptyState from '@/components/ui/EmptyState.vue';
|
||||||
import PageHeader from '@/components/ui/PageHeader.vue';
|
import PageHeader from '@/components/ui/PageHeader.vue';
|
||||||
|
|||||||
@@ -48,15 +48,9 @@
|
|||||||
:owner-text="ownerLabel(biz)"
|
:owner-text="ownerLabel(biz)"
|
||||||
>
|
>
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<AppButton variant="ghost" class="!w-auto px-2 text-xs" @click="openEdit(biz)">
|
<AppIconButton icon="pencil" label="ویرایش" @click="openEdit(biz)" />
|
||||||
ویرایش
|
<AppIconButton icon="user-cog" label="مدیر" @click="openAssign(biz)" />
|
||||||
</AppButton>
|
<AppIconButton icon="trash" label="حذف" variant="danger" @click="onDelete(biz)" />
|
||||||
<AppButton variant="ghost" class="!w-auto px-2 text-xs" @click="openAssign(biz)">
|
|
||||||
مدیر
|
|
||||||
</AppButton>
|
|
||||||
<AppButton variant="danger" class="!w-auto px-2 text-xs" @click="onDelete(biz)">
|
|
||||||
حذف
|
|
||||||
</AppButton>
|
|
||||||
</template>
|
</template>
|
||||||
</BusinessListCard>
|
</BusinessListCard>
|
||||||
</div>
|
</div>
|
||||||
@@ -133,12 +127,24 @@
|
|||||||
v-else-if="assignCurrentOwner"
|
v-else-if="assignCurrentOwner"
|
||||||
class="rounded-xl border border-border bg-surface-3 p-3"
|
class="rounded-xl border border-border bg-surface-3 p-3"
|
||||||
>
|
>
|
||||||
<p class="text-xs font-medium text-muted">مدیر فعلی</p>
|
<dl class="space-y-3">
|
||||||
<p class="mt-1 font-semibold text-text">
|
<div class="flex items-center justify-between gap-4">
|
||||||
{{ assignCurrentOwner.fullName ?? 'بدون نام' }}
|
<dt class="shrink-0 text-xs text-muted">نام</dt>
|
||||||
</p>
|
<dd class="font-semibold text-text">
|
||||||
<p class="mt-0.5 text-sm text-muted" dir="ltr">{{ assignCurrentOwner.mobile }}</p>
|
{{ assignCurrentOwner.fullName ?? 'بدون نام' }}
|
||||||
<AppBadge class="mt-2">{{ roleLabel(assignCurrentOwner.role) }}</AppBadge>
|
</dd>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between gap-4">
|
||||||
|
<dt class="shrink-0 text-xs text-muted">موبایل</dt>
|
||||||
|
<dd class="text-sm text-muted" dir="ltr">{{ assignCurrentOwner.mobile }}</dd>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between gap-4">
|
||||||
|
<dt class="shrink-0 text-xs text-muted">نقش</dt>
|
||||||
|
<dd>
|
||||||
|
<AppBadge>{{ roleLabel(assignCurrentOwner.role) }}</AppBadge>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -199,6 +205,7 @@ import BusinessServicesSection from '@/components/admin/BusinessServicesSection.
|
|||||||
import BusinessListCard from '@/components/admin/BusinessListCard.vue';
|
import BusinessListCard from '@/components/admin/BusinessListCard.vue';
|
||||||
import AppBadge from '@/components/ui/AppBadge.vue';
|
import AppBadge from '@/components/ui/AppBadge.vue';
|
||||||
import AppButton from '@/components/ui/AppButton.vue';
|
import AppButton from '@/components/ui/AppButton.vue';
|
||||||
|
import AppIconButton from '@/components/ui/AppIconButton.vue';
|
||||||
import AppInput from '@/components/ui/AppInput.vue';
|
import AppInput from '@/components/ui/AppInput.vue';
|
||||||
import AppModal from '@/components/ui/AppModal.vue';
|
import AppModal from '@/components/ui/AppModal.vue';
|
||||||
import AppSelect from '@/components/ui/AppSelect.vue';
|
import AppSelect from '@/components/ui/AppSelect.vue';
|
||||||
|
|||||||
@@ -48,9 +48,9 @@
|
|||||||
{{ activeLabel(cat.isActive) }}
|
{{ activeLabel(cat.isActive) }}
|
||||||
</AppBadge>
|
</AppBadge>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex shrink-0 flex-col gap-1">
|
<div class="flex shrink-0 items-center gap-1">
|
||||||
<AppButton variant="ghost" class="!w-auto px-3" @click="openEdit(cat)">ویرایش</AppButton>
|
<AppIconButton icon="pencil" label="ویرایش" @click="openEdit(cat)" />
|
||||||
<AppButton variant="danger" class="!w-auto px-3" @click="onDelete(cat)">حذف</AppButton>
|
<AppIconButton icon="trash" label="حذف" variant="danger" @click="onDelete(cat)" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@@ -93,6 +93,7 @@ import type { BusinessCategory } from '@/api/types';
|
|||||||
import { ApiError } from '@/api/client';
|
import { ApiError } from '@/api/client';
|
||||||
import AppBadge from '@/components/ui/AppBadge.vue';
|
import AppBadge from '@/components/ui/AppBadge.vue';
|
||||||
import AppButton from '@/components/ui/AppButton.vue';
|
import AppButton from '@/components/ui/AppButton.vue';
|
||||||
|
import AppIconButton from '@/components/ui/AppIconButton.vue';
|
||||||
import AppInput from '@/components/ui/AppInput.vue';
|
import AppInput from '@/components/ui/AppInput.vue';
|
||||||
import AppModal from '@/components/ui/AppModal.vue';
|
import AppModal from '@/components/ui/AppModal.vue';
|
||||||
import EmptyState from '@/components/ui/EmptyState.vue';
|
import EmptyState from '@/components/ui/EmptyState.vue';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<AuthLayout brand subtitle="پنل مدیریت — ورود سوپر ادمین">
|
<AuthLayout brand>
|
||||||
<div class="flex flex-1 flex-col justify-start gap-8 pt-10">
|
<div class="flex flex-1 flex-col justify-start gap-8 pt-10">
|
||||||
<section class="flex flex-col items-center text-center">
|
<section class="flex flex-col items-center text-center">
|
||||||
<AppLogo variant="vertical" class="mb-3 h-28 w-auto object-contain" />
|
<AppLogo variant="vertical" class="mb-3 h-28 w-auto object-contain" />
|
||||||
|
|||||||
@@ -18,14 +18,16 @@
|
|||||||
<form v-if="auth.user" class="mt-6 space-y-6" @submit.prevent="onSaveProfile">
|
<form v-if="auth.user" class="mt-6 space-y-6" @submit.prevent="onSaveProfile">
|
||||||
<section class="space-y-4 rounded-2xl border border-border bg-surface-2 p-4">
|
<section class="space-y-4 rounded-2xl border border-border bg-surface-2 p-4">
|
||||||
<h2 class="text-sm font-semibold text-text">اطلاعات حساب</h2>
|
<h2 class="text-sm font-semibold text-text">اطلاعات حساب</h2>
|
||||||
<div>
|
<dl class="space-y-3">
|
||||||
<p class="text-xs text-muted">موبایل</p>
|
<div class="flex items-center justify-between gap-4">
|
||||||
<p class="mt-1 font-medium" dir="ltr">{{ auth.user.mobile }}</p>
|
<dt class="shrink-0 text-xs text-muted">موبایل</dt>
|
||||||
</div>
|
<dd class="font-medium" dir="ltr">{{ auth.user.mobile }}</dd>
|
||||||
<div>
|
</div>
|
||||||
<p class="text-xs text-muted">نقش</p>
|
<div class="flex items-center justify-between gap-4">
|
||||||
<p class="mt-1 font-medium">{{ roleLabel(auth.user.role) }}</p>
|
<dt class="shrink-0 text-xs text-muted">نقش</dt>
|
||||||
</div>
|
<dd class="font-medium">{{ roleLabel(auth.user.role) }}</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
<AppInput id="fullName" v-model="fullName" label="نام نمایشی" placeholder="نام شما" />
|
<AppInput id="fullName" v-model="fullName" label="نام نمایشی" placeholder="نام شما" />
|
||||||
<AppButton type="submit" :loading="savingProfile">ذخیره پروفایل</AppButton>
|
<AppButton type="submit" :loading="savingProfile">ذخیره پروفایل</AppButton>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -59,9 +59,9 @@
|
|||||||
{{ activeLabel(tpl.isActive) }}
|
{{ activeLabel(tpl.isActive) }}
|
||||||
</AppBadge>
|
</AppBadge>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex shrink-0 flex-col gap-1">
|
<div class="flex shrink-0 items-center gap-1">
|
||||||
<AppButton variant="ghost" class="!w-auto px-3" @click="openEdit(tpl)">ویرایش</AppButton>
|
<AppIconButton icon="pencil" label="ویرایش" @click="openEdit(tpl)" />
|
||||||
<AppButton variant="danger" class="!w-auto px-3" @click="onDelete(tpl)">حذف</AppButton>
|
<AppIconButton icon="trash" label="حذف" variant="danger" @click="onDelete(tpl)" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@@ -105,6 +105,7 @@ import type { BusinessCategory, ServiceTemplate } from '@/api/types';
|
|||||||
import { ApiError } from '@/api/client';
|
import { ApiError } from '@/api/client';
|
||||||
import AppBadge from '@/components/ui/AppBadge.vue';
|
import AppBadge from '@/components/ui/AppBadge.vue';
|
||||||
import AppButton from '@/components/ui/AppButton.vue';
|
import AppButton from '@/components/ui/AppButton.vue';
|
||||||
|
import AppIconButton from '@/components/ui/AppIconButton.vue';
|
||||||
import AppInput from '@/components/ui/AppInput.vue';
|
import AppInput from '@/components/ui/AppInput.vue';
|
||||||
import AppModal from '@/components/ui/AppModal.vue';
|
import AppModal from '@/components/ui/AppModal.vue';
|
||||||
import AppSelect from '@/components/ui/AppSelect.vue';
|
import AppSelect from '@/components/ui/AppSelect.vue';
|
||||||
|
|||||||
+17
-16
@@ -28,23 +28,23 @@
|
|||||||
:key="user.id"
|
:key="user.id"
|
||||||
class="rounded-2xl border border-border bg-surface-2 p-4"
|
class="rounded-2xl border border-border bg-surface-2 p-4"
|
||||||
>
|
>
|
||||||
<div class="flex items-start justify-between gap-2">
|
<div class="flex items-center justify-between gap-4">
|
||||||
<div class="min-w-0 flex-1">
|
<p class="min-w-0 truncate font-semibold text-text">
|
||||||
<p class="font-semibold text-text">{{ user.fullName ?? 'بدون نام' }}</p>
|
{{ user.fullName ?? 'بدون نام' }}
|
||||||
<p class="mt-0.5 text-sm text-muted" dir="ltr">{{ user.mobile }}</p>
|
</p>
|
||||||
<div class="mt-2 flex flex-wrap gap-2">
|
<p class="shrink-0 text-sm text-muted" dir="ltr">{{ user.mobile }}</p>
|
||||||
<AppBadge>{{ roleLabel(user.role) }}</AppBadge>
|
</div>
|
||||||
<AppBadge :tone="user.isActive ? 'success' : 'danger'">
|
<div class="mt-2 flex items-center justify-between gap-2">
|
||||||
{{ activeLabel(user.isActive) }}
|
<div class="flex min-w-0 flex-wrap gap-2">
|
||||||
</AppBadge>
|
<AppBadge>{{ roleLabel(user.role) }}</AppBadge>
|
||||||
<AppBadge :tone="user.hasPassword ? 'default' : 'warning'">
|
<AppBadge :tone="user.isActive ? 'success' : 'danger'">
|
||||||
{{ user.hasPassword ? 'رمز دارد' : 'بدون رمز' }}
|
{{ activeLabel(user.isActive) }}
|
||||||
</AppBadge>
|
</AppBadge>
|
||||||
</div>
|
<AppBadge :tone="user.hasPassword ? 'default' : 'warning'">
|
||||||
|
{{ user.hasPassword ? 'رمز دارد' : 'بدون رمز' }}
|
||||||
|
</AppBadge>
|
||||||
</div>
|
</div>
|
||||||
<AppButton variant="ghost" class="!w-auto shrink-0 px-3" @click="openEdit(user)">
|
<AppIconButton icon="pencil" label="ویرایش کاربر" @click="openEdit(user)" />
|
||||||
ویرایش
|
|
||||||
</AppButton>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -105,6 +105,7 @@ import type { User, UserRole } from '@/api/types';
|
|||||||
import { ApiError } from '@/api/client';
|
import { ApiError } from '@/api/client';
|
||||||
import AppBadge from '@/components/ui/AppBadge.vue';
|
import AppBadge from '@/components/ui/AppBadge.vue';
|
||||||
import AppButton from '@/components/ui/AppButton.vue';
|
import AppButton from '@/components/ui/AppButton.vue';
|
||||||
|
import AppIconButton from '@/components/ui/AppIconButton.vue';
|
||||||
import AppInput from '@/components/ui/AppInput.vue';
|
import AppInput from '@/components/ui/AppInput.vue';
|
||||||
import AppModal from '@/components/ui/AppModal.vue';
|
import AppModal from '@/components/ui/AppModal.vue';
|
||||||
import AppSelect from '@/components/ui/AppSelect.vue';
|
import AppSelect from '@/components/ui/AppSelect.vue';
|
||||||
|
|||||||
Reference in New Issue
Block a user