feature: Digitization Workstation UI

This commit is contained in:
voltsrage
2026-06-27 12:15:43 +08:00
parent 88e70b3dbe
commit e22d33b654
55 changed files with 6411 additions and 143 deletions
@@ -0,0 +1,63 @@
<template>
<div class="min-h-screen flex items-center justify-center bg-gray-50 px-4 py-8">
<div class="max-w-md w-full bg-white rounded-lg shadow-md p-6 sm:p-8">
<div class="text-center mb-8">
<h1 class="text-2xl font-bold text-gray-900">VigilCare Records</h1>
<p class="text-gray-600 mt-2">Digitization Workstation</p>
</div>
<form @submit.prevent="handleLogin" class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Username</label>
<input
v-model="username"
type="text"
class="form-input"
placeholder="e.g. intake1, entry1, verifier1"
required
/>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Password</label>
<input
v-model="password"
type="password"
class="form-input"
required
/>
</div>
<div v-if="errorMessage" class="text-clinical-danger text-sm">
{{ errorMessage }}
</div>
<button type="submit" class="btn-primary w-full" :disabled="loading">
{{ loading ? 'Signing in...' : 'Sign In' }}
</button>
</form>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useAuthStore } from '../stores/auth'
const auth = useAuthStore()
const username = ref('')
const password = ref('')
const loading = ref(false)
const errorMessage = ref('')
async function handleLogin() {
loading.value = true
errorMessage.value = ''
try {
await auth.login({ username: username.value, password: password.value })
} catch (e: unknown) {
errorMessage.value = e instanceof Error ? e.message : 'Login failed'
} finally {
loading.value = false
}
}
</script>