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