Добавил подсказку и открытие окна в колонке умерших
This commit is contained in:
34
resources/js/Pages/Statistic/Components/DeceasedColumn.vue
Normal file
34
resources/js/Pages/Statistic/Components/DeceasedColumn.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<script setup>
|
||||
import { NTooltip } from 'naive-ui'
|
||||
import {TbClick} from 'vue-icons-plus/tb'
|
||||
const props = defineProps({
|
||||
isTotalRow: Boolean,
|
||||
value: Number
|
||||
})
|
||||
const emits = defineEmits(['openModal'])
|
||||
|
||||
const handleClick = () => {
|
||||
if (props.isTotalRow) {
|
||||
emits('openModal')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NTooltip v-if="isTotalRow" placement="top" :arrow="false">
|
||||
<template #trigger>
|
||||
<div class="relative inset-0 flex items-center justify-center cursor-pointer" @click="handleClick">
|
||||
{{ value }}
|
||||
<NIcon class="absolute -right-1 -top-1">
|
||||
<TbClick size="14" />
|
||||
</NIcon>
|
||||
</div>
|
||||
</template>
|
||||
Кликните на ячейку для просмотра
|
||||
</NTooltip>
|
||||
<span v-else>{{ value }}</span>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -24,6 +24,7 @@ import StatisticRecipientPlanOfYear from "../../Layouts/Components/Statistic/Sta
|
||||
import {percentType} from "../../Utils/numbers.js";
|
||||
import OutcomeColumn from "./Components/OutcomeColumn.vue";
|
||||
import ModalDeathPatients from "./Components/ModalDeathPatients.vue";
|
||||
import DeceasedColumn from "./Components/DeceasedColumn.vue";
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
@@ -249,18 +250,18 @@ const columns = ref([
|
||||
width: 48,
|
||||
titleAlign: 'center',
|
||||
align: 'center',
|
||||
cellProps: (row) => ({
|
||||
class: 'relative'
|
||||
}),
|
||||
render: (row) => {
|
||||
if (row.isTotalRow) {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
onClick: () => onShowDeathPatientsModal()
|
||||
},
|
||||
row.deceased
|
||||
)
|
||||
}
|
||||
|
||||
return row.deceased
|
||||
return h(
|
||||
DeceasedColumn,
|
||||
{
|
||||
isTotalRow: row.isTotalRow,
|
||||
value: row.deceased,
|
||||
onOpenModal: () => onShowDeathPatientsModal()
|
||||
},
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user