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