Форматирование
This commit is contained in:
@@ -50,6 +50,19 @@ const currentDate = computed(() => {
|
||||
|
||||
return formatted.charAt(0).toUpperCase() + formatted.slice(1)
|
||||
})
|
||||
|
||||
const exportUrl = computed(() => {
|
||||
const [startAt, endAt] = reportStore.timestampCurrentRange || []
|
||||
const departmentId = reportStore.reportInfo?.department?.department_id
|
||||
const params = new URLSearchParams()
|
||||
|
||||
if (startAt) params.set('startAt', String(startAt))
|
||||
if (endAt) params.set('endAt', String(endAt))
|
||||
if (departmentId) params.set('departmentId', String(departmentId))
|
||||
|
||||
const query = params.toString()
|
||||
return query ? `/report/export?${query}` : '/report/export'
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -128,6 +141,9 @@ const currentDate = computed(() => {
|
||||
</template>
|
||||
Нежелательные события ({{ reportStore.unwantedEvents.length }})
|
||||
</NButton>
|
||||
<NButton type="info" secondary tag="a" :href="exportUrl">
|
||||
Скачать Excel
|
||||
</NButton>
|
||||
</NFlex>
|
||||
</NFlex>
|
||||
</NCard>
|
||||
|
||||
@@ -18,13 +18,14 @@ import {
|
||||
import {useReportStore} from "../../../Stores/report.js";
|
||||
import {computed, h, ref, watch} from "vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {TbEye, TbExternalLink, TbPencil, TbTrash} from "vue-icons-plus/tb";
|
||||
import {TbEye, TbExternalLink, TbPencil, TbTrash, TbLock, TbEdit} from "vue-icons-plus/tb";
|
||||
import MoveModalComment from "./MoveModalComment.vue";
|
||||
import OperationInfoModal from "./OperationInfoModal.vue";
|
||||
import ManualPatientOutcomeModal from "./ManualPatientOutcomeModal.vue";
|
||||
import ManualPatientLinkModal from "./ManualPatientLinkModal.vue";
|
||||
import ManualPatientEditModal from "./ManualPatientEditModal.vue";
|
||||
import ManualPatientOperationsModal from "./ManualPatientOperationsModal.vue";
|
||||
import ReanimationIndicatorModal from "./ReanimationIndicatorModal.vue";
|
||||
import {useDebounceFn} from "@vueuse/core";
|
||||
|
||||
const props = defineProps({
|
||||
@@ -83,6 +84,7 @@ const showManualOutcomeModal = ref(false)
|
||||
const showManualLinkModal = ref(false)
|
||||
const showManualEditModal = ref(false)
|
||||
const showManualOperationsModal = ref(false)
|
||||
const showReanimationIndicatorModal = ref(false)
|
||||
const currentHistory = ref(null)
|
||||
const latestDropItem = ref(null)
|
||||
const activePatient = ref(null)
|
||||
@@ -90,11 +92,17 @@ const activePatient = ref(null)
|
||||
const hasDisabledEdit = computed(() => {
|
||||
return !Boolean(reportStore.reportInfo?.report?.isActiveSendButton)
|
||||
})
|
||||
const isHeadOrAdmin = computed(() => Boolean(reportStore.reportInfo?.report?.isHeadOrAdmin))
|
||||
const canEditSpecial = computed(() => (
|
||||
isSpecialStatus.value
|
||||
&& !hasDisabledEdit.value
|
||||
&& (!hasDisabledEdit.value || isHeadOrAdmin.value)
|
||||
&& baseStatus.value !== 'observation'
|
||||
))
|
||||
const canEditReanimationIndicator = computed(() => (
|
||||
baseStatus.value === 'reanimation'
|
||||
&& !isSpecialStatus.value
|
||||
&& (!hasDisabledEdit.value || isHeadOrAdmin.value)
|
||||
))
|
||||
const statusState = computed(() => statusStates.value[props.status] ?? {
|
||||
page: 1,
|
||||
perPage: 20,
|
||||
@@ -111,7 +119,11 @@ const showPagination = computed(() => !isObservationStatus.value)
|
||||
const columns = computed(() => {
|
||||
const resolvedBaseColumns = reportStore.getColumnsByKey(props.keys)
|
||||
.filter(Boolean)
|
||||
.map((column) => ({ ...column }))
|
||||
.map((column) => ({
|
||||
...column,
|
||||
align: 'left',
|
||||
titleAlign: 'left',
|
||||
}))
|
||||
|
||||
const newColumns = []
|
||||
|
||||
@@ -119,6 +131,8 @@ const columns = computed(() => {
|
||||
title: '',
|
||||
key: 'goToMis',
|
||||
width: 40,
|
||||
align: 'left',
|
||||
titleAlign: 'left',
|
||||
render: (row) => {
|
||||
const actions = []
|
||||
|
||||
@@ -204,6 +218,8 @@ const columns = computed(() => {
|
||||
const removeColumn = {
|
||||
title: '',
|
||||
key: 'remove',
|
||||
align: 'left',
|
||||
titleAlign: 'left',
|
||||
render: (row) => h(
|
||||
NButton,
|
||||
{
|
||||
@@ -226,6 +242,8 @@ const columns = computed(() => {
|
||||
const expandColumn = {
|
||||
title: '',
|
||||
width: '30',
|
||||
align: 'left',
|
||||
titleAlign: 'left',
|
||||
render: (rowData) => {
|
||||
return h(
|
||||
NIcon,
|
||||
@@ -246,6 +264,8 @@ const columns = computed(() => {
|
||||
title: '',
|
||||
key: 'fillable',
|
||||
width: '20',
|
||||
align: 'left',
|
||||
titleAlign: 'left',
|
||||
render: (row) => h(
|
||||
NBadge,
|
||||
{
|
||||
@@ -265,6 +285,8 @@ const columns = computed(() => {
|
||||
newColumns.push({
|
||||
title: 'Диагноз',
|
||||
key: 'ds',
|
||||
align: 'left',
|
||||
titleAlign: 'left',
|
||||
render: (row) => {
|
||||
if (row.mkb.ds !== null && row.mkb.name !== null) {
|
||||
return h(NPopover, {
|
||||
@@ -298,6 +320,8 @@ const columns = computed(() => {
|
||||
const operationColumn = {
|
||||
title: 'Операции',
|
||||
key: 'operations',
|
||||
align: 'left',
|
||||
titleAlign: 'left',
|
||||
render: (row) => canEditSpecial.value && row?.department_patient_id
|
||||
? h(
|
||||
'div',
|
||||
@@ -354,6 +378,8 @@ const columns = computed(() => {
|
||||
const typeColumn = {
|
||||
title: 'Причина',
|
||||
key: 'outcome_type',
|
||||
align: 'left',
|
||||
titleAlign: 'left',
|
||||
ellipsis: {
|
||||
tooltip: true
|
||||
}
|
||||
@@ -361,6 +387,86 @@ const columns = computed(() => {
|
||||
newColumns.push(typeColumn)
|
||||
}
|
||||
|
||||
if (baseStatus.value === 'reanimation') {
|
||||
const indicatorColumn = {
|
||||
title: 'Состояние',
|
||||
key: 'reanimation_indicator',
|
||||
width: 120,
|
||||
minWidth: 100,
|
||||
maxWidth: 140,
|
||||
align: 'left',
|
||||
titleAlign: 'left',
|
||||
render: (row) => {
|
||||
const labelMap = {
|
||||
stable: 'Стабильный',
|
||||
moderate: 'Средней тяжести',
|
||||
severe: 'Тяжелый',
|
||||
critical: 'Критический',
|
||||
}
|
||||
const value = row.reanimation_indicator ? (labelMap[row.reanimation_indicator] ?? row.reanimation_indicator) : '-'
|
||||
|
||||
if (canEditReanimationIndicator.value) {
|
||||
return h(
|
||||
'div',
|
||||
{
|
||||
class: 'inline-flex items-center gap-1',
|
||||
},
|
||||
[
|
||||
h(
|
||||
'div',
|
||||
{
|
||||
class: 'underline decoration-dashed cursor-pointer',
|
||||
onClick: () => {
|
||||
activePatient.value = row
|
||||
showReanimationIndicatorModal.value = true
|
||||
},
|
||||
},
|
||||
value
|
||||
),
|
||||
h(
|
||||
NTooltip,
|
||||
{},
|
||||
{
|
||||
trigger: () => h(
|
||||
'div',
|
||||
{
|
||||
class: 'cursor-pointer inline-flex text-slate-500',
|
||||
onClick: () => {
|
||||
activePatient.value = row
|
||||
showReanimationIndicatorModal.value = true
|
||||
},
|
||||
},
|
||||
[h(NIcon, { size: 14 }, h(TbEdit))]
|
||||
),
|
||||
default: () => 'Изменить состояние',
|
||||
}
|
||||
),
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
return h(
|
||||
NTooltip,
|
||||
{},
|
||||
{
|
||||
trigger: () => h(
|
||||
'div',
|
||||
{
|
||||
class: 'inline-flex items-center gap-1 text-slate-500',
|
||||
},
|
||||
[
|
||||
h('span', value),
|
||||
h(NIcon, { size: 14 }, h(TbLock)),
|
||||
]
|
||||
),
|
||||
default: () => 'Редактирование недоступно',
|
||||
}
|
||||
)
|
||||
},
|
||||
}
|
||||
newColumns.push(indicatorColumn)
|
||||
}
|
||||
|
||||
return newColumns
|
||||
})
|
||||
|
||||
@@ -540,13 +646,20 @@ watch(() => reportStore.reportInfo?.dates, async () => {
|
||||
<ManualPatientLinkModal v-model:show="showManualLinkModal" :patient="activePatient" />
|
||||
<ManualPatientEditModal v-model:show="showManualEditModal" :patient="activePatient" :source-status="status" />
|
||||
<ManualPatientOperationsModal v-model:show="showManualOperationsModal" :patient="activePatient" :source-status="status" />
|
||||
<ReanimationIndicatorModal v-model:show="showReanimationIndicatorModal" :patient="activePatient" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
:deep(.n-data-table-th),
|
||||
:deep(.n-data-table-td) {
|
||||
white-space: nowrap !important;
|
||||
font-size: var(--n-font-size);
|
||||
text-align: left !important;
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
:deep(.n-data-table-th__title),
|
||||
:deep(.n-data-table-td__content) {
|
||||
justify-content: flex-start !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user