// SYSTEM PANEL //
[ROOT]
/
home
/
csender
/
legus.lawnet.me_backup_20250830-212545
/
assets
[ PARENT ]
EDIT :: EmployeeDetails-DI4FFMxc.js
import{d as M,r as n,o as B,b as l,e as k,f as t,T as j,S,n as p,i as w,h as H,t as a,F as A,m as C,G as T,D as F,E as z,z as r,_ as I}from"./index-BhhcJpm2.js";const N={class:"min-h-screen bg-[#F4F4F6]",dir:"rtl"},Z={class:"flex pt-16"},$={key:0,class:"flex justify-center items-center p-8"},R={key:1,class:"p-8 text-center"},G={class:"text-red-500 mb-4"},q={class:"text-sm text-gray-600 mt-1"},J={key:2,class:"p-6"},K={class:"bg-white rounded-lg border border-gray-200 p-6 mb-6"},O={class:"flex items-start gap-6"},P={class:"flex-1"},Q={class:"grid grid-cols-5 gap-x-8 gap-y-6"},U={class:"text-right"},W={class:"font-normal text-[#273F62] text-base"},X={class:"text-right"},Y={class:"font-normal text-[#273F62] text-base"},tt={class:"text-right"},et={class:"font-normal text-[#273F62] text-base"},st={class:"text-right"},at={class:"font-normal text-[#273F62] text-base"},ot={class:"text-right"},lt={class:"font-normal text-[#273F62] text-base"},rt={class:"text-right"},it={class:"font-normal text-[#273F62] text-base"},nt={class:"text-right"},dt={class:"font-normal text-[#273F62] text-base"},ct={class:"text-right"},xt={class:"font-normal text-[#273F62] text-base"},vt={class:"text-right"},pt={class:"text-right"},ut={class:"font-normal text-[#273F62] text-base"},mt={class:"text-right"},gt={class:"font-normal text-[#273F62] text-base"},bt={class:"text-right"},yt={class:"font-normal text-[#273F62] text-base"},_t={class:"text-right"},ft={class:"font-normal text-[#273F62] text-base"},ht={class:"text-right"},kt={class:"bg-white rounded-lg border border-gray-200"},wt={class:"flex border-b border-gray-200"},At=["onClick"],Ct={class:"p-6"},Ft={key:0,class:"space-y-4"},Et={key:0,class:"text-center py-8"},Dt={key:1,class:"text-center py-8 text-gray-500"},Lt={key:2},Vt={class:"flex items-start justify-between"},Mt={class:"flex-1"},Bt={class:"text-sm font-medium text-gray-900"},jt={class:"text-xs text-gray-500 mt-1"},St={class:"text-xs text-gray-400 mt-1"},Ht={class:"text-xs text-gray-400"},Tt={key:1,class:"text-center py-8 text-gray-500"},zt={key:2,class:"text-center py-8 text-gray-500"},It={key:3,class:"text-center py-8 text-gray-500"},Nt=M({__name:"EmployeeDetails",setup(Zt){const y=T(),E=z(),c=n(!1),u=n(!1),m=n(!1),x=n(""),d=n("activity"),s=n(null),g=n([]),D=[{id:"activity",label:"سجل الأنشطة"},{id:"permissions",label:"الصلاحيات"},{id:"cases",label:"القضايا"},{id:"performance",label:"تقييم الأداء"}],_=()=>{c.value=!c.value},v=o=>{if(!o)return"";try{return new Date(o).toLocaleDateString("ar-SA",{year:"numeric",month:"2-digit",day:"2-digit"})}catch{return o}},f=async()=>{const o=y.params.id;u.value=!0,x.value="";try{const e=await F.getEmployeeById(o);if(e.success&&e.data)s.value=e.data,await L();else throw new Error(e.message||"فشل في تحميل بيانات الموظف")}catch(e){x.value=e.message||"حدث خطأ في تحميل بيانات الموظف",console.error("Failed to load employee:",e)}finally{u.value=!1}},L=async()=>{if(s.value){m.value=!0;try{const o=await F.getEmployeeActivityLogs(s.value.id,{page:1,per_page:20,sort_by:"created_at",sort_order:"desc"});o.success&&o.data&&(g.value=o.data)}catch(o){console.error("Failed to load activity logs:",o)}finally{m.value=!1}}},V=()=>{const o=y.params.id;E.push(`/office/employees/${o}/edit`)};return B(()=>{f()}),(o,e)=>{var h;return r(),l("div",N,[k(j,{sidebarCollapsed:c.value,onToggleSidebar:_},null,8,["sidebarCollapsed"]),t("div",Z,[k(S,{isCollapsed:c.value,onToggle:_},null,8,["isCollapsed"]),t("div",{class:p(["flex-1 min-h-full transition-all duration-300",c.value?"mr-16":"mr-64"])},[t("div",{class:"flex items-center justify-between p-6 bg-white border-b border-gray-200"},[e[1]||(e[1]=H('<div class="flex items-center gap-4" data-v-eee80e3d><div class="flex items-center justify-center w-10 h-10 bg-[#DA7E13] rounded" data-v-eee80e3d><svg class="w-6 h-6 text-white" fill="currentColor" viewBox="0 0 24 24" data-v-eee80e3d><path d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z" data-v-eee80e3d></path></svg></div><h1 class="text-xl font-semibold text-[#273F62]" data-v-eee80e3d>تفاصيل الموظف</h1></div>',1)),t("div",{class:"flex items-center gap-3"},[t("button",{onClick:V,class:"flex items-center gap-2 px-4 py-2 bg-[#DA7E13] text-white rounded hover:bg-[#DA7E13]/90 transition-colors"},e[0]||(e[0]=[t("svg",{class:"w-4 h-4 fill-current",viewBox:"0 0 24 24"},[t("path",{d:"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"})],-1),t("span",null,"تحرير الموظف",-1)]))])]),u.value?(r(),l("div",$,e[2]||(e[2]=[t("div",{class:"text-center"},[t("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-[#DA7E13] mx-auto"}),t("p",{class:"mt-2 text-gray-600"},"جاري تحميل بيانات الموظف...")],-1)]))):x.value?(r(),l("div",R,[t("div",G,[e[3]||(e[3]=t("svg",{class:"w-12 h-12 mx-auto mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e[4]||(e[4]=t("p",{class:"text-lg font-medium"},"خطأ في تحميل بيانات الموظف",-1)),t("p",q,a(x.value),1)]),t("button",{onClick:f,class:"px-4 py-2 bg-[#DA7E13] text-white rounded hover:bg-[#DA7E13]/90"}," إعادة المحاولة ")])):s.value?(r(),l("div",J,[t("div",K,[t("div",O,[e[20]||(e[20]=t("div",{class:"flex-shrink-0"},[t("div",{class:"w-24 h-24 bg-[#DA7E13] rounded-full flex items-center justify-center"},[t("svg",{class:"w-12 h-12 text-white",fill:"currentColor",viewBox:"0 0 24 24"},[t("path",{d:"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"})])])],-1)),t("div",P,[t("div",Q,[t("div",U,[e[5]||(e[5]=t("span",{class:"text-sm text-gray-400 block mb-1"},"الاسم بالعربية",-1)),t("p",W,a(s.value.name_ar||"غير محدد"),1)]),t("div",X,[e[6]||(e[6]=t("span",{class:"text-sm text-gray-400 block mb-1"},"الاسم بالإنجليزية",-1)),t("p",Y,a(s.value.name_en||"غير محدد"),1)]),t("div",tt,[e[7]||(e[7]=t("span",{class:"text-sm text-gray-400 block mb-1"},"المسمى الوظيفي",-1)),t("p",et,a(s.value.position||"غير محدد"),1)]),e[19]||(e[19]=t("div",{class:"text-right"},[t("span",{class:"text-sm text-gray-400 block mb-1"},"الفرع"),t("p",{class:"font-normal text-[#273F62] text-base"},"الرئيسي")],-1)),t("div",st,[e[8]||(e[8]=t("span",{class:"text-sm text-gray-400 block mb-1"},"رقم الهاتف",-1)),t("p",at,a(s.value.phone||"غير محدد"),1)]),t("div",ot,[e[9]||(e[9]=t("span",{class:"text-sm text-gray-400 block mb-1"},"البريد الإلكتروني",-1)),t("p",lt,a(s.value.email),1)]),t("div",rt,[e[10]||(e[10]=t("span",{class:"text-sm text-gray-400 block mb-1"},"الهوية المدنية",-1)),t("p",it,a(s.value.civil_id||"غير محدد"),1)]),t("div",nt,[e[11]||(e[11]=t("span",{class:"text-sm text-gray-400 block mb-1"},"الجنسية",-1)),t("p",dt,a(((h=s.value.nationality)==null?void 0:h.name_ar)||"غير محدد"),1)]),t("div",ct,[e[12]||(e[12]=t("span",{class:"text-sm text-gray-400 block mb-1"},"تاريخ التوظيف",-1)),t("p",xt,a(v(s.value.hire_date)||"غير محدد"),1)]),t("div",vt,[e[13]||(e[13]=t("span",{class:"text-sm text-gray-400 block mb-1"},"الحالة",-1)),t("span",{class:p([s.value.status==="active"?"bg-green-100 text-green-800":"bg-red-100 text-red-800","px-2 py-1 rounded text-xs"])},a(s.value.status==="active"?"نشط":"غير نشط"),3)]),t("div",pt,[e[14]||(e[14]=t("span",{class:"text-sm text-gray-400 block mb-1"},"القسم",-1)),t("p",ut,a(s.value.department||"غير محدد"),1)]),t("div",mt,[e[15]||(e[15]=t("span",{class:"text-sm text-gray-400 block mb-1"},"الراتب",-1)),t("p",gt,a(s.value.salary?`${s.value.salary} د.ك`:"غير محدد"),1)]),t("div",bt,[e[16]||(e[16]=t("span",{class:"text-sm text-gray-400 block mb-1"},"تاريخ الإنشاء",-1)),t("p",yt,a(v(s.value.created_at)),1)]),t("div",_t,[e[17]||(e[17]=t("span",{class:"text-sm text-gray-400 block mb-1"},"آخر تحديث",-1)),t("p",ft,a(v(s.value.updated_at)),1)]),t("div",ht,[e[18]||(e[18]=t("span",{class:"text-sm text-gray-400 block mb-1"},"حساب المستخدم",-1)),t("span",{class:p([s.value.user?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800","px-2 py-1 rounded text-xs"])},a(s.value.user?"يملك حساب":"لا يملك حساب"),3)])])])])]),t("div",kt,[t("div",wt,[(r(),l(A,null,C(D,i=>t("button",{key:i.id,onClick:b=>d.value=i.id,class:p(["px-6 py-4 text-sm font-medium border-b-2 transition-colors",d.value===i.id?"text-[#DA7E13] border-[#DA7E13]":"text-gray-500 border-transparent hover:text-gray-700 hover:border-gray-300"])},a(i.label),11,At)),64))]),t("div",Ct,[d.value==="activity"?(r(),l("div",Ft,[m.value?(r(),l("div",Et,e[21]||(e[21]=[t("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#DA7E13] mx-auto"},null,-1),t("p",{class:"mt-2 text-gray-600"},"جاري تحميل سجل الأنشطة...",-1)]))):g.value.length===0?(r(),l("div",Dt,e[22]||(e[22]=[t("svg",{class:"w-12 h-12 mx-auto mb-4 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1),t("p",null,"لا توجد أنشطة مسجلة لهذا الموظف",-1)]))):(r(),l("div",Lt,[(r(!0),l(A,null,C(g.value,i=>{var b;return r(),l("div",{key:i.id,class:"border border-gray-200 rounded-lg p-4 hover:bg-gray-50"},[t("div",Vt,[t("div",Mt,[t("h4",Bt,a(i.description),1),t("p",jt,a(i.log_name)+" - "+a(i.subject_type),1),t("p",St,a(v(i.created_at)),1)]),t("div",Ht,a(((b=i.causer)==null?void 0:b.name)||"النظام"),1)])])}),128))]))])):d.value==="permissions"?(r(),l("div",Tt,e[23]||(e[23]=[t("p",null,"إدارة الصلاحيات قيد التطوير",-1)]))):d.value==="cases"?(r(),l("div",zt,e[24]||(e[24]=[t("p",null,"قائمة القضايا المكلف بها الموظف قيد التطوير",-1)]))):d.value==="performance"?(r(),l("div",It,e[25]||(e[25]=[t("p",null,"تقييم الأداء قيد التطوير",-1)]))):w("",!0)])])])):w("",!0)],2)])])}}}),Rt=I(Nt,[["__scopeId","data-v-eee80e3d"]]);export{Rt as default};
SAVE
CANCEL