diff --git a/src/api/classApi.js b/src/api/classApi.js index 95900e6..7b18046 100644 --- a/src/api/classApi.js +++ b/src/api/classApi.js @@ -12,5 +12,7 @@ export const classApi = { registerUsers: (classId, userIds, notify) => axiosInstance.post(`/classes/admin/${classId}/register-users`, { userIds, notify }), removeUser: (classId, userId) => - axiosInstance.delete(`/classes/admin/${classId}/students/${userId}`) + axiosInstance.delete(`/classes/admin/${classId}/students/${userId}`), + sendPlanToProfessor: (classId) => + axiosInstance.post(`/classes/admin/${classId}/send-plan-professor`) }; diff --git a/src/api/employeeTimingApi.js b/src/api/employeeTimingApi.js new file mode 100644 index 0000000..31191fe --- /dev/null +++ b/src/api/employeeTimingApi.js @@ -0,0 +1,11 @@ +// /src/api/employeeTimingApi.js +import axiosInstance from './axiosInstance'; + +export const employeeTimingApi = { + getAll: (params) => axiosInstance.get('/employee-timings/admin/get-all', { params }), + getSummary: (params) => axiosInstance.get('/employee-timings/admin/summary', { params }), + getOne: (id) => axiosInstance.get(`/employee-timings/admin/get-one/${id}`), + create: (data) => axiosInstance.post('/employee-timings/admin/create', data), + update: (id, data) => axiosInstance.put(`/employee-timings/admin/update/${id}`, data), + delete: (id) => axiosInstance.delete(`/employee-timings/admin/delete/${id}`) +}; diff --git a/src/components/common/SmsPreviewConfirmDialog.vue b/src/components/common/SmsPreviewConfirmDialog.vue new file mode 100644 index 0000000..9bb5336 --- /dev/null +++ b/src/components/common/SmsPreviewConfirmDialog.vue @@ -0,0 +1,168 @@ + + + + + + diff --git a/src/components/layout/AppSidebar.vue b/src/components/layout/AppSidebar.vue index 0fd3ff8..29e2ff1 100644 --- a/src/components/layout/AppSidebar.vue +++ b/src/components/layout/AppSidebar.vue @@ -142,6 +142,7 @@ const menuGroups = computed(() => { key: 'system', label: 'مدیریت سیستم', items: [ + { label: 'ورود و خروج کارمندان', icon: 'pi pi-clock', to: '/employee-timings', permission: PERMISSIONS.EMPLOYEE_TIMINGS_READ }, { label: 'گزارش فعالیت‌ها', icon: 'pi pi-history', to: '/logs', permission: PERMISSIONS.LOGS_READ }, { label: 'نقش‌ها و دسترسی‌ها', icon: 'pi pi-shield', to: '/roles' } ] @@ -166,6 +167,7 @@ const menuGroups = computed(() => { if (permissionStore.roleName === 'SuperAdmin') { const systemGroup = groups.find((g) => g.key === 'system'); + systemGroup.items.push({ label: 'قالب‌های اعلان', icon: 'pi pi-send', to: '/notification-templates' }); systemGroup.items.push({ label: 'تنظیمات', icon: 'pi pi-cog', to: '/settings' }); } diff --git a/src/constants/permissions.js b/src/constants/permissions.js index ecd1bb2..4aad899 100644 --- a/src/constants/permissions.js +++ b/src/constants/permissions.js @@ -89,7 +89,12 @@ export const PERMISSIONS = { WAITLIST_CREATE: 'waitlist:create', WAITLIST_READ: 'waitlist:read', WAITLIST_UPDATE: 'waitlist:update', - WAITLIST_DELETE: 'waitlist:delete' + WAITLIST_DELETE: 'waitlist:delete', + + EMPLOYEE_TIMINGS_CREATE: 'employee_timings:create', + EMPLOYEE_TIMINGS_READ: 'employee_timings:read', + EMPLOYEE_TIMINGS_UPDATE: 'employee_timings:update', + EMPLOYEE_TIMINGS_DELETE: 'employee_timings:delete' }; export const PERMISSION_GROUPS = [ @@ -106,6 +111,17 @@ export const PERMISSION_GROUPS = [ { key: PERMISSIONS.USERS_ENROLL, label: 'ثبت‌نام کاربر در دوره' } ] }, + { + key: 'employee_timings', + label: 'تردد و ساعت کارمندان', + icon: 'pi pi-clock', + permissions: [ + { key: PERMISSIONS.EMPLOYEE_TIMINGS_CREATE, label: 'ثبت تردد جدید' }, + { key: PERMISSIONS.EMPLOYEE_TIMINGS_READ, label: 'مشاهده تردد کارمندان' }, + { key: PERMISSIONS.EMPLOYEE_TIMINGS_UPDATE, label: 'ویرایش تردد' }, + { key: PERMISSIONS.EMPLOYEE_TIMINGS_DELETE, label: 'حذف تردد' } + ] + }, { key: 'professors', label: 'مدیریت اساتید', diff --git a/src/locales/fa.json b/src/locales/fa.json index 835cbd7..486bee3 100644 --- a/src/locales/fa.json +++ b/src/locales/fa.json @@ -156,5 +156,15 @@ "settings": { "title": "تنظیمات سیستم", "subtitle": "عملیات راه‌اندازی و پیکربندی اولیه پایگاه داده" + }, + "employeeTimings": { + "title": "ورود و خروج کارمندان", + "subtitle": "ثبت، ویرایش و مدیریت زمان تردد و ساعت کاری کارمندان", + "addTiming": "ثبت تردد جدید", + "editTiming": "ویرایش رکورد تردد" + }, + "notificationTemplates": { + "title": "قالب‌های اعلان", + "subtitle": "مدیریت متن، شناسه‌ها و متغیرهای قالب‌های پیامک، ایمیل و بازوی بله" } } diff --git a/src/router/routes.js b/src/router/routes.js index 94a40bf..74abc46 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -241,6 +241,22 @@ export const routes = [ meta: { permission: 'logs:read' } }, + // Employee timings + { + path: 'employee-timings', + name: 'EmployeeTimingList', + component: () => import('@/views/employeeTimings/EmployeeTimingListView.vue'), + meta: { title: 'ورود و خروج کارمندان', permission: 'employee_timings:read' } + }, + + // Notification templates + { + path: 'notification-templates', + name: 'NotificationTemplates', + component: () => import('@/views/notifications/NotificationTemplatesView.vue'), + meta: { title: 'قالب‌های اعلان', superAdminOnly: true } + }, + { path: 'settings', name: 'Settings', diff --git a/src/views/classes/ClassFormView.vue b/src/views/classes/ClassFormView.vue index 61df616..3725f60 100644 --- a/src/views/classes/ClassFormView.vue +++ b/src/views/classes/ClassFormView.vue @@ -5,12 +5,23 @@ :title="isEditMode ? 'ویرایش کلاس' : 'تعریف کلاس جدید'" :subtitle="isEditMode ? 'ویرایش کلاس، دانشجویان و جلسات' : 'تعریف کلاس جدید برای دوره'" > -