[WIP] Добавил отображение дефектов Пт и П

This commit is contained in:
DwCay
2023-06-14 18:09:33 +03:00
parent 987ac0ad82
commit 747a822ecc
7 changed files with 465 additions and 229 deletions

View File

@@ -79,3 +79,40 @@ export const getFilledConditions = (condition) => {
});
return filledConditions;
};
export function getToothImageConfig(data) {
let resulConfig = {};
Object.keys(data).forEach((key) => {
if (key === "general") {
resulConfig[key] = data[key];
} else {
let crownParts = {};
Object.keys(data[key]).forEach((part) => {
if (data[key][part].includes("П") || data[key][part].includes("Пт")) {
crownParts[part] = {
fill: "#FF6565",
injury: true,
};
} else if (
data[key][part].includes("Д") ||
data[key][part].includes("Пл") ||
data[key][part].includes("Кз")
) {
crownParts[part] = {
fill: "##FFB931",
injury: false,
};
} else {
crownParts[part] = {
fill: "#D3D4DC",
injury: false,
};
}
});
resulConfig[key] = {
...crownParts,
};
}
});
return resulConfig;
}