Обновлен стартовый экран

Переписаны запросы для статистики, отчетов
Добавлена интеграция отчета сестры
This commit is contained in:
brusnitsyn
2026-05-28 22:10:00 +09:00
parent 90e0d04dfd
commit 739168d427
96 changed files with 6663 additions and 1465 deletions

View File

@@ -0,0 +1,37 @@
<script setup>
import HeaderWidget from "../HeaderWidget.vue"
import {computed} from "vue";
const props = defineProps({
counter: Number
})
const counterClass = computed(() => {
const value = typeof props.counter === 'number' ? props.counter : 0
if (value < 60) return 'counter-success'
if (value < 100) return 'counter-warning'
return 'counter-danger'
})
</script>
<template>
<HeaderWidget label="Загруженность"
:counter="counter"
:counter-class="counterClass"
percent
/>
</template>
<style scoped>
:deep(.counter-success) {
color: var(--n-color-target) !important;
}
:deep(.counter-warning) {
color: var(--n-feedback-text-color-warning) !important;
}
:deep(.counter-danger) {
color: var(--n-asterisk-color) !important;
}
</style>

View File

@@ -0,0 +1,32 @@
<script setup>
import {NModal, NSpace} from 'naive-ui'
import ReportWidget from "../ReportWidget.vue";
import {ref} from "vue";
const props = defineProps({
operations: Array,
planned: Number,
urgent: Number,
})
const showOperationsModal = ref(false)
</script>
<template>
<ReportWidget :counter="urgent" is-double-counter :counter-suffix="planned">
<NSpace vertical :size="1">
<div>Операций</div>
<div>Э / П</div>
</NSpace>
</ReportWidget>
<NModal v-model:show="showOperationsModal" preset="card" segmented class="max-w-screen md:max-w-3xl lg:max-w-6xl">
<template #header>
Кому провели операции на сегодня
</template>
</NModal>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1,52 @@
<script setup>
import HeaderWidget from "../HeaderWidget.vue"
import {computed} from "vue";
const props = defineProps({
dutyCurrent: Number,
nurseCurrent: Number,
beds: Number,
})
const getColorClassByAbsolute = (current) => {
const freeBeds = props.beds - current
if (freeBeds >= 5) return 'counter-success' // Свободно 5+ коек
if (freeBeds >= 2) return 'counter-warning' // Свободно 2-4 койки
// if (freeBeds >= 0) return 'counter-warning-high' // Свободно 0-1 койка
return 'counter-danger' // Переполнение
}
const dutyClass = computed(() => {
const dutyValue = typeof props.dutyCurrent === 'number' ? props.dutyCurrent : 0
return getColorClassByAbsolute(dutyValue)
})
const nurseClass = computed(() => {
const nurseValue = typeof props.nurseCurrent === 'number' ? props.nurseCurrent : 0
return getColorClassByAbsolute(nurseValue)
})
</script>
<template>
<HeaderWidget label="Состоит"
is-double-counter
:counter="dutyCurrent"
:counter-suffix="nurseCurrent"
:counter-class="dutyClass"
:counter-suffix-class="nurseClass"
/>
</template>
<style scoped>
:deep(.counter-success) {
color: var(--n-color-target) !important;
}
:deep(.counter-warning) {
color: var(--n-feedback-text-color-warning) !important;
}
:deep(.counter-danger) {
color: var(--n-asterisk-color) !important;
}
</style>