WIP Поправил отправку данных с мед карты, добавил обновление данных
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user