File size: 51,190 Bytes
4337bba | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | <!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard SESMT</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.sidebar {
transition: all 0.3s;
}
.sidebar-collapsed {
width: 70px;
}
.sidebar-expanded {
width: 220px;
}
.main-content {
transition: all 0.3s;
}
.content-collapsed {
margin-left: 70px;
}
.content-expanded {
margin-left: 220px;
}
.chart-container {
position: relative;
height: 280px;
}
.card-hover:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.status-badge {
width: 12px;
height: 12px;
border-radius: 50%;
display: inline-block;
}
.status-active {
background-color: #10B981;
}
.status-warning {
background-color: #F59E0B;
}
.status-danger {
background-color: #EF4444;
}
.compact-card {
padding: 1rem;
}
.compact-chart {
height: 240px;
}
.notification-badge {
position: absolute;
top: -5px;
right: -5px;
width: 18px;
height: 18px;
border-radius: 50%;
background-color: #EF4444;
color: white;
font-size: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.progress-bar {
height: 6px;
border-radius: 3px;
background-color: #E5E7EB;
overflow: hidden;
}
.progress-fill {
height: 100%;
border-radius: 3px;
}
.filter-dropdown {
display: none;
position: absolute;
right: 0;
top: 100%;
background-color: white;
border: 1px solid #E5E7EB;
border-radius: 0.5rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
z-index: 10;
min-width: 200px;
padding: 0.5rem;
}
.filter-dropdown.show {
display: block;
}
</style>
</head>
<body class="bg-gray-50">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div id="sidebar" class="sidebar sidebar-expanded bg-blue-800 text-white flex flex-col">
<div class="p-4 flex items-center justify-between border-b border-blue-700">
<div class="flex items-center">
<i class="fas fa-shield-alt text-2xl mr-3"></i>
<span id="logo-text" class="text-xl font-bold">SESMT</span>
</div>
<button id="toggle-sidebar" class="text-white focus:outline-none">
<i class="fas fa-bars"></i>
</button>
</div>
<div class="flex-1 overflow-y-auto py-4">
<nav>
<div class="px-4 mb-6">
<div class="text-xs uppercase font-semibold text-blue-300 tracking-wider mb-2 px-2" id="menu-title">Menu Principal</div>
<ul>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg bg-blue-700 text-white">
<i class="fas fa-chart-pie mr-3"></i>
<span id="dashboard-text" class="font-medium">Dashboard</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 text-white">
<i class="fas fa-home mr-3"></i>
<span id="home-text" class="font-medium">Início</span>
</a>
</li>
</ul>
</div>
<div class="px-4 mb-6">
<div class="text-xs uppercase font-semibold text-blue-300 tracking-wider mb-2 px-2" id="modules-title">Módulos</div>
<ul>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 text-white">
<i class="fas fa-user mr-3"></i>
<span id="employees-text" class="font-medium">Colaboradores</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 text-white">
<i class="fas fa-graduation-cap mr-3"></i>
<span id="trainings-text" class="font-medium">Treinamentos</span>
<span class="notification-badge">3</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 text-white">
<i class="fas fa-exchange-alt mr-3"></i>
<span id="role-change-text" class="font-medium">Mudança de Função</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 text-white">
<i class="fas fa-search mr-3"></i>
<span id="research-text" class="font-medium">Pesquisa</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 text-white">
<i class="fas fa-building mr-3"></i>
<span id="third-party-text" class="font-medium">Terceiros</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 text-white">
<i class="fas fa-chart-bar mr-3"></i>
<span id="reports-text" class="font-medium">Relatórios</span>
</a>
</li>
</ul>
</div>
<div class="px-4 mb-6">
<div class="text-xs uppercase font-semibold text-blue-300 tracking-wider mb-2 px-2" id="config-title">Configurações</div>
<ul>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 text-white">
<i class="fas fa-cog mr-3"></i>
<span id="settings-text" class="font-medium">Configurações</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 text-white">
<i class="fas fa-question-circle mr-3"></i>
<span id="help-text" class="font-medium">Ajuda</span>
</a>
</li>
</ul>
</div>
</nav>
</div>
<div class="p-4 border-t border-blue-700">
<div class="flex items-center">
<div class="relative">
<img src="https://randomuser.me/api/portraits/women/44.jpg" alt="User" class="w-8 h-8 rounded-full mr-2">
<span class="status-badge status-active absolute bottom-0 right-2 border-2 border-blue-800"></span>
</div>
<div id="user-info">
<div class="text-sm font-medium">Ana Silva</div>
<div class="text-xs text-blue-300">Admin</div>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div id="main-content" class="main-content content-expanded flex-1 overflow-y-auto">
<div class="p-4">
<!-- Header -->
<div class="flex justify-between items-center mb-4">
<div>
<h1 class="text-xl font-bold text-gray-800">Dashboard SESMT</h1>
<p class="text-sm text-gray-500">Bem-vindo de volta, Ana. Aqui está o resumo da sua empresa.</p>
</div>
<div class="flex space-x-2 relative">
<button id="export-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-3 py-1.5 rounded-lg flex items-center text-sm">
<i class="fas fa-download mr-1"></i>
<span>Exportar</span>
</button>
<button id="filter-btn" class="border border-gray-300 hover:bg-gray-100 text-gray-700 px-3 py-1.5 rounded-lg flex items-center text-sm">
<i class="fas fa-filter mr-1"></i>
<span>Filtrar</span>
</button>
<div id="filter-dropdown" class="filter-dropdown">
<div class="mb-2">
<label class="block text-xs font-medium text-gray-700 mb-1">Filtrar por Empresa</label>
<select id="company-filter" class="w-full border border-gray-300 rounded-lg px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-blue-500">
<option value="all">Todas as Empresas</option>
<option value="empresa-a">Empresa A</option>
<option value="empresa-b">Empresa B</option>
<option value="empresa-c">Empresa C</option>
<option value="empresa-d">Empresa D</option>
<option value="empresa-e">Empresa E</option>
<option value="empresa-f">Empresa F</option>
</select>
</div>
<div class="flex justify-end">
<button id="apply-filter" class="bg-blue-600 text-white px-3 py-1 rounded text-xs">Aplicar</button>
</div>
</div>
<button class="relative border border-gray-300 hover:bg-gray-100 text-gray-700 px-3 py-1.5 rounded-lg flex items-center text-sm">
<i class="fas fa-bell"></i>
<span class="notification-badge">5</span>
</button>
</div>
</div>
<!-- Summary Cards -->
<div id="summary-cards" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-4">
<!-- Cards will be updated dynamically -->
</div>
<!-- Charts Row 1 -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 mb-4">
<!-- Employees by Sector -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300 card-hover">
<div class="flex justify-between items-center mb-3">
<div>
<h3 class="text-base font-semibold text-gray-800">Colaboradores por Setor</h3>
<p class="text-xs text-gray-500">Distribuição de colaboradores por área da empresa</p>
</div>
<select id="sector-year" class="border border-gray-300 rounded-lg px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-blue-500">
<option>2023</option>
<option>2022</option>
<option>2021</option>
</select>
</div>
<div class="chart-container compact-chart">
<canvas id="sectorChart"></canvas>
</div>
</div>
<!-- Employees by Function -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300 card-hover">
<div class="flex justify-between items-center mb-3">
<div>
<h3 class="text-base font-semibold text-gray-800">Colaboradores por Função</h3>
<p class="text-xs text-gray-500">Distribuição por nível hierárquico</p>
</div>
<select id="function-sector" class="border border-gray-300 rounded-lg px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-blue-500">
<option>Todos setores</option>
<option>Produção</option>
<option>RH</option>
<option>Financeiro</option>
</select>
</div>
<div class="chart-container compact-chart">
<canvas id="functionChart"></canvas>
</div>
</div>
</div>
<!-- Charts Row 2 -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 mb-4">
<!-- Employees by Company -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300 card-hover">
<div class="flex justify-between items-center mb-3">
<div>
<h3 class="text-base font-semibold text-gray-800">Colaboradores por Empresa</h3>
<p class="text-xs text-gray-500">Distribuição entre empresas do grupo</p>
</div>
<div class="flex space-x-1">
<button id="direct-btn" class="px-2 py-1 bg-blue-100 text-blue-700 rounded-lg text-xs">Diretos</button>
<button id="third-party-btn" class="px-2 py-1 bg-gray-100 text-gray-700 rounded-lg text-xs">Terceiros</button>
</div>
</div>
<div class="chart-container compact-chart">
<canvas id="companyChart"></canvas>
</div>
</div>
<!-- Contract Time Distribution -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300 card-hover">
<div class="flex justify-between items-center mb-3">
<div>
<h3 class="text-base font-semibold text-gray-800">Distribuição de Tempo de Contrato</h3>
<p class="text-xs text-gray-500">Tempo de permanência na empresa</p>
</div>
<select id="contract-status" class="border border-gray-300 rounded-lg px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-blue-500">
<option>Todos</option>
<option>Ativos</option>
<option>Desligados</option>
</select>
</div>
<div class="chart-container compact-chart">
<canvas id="contractChart"></canvas>
</div>
</div>
</div>
<!-- Status Overview -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300 mb-4">
<div class="flex justify-between items-center mb-3">
<div>
<h3 class="text-base font-semibold text-gray-800">Visão Geral por Status</h3>
<p class="text-xs text-gray-500">Distribuição de colaboradores por status e setor</p>
</div>
<div class="flex space-x-2">
<div class="flex items-center">
<span class="status-badge status-active mr-1"></span>
<span class="text-xs">Ativo</span>
</div>
<div class="flex items-center">
<span class="status-badge status-warning mr-1"></span>
<span class="text-xs">Férias</span>
</div>
<div class="flex items-center">
<span class="status-badge status-danger mr-1"></span>
<span class="text-xs">Desligado</span>
</div>
</div>
</div>
<div class="chart-container compact-chart">
<canvas id="statusChart"></canvas>
</div>
</div>
<!-- Recent Activities -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300">
<div class="flex justify-between items-center mb-3">
<h3 class="text-base font-semibold text-gray-800">Atividades Recentes</h3>
<button class="text-blue-600 text-xs font-medium">Ver todas</button>
</div>
<div class="space-y-4">
<div class="flex items-start">
<div class="bg-blue-100 p-2 rounded-lg mr-3">
<i class="fas fa-user-plus text-blue-600 text-sm"></i>
</div>
<div class="flex-1">
<div class="flex justify-between">
<p class="text-sm font-medium text-gray-800">Novo colaborador cadastrado</p>
<span class="text-xs text-gray-500">10 min atrás</span>
</div>
<p class="text-xs text-gray-500 mt-1">João Silva foi cadastrado no setor de Produção</p>
</div>
</div>
<div class="flex items-start">
<div class="bg-yellow-100 p-2 rounded-lg mr-3">
<i class="fas fa-graduation-cap text-yellow-600 text-sm"></i>
</div>
<div class="flex-1">
<div class="flex justify-between">
<p class="text-sm font-medium text-gray-800">Treinamento vencido</p>
<span class="text-xs text-gray-500">1 hora atrás</span>
</div>
<p class="text-xs text-gray-500 mt-1">NR-10 vencida para 5 colaboradores</p>
</div>
</div>
<div class="flex items-start">
<div class="bg-green-100 p-2 rounded-lg mr-3">
<i class="fas fa-exchange-alt text-green-600 text-sm"></i>
</div>
<div class="flex-1">
<div class="flex justify-between">
<p class="text-sm font-medium text-gray-800">Mudança de função</p>
<span class="text-xs text-gray-500">2 horas atrás</span>
</div>
<p class="text-xs text-gray-500 mt-1">Maria Souza promovida a Gerente de RH</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// Sample data for different companies
const companyData = {
'all': {
totalEmployees: 1248,
activeEmployees: 1120,
vacationEmployees: 85,
terminatedEmployees: 43,
companies: 12,
mainCompany: 856,
thirdParty: 392,
trainingStatus: 87,
trainingOnTime: 72,
trainingSoon: 15,
trainingExpired: 13,
avgContractTime: 3.2,
newestContract: '2 meses',
oldestContract: '15 anos',
sectorData: [420, 150, 120, 85, 180, 95, 65, 133],
functionData: [580, 120, 210, 85, 150, 15, 88],
companyData: [856, 120, 85, 62, 45, 80],
contractData: [180, 420, 260, 150, 120, 118],
statusData: {
active: [380, 135, 105, 75, 150, 80],
vacation: [25, 10, 8, 5, 15, 8],
terminated: [15, 5, 7, 5, 15, 7]
}
},
'empresa-a': {
totalEmployees: 856,
activeEmployees: 800,
vacationEmployees: 40,
terminatedEmployees: 16,
companies: 1,
mainCompany: 856,
thirdParty: 0,
trainingStatus: 92,
trainingOnTime: 80,
trainingSoon: 12,
trainingExpired: 8,
avgContractTime: 4.1,
newestContract: '1 mês',
oldestContract: '12 anos',
sectorData: [350, 80, 70, 60, 100, 60, 50, 86],
functionData: [400, 80, 150, 60, 100, 10, 56],
companyData: [856, 0, 0, 0, 0, 0],
contractData: [100, 300, 200, 100, 80, 76],
statusData: {
active: [300, 100, 80, 60, 120, 60],
vacation: [30, 5, 5, 3, 10, 5],
terminated: [20, 5, 5, 2, 10, 5]
}
},
'empresa-b': {
totalEmployees: 120,
activeEmployees: 110,
vacationEmployees: 8,
terminatedEmployees: 2,
companies: 1,
mainCompany: 120,
thirdParty: 0,
trainingStatus: 85,
trainingOnTime: 70,
trainingSoon: 15,
trainingExpired: 15,
avgContractTime: 2.5,
newestContract: '3 meses',
oldestContract: '8 anos',
sectorData: [50, 20, 15, 10, 15, 5, 0, 5],
functionData: [80, 10, 15, 5, 10, 0, 0],
companyData: [0, 120, 0, 0, 0, 0],
contractData: [30, 50, 20, 10, 5, 5],
statusData: {
active: [40, 15, 10, 5, 15, 5],
vacation: [5, 3, 2, 1, 2, 0],
terminated: [5, 2, 3, 1, 1, 0]
}
},
// Add data for other companies similarly...
};
// Current selected company
let currentCompany = 'all';
let sectorChart, functionChart, companyChart, contractChart, statusChart;
// Toggle sidebar
document.getElementById('toggle-sidebar').addEventListener('click', function() {
const sidebar = document.getElementById('sidebar');
const mainContent = document.getElementById('main-content');
if (sidebar.classList.contains('sidebar-expanded')) {
sidebar.classList.remove('sidebar-expanded');
sidebar.classList.add('sidebar-collapsed');
mainContent.classList.remove('content-expanded');
mainContent.classList.add('content-collapsed');
// Hide text elements in sidebar
document.querySelectorAll('#logo-text, #menu-title, #dashboard-text, #home-text, #modules-title, #employees-text, #trainings-text, #role-change-text, #research-text, #third-party-text, #reports-text, #config-title, #settings-text, #help-text, #user-info').forEach(el => {
el.style.display = 'none';
});
} else {
sidebar.classList.remove('sidebar-collapsed');
sidebar.classList.add('sidebar-expanded');
mainContent.classList.remove('content-collapsed');
mainContent.classList.add('content-expanded');
// Show text elements in sidebar
document.querySelectorAll('#logo-text, #menu-title, #dashboard-text, #home-text, #modules-title, #employees-text, #trainings-text, #role-change-text, #research-text, #third-party-text, #reports-text, #config-title, #settings-text, #help-text, #user-info').forEach(el => {
el.style.display = 'block';
});
}
});
// Toggle filter dropdown
document.getElementById('filter-btn').addEventListener('click', function(e) {
e.stopPropagation();
document.getElementById('filter-dropdown').classList.toggle('show');
});
// Close filter dropdown when clicking outside
document.addEventListener('click', function(e) {
if (!e.target.closest('#filter-dropdown') && !e.target.closest('#filter-btn')) {
document.getElementById('filter-dropdown').classList.remove('show');
}
});
// Apply filter
document.getElementById('apply-filter').addEventListener('click', function() {
currentCompany = document.getElementById('company-filter').value;
updateDashboard();
document.getElementById('filter-dropdown').classList.remove('show');
});
// Update dashboard with filtered data
function updateDashboard() {
const data = companyData[currentCompany];
// Update summary cards
document.getElementById('summary-cards').innerHTML = `
<!-- Total Employees -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300 card-hover compact-card">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500 text-xs font-medium">Total Colaboradores</p>
<h2 class="text-2xl font-bold text-gray-800 mt-1">${data.totalEmployees.toLocaleString()}</h2>
<div class="flex items-center mt-1">
<span class="text-green-500 text-xs font-medium mr-1">+5.2%</span>
<span class="text-gray-500 text-xs">vs último mês</span>
</div>
</div>
<div class="bg-blue-100 p-2 rounded-lg">
<i class="fas fa-users text-blue-600 text-lg"></i>
</div>
</div>
<div class="mt-3">
<div class="progress-bar">
<div class="progress-fill bg-blue-500" style="width: ${Math.round((data.activeEmployees/data.totalEmployees)*100)}%"></div>
</div>
<div class="flex justify-between mt-2">
<div class="flex items-center text-xs text-gray-500">
<span class="status-badge status-active mr-1"></span>
<span>Ativos: ${data.activeEmployees}</span>
</div>
<div class="flex items-center text-xs text-gray-500">
<span class="status-badge status-warning mr-1"></span>
<span>Férias: ${data.vacationEmployees}</span>
</div>
<div class="flex items-center text-xs text-gray-500">
<span class="status-badge status-danger mr-1"></span>
<span>Desligados: ${data.terminatedEmployees}</span>
</div>
</div>
</div>
</div>
<!-- Companies -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300 card-hover compact-card">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500 text-xs font-medium">Empresas</p>
<h2 class="text-2xl font-bold text-gray-800 mt-1">${data.companies}</h2>
<div class="flex items-center mt-1">
<span class="text-green-500 text-xs font-medium mr-1">+2</span>
<span class="text-gray-500 text-xs">novas este ano</span>
</div>
</div>
<div class="bg-green-100 p-2 rounded-lg">
<i class="fas fa-building text-green-600 text-lg"></i>
</div>
</div>
<div class="mt-3">
<div class="progress-bar">
<div class="progress-fill bg-green-500" style="width: ${Math.round((data.mainCompany/data.totalEmployees)*100)}%"></div>
</div>
<div class="flex justify-between mt-2">
<div class="flex items-center text-xs text-gray-500">
<span class="font-medium mr-1">Principal:</span>
<span>${data.mainCompany}</span>
</div>
<div class="flex items-center text-xs text-gray-500">
<span class="font-medium mr-1">Terceiros:</span>
<span>${data.thirdParty}</span>
</div>
</div>
</div>
</div>
<!-- Training Status -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300 card-hover compact-card">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500 text-xs font-medium">Status Treinamentos</p>
<h2 class="text-2xl font-bold text-gray-800 mt-1">${data.trainingStatus}%</h2>
<div class="flex items-center mt-1">
<span class="text-red-500 text-xs font-medium mr-1">-3%</span>
<span class="text-gray-500 text-xs">vs último mês</span>
</div>
</div>
<div class="bg-yellow-100 p-2 rounded-lg">
<i class="fas fa-graduation-cap text-yellow-600 text-lg"></i>
</div>
</div>
<div class="mt-3">
<div class="progress-bar">
<div class="progress-fill bg-yellow-500" style="width: ${data.trainingStatus}%"></div>
</div>
<div class="flex justify-between mt-2">
<div class="flex items-center text-xs text-gray-500">
<span class="status-badge status-active mr-1"></span>
<span>Em dia: ${data.trainingOnTime}%</span>
</div>
<div class="flex items-center text-xs text-gray-500">
<span class="status-badge status-warning mr-1"></span>
<span>Próximo: ${data.trainingSoon}%</span>
</div>
<div class="flex items-center text-xs text-gray-500">
<span class="status-badge status-danger mr-1"></span>
<span>Vencido: ${data.trainingExpired}%</span>
</div>
</div>
</div>
</div>
<!-- Average Contract Time -->
<div class="bg-white rounded-lg shadow-sm p-4 transition-all duration-300 card-hover compact-card">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500 text-xs font-medium">Tempo Médio Contrato</p>
<h2 class="text-2xl font-bold text-gray-800 mt-1">${data.avgContractTime} anos</h2>
<div class="flex items-center mt-1">
<span class="text-green-500 text-xs font-medium mr-1">+0.4</span>
<span class="text-gray-500 text-xs">vs ano passado</span>
</div>
</div>
<div class="bg-purple-100 p-2 rounded-lg">
<i class="fas fa-clock text-purple-600 text-lg"></i>
</div>
</div>
<div class="mt-3">
<div class="progress-bar">
<div class="progress-fill bg-purple-500" style="width: ${Math.min(100, data.avgContractTime * 10)}%"></div>
</div>
<div class="flex justify-between mt-2">
<div class="flex items-center text-xs text-gray-500">
<span class="font-medium mr-1">Mais novo:</span>
<span>${data.newestContract}</span>
</div>
<div class="flex items-center text-xs text-gray-500">
<span class="font-medium mr-1">Mais antigo:</span>
<span>${data.oldestContract}</span>
</div>
</div>
</div>
</div>
`;
// Update charts
updateCharts();
}
// Update charts with filtered data
function updateCharts() {
const data = companyData[currentCompany];
// Sector Chart
sectorChart.data.datasets[0].data = data.sectorData;
sectorChart.update();
// Function Chart
functionChart.data.datasets[0].data = data.functionData;
functionChart.update();
// Company Chart
companyChart.data.datasets[0].data = data.companyData;
companyChart.update();
// Contract Chart
contractChart.data.datasets[0].data = data.contractData;
contractChart.update();
// Status Chart
statusChart.data.datasets[0].data = data.statusData.active;
statusChart.data.datasets[1].data = data.statusData.vacation;
statusChart.data.datasets[2].data = data.statusData.terminated;
statusChart.update();
}
// Initialize charts when DOM is loaded
document.addEventListener('DOMContentLoaded', function() {
// Sector Chart (Bar)
const sectorCtx = document.getElementById('sectorChart').getContext('2d');
sectorChart = new Chart(sectorCtx, {
type: 'bar',
data: {
labels: ['Produção', 'RH', 'Financeiro', 'TI', 'Logística', 'Manutenção', 'Qualidade', 'Comercial'],
datasets: [{
label: 'Colaboradores',
data: companyData.all.sectorData,
backgroundColor: [
'rgba(59, 130, 246, 0.7)',
'rgba(16, 185, 129, 0.7)',
'rgba(245, 158, 11, 0.7)',
'rgba(139, 92, 246, 0.7)',
'rgba(20, 184, 166, 0.7)',
'rgba(244, 63, 94, 0.7)',
'rgba(217, 70, 239, 0.7)',
'rgba(6, 182, 212, 0.7)'
],
borderColor: [
'rgba(59, 130, 246, 1)',
'rgba(16, 185, 129, 1)',
'rgba(245, 158, 11, 1)',
'rgba(139, 92, 246, 1)',
'rgba(20, 184, 166, 1)',
'rgba(244, 63, 94, 1)',
'rgba(217, 70, 239, 1)',
'rgba(6, 182, 212, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true,
grid: {
display: true,
drawBorder: false
},
ticks: {
stepSize: 100
}
},
x: {
grid: {
display: false
}
}
},
plugins: {
legend: {
display: false
},
tooltip: {
callbacks: {
label: function(context) {
return context.parsed.y + ' colaboradores';
}
}
}
}
}
});
// Function Chart (Doughnut)
const functionCtx = document.getElementById('functionChart').getContext('2d');
functionChart = new Chart(functionCtx, {
type: 'doughnut',
data: {
labels: ['Operador', 'Supervisor', 'Analista', 'Gerente', 'Assistente', 'Diretor', 'Estagiário'],
datasets: [{
data: companyData.all.functionData,
backgroundColor: [
'rgba(59, 130, 246, 0.7)',
'rgba(16, 185, 129, 0.7)',
'rgba(245, 158, 11, 0.7)',
'rgba(139, 92, 246, 0.7)',
'rgba(20, 184, 166, 0.7)',
'rgba(244, 63, 94, 0.7)',
'rgba(217, 70, 239, 0.7)'
],
borderColor: [
'rgba(59, 130, 246, 1)',
'rgba(16, 185, 129, 1)',
'rgba(245, 158, 11, 1)',
'rgba(139, 92, 246, 1)',
'rgba(20, 184, 166, 1)',
'rgba(244, 63, 94, 1)',
'rgba(217, 70, 239, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right',
labels: {
boxWidth: 12,
padding: 10,
font: {
size: 10
}
}
},
tooltip: {
callbacks: {
label: function(context) {
const label = context.label || '';
const value = context.raw || 0;
const total = context.dataset.data.reduce((a, b) => a + b, 0);
const percentage = Math.round((value / total) * 100);
return `${label}: ${value} (${percentage}%)`;
}
}
}
},
cutout: '65%'
}
});
// Company Chart (Horizontal Bar)
const companyCtx = document.getElementById('companyChart').getContext('2d');
companyChart = new Chart(companyCtx, {
type: 'bar',
data: {
labels: ['Empresa A', 'Empresa B', 'Empresa C', 'Empresa D', 'Empresa E', 'Empresa F'],
datasets: [{
label: 'Colaboradores',
data: companyData.all.companyData,
backgroundColor: 'rgba(59, 130, 246, 0.7)',
borderColor: 'rgba(59, 130, 246, 1)',
borderWidth: 1
}]
},
options: {
indexAxis: 'y',
responsive: true,
maintainAspectRatio: false,
scales: {
x: {
beginAtZero: true,
grid: {
display: true,
drawBorder: false
}
},
y: {
grid: {
display: false
}
}
},
plugins: {
legend: {
display: false
},
tooltip: {
callbacks: {
label: function(context) {
return context.parsed.x + ' colaboradores';
}
}
}
}
}
});
// Contract Time Chart (Line)
const contractCtx = document.getElementById('contractChart').getContext('2d');
contractChart = new Chart(contractCtx, {
type: 'line',
data: {
labels: ['< 1 ano', '1-3 anos', '3-5 anos', '5-7 anos', '7-10 anos', '> 10 anos'],
datasets: [{
label: 'Colaboradores',
data: companyData.all.contractData,
fill: true,
backgroundColor: 'rgba(59, 130, 246, 0.2)',
borderColor: 'rgba(59, 130, 246, 1)',
tension: 0.4,
pointBackgroundColor: 'rgba(59, 130, 246, 1)',
pointBorderColor: '#fff',
pointHoverRadius: 5,
pointRadius: 4
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true,
grid: {
display: true,
drawBorder: false
}
},
x: {
grid: {
display: false
}
}
},
plugins: {
legend: {
display: false
},
tooltip: {
callbacks: {
label: function(context) {
return context.parsed.y + ' colaboradores';
}
}
}
}
}
});
// Status Overview Chart (Stacked Bar)
const statusCtx = document.getElementById('statusChart').getContext('2d');
statusChart = new Chart(statusCtx, {
type: 'bar',
data: {
labels: ['Produção', 'RH', 'Financeiro', 'TI', 'Logística', 'Manutenção'],
datasets: [
{
label: 'Ativo',
data: companyData.all.statusData.active,
backgroundColor: 'rgba(16, 185, 129, 0.7)',
borderColor: 'rgba(16, 185, 129, 1)',
borderWidth: 1
},
{
label: 'Férias',
data: companyData.all.statusData.vacation,
backgroundColor: 'rgba(245, 158, 11, 0.7)',
borderColor: 'rgba(245, 158, 11, 1)',
borderWidth: 1
},
{
label: 'Desligado',
data: companyData.all.statusData.terminated,
backgroundColor: 'rgba(239, 68, 68, 0.7)',
borderColor: 'rgba(239, 68, 68, 1)',
borderWidth: 1
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
x: {
stacked: true,
grid: {
display: false
}
},
y: {
stacked: true,
beginAtZero: true,
grid: {
display: true,
drawBorder: false
}
}
},
plugins: {
legend: {
position: 'bottom',
labels: {
boxWidth: 12,
padding: 10,
font: {
size: 10
}
}
},
tooltip: {
callbacks: {
afterBody: function(context) {
const dataset = context[0];
const total = dataset.dataset.data.reduce((a, b) => a + b, 0);
const percentage = Math.round((dataset.raw / total) * 100);
return `Total: ${total}\nPercentual: ${percentage}%`;
}
}
}
}
}
});
// Initialize dashboard with all data
updateDashboard();
// Make charts responsive to window resize
window.addEventListener('resize', function() {
sectorChart.resize();
functionChart.resize();
companyChart.resize();
contractChart.resize();
statusChart.resize();
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=SFDFASDF/sesmt" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |