PageSourceSearch

https://intervmanage-dpk2btox.manus.space/assets/TimeExtensionRequests-aBzz0kM0.js

js intervmanage-dpk2btox.manus.space collected 2026-10-03 05:03:40 UTC 10,846 bytes, 1 lines download raw bytes

1import{a as q,b as p,t as u,O as g,j as s,T as w,v as z,B as c,m as o,q as l,a3 as y,f as h,n as C,p as k,y as I,ak as L}from"./index-BjSX7oRZ.js";import{A as M}from"./arrow-left-D2B1BNha.js";import{C as A}from"./circle-x-BK5ScYY5.js";const D=(e,a)=>{const n={inaccurate_estimate:{ar:"الوقت المحدد من الأول غير دقيق",fr:"Estimation initiale inexacte",en:"Initial estimate inaccurate",zh:"初始预估不准确"},resource_loss:{ar:"ضياع للوقت بسبب الموارد",fr:"Perte de temps بسبب الموارد",en:"Time lost due to resources",zh:"资源问题导致时间损失"},lack_of_resources:{ar:"عدم وجود الموارد اللازمة",fr:"Ressources nécessaires indisponibles",en:"Lack of necessary resources",zh:"缺少必要资源"},other:{ar:"أسباب أخرى",fr:"Autres raisons",en:"Other reasons",zh:"其他原因"}};return n[e||"other"]?.[a]||n[e||"other"]?.en||e||"—"},S=(e,a)=>{if(!e)return"—";try{return new Date(e).toLocaleString(a==="ar"?"ar-DZ":a==="zh"?"zh-CN":a==="fr"?"fr-FR":"en-GB",{dateStyle:"medium",timeStyle:"short"})}catch{return String(e)}};function O(){const{language:e}=q(),[a,n]=p.useState({}),[E,i]=p.useState(null),{data:x=[],isLoading:d,refetch:f}=u.interventions.getPendingTimeExtensions.useQuery(void 0,{refetchInterval:15e3}),m=u.interventions.reviewTimeExtension.useMutation({onSuccess:async(t,r)=>{await f(),i(null),g.success(r.status==="approved"?e==="ar"?"تمت الموافقة على الوقت الإضافي وإبلاغ الفني.":e==="fr"?"Prolongation approuvée et technicien informé.":e==="zh"?"延时已批准,技术员已收到通知。":"Extension approved and technician notified.":e==="ar"?"تم رفض طلب الوقت الإضافي وتسجيل الملاحظة.":e==="fr"?"Prolongation refusée et décision enregistrée.":e==="zh"?"延时已拒绝,决定已记录。":"Extension rejected and decision recorded.")},onError:t=>{i(null),g.error(t.message)}}),T=e==="ar"?"طلبات الوقت الإضافي":e==="fr"?"Demandes de prolongation":e==="zh"?"延时申请":"Time extension requests",j=e==="ar"?"راجع أسباب تجاوز الوقت قبل الموافقة أو الرفض. كل قرار يبقى محفوظاً في سجل التدخل.":e==="fr"?"Examinez les causes du dépassement avant d’approuver ou de refuser. Chaque décision est conservée dans l’historique.":e==="zh"?"审核超时原因后批准或拒绝,所有决定都会保存在干预历史中。":"Review the overtime reason before approving or rejecting. Every decision remains in the intervention history.",R=e==="ar"?"العودة إلى لوحة المسؤول":e==="fr"?"Retour au tableau responsable":e==="zh"?"返回负责人面板":"Back to manager dashboard",N=e==="ar"?"لا توجد طلبات وقت إضافي معلقة.":e==="fr"?"Aucune demande de prolongation en attente.":e==="zh"?"暂无待审核延时申请。":"No pending extension requests.";return s.jsx("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:58",className:"min-h-screen bg-slate-50 px-4 py-6 sm:px-6",dir:e==="ar"?"rtl":"ltr",children:s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:59",className:"mx-auto max-w-5xl space-y-6",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:60",className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:61",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:62",className:"mb-2 flex items-center gap-2 text-orange-600",children:[s.jsx(w,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:62",className:"h-5 w-5"}),s.jsx("span",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:62",className:"text-xs font-semibold uppercase tracking-wide",children:e==="ar"?"مراجعة المسؤول":e==="fr"?"Revue responsable":e==="zh"?"负责人审核":"Manager review"})]}),s.jsx("h1",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:63",className:"text-2xl font-bold text-slate-900",children:T}),s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:64",className:"mt-1 max-w-3xl text-sm text-slate-600",children:j})]}),s.jsx(z,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:66",href:"/manager",children:s.jsxs(c,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:66",variant:"outline",children:[s.jsx(M,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:66",className:"mr-2 h-4 w-4"}),R]})})]}),d&&s.jsx(o,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:69",children:s.jsxs(l,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:69",className:"flex items-center justify-center gap-2 py-12 text-slate-500",children:[s.jsx(y,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:69",className:"h-5 w-5 animate-spin"}),e==="ar"?"جارٍ تحميل الطلبات...":"Loading requests..."]})}),!d&&x.length===0&&s.jsx(o,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:70",children:s.jsxs(l,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:70",className:"py-16 text-center text-slate-500",children:[s.jsx(h,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:70",className:"mx-auto mb-3 h-10 w-10 text-emerald-500"}),N]})}),s.jsx("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:72",className:"space-y-4",children:x.map(t=>{const r=E===t.id;return s.jsxs(o,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:76",className:"border-orange-200 shadow-sm",children:[s.jsx(C,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:77",className:"pb-3",children:s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:78",className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:79",children:[s.jsxs(k,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:80",className:"flex items-center gap-2 text-lg",children:[s.jsx(I,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:80",className:"h-5 w-5 text-orange-500"}),t.equipement]}),s.jsxs("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:81",className:"mt-1 text-sm text-slate-500",children:[t.atelier," · ",e==="ar"?"التدخل رقم":"Intervention"," #",t.id]})]}),s.jsx("span",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:83",className:"rounded-full border border-orange-300 bg-orange-50 px-3 py-1 text-xs font-semibold text-orange-700",children:e==="ar"?"بانتظار القرار":e==="fr"?"En attente":e==="zh"?"待审核":"Pending decision"})]})}),s.jsxs(l,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:86",className:"space-y-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:87",className:"grid gap-3 text-sm sm:grid-cols-3",children:[s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:88",className:"rounded-xl bg-slate-100 p-3",children:[s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:88",className:"text-xs text-slate-500",children:e==="ar"?"الفني":e==="fr"?"Technicien":e==="zh"?"技术员":"Technician"}),s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:88",className:"mt-1 font-semibold text-slate-800",children:t.assignedToId?`#${t.assignedToId}`:"—"})]}),s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:89",className:"rounded-xl bg-slate-100 p-3",children:[s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:89",className:"text-xs text-slate-500",children:e==="ar"?"الوقت المحدد":e==="fr"?"Durée prévue":e==="zh"?"预计时间":"Planned time"}),s.jsxs("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:89",className:"mt-1 font-semibold text-slate-800",children:[t.estimatedDurationMinutes||0," ",e==="ar"?"دقيقة":e==="zh"?"分钟":"min"]})]}),s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:90",className:"rounded-xl bg-slate-100 p-3",children:[s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:90",className:"text-xs text-slate-500",children:e==="ar"?"الوقت المطلوب":e==="fr"?"Temps demandé":e==="zh"?"申请延时":"Requested extra time"}),s.jsxs("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:90",className:"mt-1 font-semibold text-orange-700",children:["+",t.timeExtensionMinutes||0," ",e==="ar"?"دقيقة":e==="zh"?"分钟":"min"]})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:92",className:"rounded-xl border border-orange-100 bg-orange-50/60 p-4 text-sm",children:[s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:92",className:"font-semibold text-orange-900",children:e==="ar"?"سبب التجاوز":e==="fr"?"Cause du dépassement":e==="zh"?"超时原因":"Overtime reason"}),s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:92",className:"mt-1 text-orange-800",children:D(t.timeExtensionReason,e)}),t.timeExtensionNote&&s.jsx("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:92",className:"mt-2 whitespace-pre-wrap text-slate-700",children:t.timeExtensionNote})]}),s.jsxs("p",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:93",className:"text-xs text-slate-500",children:[e==="ar"?"آخر تحديث":e==="fr"?"Dernière mise à jour":e==="zh"?"最后更新":"Last updated",": ",S(t.updatedAt,e)]}),s.jsx(L,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:94",value:a[t.id]||"",onChange:v=>n(b=>({...b,[t.id]:v.target.value})),placeholder:e==="ar"?"ملاحظة المسؤول على القرار...":e==="fr"?"Note du responsable...":e==="zh"?"负责人备注...":"Manager decision note...",className:"min-h-20"}),s.jsxs("div",{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:95",className:"flex flex-wrap justify-end gap-2",children:[s.jsxs(c,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:96",variant:"outline",disabled:r,onClick:()=>{i(t.id),m.mutate({interventionId:t.id,status:"rejected",managerNote:a[t.id],managerName:"Manager"})},className:"border-red-300 text-red-700 hover:bg-red-50",children:[s.jsx(A,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:96",className:"mr-2 h-4 w-4"}),e==="ar"?"رفض الطلب":e==="fr"?"Refuser":e==="zh"?"拒绝":"Reject"]}),s.jsxs(c,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:97",disabled:r,onClick:()=>{i(t.id),m.mutate({interventionId:t.id,status:"approved",managerNote:a[t.id],managerName:"Manager"})},className:"bg-emerald-600 hover:bg-emerald-700",children:[s.jsx(h,{"data-loc":"client/src/pages/TimeExtensionRequests.tsx:97",className:"mr-2 h-4 w-4"}),e==="ar"?"الموافقة وإضافة الوقت":e==="fr"?"Approuver et ajouter":e==="zh"?"批准并增加时间":"Approve and add time"]})]})]})]},t.id)})})]})})}export{O as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.