[WIP] Фикс отображения чекбоксах на форме создания осмотра, исправил отображение тэгов, фикс конфига и стилей

This commit is contained in:
megavrilinvv
2023-06-27 17:54:18 +03:00
parent e032159e7f
commit 9bafd0f9b5
6 changed files with 122 additions and 104 deletions

View File

@@ -10,16 +10,20 @@
.disease-body.flex
.flex.flex-col.gap-y-17px.w-full(v-if="fillInspection || change")
.flex.-ml-2(v-if="data.key === 'disease'")
q-checkbox.text-smm.font-medium(v-model="data.results.checked" label="Без особенностей" size="36px")
q-checkbox.text-smm.font-medium(
v-model="protocolData[data.state].checked",
label="Без особенностей",
size="36px"
)
.textarea.flex.w-full
base-input.w-full(
v-model="modelValue",
v-model="protocolData[data.state].text",
type="textarea",
outlined,
resize="vertical",
placeholder="Введите данные..."
)
.font-medium.text-smm(v-else) {{displayedValue}}
.font-medium.text-smm(v-else) {{protocolData[data.state]?.text}}
</template>
<script>
@@ -35,29 +39,12 @@ export default {
fillInspection: Boolean,
},
data() {
return { change: false, modelValue: null };
return { change: false };
},
computed: {
...mapState({
protocolData: (state) => state.medical.protocolData,
}),
state() {
return this.protocolData[this.data.state];
},
findedListItem() {
if (this.data.results?.text && this.modelValue)
return this.data.results?.text === this.modelValue;
return null;
},
reference() {
if (this.findedListItem && this.findedListItem?.text)
return this.findedListItem?.text;
return this.data.results?.text;
},
displayedValue() {
if (this.findedListItem?.text) return this.findedListItem?.text;
return this.modelValue;
},
},
methods: {
openCard() {
@@ -68,29 +55,15 @@ export default {
},
},
watch: {
state: {
immediate: true,
handler(value) {
if (!this.fillInspection) this.modelValue = value;
},
},
fillInspection: {
immediate: true,
handler(newVal) {
if (newVal) {
this.change = false;
this.modelValue = null;
} else {
this.modelValue = this.state;
this.protocolData[this.data.state].text = null;
}
},
},
modelValue: {
immediate: true,
handler(value) {
this.protocolData[this.data.state] = value;
},
},
},
};
</script>