Роли, переделывание отчета, изменение на главной странице

This commit is contained in:
brusnitsyn
2026-01-11 23:37:18 +09:00
parent eb019504d7
commit d4f077cdaf
59 changed files with 2099 additions and 366 deletions

View File

@@ -0,0 +1,55 @@
<script setup>
import {computed, onMounted, ref} from "vue";
import {NSkeleton, NText} from 'naive-ui'
const props = defineProps({
title: {
type: String,
default: null
},
status: {
type: String,
default: null
}
})
const isLoading = ref(true)
const countPatient = ref(null)
const fetchPatientCount = async () => {
if (props.status === 'plan' || props.status === 'emergency') {
isLoading.value = true
await axios.post('/api/mis/patients/count', {
status: props.status
}).then((res) => {
countPatient.value = res.data
}).finally(() => {
isLoading.value = false
})
} else {
isLoading.value = false
}
}
const computedHeader = computed(() => {
if (countPatient.value !== null) {
return `${props.title} (${countPatient.value})`
} else {
return props.title
}
})
onMounted(async () => {
await fetchPatientCount()
})
</script>
<template>
<NSkeleton text style="width: 128px; height: 22px" round v-if="isLoading" />
<NText v-else>
{{ computedHeader }}
</NText>
</template>
<style scoped>
</style>