Update index.html
Browse files148 unmodified lines1491501511521531541551561571581591601611 unmodified line1631641651661671681695 unmodified lines1751761771781791801813 unmodified lines1851861871881891901915 unmodified lines1971981992002012022032 unmodified lines20620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028123 unmodified lines30530630730830931031131 unmodified lines34334434534634734834912 unmodified lines3623633643653663673683 unmodified lines3723733743753763773784 unmodified lines3833843853863873883896 unmodified lines3963973983994004014021 unmodified line40440540640740840941041141241341441541611 unmodified lines42842943043143243343412 unmodified lines4474484494504514524531 unmodified line4554564574584594604614624634644654664674684694704716 unmodified lines47847948048148248348415 unmodified lines500501502503504505506148 unmodified lines<!-- أداء المؤشرات (Progress Bars) --><div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm lg:col-span-2"><h3 class="font-bold text-gray-800 mb-6" data-i18n="kpi_performance">أداء المؤشرات الرئيسية</h3><div id="dashboard-progress-bars" class="space-y-5"><!-- تُعبأ ديناميكياً --></div></div></div><!-- الجزئية المفقودة 1: تطور الأداء (مخطط خطي لـ 60 يوماً) --><div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm space-y-4"><h3 class="font-bold text-gray-800" data-i18n="perf_evolution">تطور الأداء (خلال 60 يوماً)</h3><div class="w-full h-64">1 unmodified line</div></div><!-- الجزئية المفقودة 2: التحليلات الذكية (رؤى مدعومة بالذكاء الاصطناعي) --><div class="space-y-4"><h3 class="font-bold text-gray-800 text-lg flex items-center gap-2">✨ <span data-i18n="ai_insights_title">التحليلات الذكية (رؤى مدعومة بالذكاء الاصطناعي)</span>5 unmodified lines</div><div class="bg-white p-5 rounded-2xl border border-gray-100 shadow-sm border-r-4 border-r-amber-500 space-y-2"><h4 class="font-bold text-amber-600 text-sm" data-i18n="insight_2_title">تنبيه</h4><p class="text-xs text-gray-600" data-i18n="insight_2_desc">مؤشر "خفض زمن إنجاز المعاملات" يحتاج إلى تدخل سريع لتحقيق الهدف.</p></div><div class="bg-white p-5 rounded-2xl border border-gray-100 shadow-sm border-r-4 border-r-blue-500 space-y-2"><h4 class="font-bold text-blue-600 text-sm" data-i18n="insight_3_title">توصية</h4>3 unmodified lines</div></section><!-- ================= الواجهة الثانية: مؤشرات الأداء ================= --><section id="view-kpis" class="space-y-6 hidden"><div class="flex justify-between items-center"><div>5 unmodified lines</div></div><!-- قائمة بطاقات المؤشرات --><div id="kpi-cards-container" class="space-y-4"><!-- تُعبأ ديناميكياً --></div>2 unmodified lines</div></main><!-- البرمجية والبيانات المدمجة --><script>// ملفات البيانات العربية والإنجليزية بـ 60 عينة يوميةconst data_ar = [{kpi_id: "KPI_01",kpi_name: "تحسين رضا المتعاملين",description: "قياس مستوى رضا المتعاملين من خلال استبيانات دورية",department: "إدارة خدمة المتعاملين",target: 90,status: "جيد",latest_value: 85.0,daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(90, 72 + (i * 0.25)) }))},{kpi_id: "KPI_02",kpi_name: "رقمنة الخدمات الحكومية",description: "نسبة الخدمات المتاحة رقمياً من إجمالي الخدمات",department: "إدارة التحول الرقمي",target: 95,status: "جيد",latest_value: 92.0,daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(95, 80 + (i * 0.2)) }))},{kpi_id: "KPI_03",kpi_name: "خفض زمن إنجاز المعاملات",description: "متوسط الوقت المستغرق لإنجاز المعاملات الحكومية",department: "إدارة العمليات",target: 80,status: "يحتاج متابعة",latest_value: 65.0,daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(80, 50 + (i * 0.25)) }))}];const data_en = [{kpi_id: "KPI_01",kpi_name: "Customer Satisfaction Improvement",description: "Measuring customer satisfaction level through periodic surveys",department: "Customer Service Department",target: 90,status: "Good",latest_value: 85.0,daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(90, 72 + (i * 0.25)) }))},{kpi_id: "KPI_02",kpi_name: "Government Services Digitalization",description: "Percentage of digitally available services out of total services",department: "Digital Transformation Department",target: 95,status: "Good",latest_value: 92.0,daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(95, 80 + (i * 0.2)) }))},{kpi_id: "KPI_03",kpi_name: "Transaction Processing Time Reduction",description: "Average time taken to complete government transactions",department: "Operations Department",target: 80,status: "Needs Follow-up",latest_value: 65.0,daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(80, 50 + (i * 0.25)) }))}];// ترجمات الواجهة للغتينconst translations = {ar: {page_title: "منصة الأداء - رؤية 2030",23 unmodified linesinsight_1_title: "تحسن ملحوظ",insight_1_desc: "مؤشر رضا المتعاملين تحسن بنسبة 15% خلال الفترة الماضية.",insight_2_title: "تنبيه",insight_2_desc: "مؤشر 'خفض زمن إنجاز المعاملات' يحتاج إلى تدخل سريع لتحقيق الهدف.",insight_3_title: "توصية",insight_3_desc: "يمكن تحسين أداء 3 مؤشرات من خلال زيادة الموارد المخصصة بنسبة 20%.",kpi_mgmt_title: "إدارة مؤشرات الأداء",31 unmodified linesinsight_1_title: "Notable Improvement",insight_1_desc: "Customer satisfaction KPI improved by 15% over the past period.",insight_2_title: "Alert",insight_2_desc: "Transaction time reduction KPI needs prompt intervention.",insight_3_title: "Recommendation",insight_3_desc: "Performance of 3 KPIs can be improved by increasing allocated resources by 20%.",kpi_mgmt_title: "KPIs Management",12 unmodified linesreturn currentLang === 'ar' ? data_ar : data_en;}// تبديل اللغة وتحديث عناصر الصفحةfunction toggleLanguage() {currentLang = currentLang === 'ar' ? 'en' : 'ar';const root = document.getElementById('html-root');3 unmodified linesdocument.getElementById('lang-btn-text').innerText = currentLang === 'ar' ? 'English' : 'عربي';document.getElementById('search-input').placeholder = translations[currentLang].search_placeholder;// تحديث جميع النصوص التي تحمل السمة data-i18ndocument.querySelectorAll('[data-i18n]').forEach(el => {const key = el.getAttribute('data-i18n');if (translations[currentLang][key]) {4 unmodified linesrenderAll();}// عرض أشرطة التقدم في لوحة التحكمfunction renderDashboardProgress(data) {const container = document.getElementById('dashboard-progress-bars');container.innerHTML = '';6 unmodified lines<span class="font-bold text-gray-700">${item.kpi_name}</span><span class="text-gray-500">${targetText}: ${item.target}% (<span class="font-bold text-gray-800">${item.latest_value}%</span>)</span></div><div class="w-full bg-gray-100 h-3 rounded-full overflow-hidden"><div class="${color} h-full rounded-full transition-all duration-500" style="width: ${item.latest_value}%"></div></div></div>1 unmodified line});}// عرض قائمة المؤشرات في واجهة المؤشراتfunction renderKPIsList(data) {const container = document.getElementById('kpi-cards-container');container.innerHTML = '';data.forEach(item => {let isGood = item.status.includes('Good') || item.status.includes('جيد');let badgeColor = isGood ? 'bg-emerald-50 text-emerald-600' : 'bg-amber-50 text-amber-600';const t = translations[currentLang];container.innerHTML += `<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm space-y-4">11 unmodified lines</div></div><div class="grid grid-cols-2 md:grid-cols-2 gap-4 text-xs text-gray-500 bg-gray-50 p-3 rounded-xl"><div>${t.dept_label}: <span class="font-bold text-gray-700">${item.department}</span></div><div>${t.target_label}: <span class="font-bold text-gray-700">${item.target}%</span></div></div>12 unmodified lines});}// رسم المخطط الخطي لتطور الأداء (Chart.js)function renderPerformanceChart(data) {const ctx = document.getElementById('performanceChart').getContext('2d');if (chartInstance) {1 unmodified line}const labels = data[0].daily_history.map(d => `Day ${d.day}`);const datasets = data.map((kpi, idx) => {const colors = ['#0D9488', '#3B82F6', '#10B981'];return {label: kpi.kpi_name,data: kpi.daily_history.map(d => d.value),borderColor: colors[idx % colors.length],backgroundColor: colors[idx % colors.length],tension: 0.3,borderWidth: 2};});chartInstance = new Chart(ctx, {type: 'line',6 unmodified lines});}// التنقل بين الأقسامfunction switchTab(tab) {if(tab === 'dashboard') {document.getElementById('view-dashboard').classList.remove('hidden');15 unmodified linesrenderPerformanceChart(data);}// التشغيل الأولي عند فتح الصفحةrenderAll();</script></body>148 unmodified lines1491501511521531541551561571581591601611 unmodified line1631641651661671681695 unmodified lines1751761771781791801813 unmodified lines1851861871881891901915 unmodified lines1971981992002012022 unmodified lines20520620720820921021121221321421521621721821922022122222322422522622722823 unmodified lines25225325425525625725831 unmodified lines29029129229329429529612 unmodified lines3093103113123133143 unmodified lines3183193203213223234 unmodified lines3283293303313323336 unmodified lines3403413423433443453461 unmodified line34834935035135235335435535635735835936011 unmodified lines37237337437537637737812 unmodified lines3913923933943953961 unmodified line3983994004014024034044054064074084094104114126 unmodified lines41942042142242342415 unmodified lines440441442443444445148 unmodified lines<!-- أداء المؤشرات (Progress Bars) --><div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm lg:col-span-2"><h3 class="font-bold text-gray-800 mb-6" data-i18n="kpi_performance">أداء المؤشرات الرئيسية</h3><div id="dashboard-progress-bars" class="space-y-4"><!-- تُعبأ ديناميكياً بدقة --></div></div></div><!-- مخطط تطور الأداء (60 يوماً) --><div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm space-y-4"><h3 class="font-bold text-gray-800" data-i18n="perf_evolution">تطور الأداء (خلال 60 يوماً)</h3><div class="w-full h-64">1 unmodified line</div></div><!-- التحليلات الذكية --><div class="space-y-4"><h3 class="font-bold text-gray-800 text-lg flex items-center gap-2">✨ <span data-i18n="ai_insights_title">التحليلات الذكية (رؤى مدعومة بالذكاء الاصطناعي)</span>5 unmodified lines</div><div class="bg-white p-5 rounded-2xl border border-gray-100 shadow-sm border-r-4 border-r-amber-500 space-y-2"><h4 class="font-bold text-amber-600 text-sm" data-i18n="insight_2_title">تنبيه</h4><p class="text-xs text-gray-600" data-i18n="insight_2_desc">مؤشر "تطوير الكفاءات" يحتاج إلى تدخل سريع لتحقيق الهدف.</p></div><div class="bg-white p-5 rounded-2xl border border-gray-100 shadow-sm border-r-4 border-r-blue-500 space-y-2"><h4 class="font-bold text-blue-600 text-sm" data-i18n="insight_3_title">توصية</h4>3 unmodified lines</div></section><!-- ================= واجهة مؤشرات الأداء ================= --><section id="view-kpis" class="space-y-6 hidden"><div class="flex justify-between items-center"><div>5 unmodified lines</div></div><div id="kpi-cards-container" class="space-y-4"><!-- تُعبأ ديناميكياً --></div>2 unmodified lines</div></main><!-- البرمجية والبيانات المدمجة للـ 5 مؤشرات --><script>const data_ar = [{ kpi_name: "تحسين رضا المتعاملين", description: "قياس مستوى رضا المتعاملين من خلال استبيانات دورية", department: "إدارة خدمة المتعاملين", target: 90, latest_value: 85, status: "جيد", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(90, 70 + (i * 0.3)) })) },{ kpi_name: "رقمنة الخدمات الحكومية", description: "نسبة الخدمات المتاحة رقمياً من إجمالي الخدمات", department: "إدارة التحول الرقمي", target: 95, latest_value: 92, status: "جيد", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(95, 78 + (i * 0.25)) })) },{ kpi_name: "خفض زمن إنجاز المعاملات", description: "متوسط الوقت المستغرق لإنجاز المعاملات الحكومية", department: "إدارة العمليات", target: 80, latest_value: 65, status: "يحتاج متابعة", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(80, 45 + (i * 0.35)) })) },{ kpi_name: "تطوير الكفاءات الوطنية", description: "نسبة الموظفين الحاصلين على التدريب المتخصص", department: "إدارة الموارد البشرية", target: 85, latest_value: 45, status: "متأخر", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(85, 30 + (i * 0.25)) })) },{ kpi_name: "تحقيق الاستدامة المالية", description: "كفاءة ترشيد الإنفاق وتحقيق مستهدفات الميزانية", department: "الإدارة المالية", target: 85, latest_value: 78, status: "يحتاج متابعة", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(85, 60 + (i * 0.3)) })) }];const data_en = [{ kpi_name: "Customer Satisfaction Improvement", description: "Measuring customer satisfaction level through periodic surveys", department: "Customer Service Department", target: 90, latest_value: 85, status: "Good", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(90, 70 + (i * 0.3)) })) },{ kpi_name: "Government Services Digitalization", description: "Percentage of digitally available services out of total services", department: "Digital Transformation Department", target: 95, latest_value: 92, status: "Good", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(95, 78 + (i * 0.25)) })) },{ kpi_name: "Transaction Processing Time Reduction", description: "Average time taken to complete government transactions", department: "Operations Department", target: 80, latest_value: 65, status: "Needs Follow-up", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(80, 45 + (i * 0.35)) })) },{ kpi_name: "National Competencies Development", description: "Percentage of employees receiving specialized training", department: "Human Resources", target: 85, latest_value: 45, status: "Delayed", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(85, 30 + (i * 0.25)) })) },{ kpi_name: "Financial Sustainability Achievement", description: "Efficiency of spending rationalization and budget targets", department: "Financial Department", target: 85, latest_value: 78, status: "Needs Follow-up", daily_history: Array.from({length: 60}, (_, i) => ({ day: i+1, value: Math.min(85, 60 + (i * 0.3)) })) }];const translations = {ar: {page_title: "منصة الأداء - رؤية 2030",23 unmodified linesinsight_1_title: "تحسن ملحوظ",insight_1_desc: "مؤشر رضا المتعاملين تحسن بنسبة 15% خلال الفترة الماضية.",insight_2_title: "تنبيه",insight_2_desc: "مؤشر 'تطوير الكفاءات' يحتاج إلى تدخل سريع لتحقيق الهدف.",insight_3_title: "توصية",insight_3_desc: "يمكن تحسين أداء 3 مؤشرات من خلال زيادة الموارد المخصصة بنسبة 20%.",kpi_mgmt_title: "إدارة مؤشرات الأداء",31 unmodified linesinsight_1_title: "Notable Improvement",insight_1_desc: "Customer satisfaction KPI improved by 15% over the past period.",insight_2_title: "Alert",insight_2_desc: "National competencies KPI needs prompt intervention.",insight_3_title: "Recommendation",insight_3_desc: "Performance of 3 KPIs can be improved by increasing allocated resources by 20%.",kpi_mgmt_title: "KPIs Management",12 unmodified linesreturn currentLang === 'ar' ? data_ar : data_en;}function toggleLanguage() {currentLang = currentLang === 'ar' ? 'en' : 'ar';const root = document.getElementById('html-root');3 unmodified linesdocument.getElementById('lang-btn-text').innerText = currentLang === 'ar' ? 'English' : 'عربي';document.getElementById('search-input').placeholder = translations[currentLang].search_placeholder;document.querySelectorAll('[data-i18n]').forEach(el => {const key = el.getAttribute('data-i18n');if (translations[currentLang][key]) {4 unmodified linesrenderAll();}function renderDashboardProgress(data) {const container = document.getElementById('dashboard-progress-bars');container.innerHTML = '';6 unmodified lines<span class="font-bold text-gray-700">${item.kpi_name}</span><span class="text-gray-500">${targetText}: ${item.target}% (<span class="font-bold text-gray-800">${item.latest_value}%</span>)</span></div><div class="w-full bg-gray-100 h-2.5 rounded-full overflow-hidden"><div class="${color} h-full rounded-full transition-all duration-500" style="width: ${item.latest_value}%"></div></div></div>1 unmodified line});}function renderKPIsList(data) {const container = document.getElementById('kpi-cards-container');container.innerHTML = '';data.forEach(item => {let isGood = item.latest_value >= 80;let isMedium = item.latest_value >= 60 && item.latest_value < 80;let badgeColor = isGood ? 'bg-emerald-50 text-emerald-600' : (isMedium ? 'bg-amber-50 text-amber-600' : 'bg-red-50 text-red-600');const t = translations[currentLang];container.innerHTML += `<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm space-y-4">11 unmodified lines</div></div><div class="grid grid-cols-2 gap-4 text-xs text-gray-500 bg-gray-50 p-3 rounded-xl"><div>${t.dept_label}: <span class="font-bold text-gray-700">${item.department}</span></div><div>${t.target_label}: <span class="font-bold text-gray-700">${item.target}%</span></div></div>12 unmodified lines});}function renderPerformanceChart(data) {const ctx = document.getElementById('performanceChart').getContext('2d');if (chartInstance) {1 unmodified line}const labels = data[0].daily_history.map(d => `Day ${d.day}`);const colors = ['#0D9488', '#3B82F6', '#10B981', '#F59E0B', '#EF4444'];const datasets = data.map((kpi, idx) => ({label: kpi.kpi_name,data: kpi.daily_history.map(d => d.value),borderColor: colors[idx % colors.length],backgroundColor: colors[idx % colors.length],tension: 0.3,borderWidth: 2}));chartInstance = new Chart(ctx, {type: 'line',6 unmodified lines});}function switchTab(tab) {if(tab === 'dashboard') {document.getElementById('view-dashboard').classList.remove('hidden');15 unmodified linesrenderPerformanceChart(data);}renderAll();</script></body>
index.html+33-94