Initial commit: Ressourcenplanung-App
Vue 3 + Vite Frontend und Node/Express + SQLite Backend für Projekt-, Aufgaben-, Mitarbeiter- und Teamverwaltung inkl. Gantt-Zeitplan und Auslastungs-Heatmap.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import { store } from './store.js';
|
||||
|
||||
const newEmployee = reactive({ name: '', email: '', role: '', weekly_capacity_hours: 40 });
|
||||
|
||||
async function addEmployee() {
|
||||
if (!newEmployee.name) return;
|
||||
await store.createEmployee({ ...newEmployee });
|
||||
Object.assign(newEmployee, { name: '', email: '', role: '', weekly_capacity_hours: 40 });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="panel-section">
|
||||
<h2>Neuer Mitarbeiter</h2>
|
||||
<div class="form-row">
|
||||
<input v-model="newEmployee.name" placeholder="Name" />
|
||||
<input v-model="newEmployee.email" placeholder="E-Mail" />
|
||||
<input v-model="newEmployee.role" placeholder="Rolle" />
|
||||
<input v-model.number="newEmployee.weekly_capacity_hours" type="number" style="width: 100px" placeholder="Std/Woche" />
|
||||
<button class="btn" @click="addEmployee">Anlegen</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-section">
|
||||
<h2>Mitarbeiter</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>E-Mail</th>
|
||||
<th>Rolle</th>
|
||||
<th>Kapazität (Std/Woche)</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="e in store.employees" :key="e.id">
|
||||
<td>{{ e.name }}</td>
|
||||
<td>{{ e.email }}</td>
|
||||
<td>{{ e.role }}</td>
|
||||
<td>{{ e.weekly_capacity_hours }}</td>
|
||||
<td><button class="btn danger" @click="store.deleteEmployee(e.id)">Löschen</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p v-if="store.employees.length === 0" class="muted">Noch keine Mitarbeiter angelegt.</p>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user