initial commit
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
@page "/organization"
|
||||
@using Indotalent.Features.Organization.Employee.Components
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Indotalent.Infrastructure.Authorization.Identity
|
||||
@attribute [Authorize(Roles = $"{ApplicationRoles.Admin},{ApplicationRoles.Member}")]
|
||||
@using Indotalent.Features.Organization.Branch
|
||||
@using Indotalent.Features.Organization.Branch.Components
|
||||
@using Indotalent.Features.Organization.Department
|
||||
@using Indotalent.Features.Organization.Department.Components
|
||||
@using Indotalent.Features.Organization.Designation
|
||||
@using Indotalent.Features.Organization.Designation.Components
|
||||
@using MudBlazor
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<style>
|
||||
.clean-white-tabs .mud-tabs-toolbar {
|
||||
background-color: white !important;
|
||||
border-bottom: 2px solid #DCEBFA;
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
|
||||
.clean-white-tabs .mud-tab {
|
||||
color: #94a3b8 !important;
|
||||
text-transform: none;
|
||||
font-weight: 500;
|
||||
min-width: 160px;
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
|
||||
.clean-white-tabs .mud-tab-active {
|
||||
color: var(--mud-palette-primary) !important;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.clean-white-tabs .mud-tabs-slider {
|
||||
background-color: var(--mud-palette-primary) !important;
|
||||
height: 3px !important;
|
||||
bottom: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="mt-2 mb-8">
|
||||
|
||||
<div class="clean-white-tabs">
|
||||
<MudTabs Elevation="0"
|
||||
ActivePanelIndex="@_activeTabIndex"
|
||||
ActivePanelIndexChanged="OnTabChanged"
|
||||
ApplyEffectsToContainer="true"
|
||||
TabPanelsClass="pt-4">
|
||||
|
||||
<MudTabPanel Text="Branches" Icon="@Icons.Material.Outlined.LocationOn">
|
||||
<BranchPage />
|
||||
</MudTabPanel>
|
||||
|
||||
<MudTabPanel Text="Departments" Icon="@Icons.Material.Outlined.AccountTree">
|
||||
<DepartmentPage />
|
||||
</MudTabPanel>
|
||||
|
||||
<MudTabPanel Text="Designations" Icon="@Icons.Material.Outlined.Badge">
|
||||
<DesignationPage />
|
||||
</MudTabPanel>
|
||||
|
||||
<MudTabPanel Text="Employees" Icon="@Icons.Material.Outlined.Groups">
|
||||
<EmployeePage />
|
||||
</MudTabPanel>
|
||||
|
||||
</MudTabs>
|
||||
</div>
|
||||
</MudContainer>
|
||||
|
||||
@code {
|
||||
private int _activeTabIndex = 0;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var uri = NavigationManager.ToAbsoluteUri(NavigationManager.Uri);
|
||||
if (Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query).TryGetValue("tab", out var tabValue))
|
||||
{
|
||||
_activeTabIndex = tabValue.ToString().ToLower() switch
|
||||
{
|
||||
"branch" => 0,
|
||||
"department" => 1,
|
||||
"designation" => 2,
|
||||
"employee" => 3,
|
||||
_ => 0
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTabChanged(int index)
|
||||
{
|
||||
_activeTabIndex = index;
|
||||
string tabName = index switch
|
||||
{
|
||||
0 => "branch",
|
||||
1 => "department",
|
||||
2 => "designation",
|
||||
3 => "employee",
|
||||
_ => "branch"
|
||||
};
|
||||
|
||||
NavigationManager.NavigateTo($"/organization?tab={tabName}", replace: false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user