wip calculator

This commit is contained in:
salam committed 2026-09-05 16:15:18 +02:00
1 parent 3d3748c353
commit 217636b564
14 files changed
+146 -230

No files matched your search

+24 -23
View File
@@ -2,35 +2,29 @@
namespace App\Livewire;
use Illuminate\Support\Facades\Log;
use Livewire\Component;
class BoardDispatcher extends Component
{
public array $lists = [];
public array $destLabels = ['DR', 'MR', 'RW', 'DC', 'DM', 'MC', 'AM', 'SW', 'DC', 'DM', 'MC', 'AM', 'SM', 'ST', 'DC', 'DM', 'MC', 'AM', 'DL', 'ML', 'LM'];
public string $boardVersion = '';
public function mount()
public function mount(array $filters)
{
$this->boardVersion = uniqid();
$this->lists['source-1'] = [
['id' => '1', 'name' => 'Source Item A', 'origin' => 'source-1'],
['id' => '2', 'name' => 'Source Item B', 'origin' => 'source-1'],
];
$this->lists['source-2'] = [
['id' => '3', 'name' => 'Source Item C', 'origin' => 'source-2'],
];
$this->lists['source-3'] = [
['id' => '4', 'name' => 'Source Item D', 'origin' => 'source-3'],
['id' => '5', 'name' => 'Source Item E', 'origin' => 'source-3'],
];
$this->lists['source-4'] = [
['id' => '6', 'name' => 'Source Item F', 'origin' => 'source-4'],
];
$this->lists = PlayerCalculator::load($filters);
for ($i = 1; $i <= 21; $i++) {
$this->lists["dest-{$i}"] = [];
$active = [2, 4, 6, 9, 10, 11, 12, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 30, 32, 34];
for ($i = 1; $i <= 35; $i++) {
if (in_array($i, $active))
$this->lists["dest-{$i}"] = [];
else
$this->lists["blind-{$i}"] = [];
}
}
@@ -74,6 +68,10 @@ class BoardDispatcher extends Component
{
$itemId = (string) $itemId;
// Log::info($this->boardVersion);
// Log::info('itemId, currentListId', [$itemId, $currentListId]);
// Log::info('OLD LIST', $this->lists);
if (! isset($this->lists[$currentListId])) {
$this->boardVersion = uniqid();
@@ -93,12 +91,15 @@ class BoardDispatcher extends Component
if ($foundItem && isset($this->lists[$foundItem['origin']])) {
// Nur zurücklegen, wenn die Quelle wirklich frei ist
if (count($this->lists[$foundItem['origin']]) < 1) {
array_unshift($this->lists[$foundItem['origin']], $foundItem);
} else {
// Ausfallsicherheit gegen Datenverlust: Zurück in die Bucht schieben
array_unshift($this->lists[$currentListId], $foundItem);
}
array_unshift($this->lists[$foundItem['origin']], $foundItem);
// if (count($this->lists[$foundItem['origin']]) < 2) {
// Log::info('origin');
// array_unshift($this->lists[$foundItem['origin']], $foundItem);
// } else {
// // Ausfallsicherheit gegen Datenverlust: Zurück in die Bucht schieben
// array_unshift($this->lists[$currentListId], $foundItem);
// Log::info('box');
// }
}
$this->boardVersion = uniqid();