пластмассовый мир победил, мкет оказался сильней

master
Алексей Алексей 2026-05-16 20:04:06 +10:00
parent b0aca0e5d4
commit c08817d049
1 changed files with 26 additions and 2 deletions

View File

@ -40,7 +40,24 @@ impl Default for App{
Tab{ Tab{
tab_type: TabTypes::Worker, tab_type: TabTypes::Worker,
title: "Сотрудники".to_owned(), title: "Сотрудники".to_owned(),
},
Tab{
tab_type: TabTypes::Salary,
title:"Выплаты".to_owned(),
},
Tab{
tab_type: TabTypes::Position,
title: "Должности".to_owned(),
},
Tab{
tab_type: TabTypes::Recipe,
title: "Рецеты".to_owned(),
},
Tab{
tab_type: TabTypes::Product,
title: "Продукция".to_owned()
} }
]); ]);
Self{tree} Self{tree}
} }
@ -116,19 +133,23 @@ impl MainTabViewer{
} }
fn show_worker(&mut self, ui: &mut egui::Ui){ fn show_worker(&mut self, ui: &mut egui::Ui){
todo!()
}
fn show_position(&mut self, ui: &mut egui::Ui){
let rt = tokio::runtime::Runtime::new().unwrap(); let rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async{ rt.block_on(async{
for eq in self.positions.read().clone().unwrap().iter(){ for eq in self.positions.read().clone().unwrap().iter(){
ui.push_id(&eq.name, |ui|{ ui.push_id(&eq.name, |ui|{
egui::CollapsingHeader::new(&eq.name) egui::CollapsingHeader::new(&eq.name)
.default_open(false) .default_open(false)
.show(ui, |ui|{ .show(ui, |ui|{
ui.label(eq.wage.to_string()); ui.label(eq.wage.to_string());
}) })
}); });
} }
}) })
} }
fn show_salary(&mut self, ui: &mut egui::Ui){ fn show_salary(&mut self, ui: &mut egui::Ui){
ui.label("Salary"); ui.label("Salary");
@ -157,6 +178,9 @@ impl egui_dock::TabViewer for MainTabViewer{
}, },
TabTypes::Material => { TabTypes::Material => {
&self.show_material(ui); &self.show_material(ui);
},
TabTypes::Position =>{
&self.show_position(ui);
} }
_ =>{ _ =>{
ui.label("This is not"); ui.label("This is not");