From 409c882383945afcd20a610dbfaacc91204af138 Mon Sep 17 00:00:00 2001 From: ultrageese Date: Sun, 21 Jun 2026 19:29:39 +1000 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B9=20=D0=B4=D0=B0=20=D0=BA=20=D1=87?= =?UTF-8?q?=D1=91=D1=80=D1=82=D1=83=20=D0=B5=D1=89=D1=91=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D1=8B=20=D0=BD=D0=B0=D0=BF=D0=B8=D1=88=D1=83=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D0=BE=D0=B7=D0=B6=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++--- code/src/main.rs | 1 - code/src/payment_tab.rs | 53 -------------------------------------- code/src/production_tab.rs | 4 +-- code/src/recipe_tab.rs | 4 --- 5 files changed, 3 insertions(+), 65 deletions(-) delete mode 100644 code/src/payment_tab.rs diff --git a/README.md b/README.md index 1958a8a..4228103 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ # Система управления пивоварней Система позволяет вести учёт: -- [ ] Оборудования +- [x] Оборудования - [x] Сотрудников - [x] Сырья - [ ] Произведённой продукции -- [ ] Доходов от продажи продукции - [x] Зарплат сотрудникам Помимо этого, система позволяет: -- [ ] Составлять рецепты, используя доступное сырьё и оборудование +- [x] Составлять рецепты, используя доступное сырьё и оборудование - [ ] Использовать рецепты при учёте произведённой продукции, позволяя отслеживать, сколько и какого сырья потребуется на производство определённого объёма продукции. - diff --git a/code/src/main.rs b/code/src/main.rs index 03d8aec..8fc69ef 100644 --- a/code/src/main.rs +++ b/code/src/main.rs @@ -5,7 +5,6 @@ mod app; mod database; mod material_tab; mod models; -mod payment_tab; mod production_tab; mod recipe_tab; mod reports; diff --git a/code/src/payment_tab.rs b/code/src/payment_tab.rs deleted file mode 100644 index 73550d1..0000000 --- a/code/src/payment_tab.rs +++ /dev/null @@ -1,53 +0,0 @@ -use crate::{ - database::DBOperator, - tab::{TABS_CAN_BE_WINDOWS, Tab, TabTypes}, -}; -/* - * Я не придумал, зачем я сделал данный файл. Мой глупый разум решил, что он нужен. - */ -pub struct PaymentTabViewer { - db_oper: DBOperator, - is_admin: bool, - rt: tokio::runtime::Runtime, -} -impl PaymentTabViewer { - pub fn new(is_admin: bool) -> Self { - Self { - is_admin, - ..Default::default() - } - } -} -impl egui_dock::TabViewer for PaymentTabViewer { - type Tab = Tab; - fn title(&mut self, tab: &mut Self::Tab) -> egui::WidgetText { - (&*tab.title).into() - } - fn ui(&mut self, ui: &mut egui::Ui, tab: &mut Self::Tab) { - match &tab.tab_type { - _ => { - ui.label("Nope"); - } - } - } - fn id(&mut self, tab: &mut Self::Tab) -> egui::Id { - egui::Id::new(&tab.title) - } - fn allowed_in_windows(&self, _tab: &mut Self::Tab) -> bool { - TABS_CAN_BE_WINDOWS - } - fn is_closeable(&self, _tab: &Self::Tab) -> bool { - !self.is_admin - } -} -impl Default for PaymentTabViewer { - fn default() -> Self { - let rt = tokio::runtime::Runtime::new().unwrap(); - let db_oper = rt.block_on(async { DBOperator::new().await }); - Self { - db_oper, - rt, - is_admin: false, - } - } -} diff --git a/code/src/production_tab.rs b/code/src/production_tab.rs index e435206..ee5e12f 100644 --- a/code/src/production_tab.rs +++ b/code/src/production_tab.rs @@ -1,3 +1 @@ -pub struct ProductionTabViewer { - is_admin: bool, -} +struct ProductionTabViewer {} diff --git a/code/src/recipe_tab.rs b/code/src/recipe_tab.rs index 02a9d52..88cb906 100644 --- a/code/src/recipe_tab.rs +++ b/code/src/recipe_tab.rs @@ -23,7 +23,6 @@ pub struct RecipeTabViewer { db_oper: DBOperator, recipes: Arc>>, - recipe_elements: Arc>>, materials: Arc>>, equipment: Arc>>, @@ -299,9 +298,6 @@ impl Default for RecipeTabViewer { recipes: Arc::new(RwLock::new( rt.block_on(async { db_oper.get_recipes().await.unwrap_or(Vec::new()) }), )), - recipe_elements: Arc::new(RwLock::new( - rt.block_on(async { db_oper.get_recipe_elements().await.unwrap_or(Vec::new()) }), - )), materials: Arc::new(RwLock::new( rt.block_on(async { db_oper.get_materials().await.unwrap_or(Vec::new()) }), )),