Update index.html
Browse files148 unmodified lines1491501511521531521531541551561571581581591601611 unmodified line1631641651661661671681695 unmodified lines1751761771781781791801813 unmodified lines1851861871881881891901915 unmodified lines1971981992002002012022 unmodified lines20520620720920820921121021321421521621721821922022122222322422522622722822923023123223323423523623723823924024124221121221321421521621721824624724824925025125225325425525625725825926026126226326426526626726826927027127227327427521922022122222322422527822622722823 unmodified lines25225325430825525625725831 unmodified lines29029129234629329429529612 unmodified lines3093103113653123133143 unmodified lines3183193203753213223234 unmodified lines3283293303863313323336 unmodified lines3403413423993433443453461 unmodified line34834935040735135235335441241335535635735835936011 unmodified lines37237337443137537637737812 unmodified lines3913923934503943953961 unmodified line3983994004584594604614624634644654664674014024034044054064074084094684104114126 unmodified lines41942042148142242342415 unmodified lines440441442503443444445148 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 id="dashboard-progress-bars" class="space-y-4"> <!-- تُعبأ ديناميكياً بدقة --> </div> </div> </div>
<!-- الجزئية المفقودة 1: تطور الأداء (مخطط خطي لـ 60 يوماً) --> <!-- مخطط تطور الأداء (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> <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> // ملفات البيانات العربية والإنجليزية بـ 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)) })) } { 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_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)) })) } { 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 lines insight_1_title: "تحسن ملحوظ", insight_1_desc: "مؤشر رضا المتعاملين تحسن بنسبة 15% خلال الفترة الماضية.", insight_2_title: "تنبيه", insight_2_desc: "مؤشر 'خفض زمن إنجاز المعاملات' يحتاج إلى تدخل سريع لتحقيق الهدف.", insight_2_desc: "مؤشر 'تطوير الكفاءات' يحتاج إلى تدخل سريع لتحقيق الهدف.", insight_3_title: "توصية", insight_3_desc: "يمكن تحسين أداء 3 مؤشرات من خلال زيادة الموارد المخصصة بنسبة 20%.", kpi_mgmt_title: "إدارة مؤشرات الأداء",31 unmodified lines insight_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_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 lines return currentLang === 'ar' ? data_ar : data_en; }
// تبديل اللغة وتحديث عناصر الصفحة function toggleLanguage() { currentLang = currentLang === 'ar' ? 'en' : 'ar'; const root = document.getElementById('html-root');3 unmodified lines document.getElementById('lang-btn-text').innerText = currentLang === 'ar' ? 'English' : 'عربي'; document.getElementById('search-input').placeholder = translations[currentLang].search_placeholder;
// تحديث جميع النصوص التي تحمل السمة data-i18n document.querySelectorAll('[data-i18n]').forEach(el => { const key = el.getAttribute('data-i18n'); if (translations[currentLang][key]) {4 unmodified lines renderAll(); }
// عرض أشرطة التقدم في لوحة التحكم 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="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.status.includes('Good') || item.status.includes('جيد'); let badgeColor = isGood ? 'bg-emerald-50 text-emerald-600' : 'bg-amber-50 text-amber-600'; 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 md:grid-cols-2 gap-4 text-xs text-gray-500 bg-gray-50 p-3 rounded-xl"> <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 }); }
// رسم المخطط الخطي لتطور الأداء (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 }; 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 lines renderPerformanceChart(data); }
// التشغيل الأولي عند فتح الصفحة renderAll(); </script></body>index.html+33-94