WIP Добавил отображение данных медицинской карты

This commit is contained in:
DwCay
2022-12-30 17:52:22 +03:00
parent 1c824bc540
commit 969416cd26
5 changed files with 211 additions and 36 deletions

View File

@@ -1,9 +1,13 @@
<template lang="pug">
.section-wrapper.flex.flex-col.h-fit.cursor-pointer(:style="{height: `${height}px`}")
.section-header.flex.items-center.justify-between.pl-4.pr-3.py-4
.section-header.flex.items-center.justify-between.pl-4.pr-3.py-4.mb-3
span.text-sm.font-semibold.whitespace-normal {{title}}
.flex.items-center.gap-x-8
.section-add.flex.justify-center.items-center.cursor-pointer Добавить данные
.flex.flex-col.items-center.gap-y-4.px-4
slot(v-if="!isNoData")
.section-add.flex.justify-center.items-center.cursor-pointer(
v-if="isNoData"
@click="openAddDoc"
) Добавить данные
</template>
<script>
@@ -12,6 +16,28 @@ export default {
props: {
title: String,
height: Number,
data: Object,
},
data() {
return {
isNoData: true,
};
},
methods: {
openAddDoc() {
this.isNoData = false;
},
},
watch: {
data() {
Object.values(this.data)
.map((el) => (el ? el : undefined))
.forEach((el) => {
if (el) {
this.isNoData = false;
}
});
},
},
};
</script>