feat: add Admin layout

This commit is contained in:
2026-09-12 19:38:11 +07:00
parent 301063533a
commit 1c877de130
26 changed files with 742 additions and 1132 deletions
+24 -6
View File
@@ -92,13 +92,31 @@ const savingError = ref('')
const statusOptions = ref<{ label: string; value: TaskStatus }[]>([])
const priorityOptions = ref<{ label: string; value: TaskPriority }[]>([])
const FALLBACK_STATUS: { label: string; value: TaskStatus }[] = [
{ label: 'To Do', value: 'Todo' },
{ label: 'In Progress', value: 'InProgress' },
{ label: 'Done', value: 'Done' },
{ label: 'Cancelled', value: 'Cancelled' },
]
const FALLBACK_PRIORITY: { label: string; value: TaskPriority }[] = [
{ label: 'Low', value: 'Low' },
{ label: 'Medium', value: 'Medium' },
{ label: 'High', value: 'High' },
]
onMounted(async () => {
const [status, priority] = await Promise.all([
getMasterDataOptions('task_status'),
getMasterDataOptions('task_priority'),
])
statusOptions.value = status as { label: string; value: TaskStatus }[]
priorityOptions.value = priority as { label: string; value: TaskPriority }[]
try {
const [status, priority] = await Promise.all([
getMasterDataOptions('task_status'),
getMasterDataOptions('task_priority'),
])
statusOptions.value = (status.length ? status : FALLBACK_STATUS) as { label: string; value: TaskStatus }[]
priorityOptions.value = (priority.length ? priority : FALLBACK_PRIORITY) as { label: string; value: TaskPriority }[]
} catch {
statusOptions.value = FALLBACK_STATUS
priorityOptions.value = FALLBACK_PRIORITY
}
})
const assigneeOptions = computed(() => props.members.map((m) => ({ label: m.displayName, value: m.userId })))