WIP Настроила кнопки на хедере
This commit is contained in:
@@ -1,12 +1,22 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.w-full
|
.w-full
|
||||||
medical-card-header
|
medical-card-header(v-model="currentMenuItem")
|
||||||
|
component(
|
||||||
|
v-if="currentMenuItem",
|
||||||
|
v-bind:is="currentMenuItem",
|
||||||
|
)
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MedicalCardHeader from "@/pages/newMedicalCard/components/MedicalCardHeader.vue";
|
import MedicalCardHeader from "@/pages/newMedicalCard/components/MedicalCardHeader.vue";
|
||||||
|
import BasicDataForm from "@/pages/newMedicalCard/components/BasicDataForm.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "TheMedicalCard",
|
name: "TheMedicalCard",
|
||||||
components: { MedicalCardHeader },
|
components: { MedicalCardHeader, BasicDataForm },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
currentMenuItem: "BasicDataForm",
|
||||||
|
};
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -17,14 +17,14 @@
|
|||||||
size="10px"
|
size="10px"
|
||||||
label="Удалить медкарту",
|
label="Удалить медкарту",
|
||||||
no-caps,
|
no-caps,
|
||||||
padding="4px"
|
padding="6px"
|
||||||
)
|
)
|
||||||
.flex.justify-between.mt-22px
|
.flex.justify-between.mt-22px
|
||||||
.flex
|
.flex
|
||||||
.menu-item.px-6.py-10px.cursor-pointer.text-base(
|
.menu-item.px-6.py-10px.cursor-pointer.text-base(
|
||||||
v-for="item in menuItem",
|
v-for="item in menuItem",
|
||||||
@click="selectItem(item.component)",
|
@click="selectItem(item)",
|
||||||
:class="{'menu-item-active': item.component === currentMenuItem}",
|
:class="{'menu-item-active': item.component === modelValue}",
|
||||||
:key="item.id",
|
:key="item.id",
|
||||||
:id="item.id"
|
:id="item.id"
|
||||||
) {{item.title}}
|
) {{item.title}}
|
||||||
@@ -36,19 +36,22 @@
|
|||||||
flat,
|
flat,
|
||||||
no-caps,
|
no-caps,
|
||||||
padding="2px 4px"
|
padding="2px 4px"
|
||||||
|
:style="{height: '32px'}"
|
||||||
)
|
)
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { v_model } from "@/shared/mixins/v-model";
|
||||||
export default {
|
export default {
|
||||||
name: "MedicalCardHeader",
|
name: "MedicalCardHeader",
|
||||||
|
mixins: [v_model],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
menuItem: [
|
menuItem: [
|
||||||
{
|
{
|
||||||
title: "Общая информация",
|
title: "Общая информация",
|
||||||
id: "basic",
|
id: "basic",
|
||||||
component: "Basic",
|
component: "BasicDataForm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Журнал посещений",
|
title: "Журнал посещений",
|
||||||
@@ -71,14 +74,11 @@ export default {
|
|||||||
component: "ContactHistory",
|
component: "ContactHistory",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
currentMenuItem: "Basic",
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectItem(componentName) {
|
selectItem(item) {
|
||||||
this.currentMenuItem = this.menuItem.find(
|
this.value = item?.component;
|
||||||
(elem) => elem.component === componentName
|
|
||||||
)?.component;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -100,6 +100,8 @@ export default {
|
|||||||
.q-btn
|
.q-btn
|
||||||
font-size: 14px !important
|
font-size: 14px !important
|
||||||
font-weight: 500 !important
|
font-weight: 500 !important
|
||||||
|
.q-btn :deep(.q-icon)
|
||||||
|
font-size: 16px !important
|
||||||
.q-btn :deep(.on-left)
|
.q-btn :deep(.on-left)
|
||||||
margin-right: 4px !important
|
margin-right: 4px !important
|
||||||
.q-btn :deep(.q-btn-dropdown__arrow)
|
.q-btn :deep(.q-btn-dropdown__arrow)
|
||||||
@@ -111,4 +113,6 @@ export default {
|
|||||||
font-size: 12px
|
font-size: 12px
|
||||||
line-height: 135%
|
line-height: 135%
|
||||||
color: var(--font-grey-color)
|
color: var(--font-grey-color)
|
||||||
|
.q-breadcrumbs :deep(.q-breadcrumbs__separator)
|
||||||
|
margin: 10px 0 4px 8px !important
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user