WIP Поправил отправку данных с мед карты, добавил обновление данных

This commit is contained in:
DwCay
2023-03-03 18:24:34 +03:00
parent 4e6e1616ed
commit 90ab7197a2
5 changed files with 384 additions and 167 deletions

View File

@@ -4,13 +4,13 @@
span.text-sm.font-semibold.whitespace-normal {{title}}
.flex.gap-y-4.px-4.py-3(
:style="{height: `${height}px`}"
v-if="!isNoData"
v-if="isNoData"
:class="{'flex-col': !directionRow}"
)
slot
.section-add.flex.justify-center.items-center.cursor-pointer(
:style="{height: `${height}px`}"
v-if="isNoData"
v-if="!isNoData"
@click="openAddDoc"
) Добавить данные
</template>
@@ -21,28 +21,26 @@ export default {
props: {
title: String,
height: Number,
data: Object,
data: Array,
directionRow: Boolean,
},
data() {
return {
isNoData: true,
isNoData: false,
};
},
methods: {
openAddDoc() {
this.isNoData = false;
this.isNoData = true;
},
},
watch: {
data() {
Object.values(this.data)
.map((el) => (el !== undefined && el !== null ? el : undefined))
.forEach((el) => {
if (el !== undefined) {
this.isNoData = false;
}
});
this.data.forEach((el) => {
if (el !== undefined) {
this.isNoData = true;
}
});
},
},
};

View File

@@ -68,7 +68,7 @@ export default {
lazyRule: [Boolean, String],
noErrorIcon: Boolean,
itemAligned: Boolean,
modelValue: [String, Date],
modelValue: [String, Date, Number],
placeholder: String,
disabled: Boolean,
label: String,