[WIP] Фикс багов и скролла страницы медкартотчек
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
)
|
||||
.form-wrapper.flex.flex-col.overflow-y-auto(
|
||||
@scroll="scrollTo",
|
||||
id="scroll",
|
||||
:class="{'default-form': patientsData.length <= 3}"
|
||||
)
|
||||
.patient.flex.items-center.p-4.justify-between(
|
||||
@@ -91,6 +92,14 @@ export default {
|
||||
return (this.isGradient = false);
|
||||
this.isGradient = true;
|
||||
},
|
||||
checkScroll() {
|
||||
let elem = document.getElementById("scroll");
|
||||
if (Math.abs(elem.scrollHeight - elem.clientHeight - elem.scrollTop))
|
||||
this.isGradient = true;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.checkScroll();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -123,6 +132,7 @@ export default {
|
||||
border-bottom: 1px solid var(--gray-secondary)
|
||||
border-right: 1px solid var(--gray-secondary)
|
||||
margin-right: 8px
|
||||
height: 77px
|
||||
&:last-child
|
||||
border-bottom: none
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<template lang="pug">
|
||||
medcard-form-wrapper(title="Недавно просмотренные медкарты")
|
||||
medcard-form-wrapper.relative(title="Недавно просмотренные медкарты")
|
||||
.form-wrapper.flex.flex-col.overflow-y-auto(
|
||||
@scroll="scrollTo",
|
||||
:class="{'default-params': viewPatients.length <= 3}"
|
||||
id="scroll-view",
|
||||
:class="{'default-form': viewPatients.length <= 3}"
|
||||
)
|
||||
.patient.flex.items-center.p-4.justify-between(
|
||||
v-for="(patient, index) in viewPatients",
|
||||
:class="{'default-params': viewPatients.length <= 3}"
|
||||
:class="{'default-patient': viewPatients.length <= 3}"
|
||||
)
|
||||
.flex.text-base.font-medium.gap-x-3
|
||||
img.h-11.w-11.object-cover.rounded-full(:src="patient.avatar")
|
||||
@@ -58,6 +59,11 @@ export default {
|
||||
return (this.isGradient = false);
|
||||
this.isGradient = true;
|
||||
},
|
||||
checkScroll() {
|
||||
let elem = document.getElementById("scroll-view");
|
||||
if (Math.abs(elem.scrollHeight - elem.clientHeight - elem.scrollTop) < 1)
|
||||
this.isGradient = true;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
patientsData: {
|
||||
@@ -68,6 +74,16 @@ export default {
|
||||
this.viewPatients.push(...JSON.parse(localStorage.getItem("view")));
|
||||
},
|
||||
},
|
||||
viewPatients: {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler() {
|
||||
if (this.viewPatients.length > 3) this.checkScroll();
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.checkScroll();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -95,26 +111,26 @@ export default {
|
||||
pointer-events: none
|
||||
|
||||
.patient
|
||||
border-bottom: 1px solid var(--gray-scondary)
|
||||
border-right: 1px solid var(--gray-scondary)
|
||||
border-bottom: 1px solid var(--gray-secondary)
|
||||
border-right: 1px solid var(--gray-secondary)
|
||||
margin-right: 8px
|
||||
height: 77px
|
||||
&:last-child
|
||||
border-bottom: none
|
||||
|
||||
.default-params
|
||||
margin-right: 0px
|
||||
border-right: none
|
||||
&:last-child
|
||||
border-bottom: 1px solid var(--gray-scondary)
|
||||
|
||||
.default-params.form-wrapper
|
||||
border-right: none
|
||||
.default-form
|
||||
margin-right: 0px
|
||||
&:last-child
|
||||
border-bottom: none
|
||||
|
||||
.default-patient
|
||||
margin-right: 0px
|
||||
border-right: none
|
||||
&:last-child
|
||||
border-bottom: 1px solid var(--gray-secondary)
|
||||
|
||||
.btn
|
||||
border: 1px solid var(--gray-scondary)
|
||||
border: 1px solid var(--gray-secondary)
|
||||
color: var(--font-grey-color)
|
||||
background: var(--bg-light-grey)
|
||||
|
||||
|
||||
@@ -9,10 +9,7 @@
|
||||
)
|
||||
img(:src="arrow")
|
||||
.form.flex.p-4
|
||||
base-button(
|
||||
width="100%",
|
||||
@click="createForm",
|
||||
)
|
||||
base-button(width="100%", @click="createForm")
|
||||
q-icon.plus(name="app:plus", size="24px", left)
|
||||
span Создать запись
|
||||
.flex.flex-col.gap-y-px
|
||||
@@ -51,17 +48,10 @@
|
||||
placeholder="Найти пациента...",
|
||||
:width="160"
|
||||
size="S",
|
||||
:iconLeft="!foundPerson",
|
||||
iconRight
|
||||
icon-left
|
||||
)
|
||||
template(v-slot:iconLeft)
|
||||
q-icon.input-icon(name="app:search", size="16px")
|
||||
template(v-slot:iconRight)
|
||||
q-icon.cursor-pointer.input-icon(
|
||||
@click="copyValue(foundPerson)"
|
||||
name="app:copy",
|
||||
size="16px"
|
||||
)
|
||||
q-btn.ml-2(
|
||||
@click="sortPerson(elem.data)",
|
||||
:class="sortingClass",
|
||||
|
||||
@@ -74,17 +74,10 @@
|
||||
placeholder="Найти пациента...",
|
||||
:width="160"
|
||||
size="S",
|
||||
:iconLeft="!foundPerson",
|
||||
iconRight
|
||||
icon-left
|
||||
)
|
||||
template(v-slot:iconLeft)
|
||||
q-icon.input-icon(name="app:search", size="16px")
|
||||
template(v-slot:iconRight)
|
||||
q-icon.cursor-pointer.input-icon(
|
||||
@click="copyValue(foundPerson)"
|
||||
name="app:copy",
|
||||
size="16px"
|
||||
)
|
||||
q-btn.ml-2(
|
||||
@click="sortPerson(patientsData)",
|
||||
:style="{width: '32px', height: '32px', border: '1px solid var(--gray-secondary)'}",
|
||||
@@ -195,9 +188,6 @@ export default {
|
||||
"green-color": priority === 3,
|
||||
};
|
||||
},
|
||||
copyValue(text) {
|
||||
navigator.clipboard.writeText(text);
|
||||
},
|
||||
checkPerson(index, arr) {
|
||||
arr.map((e) => {
|
||||
if (e.id === index) e.check = !e.check;
|
||||
|
||||
@@ -114,8 +114,8 @@ export const patientList = [
|
||||
check: false,
|
||||
view: false,
|
||||
viewDate: "",
|
||||
reception: "26.07.2023",
|
||||
time: { from: "11:00", to: "18:00" },
|
||||
reception: "28.07.2023",
|
||||
time: { from: "11:00", to: "12:00" },
|
||||
priority: 1,
|
||||
phone: "+7 (910) 623–32–23",
|
||||
email: "gaevaia@yandex.ru",
|
||||
@@ -132,8 +132,8 @@ export const patientList = [
|
||||
check: false,
|
||||
view: false,
|
||||
viewDate: "",
|
||||
reception: "26.07.2023",
|
||||
time: { from: "05:00", to: "06:00" },
|
||||
reception: "28.07.2023",
|
||||
time: { from: "12:00", to: "13:00" },
|
||||
priority: 1,
|
||||
phone: "+7 (910) 623–32–23",
|
||||
email: "gaevaia@yandex.ru",
|
||||
@@ -150,8 +150,8 @@ export const patientList = [
|
||||
check: false,
|
||||
view: false,
|
||||
viewDate: "",
|
||||
reception: "26.07.2023",
|
||||
time: { from: "18:00", to: "19:00" },
|
||||
reception: "28.07.2023",
|
||||
time: { from: "13:00", to: "14:00" },
|
||||
priority: 1,
|
||||
phone: "+7 (910) 623–32–23",
|
||||
email: "gaevaia@yandex.ru",
|
||||
@@ -168,8 +168,8 @@ export const patientList = [
|
||||
check: false,
|
||||
view: false,
|
||||
viewDate: "",
|
||||
reception: "26.07.2023",
|
||||
time: { from: "19:00", to: "20:00" },
|
||||
reception: "28.07.2023",
|
||||
time: { from: "14:00", to: "16:00" },
|
||||
priority: 1,
|
||||
phone: "+7 (910) 623–32–23",
|
||||
email: "gaevaia@yandex.ru",
|
||||
@@ -186,8 +186,8 @@ export const patientList = [
|
||||
check: false,
|
||||
view: false,
|
||||
viewDate: "",
|
||||
reception: "27.07.2023",
|
||||
time: { from: "11:00", to: "14:00" },
|
||||
reception: "28.07.2023",
|
||||
time: { from: "16:00", to: "20:00" },
|
||||
priority: 1,
|
||||
phone: "+7 (910) 623–32–23",
|
||||
email: "gaevaia@yandex.ru",
|
||||
|
||||
Reference in New Issue
Block a user