final implementation of graphics to visualize the work in progress.
This commit is contained in:
parent
4f0b53a49d
commit
98593e22ed
|
|
@ -23,6 +23,14 @@ class userController extends Controller
|
|||
{
|
||||
public function EditProfile(Request $request){
|
||||
|
||||
// dump($request);
|
||||
|
||||
$user = User::find($request->userID);
|
||||
|
||||
$user->user_name = $request->fullName;
|
||||
$user->email = $request->email;
|
||||
$user->user_phone = $request->phone;
|
||||
$user->user_nif = $request->nif;
|
||||
|
||||
// $request->validate([
|
||||
// 'name' => 'required',
|
||||
|
|
@ -128,24 +136,26 @@ public function edit($id)
|
|||
|
||||
public function update(Request $request, User $user)
|
||||
{
|
||||
dump($request);
|
||||
// $request->validate([
|
||||
// 'name' => 'required',
|
||||
// 'email' => 'required|email|unique:users,email,' . $user->user_id,
|
||||
// 'password' => 'nullable|min:8|confirmed',
|
||||
// 'user_type' => 'required',
|
||||
// 'user_phone' => 'required',
|
||||
// 'user_nif' => 'required',
|
||||
// ]);
|
||||
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
'email' => 'required|email|unique:users,email,' . $user->user_id,
|
||||
'password' => 'nullable|min:8|confirmed',
|
||||
'user_type' => 'required',
|
||||
'user_phone' => 'required',
|
||||
'user_nif' => 'required',
|
||||
]);
|
||||
// $user->update([
|
||||
// 'name' => $request->get('name'),
|
||||
// 'email' => $request->get('email'),
|
||||
// 'password' => $request->filled('password') ? Hash::make($request->get('password')) : $user->password,
|
||||
// 'user_type' => $request->get('user_type'),
|
||||
// 'user_phone' => $request->get('user_phone'),
|
||||
// 'user_nif' => $request->get('user_nif'),
|
||||
// ]);
|
||||
|
||||
$user->update([
|
||||
'name' => $request->get('name'),
|
||||
'email' => $request->get('email'),
|
||||
'password' => $request->filled('password') ? Hash::make($request->get('password')) : $user->password,
|
||||
'user_type' => $request->get('user_type'),
|
||||
'user_phone' => $request->get('user_phone'),
|
||||
'user_nif' => $request->get('user_nif'),
|
||||
]);
|
||||
// $userUpdate->
|
||||
|
||||
return redirect('/users/listUsers')->with('success', 'Utilizadores atualizado com Sucesso!!');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,11 +19,14 @@ class TasksDashboard extends Component
|
|||
public $receiveElementalTasks; // Recebe todas as acoes ja feitas atualmente por tarefa
|
||||
public $receiveElementalTasksAll;// Recebe o total de tarefas que vamos fazer
|
||||
|
||||
public $countElementalTasks;
|
||||
public $countElementalTasksAll;
|
||||
public $lastUpdated;
|
||||
|
||||
// Por enquanto nao ira usar, vamos deixar
|
||||
// public $receiveAllFurtherTasks;
|
||||
|
||||
public $lastUpdated;
|
||||
|
||||
|
||||
// Deveria funcionar para receber o Repositorio.
|
||||
// public function initialize()
|
||||
|
|
@ -39,7 +42,7 @@ class TasksDashboard extends Component
|
|||
public function updateTimeGrafics()
|
||||
{
|
||||
// Data atual
|
||||
$this->lastUpdated = now()->toDateTimeString();
|
||||
$this->lastUpdated = now()->format('Y-m-d H:i');
|
||||
|
||||
// Chame o método para atualizar os dados dos gráficos
|
||||
$this->refreshDataEquipments($this->datasProject);
|
||||
|
|
@ -51,7 +54,6 @@ public function updateTimeGrafics()
|
|||
]);
|
||||
}
|
||||
|
||||
|
||||
// Graficos de porcentagem entre o valor atual de finalizadas com valor final de quantas faltam
|
||||
public function showPercentageElementalTasks()
|
||||
{
|
||||
|
|
@ -59,14 +61,10 @@ public function showPercentageElementalTasks()
|
|||
$this->dispatch('refreshPercentageElementalTasks', [
|
||||
'receiveElementalTasks' => $this->receiveElementalTasks,
|
||||
'receiveElementalTasksAll' => $this->receiveElementalTasksAll,
|
||||
|
||||
'countElementalTasksAll'=> $this->countElementalTasksAll
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function mount($datasProject)
|
||||
{
|
||||
$this->datasProject = $datasProject;
|
||||
|
|
@ -127,6 +125,13 @@ public function mount($datasProject)
|
|||
|
||||
// Agora, $newArray contém a contagem de tasks por elemental_tasks_code
|
||||
$this->receiveElementalTasksAll = $newArray1;
|
||||
|
||||
|
||||
// Criar o contador para receber o valor total.
|
||||
$this->countElementalTasksAll =array_sum($this->receiveElementalTasksAll);
|
||||
|
||||
|
||||
$this->lastUpdated = now()->format('Y-m-d H:i');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class WorkstationDashboard extends Component
|
|||
{
|
||||
public $receivefnishTasksInWorkstation;
|
||||
|
||||
public $test = 'batata';
|
||||
public $lastUpdated;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
|
|
@ -21,6 +21,9 @@ public function mount()
|
|||
->whereNotNull('departure_date')
|
||||
->get();
|
||||
|
||||
|
||||
$this->lastUpdated = now()->format('Y-m-d H:i');
|
||||
|
||||
// Inicializando um array para armazenar a contagem
|
||||
// $workstationCounts = [];
|
||||
|
||||
|
|
@ -39,8 +42,6 @@ public function mount()
|
|||
|
||||
// dump($workstationCounts);
|
||||
|
||||
|
||||
|
||||
$workstationCounts = ControlEquipmentWorkstation::select('id_workstations', DB::raw('count(*) as count'))
|
||||
->whereNotNull('id_workstations')
|
||||
->whereNotNull('entry_date')
|
||||
|
|
@ -67,7 +68,8 @@ public function updateData()
|
|||
// Atualize a variável com os novos dados
|
||||
$this->receivefnishTasksInWorkstation = [1, 2, 3];
|
||||
|
||||
$this->test = 'FUncionaa';
|
||||
// Data atual
|
||||
$this->lastUpdated = now()->format('Y-m-d H:i');
|
||||
|
||||
// Emita um evento com os novos dados
|
||||
$this->dispatch('updateChart', $this->receivefnishTasksInWorkstation);
|
||||
|
|
|
|||
|
|
@ -26,15 +26,7 @@ class User extends Authenticatable
|
|||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
// protected $fillable = [
|
||||
// 'name',
|
||||
// 'email',
|
||||
// 'password',
|
||||
// 'user_type',
|
||||
// 'user_phone',
|
||||
// 'user_nif'
|
||||
|
||||
// ];
|
||||
protected $fillable = ['user_name', 'email', 'password', 'user_phone', 'user_nif', 'type_users'];
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -100,6 +100,8 @@ class="bi bi-trash"></i></a>
|
|||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<input type="hidden" name="userID"
|
||||
value="{{ $user->user_id }}">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="fullName" class="col-md-4 col-lg-3 col-form-label">Nome e Apelido</label>
|
||||
|
|
|
|||
|
|
@ -1,25 +1,35 @@
|
|||
<div>
|
||||
<div class="row">
|
||||
{{-- Proxima implementacao --}}
|
||||
{{-- <div class="row">
|
||||
<div class="col-sm">
|
||||
<button wire:click="showPercentageElementalTasks">Grafico em porcentagem</button>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm d-flex justify-content-end">
|
||||
<button class="btn btn-primary mb-2" wire:click="updateTimeGrafics">
|
||||
<i class="fa-solid fa-arrows-rotate"></i>
|
||||
</button>
|
||||
<div
|
||||
style="font-size: 15px; color:#09255C; margin-left:4px; display: flex; align-items: center; justify-content: center; height: 50px;">
|
||||
{{ $lastUpdated }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row text-center">
|
||||
<div class="col-sm">
|
||||
<h6>Quantidade Tarefas Concluidas</h6>
|
||||
<p style="color:gray; font-size:13px"> Total de acções a serem realizadas por tarefa.</p>
|
||||
<p style="color:gray; font-size:13px">Total de acções já realizadas de acordo com a tarefa.</p>
|
||||
<canvas id="myPieChart2" width="50" height="50"></canvas>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<h6>Quantidade tarefas Acumuladas</h6>
|
||||
<p style="color:gray; font-size:13px">Total de acções já realizadas de acordo com a tarefa.</p>
|
||||
<p style="color:gray; font-size:13px"> Total de acções a serem realizadas por tarefa.</p>
|
||||
<canvas id="myPieChart3" width="50" height="50"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ $lastUpdated }}
|
||||
<button wire:click="updateTimeGrafics">Atualizar Gráfico</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
|
@ -145,8 +155,16 @@
|
|||
}]
|
||||
},
|
||||
options: {
|
||||
events: [], // Desativa todos os eventos
|
||||
}
|
||||
animation: false,
|
||||
plugins: {
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
tooltip: {
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
var elementalTasksCountAll = data.receiveElementalTasksAll;
|
||||
|
|
@ -171,22 +189,27 @@
|
|||
}]
|
||||
},
|
||||
options: {
|
||||
events: [], // Desativa todos os eventos
|
||||
title: {
|
||||
display: true, // Ativa a exibição do título
|
||||
text: 'Total', // Define o texto do título
|
||||
position: 'top' // Define a posição do título
|
||||
animation: false,
|
||||
plugins: {
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
tooltip: {
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{{-- Script de Gradico em porcentagem --}}
|
||||
<script>
|
||||
{{-- Script de Gradico em porcentagem , para proxima implementacao e ADD+ Esforco --}}
|
||||
{{-- <script>
|
||||
window.addEventListener('refreshPercentageElementalTasks', event => {
|
||||
|
||||
|
||||
|
||||
var data = event.detail[0];
|
||||
// Tarefas ja feitas
|
||||
if (myPieChart2) {
|
||||
myPieChart2.destroy(); // Destrua o gráfico antigo antes de criar um novo
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script> --}}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
<div>
|
||||
|
||||
<button wire:click="updateData">Atualizar Gráfico</button>
|
||||
<div class="row">
|
||||
<div class="col-sm d-flex justify-content-end">
|
||||
<button class="btn btn-primary mb-2" wire:click="updateData">
|
||||
<i class="fa-solid fa-arrows-rotate"></i>
|
||||
</button>
|
||||
<div
|
||||
style="font-size: 15px; color:#09255C; margin-left:4px; display: flex; align-items: center; justify-content: center; height: 50px;">
|
||||
{{ $lastUpdated }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<canvas id="myPieChart5" width="50" height="50"></canvas>
|
||||
|
||||
|
|
@ -37,7 +46,15 @@
|
|||
}]
|
||||
},
|
||||
options: {
|
||||
events: [], // Desativa todos os eventos
|
||||
}
|
||||
animation: false,
|
||||
plugins: {
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
tooltip: {
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
});
|
||||
|
||||
|
||||
Route::get('/', [ProjectoDatacontroller::class, ('HomePage')])->name('home');
|
||||
|
||||
|
||||
|
||||
|
|
@ -120,7 +121,7 @@
|
|||
Route::get('users/{id}/edit', 'edit')->name('users.edit');
|
||||
Route::put('users/{user}', 'update')->name('users.update');
|
||||
Route::delete('users/{user}', 'destroy')->name('users.destroy');
|
||||
Route::put('editProfile/{id}', 'EditProfile')->name('editProfile');
|
||||
Route::get('editProfile/{id}', 'EditProfile')->name('editProfile');
|
||||
});
|
||||
|
||||
Route::controller(CreateProjectController::class)
|
||||
|
|
@ -216,7 +217,7 @@
|
|||
// Mostrar Instalação click
|
||||
Route::get('units/{id}', [ProjectoDatacontroller::class, 'showUnit'])->name('showUnit');
|
||||
|
||||
Route::get('/', [ProjectoDatacontroller::class, ('HomePage')])->name('home');
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user