diff --git a/src/components/dashboard/DashboardActivityCard.vue b/src/components/dashboard/DashboardActivityCard.vue new file mode 100644 index 0000000..246d715 --- /dev/null +++ b/src/components/dashboard/DashboardActivityCard.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/src/components/dashboard/DashboardActivityGroup.vue b/src/components/dashboard/DashboardActivityGroup.vue new file mode 100644 index 0000000..5fc032d --- /dev/null +++ b/src/components/dashboard/DashboardActivityGroup.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/components/dashboard/DashboardCalendar.vue b/src/components/dashboard/DashboardCalendar.vue new file mode 100644 index 0000000..0a1de64 --- /dev/null +++ b/src/components/dashboard/DashboardCalendar.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/components/dashboard/DashboardProfileCard.vue b/src/components/dashboard/DashboardProfileCard.vue new file mode 100644 index 0000000..5c015ea --- /dev/null +++ b/src/components/dashboard/DashboardProfileCard.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/src/components/dashboard/DashboardStatCard.vue b/src/components/dashboard/DashboardStatCard.vue new file mode 100644 index 0000000..02ce94b --- /dev/null +++ b/src/components/dashboard/DashboardStatCard.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/src/composables/useTehranCalendar.js b/src/composables/useTehranCalendar.js new file mode 100644 index 0000000..75fbe7c --- /dev/null +++ b/src/composables/useTehranCalendar.js @@ -0,0 +1,50 @@ +import { toFaDigits } from '@/utils/persian' +import { toJalaali } from '@/utils/date-utils' + +const WEEKDAY_NAMES = ['شنبه', 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه'] +const MONTH_NAMES = [ + 'فروردین', + 'اردیبهشت', + 'خرداد', + 'تیر', + 'مرداد', + 'شهریور', + 'مهر', + 'آبان', + 'آذر', + 'دی', + 'بهمن', + 'اسفند', +] +const GREGORIAN_WEEKDAYS = ['Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri'] +const DAY_MS = 24 * 60 * 60 * 1000 + +/** + * Builds the current Jalaali week (Saturday → Friday) anchored to the Asia/Tehran + * timezone, independent of the viewer's local clock. The day matching Tehran's + * "today" is flagged `selected`. Returns `{ month, days }` for DashboardCalendar. + */ +export const useTehranCalendar = () => { + const parts = new Intl.DateTimeFormat('en-US', { + timeZone: 'Asia/Tehran', + year: 'numeric', + month: 'numeric', + day: 'numeric', + weekday: 'short', + }).formatToParts(new Date()) + const part = (type) => parts.find((p) => p.type === type)?.value + const todayIndex = GREGORIAN_WEEKDAYS.indexOf(part('weekday')) + const todayUtc = Date.UTC(Number(part('year')), Number(part('month')) - 1, Number(part('day'))) + const weekStartUtc = todayUtc - todayIndex * DAY_MS + + const today = new Date(todayUtc) + const { jm } = toJalaali(today.getUTCFullYear(), today.getUTCMonth() + 1, today.getUTCDate()) + + const days = WEEKDAY_NAMES.map((weekday, i) => { + const date = new Date(weekStartUtc + i * DAY_MS) + const { jd } = toJalaali(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate()) + return { weekday, day: toFaDigits(jd), selected: i === todayIndex } + }) + + return { month: `${MONTH_NAMES[jm - 1]} ماه`, days } +} diff --git a/src/enums/index.js b/src/enums/index.js index 3453321..a6b33b9 100644 --- a/src/enums/index.js +++ b/src/enums/index.js @@ -220,6 +220,6 @@ export const MISSIONARY_REQUEST_STATUS = Object.freeze({ // page. Roles not listed here fall back to the student dashboard. export const ROLE_HOME_ROUTES = Object.freeze({ admin: 'admin-dashboard', - counselor: 'counselor-consultations', - missionary: 'missionary-requests', + counselor: 'counselor-dashboard', + missionary: 'missionary-dashboard', }) diff --git a/src/features/admin/pages/AdminDashboardPage.vue b/src/features/admin/pages/AdminDashboardPage.vue index 7506380..d27d0ee 100644 --- a/src/features/admin/pages/AdminDashboardPage.vue +++ b/src/features/admin/pages/AdminDashboardPage.vue @@ -1,53 +1,256 @@ - + diff --git a/src/features/counselor/pages/CounselorDashboardPage.vue b/src/features/counselor/pages/CounselorDashboardPage.vue new file mode 100644 index 0000000..72ed559 --- /dev/null +++ b/src/features/counselor/pages/CounselorDashboardPage.vue @@ -0,0 +1,212 @@ + + + + + diff --git a/src/features/counselor/router.js b/src/features/counselor/router.js index c00f272..66bf8f2 100644 --- a/src/features/counselor/router.js +++ b/src/features/counselor/router.js @@ -1,4 +1,15 @@ export default [ + { + path: '/counselor/dashboard', + name: 'counselor-dashboard', + component: () => import('@/features/counselor/pages/CounselorDashboardPage.vue'), + meta: { + layout: 'counselor', + role: 'counselor', + title: 'سلام بر شما', + subtitle: 'به پنل مشاوره بانو خوش آمدید.', + }, + }, { path: '/counselor/consultations', name: 'counselor-consultations', diff --git a/src/features/missionary/pages/MissionaryDashboardPage.vue b/src/features/missionary/pages/MissionaryDashboardPage.vue new file mode 100644 index 0000000..c2d1613 --- /dev/null +++ b/src/features/missionary/pages/MissionaryDashboardPage.vue @@ -0,0 +1,231 @@ + + + + + diff --git a/src/features/missionary/router.js b/src/features/missionary/router.js index c9a7ed5..4a1b7dc 100644 --- a/src/features/missionary/router.js +++ b/src/features/missionary/router.js @@ -1,4 +1,15 @@ export default [ + { + path: '/missionary-panel/dashboard', + name: 'missionary-dashboard', + component: () => import('@/features/missionary/pages/MissionaryDashboardPage.vue'), + meta: { + layout: 'missionary', + role: 'missionary', + title: 'سلام بر شما', + subtitle: 'به پنل اعزام بانو خوش آمدید.', + }, + }, { path: '/missionary-panel/requests', name: 'missionary-requests', diff --git a/src/features/student/pages/StudentDashboardPage.vue b/src/features/student/pages/StudentDashboardPage.vue index 9801ed7..71a1d14 100644 --- a/src/features/student/pages/StudentDashboardPage.vue +++ b/src/features/student/pages/StudentDashboardPage.vue @@ -9,7 +9,8 @@ -
+ +
-
+ +
@@ -46,9 +48,12 @@