Feature: ermögliche den Import von CSV-Daten
This commit is contained in:
@@ -5,10 +5,12 @@
|
||||
import xIcon from '@iconify-icons/oi/x'
|
||||
import EditByDay from "./Formular/EditByDay.svelte";
|
||||
import EditByWeek from "./Formular/EditByWeek.svelte";
|
||||
import ImportCsv from "./Formular/ImportCsv.svelte";
|
||||
import {TimekeepingDate} from "../../components/TimekeepingDate.svelte";
|
||||
|
||||
const DAILY_EDIT = 0
|
||||
const WEEKLY_EDIT = 1
|
||||
const CSV_IMPORT = 2
|
||||
|
||||
const Controller = {
|
||||
'saveRecord': () => {
|
||||
@@ -65,6 +67,11 @@
|
||||
})
|
||||
}
|
||||
}
|
||||
const CsvController = {
|
||||
'makeTimekeepingList': () => {
|
||||
MenuController.dailyEdit()
|
||||
}
|
||||
}
|
||||
const MenuController = {
|
||||
'dailyEdit': () => {
|
||||
period_of_edit = DAILY_EDIT
|
||||
@@ -75,6 +82,11 @@
|
||||
period_of_edit = WEEKLY_EDIT
|
||||
makeTimekeepingList = WeekController.makeTimekeepingList
|
||||
makeTimekeepingList()
|
||||
},
|
||||
'csvImport': () => {
|
||||
period_of_edit = CSV_IMPORT
|
||||
activeRecordList = []
|
||||
makeTimekeepingList = CsvController.makeTimekeepingList
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +105,7 @@
|
||||
<nav class="menu">
|
||||
<span on:click={MenuController.dailyEdit} on:keypress={() => {}} class:active={period_of_edit === DAILY_EDIT}>Täglich</span>
|
||||
<span on:click={MenuController.weeklyEdit} on:keypress={() => {}} class:active={period_of_edit === WEEKLY_EDIT}>Wöchentlich</span>
|
||||
<span on:click={MenuController.csvImport} on:keypress={() => {}} class:active={period_of_edit === CSV_IMPORT}>Import per CSV</span>
|
||||
</nav>
|
||||
{#if period_of_edit === DAILY_EDIT}
|
||||
<EditByDay bind:activeRecordList bind:activeDate bind:makeTimekeepingList/>
|
||||
@@ -100,6 +113,9 @@
|
||||
{#if period_of_edit === WEEKLY_EDIT}
|
||||
<EditByWeek bind:activeRecordList bind:activeDate bind:makeTimekeepingList/>
|
||||
{/if}
|
||||
{#if period_of_edit === CSV_IMPORT}
|
||||
<ImportCsv bind:activeRecordList bind:makeTimekeepingList/>
|
||||
{/if}
|
||||
<fieldset name="buttons">
|
||||
<button on:click={Controller.saveRecord} type="button">Übernehmen und Weiter
|
||||
<IconifyIcon icon={checkIcon} color="green"/>
|
||||
|
||||
Reference in New Issue
Block a user