From e11a628c789ac930f1c3ac0e327e53e8a179fa64 Mon Sep 17 00:00:00 2001 From: DwCay Date: Mon, 29 May 2023 18:09:01 +0300 Subject: [PATCH] =?UTF-8?q?[WIP]=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D0=BE=D1=81=D1=82=D0=BE=D1=8F=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B8=20=D0=BF=D0=BE=D0=B4=D0=B2=D0=B8=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=20=D0=B7=D1=83=D0=B1=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ToothFormula/ToothConditionsInfo.vue | 27 + .../Forms/ToothFormula/ToothFormulaForm.vue | 23 +- .../Forms/ToothFormula/ToothFormulaTable.vue | 34 +- .../Forms/ToothFormula/ToothLowSvg.vue | 22 +- .../newMedicalCard/utils/gettersObjects.js | 8 + .../newMedicalCard/utils/medicalConfig.js | 53 +- src/store/modules/medicalCard.js | 7 +- src/store/modules/toothFormula.js | 660 ++++++++++++++++++ 8 files changed, 808 insertions(+), 26 deletions(-) create mode 100644 src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothConditionsInfo.vue create mode 100644 src/store/modules/toothFormula.js diff --git a/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothConditionsInfo.vue b/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothConditionsInfo.vue new file mode 100644 index 0000000..bd3b039 --- /dev/null +++ b/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothConditionsInfo.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaForm.vue b/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaForm.vue index 489c1be..e70bfc5 100644 --- a/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaForm.vue +++ b/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothFormulaForm.vue @@ -1,16 +1,25 @@ @@ -52,4 +78,10 @@ export default { border-right: 1px solid var(--border-light-grey-color) &:last-child border-right-width: 0 +.conditions + background-color: var(--bg-light-grey) + &:hover + background-color: var(--font-grey-color-0) + &.active + background-color: var(--btn-blue-color) diff --git a/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothLowSvg.vue b/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothLowSvg.vue index 9869493..f99a9b9 100644 --- a/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothLowSvg.vue +++ b/src/pages/newMedicalCard/components/InitialInspectionProtocol/Forms/ToothFormula/ToothLowSvg.vue @@ -4,7 +4,8 @@ :width="getSize.width", :height="getSize.height", :viewBox="getSize.viewBox", - fill="none", + :fill-opacity="opacity" + fill="#252850", xmlns="http://www.w3.org/2000/svg", ) path( @@ -34,9 +35,22 @@ export default { name: "ToothLowSvg", props: { - type: String, - position: String, - jaw: String, + opacity: { + type: Number, + default: 1, + }, + type: { + type: String, + default: "molars", + }, + position: { + type: String, + default: "left", + }, + jaw: { + type: String, + default: "upper", + }, }, computed: { getSize() { diff --git a/src/pages/newMedicalCard/utils/gettersObjects.js b/src/pages/newMedicalCard/utils/gettersObjects.js index 8d39f53..1cbb220 100644 --- a/src/pages/newMedicalCard/utils/gettersObjects.js +++ b/src/pages/newMedicalCard/utils/gettersObjects.js @@ -54,3 +54,11 @@ export function getConfidantObject(data) { }; } } + +export const getFiiledConditions = (condition) => { + let filledConditions = [ + ...Object.values(condition.crown).filter((val) => val), + ...Object.values(condition.root).filter((val) => val), + ]; + return filledConditions; +}; diff --git a/src/pages/newMedicalCard/utils/medicalConfig.js b/src/pages/newMedicalCard/utils/medicalConfig.js index 8b3faf4..8802fb3 100644 --- a/src/pages/newMedicalCard/utils/medicalConfig.js +++ b/src/pages/newMedicalCard/utils/medicalConfig.js @@ -933,6 +933,27 @@ export const protocolForms = [ component: "ToothFormulaForm", key: "toothFormula", state: "toothFormula", + toothConfig: { + conditions: { + К: "Кариес", + П: "Пульпит", + Пт: "Периодонтит", + Д: "Дефект", + Пл: "Пломба", + ИК: "Искусственная коронка", + ИЗ: "Искусственный зуб", + В: "Вкладка", + И: "Имплантат", + КЗ: "Корень зуба", + О: "Отсутствующий зуб", + }, + mobility: [ + { id: 1, label: "I" }, + { id: 2, label: "II" }, + { id: 3, label: "III" }, + { id: 4, label: "IV" }, + ], + }, formulaConfig: [ { name: "upper", @@ -1074,103 +1095,103 @@ export const protocolForms = [ columns: [ { type: "molars", - tooth_number: 48, + tooth_number: "48", dental_condition: "", tooth_mobility: "", }, { type: "molars", - tooth_number: 47, + tooth_number: "47", dental_condition: "", tooth_mobility: "", }, { type: "molars", - tooth_number: 46, + tooth_number: "46", dental_condition: "", tooth_mobility: "", }, { position: "left", type: "pre-molars", - tooth_number: 45, + tooth_number: "45", dental_condition: "", tooth_mobility: "", }, { position: "left", type: "pre-molars", - tooth_number: 44, + tooth_number: "44", dental_condition: "", tooth_mobility: "", }, { position: "left", type: "fangs", - tooth_number: 43, + tooth_number: "43", dental_condition: "", tooth_mobility: "", }, { type: "incisors", - tooth_number: 42, + tooth_number: "42", dental_condition: "", tooth_mobility: "", }, { type: "incisors", - tooth_number: 41, + tooth_number: "41", dental_condition: "", tooth_mobility: "", }, { type: "incisors", - tooth_number: 31, + tooth_number: "31", dental_condition: "", tooth_mobility: "", }, { type: "incisors", - tooth_number: 32, + tooth_number: "32", dental_condition: "", tooth_mobility: "", }, { position: "right", type: "fangs", - tooth_number: 33, + tooth_number: "33", dental_condition: "", tooth_mobility: "", }, { position: "right", type: "pre-molars", - tooth_number: 34, + tooth_number: "34", dental_condition: "", tooth_mobility: "", }, { position: "right", type: "pre-molars", - tooth_number: 35, + tooth_number: "35", dental_condition: "", tooth_mobility: "", }, { type: "molars", - tooth_number: 36, + tooth_number: "36", dental_condition: "", tooth_mobility: "", }, { type: "molars", - tooth_number: 37, + tooth_number: "37", dental_condition: "", tooth_mobility: "", }, { type: "molars", - tooth_number: 38, + tooth_number: "38", dental_condition: "", tooth_mobility: "", }, diff --git a/src/store/modules/medicalCard.js b/src/store/modules/medicalCard.js index 32a422b..429fad0 100644 --- a/src/store/modules/medicalCard.js +++ b/src/store/modules/medicalCard.js @@ -1,6 +1,7 @@ import { fetchWrapper } from "@/shared/fetchWrapper"; import { genderOptions } from "@/pages/newMedicalCard/utils/medicalConfig"; import { getConfidantObject } from "@/pages/newMedicalCard/utils/gettersObjects"; +import toothFormula from "@/store/modules/toothFormula"; const state = () => ({ medicalCard: {}, @@ -305,7 +306,8 @@ const getters = { }, }, toothFormula: { - lacticBite: true, + lacticBite: toothFormula.state.lacticBite, + formula: toothFormula.state.formula, }, }; }, @@ -334,7 +336,8 @@ const getters = { }, disease: null, toothFormula: { - lacticBite: false, + lacticBite: toothFormula.stateInit.lacticBite, + formula: toothFormula.stateInit.formula, }, }; }, diff --git a/src/store/modules/toothFormula.js b/src/store/modules/toothFormula.js new file mode 100644 index 0000000..a31a4c8 --- /dev/null +++ b/src/store/modules/toothFormula.js @@ -0,0 +1,660 @@ +const stateInit = { + lacticBite: false, + formula: { + 18: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 17: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 16: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 15: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 14: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 13: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 12: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 11: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 21: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 22: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 23: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 24: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 25: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 26: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 27: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 28: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 48: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 47: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 46: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 45: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 44: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 43: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 42: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 41: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 31: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 32: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 33: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 34: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 35: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 36: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 37: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + 38: { + dental_condition: { + general: null, + crown: { + central: null, + upper: null, + lower: null, + left: null, + right: null, + }, + root: { + central: null, + left: null, + right: null, + }, + }, + tooth_mobility: null, + }, + }, +}; + +const state = { + lacticBite: true, + formula: { + ...JSON.parse(JSON.stringify(stateInit.formula)), + 13: { + dental_condition: { + general: "О", + crown: { ...stateInit.formula["13"].dental_condition.crown }, + root: { ...stateInit.formula["13"].dental_condition.root }, + }, + tooth_mobility: 1, + }, + 12: { + dental_condition: { + general: "О", + crown: { ...stateInit.formula["12"].dental_condition.crown }, + root: { ...stateInit.formula["12"].dental_condition.root }, + }, + tooth_mobility: null, + }, + 11: { + dental_condition: { + general: "ИЗ", + crown: { + ...stateInit.formula["11"].dental_condition.crown, + central: "К", + }, + root: { ...stateInit.formula["11"].dental_condition.root }, + }, + tooth_mobility: null, + }, + 25: { + dental_condition: { + general: "ИЗ", + crown: { ...stateInit.formula["25"].dental_condition.crown }, + root: { ...stateInit.formula["25"].dental_condition.root }, + }, + tooth_mobility: 3, + }, + 43: { + dental_condition: { + general: "О", + crown: { ...stateInit.formula["43"].dental_condition.crown }, + root: { ...stateInit.formula["43"].dental_condition.root }, + }, + tooth_mobility: 3, + }, + 42: { + dental_condition: { + general: "О", + crown: { ...stateInit.formula["42"].dental_condition.crown }, + root: { ...stateInit.formula["42"].dental_condition.root }, + }, + tooth_mobility: null, + }, + 41: { + dental_condition: { + general: "ИЗ", + crown: { ...stateInit.formula["41"].dental_condition.crown }, + root: { ...stateInit.formula["41"].dental_condition.root, left: "П" }, + }, + tooth_mobility: null, + }, + 35: { + dental_condition: { + general: "ИЗ", + crown: { ...stateInit.formula["35"].dental_condition.crown }, + root: { ...stateInit.formula["35"].dental_condition.root }, + }, + tooth_mobility: null, + }, + }, +}; + +export default { + stateInit, + state, +};