Add Persian date input and refine admin category/check screens.
Introduce shared PersianDateInput with jalali utilities and align categories and check management views with updated form patterns.
This commit is contained in:
@@ -39,6 +39,9 @@ const toast = useToast()
|
||||
const showAddUsage = ref(false)
|
||||
const showAddSeason = ref(false)
|
||||
const ICON_OPTIONS = [
|
||||
{ value: 'shirt', label: 'پیراهن' },
|
||||
{ value: 'suit', label: 'کتشلوار' },
|
||||
{ value: 'trousers', label: 'شلوار' },
|
||||
{ value: 'bolt', label: 'آذرخش' },
|
||||
{ value: 'feather', label: 'پر' },
|
||||
{ value: 'diamond', label: 'الماس' },
|
||||
@@ -51,8 +54,9 @@ const ICON_OPTIONS = [
|
||||
]
|
||||
|
||||
function defaultUsageIcon(id: string) {
|
||||
if (id === 'shirt') return 'id-card'
|
||||
if (id === 'suit') return 'bag'
|
||||
if (id === 'shirt') return 'shirt'
|
||||
if (id === 'suit') return 'suit'
|
||||
if (id === 'trousers') return 'trousers'
|
||||
return 'grid'
|
||||
}
|
||||
|
||||
@@ -128,7 +132,7 @@ async function load() {
|
||||
id: 'trousers',
|
||||
title: 'پارچههای شلواری',
|
||||
subtitle: 'مشاهده محصولات',
|
||||
icon: 'grid',
|
||||
icon: 'trousers',
|
||||
showTitle: true,
|
||||
showSubtitle: true,
|
||||
showIcon: true,
|
||||
@@ -137,7 +141,7 @@ async function load() {
|
||||
id: 'suit',
|
||||
title: 'پارچههای کتشلواری',
|
||||
subtitle: 'مشاهده محصولات',
|
||||
icon: 'bag',
|
||||
icon: 'suit',
|
||||
showTitle: true,
|
||||
showSubtitle: true,
|
||||
showIcon: true,
|
||||
@@ -146,7 +150,7 @@ async function load() {
|
||||
id: 'shirt',
|
||||
title: 'پارچههای پیراهنی',
|
||||
subtitle: 'مشاهده محصولات',
|
||||
icon: 'id-card',
|
||||
icon: 'shirt',
|
||||
showTitle: true,
|
||||
showSubtitle: true,
|
||||
showIcon: true,
|
||||
@@ -212,7 +216,7 @@ async function load() {
|
||||
id: 'trousers',
|
||||
title: 'پارچههای شلواری',
|
||||
subtitle: 'مشاهده محصولات',
|
||||
icon: 'grid',
|
||||
icon: 'trousers',
|
||||
showTitle: true,
|
||||
showSubtitle: true,
|
||||
showIcon: true,
|
||||
@@ -221,7 +225,7 @@ async function load() {
|
||||
id: 'suit',
|
||||
title: 'پارچههای کتشلواری',
|
||||
subtitle: 'مشاهده محصولات',
|
||||
icon: 'bag',
|
||||
icon: 'suit',
|
||||
showTitle: true,
|
||||
showSubtitle: true,
|
||||
showIcon: true,
|
||||
@@ -230,7 +234,7 @@ async function load() {
|
||||
id: 'shirt',
|
||||
title: 'پارچههای پیراهنی',
|
||||
subtitle: 'مشاهده محصولات',
|
||||
icon: 'id-card',
|
||||
icon: 'shirt',
|
||||
showTitle: true,
|
||||
showSubtitle: true,
|
||||
showIcon: true,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import StatusBadge from '@/components/ui/StatusBadge.vue'
|
||||
import { checksApi, mapAdminOrder, ordersApi, type ApiOrder } from '@/services/api'
|
||||
import { ApiError } from '@/services/http'
|
||||
import { formatCurrency, formatDate } from '@/utils/format'
|
||||
import { formatCurrency, formatDate, formatDateTime as formatPersianDateTime } from '@/utils/format'
|
||||
import { useToast } from '@/composables/useToast'
|
||||
import { confirm } from '@/composables/useConfirm'
|
||||
import { rawStatusLabel } from '@/utils/orderStatus'
|
||||
@@ -118,15 +118,7 @@ function actorLabel(changedBy?: string) {
|
||||
}
|
||||
|
||||
function formatDateTime(iso?: string) {
|
||||
if (!iso) return '—'
|
||||
try {
|
||||
return new Intl.DateTimeFormat('fa-IR', {
|
||||
dateStyle: 'medium',
|
||||
timeStyle: 'short',
|
||||
}).format(new Date(iso))
|
||||
} catch {
|
||||
return iso.slice(0, 16).replace('T', ' ')
|
||||
}
|
||||
return formatPersianDateTime(iso)
|
||||
}
|
||||
|
||||
function ownerName(check: Check) {
|
||||
|
||||
Reference in New Issue
Block a user