Update index.html
Browse files12345678910112 unmodified lines141516171819202122232425261 unmodified line282930313233343536373839404142431 unmodified line4546474849505152534 unmodified lines58596061626364656667686970714 unmodified lines76777879808182834 unmodified lines88899091929394953 unmodified lines991001011021031041051063 unmodified lines1101111121131141151161174 unmodified lines1221231241251261271282 unmodified lines13113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321410 unmodified lines2252262272282292302312322332342352362372382392402412422431 unmodified line2452462472482492508 unmodified lines259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295<!DOCTYPE html><html lang="ar" dir="rtl"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>منصة الأداء - رؤية 2030</title><!-- استدعاء Tailwind CSS للتصميم الاحترافي المطابق للصورة --><script src="https://cdn.tailwindcss.com"></script><link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap" rel="stylesheet"><style>body { font-family: 'Cairo', sans-serif; background-color: #f8fafc; }2 unmodified lines<body class="flex h-screen overflow-hidden"><!-- القائمة الجانبية (Sidebar) --><aside class="w-64 bg-white border-l border-gray-200 flex flex-col justify-between hidden md:flex"><div><!-- ترويسة الشعار --><div class="p-6 flex items-center justify-between border-b border-gray-100"><div class="text-right"><h1 class="text-lg font-bold text-teal-700">منصة الأداء</h1><p class="text-xs text-gray-400">رؤية 2030</p></div><div class="w-9 h-9 rounded-xl bg-teal-600 flex items-center justify-center text-white font-bold">✨</div></div>1 unmodified line<!-- روابط التنقل --><nav class="p-4 space-y-2"><button onclick="switchTab('dashboard')" id="btn-dashboard" class="w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-semibold transition bg-teal-700 text-white shadow-sm">📊 لوحة التحكم</button><button onclick="switchTab('kpis')" id="btn-kpis" class="w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-semibold transition text-gray-600 hover:bg-gray-50">📈 مؤشرات الأداء</button><button class="w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-semibold text-gray-600 hover:bg-gray-50">📋 إدارة المهام</button><button class="w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-semibold text-gray-600 hover:bg-gray-50">📑 التقارير</button></nav></div>1 unmodified line<!-- معلومات المستخدم في أسفل القائمة --><div class="p-4 border-t border-gray-100 flex items-center gap-3"><div class="w-10 h-10 rounded-full bg-teal-700 text-white flex items-center justify-center font-bold">أ</div><div class="text-right"><h4 class="text-sm font-bold text-gray-800">أحمد العتيبي</h4><p class="text-xs text-gray-500">مدير الأداء</p></div></div></aside>4 unmodified lines<!-- الشريط العلوى (Navbar) --><header class="bg-white border-b border-gray-200 px-8 py-4 flex items-center justify-between sticky top-0 z-10"><div class="flex items-center gap-4 w-1/3"><input type="text" placeholder="البحث عن مؤشرات، مهام، أو تقارير..." class="w-full bg-gray-50 border border-gray-200 rounded-xl px-4 py-2 text-sm focus:outline-none focus:border-teal-600"></div><!-- زر رفع ملف الـ JSON الديناميكي --><div class="flex items-center gap-4"><label class="bg-teal-50 text-teal-700 border border-teal-200 px-4 py-2 rounded-xl text-sm font-bold cursor-pointer hover:bg-teal-100 transition">📁 رفع ملف JSON<input type="file" id="jsonUpload" accept=".json" class="hidden" onchange="loadJSON(event)"></label><span class="text-sm text-gray-500">🔔</span></div></header>4 unmodified lines<!-- ================= الواجهة الأولى: لوحة التحكم ================= --><section id="view-dashboard" class="space-y-8"><div><h2 class="text-xl font-bold text-gray-800">لوحة التحكم</h2><p class="text-sm text-gray-500">نظرة شاملة على مؤشرات الأداء الرئيسية</p></div><!-- البطاقات الأربع العلوية -->4 unmodified lines<span class="text-xs font-bold text-emerald-600 bg-emerald-50 px-2 py-1 rounded-lg">+12% ↗</span></div><div class="mt-4"><h3 class="text-2xl font-bold text-gray-800" id="stat-total">24</h3><p class="text-xs text-gray-500 mt-1">إجمالي المؤشرات</p></div></div>3 unmodified lines<span class="text-xs font-bold text-emerald-600 bg-emerald-50 px-2 py-1 rounded-lg">+8% ↗</span></div><div class="mt-4"><h3 class="text-2xl font-bold text-gray-800" id="stat-completed">18</h3><p class="text-xs text-gray-500 mt-1">المؤشرات المكتملة</p></div></div>3 unmodified lines<span class="text-xs font-bold text-red-600 bg-red-50 px-2 py-1 rounded-lg">-2% ↘</span></div><div class="mt-4"><h3 class="text-2xl font-bold text-gray-800" id="stat-delayed">3</h3><p class="text-xs text-gray-500 mt-1">المؤشرات المتأخرة</p></div></div>4 unmodified lines</div><div class="mt-4"><h3 class="text-2xl font-bold text-gray-800">75%</h3><p class="text-xs text-gray-500 mt-1">نسبة الإنجاز</p></div></div></div>2 unmodified lines<div class="grid grid-cols-1 lg:grid-cols-3 gap-6"><!-- توزيع الحالات --><div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm"><h3 class="font-bold text-gray-800 mb-4">توزيع الحالات</h3><div class="flex flex-col items-center justify-center py-6"><div class="w-36 h-36 rounded-full border-8 border-teal-500 border-t-amber-500 border-l-red-500 flex items-center justify-center"><span class="text-sm font-bold text-gray-700">الحالة العامة</span></div></div><div class="flex justify-around text-xs text-gray-600 mt-4"><span class="flex items-center gap-1"><i class="w-2.5 h-2.5 rounded-full bg-emerald-500 inline-block"></i> جيد (18)</span><span class="flex items-center gap-1"><i class="w-2.5 h-2.5 rounded-full bg-amber-500 inline-block"></i> متوسط (3)</span><span class="flex items-center gap-1"><i class="w-2.5 h-2.5 rounded-full bg-red-500 inline-block"></i> متأخر (3)</span></div></div><!-- أداء المؤشرات (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">أداء المؤشرات الرئيسية</h3><div id="dashboard-progress-bars" class="space-y-5"><!-- سيتم تعبئتها ديناميكياً من الـ JSON --></div></div></div></section><!-- ================= الواجهة الثانية: مؤشرات الأداء (إدارة المؤشرات) ================= --><section id="view-kpis" class="space-y-6 hidden"><div class="flex justify-between items-center"><div><h2 class="text-xl font-bold text-gray-800">إدارة مؤشرات الأداء</h2><p class="text-sm text-gray-500">إنشاء ومتابعة وتحليل مؤشرات الأداء الرئيسية</p></div><div class="flex gap-3"><button class="bg-teal-700 text-white px-4 py-2 rounded-xl text-sm font-bold shadow-sm hover:bg-teal-800 transition">+ إنشاء مؤشر جديد</button></div></div><!-- قائمة بطاقات المؤشرات --><div id="kpi-cards-container" class="space-y-4"><!-- تُعبأ تلقائياً ديناميكياً --></div></section></div></main><!-- سكربت التشغيل الديناميكي وقراءة الـ JSON --><script>// بيانات افتراضية أساسية تتوافق مع ملفاتكlet defaultData = [{ kpi_name: "تحسين رضا المتعاملين", description: "قياس مستوى رضا المتعاملين من خلال استبيانات دورية", department: "إدارة خدمة المتعاملين", target: 90, current: 85, date: "2026-12-31", status: "جيد" },{ kpi_name: "رقمنة الخدمات الحكومية", description: "نسبة الخدمات المتاحة رقمياً من إجمالي الخدمات", department: "إدارة التحول الرقمي", target: 95, current: 92, date: "2026-10-15", status: "جيد" },{ kpi_name: "خفض زمن إنجاز المعاملات", description: "متوسط الوقت المستغرق لإنجاز المعاملات الحكومية", department: "إدارة العمليات", target: 80, current: 65, date: "2026-09-30", status: "يحتاج متابعة" },{ kpi_name: "تطوير الكفاءات الوطنية", description: "نسبة الموظفين الحاصلين على التدريب المتخصص", department: "إدارة الموارد البشرية", target: 85, current: 45, date: "2026-08-20", status: "متأخر" }];function renderDashboard(data) {const container = document.getElementById('dashboard-progress-bars');container.innerHTML = '';data.forEach(item => {let color = item.current >= 80 ? 'bg-emerald-500' : (item.current >= 60 ? 'bg-amber-500' : 'bg-red-500');container.innerHTML += `<div><div class="flex justify-between text-sm mb-1"><span class="font-bold text-gray-700">${item.kpi_name}</span><span class="text-gray-500">الهدف: ${item.target}% (<span class="font-bold text-gray-800">${item.current}%</span>)</span></div><div class="w-full bg-gray-100 h-3 rounded-full overflow-hidden"><div class="${color} h-full rounded-full" style="width: ${item.current}%"></div></div></div>`;});}function renderKPIsList(data) {const container = document.getElementById('kpi-cards-container');container.innerHTML = '';data.forEach(item => {let badgeColor = item.status === 'جيد' ? 'bg-emerald-50 text-emerald-600' : (item.status === 'متأخر' ? 'bg-red-50 text-red-600' : 'bg-amber-50 text-amber-600');container.innerHTML += `<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm space-y-4"><div class="flex justify-between items-start">10 unmodified lines</div></div><div class="grid grid-cols-2 md:grid-cols-3 gap-4 text-xs text-gray-500 bg-gray-50 p-3 rounded-xl"><div>الجهة المسؤولة: <span class="font-bold text-gray-700">${item.department}</span></div><div>تاريخ الإنجاز: <span class="font-bold text-gray-700">${item.date}</span></div><div>الهدف: <span class="font-bold text-gray-700">${item.target}%</span></div></div><div><div class="flex justify-between text-xs mb-1 text-gray-500"><span>نسبة التقدم</span><span class="font-bold text-gray-700">${item.current}%</span></div><div class="w-full bg-gray-100 h-2.5 rounded-full overflow-hidden"><div class="bg-emerald-500 h-full rounded-full" style="width: ${item.current}%"></div></div></div></div>1 unmodified line});}function switchTab(tab) {if(tab === 'dashboard') {document.getElementById('view-dashboard').classList.remove('hidden');8 unmodified lines}}// دالة رفع وقراءة ملف الـ JSON الديناميكيfunction loadJSON(event) {const file = event.target.files[0];if (!file) return;const reader = new FileReader();reader.onload = function(e) {try {const jsonData = JSON.parse(e.target.result);// إذا كان ملفك بنفس هيكل 3month_ar.json، سنقوم بتحويله لتنسيق الواجهةlet formattedData = jsonData.map(item => ({kpi_name: item.kpi_name,description: "مؤشر أداء رئيسي معتمد للتقييم الدوري",department: "الإدارة العامة للأداء",target: item.target,current: item.month_3 || 75,date: "2026-12-31",status: (item.month_3 || 75) >= 75 ? "جيد" : ((item.month_3 || 75) >= 60 ? "يحتاج متابعة" : "متأخر")}));renderDashboard(formattedData);renderKPIsList(formattedData);alert("تم تحميل بيانات JSON وتحديث الواجهة بنجاح!");} catch (err) {alert("حدث خطأ أثناء قراءة ملف الـ JSON.");}};reader.readAsText(file);}// التشغيل الأوليrenderDashboard(defaultData);renderKPIsList(defaultData);</script></body></html>123456789101112132 unmodified lines161718192021222324252627281 unmodified line303132333435363738394041424344451 unmodified line4748495051525354554 unmodified lines60616263646566676869707172734 unmodified lines78798081828384854 unmodified lines90919293949596973 unmodified lines1011021031041051061071083 unmodified lines1121131141151161171181194 unmodified lines1241251261271281291302 unmodified lines13313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641710 unmodified lines4284294304314324334344354364374384394404414424434444451 unmodified line4474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834848 unmodified lines493494495496497498499500501502503504505506507<!DOCTYPE html><html lang="ar" dir="rtl" id="html-root"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title id="page-title">منصة الأداء - رؤية 2030</title><!-- Tailwind CSS --><script src="https://cdn.tailwindcss.com"></script><!-- Chart.js للرسم البياني لتطور الأداء --><script src="https://cdn.jsdelivr.net/npm/chart.js"></script><link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap" rel="stylesheet"><style>body { font-family: 'Cairo', sans-serif; background-color: #f8fafc; }2 unmodified lines<body class="flex h-screen overflow-hidden"><!-- القائمة الجانبية (Sidebar) --><aside class="w-64 bg-white border-l border-gray-200 flex flex-col justify-between hidden md:flex" id="sidebar"><div><!-- ترويسة الشعار --><div class="p-6 flex items-center justify-between border-b border-gray-100"><div class="text-right rtl:text-right ltr:text-left"><h1 class="text-lg font-bold text-teal-700" id="nav-brand">منصة الأداء</h1><p class="text-xs text-gray-400" id="nav-sub">رؤية 2030</p></div><div class="w-9 h-9 rounded-xl bg-teal-600 flex items-center justify-center text-white font-bold">✨</div></div>1 unmodified line<!-- روابط التنقل --><nav class="p-4 space-y-2"><button onclick="switchTab('dashboard')" id="btn-dashboard" class="w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-semibold transition bg-teal-700 text-white shadow-sm">📊 <span data-i18n="menu_dashboard">لوحة التحكم</span></button><button onclick="switchTab('kpis')" id="btn-kpis" class="w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-semibold transition text-gray-600 hover:bg-gray-50">📈 <span data-i18n="menu_kpis">مؤشرات الأداء</span></button><button class="w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-semibold text-gray-600 hover:bg-gray-50">📋 <span data-i18n="menu_tasks">إدارة المهام</span></button><button class="w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-semibold text-gray-600 hover:bg-gray-50">📑 <span data-i18n="menu_reports">التقارير</span></button></nav></div>1 unmodified line<!-- معلومات المستخدم في أسفل القائمة --><div class="p-4 border-t border-gray-100 flex items-center gap-3"><div class="w-10 h-10 rounded-full bg-teal-700 text-white flex items-center justify-center font-bold">أ</div><div class="text-right rtl:text-right ltr:text-left"><h4 class="text-sm font-bold text-gray-800" data-i18n="user_name">أحمد العتيبي</h4><p class="text-xs text-gray-500" data-i18n="user_role">مدير الأداء</p></div></div></aside>4 unmodified lines<!-- الشريط العلوى (Navbar) --><header class="bg-white border-b border-gray-200 px-8 py-4 flex items-center justify-between sticky top-0 z-10"><div class="flex items-center gap-4 w-1/3"><input type="text" id="search-input" placeholder="البحث عن مؤشرات، مهام، أو تقارير..." class="w-full bg-gray-50 border border-gray-200 rounded-xl px-4 py-2 text-sm focus:outline-none focus:border-teal-600"></div><div class="flex items-center gap-4"><!-- زر تبديل اللغة --><button onclick="toggleLanguage()" class="bg-gray-100 hover:bg-gray-200 text-gray-700 font-bold px-3 py-1.5 rounded-xl text-xs transition flex items-center gap-1">🌐 <span id="lang-btn-text">English</span></button><span class="text-sm text-gray-500">🔔</span></div></header>4 unmodified lines<!-- ================= الواجهة الأولى: لوحة التحكم ================= --><section id="view-dashboard" class="space-y-8"><div><h2 class="text-xl font-bold text-gray-800" data-i18n="dash_title">لوحة التحكم</h2><p class="text-sm text-gray-500" data-i18n="dash_subtitle">نظرة شاملة على مؤشرات الأداء الرئيسية</p></div><!-- البطاقات الأربع العلوية -->4 unmodified lines<span class="text-xs font-bold text-emerald-600 bg-emerald-50 px-2 py-1 rounded-lg">+12% ↗</span></div><div class="mt-4"><h3 class="text-2xl font-bold text-gray-800">24</h3><p class="text-xs text-gray-500 mt-1" data-i18n="card_total">إجمالي المؤشرات</p></div></div>3 unmodified lines<span class="text-xs font-bold text-emerald-600 bg-emerald-50 px-2 py-1 rounded-lg">+8% ↗</span></div><div class="mt-4"><h3 class="text-2xl font-bold text-gray-800">18</h3><p class="text-xs text-gray-500 mt-1" data-i18n="card_completed">المؤشرات المكتملة</p></div></div>3 unmodified lines<span class="text-xs font-bold text-red-600 bg-red-50 px-2 py-1 rounded-lg">-2% ↘</span></div><div class="mt-4"><h3 class="text-2xl font-bold text-gray-800">3</h3><p class="text-xs text-gray-500 mt-1" data-i18n="card_delayed">المؤشرات المتأخرة</p></div></div>4 unmodified lines</div><div class="mt-4"><h3 class="text-2xl font-bold text-gray-800">75%</h3><p class="text-xs text-gray-500 mt-1" data-i18n="card_rate">نسبة الإنجاز</p></div></div></div>2 unmodified lines<div class="grid grid-cols-1 lg:grid-cols-3 gap-6"><!-- توزيع الحالات --><div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm"><h3 class="font-bold text-gray-800 mb-4" data-i18n="status_dist">توزيع الحالات</h3><div class="flex flex-col items-center justify-center py-6"><div class="w-36 h-36 rounded-full border-8 border-teal-500 border-t-amber-500 border-l-red-500 flex items-center justify-center"><span class="text-sm font-bold text-gray-700" data-i18n="status_general">الحالة العامة</span></div></div><div class="flex justify-around text-xs text-gray-600 mt-4"><span class="flex items-center gap-1"><i class="w-2.5 h-2.5 rounded-full bg-emerald-500 inline-block"></i> <span data-i18n="status_good">جيد</span> (18)</span><span class="flex items-center gap-1"><i class="w-2.5 h-2.5 rounded-full bg-amber-500 inline-block"></i> <span data-i18n="status_medium">متوسط</span> (3)</span><span class="flex items-center gap-1"><i class="w-2.5 h-2.5 rounded-full bg-red-500 inline-block"></i> <span data-i18n="status_late">متأخر</span> (3)</span></div></div><!-- أداء المؤشرات (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"><canvas id="performanceChart"></canvas></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></h3><div class="grid grid-cols-1 md:grid-cols-3 gap-6"><div class="bg-white p-5 rounded-2xl border border-gray-100 shadow-sm border-r-4 border-r-emerald-500 space-y-2"><h4 class="font-bold text-emerald-600 text-sm" data-i18n="insight_1_title">تحسن ملحوظ</h4><p class="text-xs text-gray-600" data-i18n="insight_1_desc">مؤشر رضا المتعاملين تحسن بنسبة 15% خلال الفترة الماضية.</p></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><p class="text-xs text-gray-600" data-i18n="insight_3_desc">يمكن تحسين أداء 3 مؤشرات من خلال زيادة الموارد المخصصة بنسبة 20%.</p></div></div></div></section><!-- ================= الواجهة الثانية: مؤشرات الأداء ================= --><section id="view-kpis" class="space-y-6 hidden"><div class="flex justify-between items-center"><div><h2 class="text-xl font-bold text-gray-800" data-i18n="kpi_mgmt_title">إدارة مؤشرات الأداء</h2><p class="text-sm text-gray-500" data-i18n="kpi_mgmt_sub">إنشاء ومتابعة وتحليل مؤشرات الأداء الرئيسية</p></div><div><button class="bg-teal-700 text-white px-4 py-2 rounded-xl text-sm font-bold shadow-sm hover:bg-teal-800 transition" data-i18n="new_kpi_btn">+ إنشاء مؤشر جديد</button></div></div><!-- قائمة بطاقات المؤشرات --><div id="kpi-cards-container" class="space-y-4"><!-- تُعبأ ديناميكياً --></div></section></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",nav_brand: "منصة الأداء",nav_sub: "رؤية 2030",menu_dashboard: "لوحة التحكم",menu_kpis: "مؤشرات الأداء",menu_tasks: "إدارة المهام",menu_reports: "التقارير",user_name: "أحمد العتيبي",user_role: "مدير الأداء",search_placeholder: "البحث عن مؤشرات، مهام، أو تقارير...",dash_title: "لوحة التحكم",dash_subtitle: "نظرة شاملة على مؤشرات الأداء الرئيسية",card_total: "إجمالي المؤشرات",card_completed: "المؤشرات المكتملة",card_delayed: "المؤشرات المتأخرة",card_rate: "نسبة الإنجاز",status_dist: "توزيع الحالات",status_general: "الحالة العامة",status_good: "جيد",status_medium: "متوسط",status_late: "متأخر",kpi_performance: "أداء المؤشرات الرئيسية",perf_evolution: "تطور الأداء (خلال 60 يوماً)",ai_insights_title: "التحليلات الذكية (رؤى مدعومة بالذكاء الاصطناعي)",insight_1_title: "تحسن ملحوظ",insight_1_desc: "مؤشر رضا المتعاملين تحسن بنسبة 15% خلال الفترة الماضية.",insight_2_title: "تنبيه",insight_2_desc: "مؤشر 'خفض زمن إنجاز المعاملات' يحتاج إلى تدخل سريع لتحقيق الهدف.",insight_3_title: "توصية",insight_3_desc: "يمكن تحسين أداء 3 مؤشرات من خلال زيادة الموارد المخصصة بنسبة 20%.",kpi_mgmt_title: "إدارة مؤشرات الأداء",kpi_mgmt_sub: "إنشاء ومتابعة وتحليل مؤشرات الأداء الرئيسية",new_kpi_btn: "+ إنشاء مؤشر جديد",target_label: "الهدف",dept_label: "الجهة المسؤولة",progress_label: "نسبة التقدم"},en: {page_title: "Performance Platform - Vision 2030",nav_brand: "Performance Platform",nav_sub: "Vision 2030",menu_dashboard: "Dashboard",menu_kpis: "KPIs Management",menu_tasks: "Tasks Management",menu_reports: "Reports",user_name: "Ahmed Al-Otaibi",user_role: "Performance Director",search_placeholder: "Search for KPIs, tasks, or reports...",dash_title: "Dashboard",dash_subtitle: "Comprehensive overview of key performance indicators",card_total: "Total KPIs",card_completed: "Completed KPIs",card_delayed: "Delayed KPIs",card_rate: "Completion Rate",status_dist: "Status Distribution",status_general: "Overall Status",status_good: "Good",status_medium: "Medium",status_late: "Late",kpi_performance: "Key Indicators Performance",perf_evolution: "Performance Evolution (60 Days)",ai_insights_title: "Smart Analytics (AI-Powered Insights)",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_3_title: "Recommendation",insight_3_desc: "Performance of 3 KPIs can be improved by increasing allocated resources by 20%.",kpi_mgmt_title: "KPIs Management",kpi_mgmt_sub: "Create, monitor, and analyze key performance indicators",new_kpi_btn: "+ New KPI",target_label: "Target",dept_label: "Responsible Dept",progress_label: "Progress Rate"}};let currentLang = 'ar';let chartInstance = null;function getData() {return currentLang === 'ar' ? data_ar : data_en;}// تبديل اللغة وتحديث عناصر الصفحةfunction toggleLanguage() {currentLang = currentLang === 'ar' ? 'en' : 'ar';const root = document.getElementById('html-root');root.lang = currentLang;root.dir = currentLang === 'ar' ? 'rtl' : 'ltr';document.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]) {el.innerText = translations[currentLang][key];}});renderAll();}// عرض أشرطة التقدم في لوحة التحكمfunction renderDashboardProgress(data) {const container = document.getElementById('dashboard-progress-bars');container.innerHTML = '';data.forEach(item => {let color = item.latest_value >= 80 ? 'bg-emerald-500' : (item.latest_value >= 60 ? 'bg-amber-500' : 'bg-red-500');const targetText = currentLang === 'ar' ? 'الهدف' : 'Target';container.innerHTML += `<div><div class="flex justify-between text-sm mb-1"><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>`;});}// عرض قائمة المؤشرات في واجهة المؤشرات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"><div class="flex justify-between items-start">10 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><div><div class="flex justify-between text-xs mb-1 text-gray-500"><span>${t.progress_label}</span><span class="font-bold text-gray-700">${item.latest_value}%</span></div><div class="w-full bg-gray-100 h-2.5 rounded-full overflow-hidden"><div class="bg-emerald-500 h-full rounded-full" style="width: ${item.latest_value}%"></div></div></div></div>1 unmodified line});}// رسم المخطط الخطي لتطور الأداء (Chart.js)function renderPerformanceChart(data) {const ctx = document.getElementById('performanceChart').getContext('2d');if (chartInstance) {chartInstance.destroy();}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',data: { labels: labels, datasets: datasets },options: {responsive: true,maintainAspectRatio: false,plugins: { legend: { position: 'bottom' } }}});}// التنقل بين الأقسامfunction switchTab(tab) {if(tab === 'dashboard') {document.getElementById('view-dashboard').classList.remove('hidden');8 unmodified lines}}function renderAll() {const data = getData();renderDashboardProgress(data);renderKPIsList(data);renderPerformanceChart(data);}// التشغيل الأولي عند فتح الصفحةrenderAll();</script></body></html>
index.html+302-90