Vereinfache den Aufruf der Anzeige der Arbeitszeitdaten
This commit is contained in:
@@ -2,18 +2,15 @@
|
||||
import {PeriodRecord} from './Models.svelte.js'
|
||||
import TablePagination from "$lib/TablePagination.svelte";
|
||||
|
||||
/**
|
||||
* @type {{ promise: Promise<object>; title: string;}}
|
||||
*/
|
||||
let {params} = $props();
|
||||
let { promise, title } = $props();
|
||||
/** @type PeriodRecord[] **/
|
||||
let records = $state([])
|
||||
/** @type PeriodRecord[] **/
|
||||
let actual_records = $state([])
|
||||
let isLoading = $state(true)
|
||||
const init = async () => await params.promise.then(
|
||||
const init = async () => await promise.then(
|
||||
/**
|
||||
* @param {Array<object>} data
|
||||
* @param {Array<{ workingDays: Number; totalHours: any; overtime: string; period: string; }>} data
|
||||
*/
|
||||
data => {
|
||||
records = data.map(row => new PeriodRecord(row))
|
||||
@@ -24,12 +21,12 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{params.title}</title>
|
||||
<title>{title}</title>
|
||||
</svelte:head>
|
||||
|
||||
<section id="list-records">
|
||||
<header>
|
||||
<h1>{params.title}</h1>
|
||||
<h1>{title}</h1>
|
||||
</header>
|
||||
<article>
|
||||
{#if isLoading === true}
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
let { data } = $props();
|
||||
</script>
|
||||
|
||||
<Views params={data}/>
|
||||
<Views {...data}/>
|
||||
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
let { data } = $props();
|
||||
</script>
|
||||
|
||||
<Views params={data}/>
|
||||
<Views {...data}/>
|
||||
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
let { data } = $props();
|
||||
</script>
|
||||
|
||||
<Views params={data}/>
|
||||
<Views {...data}/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user