Loheide-eu-mitarbeiterplatt.../public/build/assets/TicketCreate-BtxC-oth.js
Friederich Loheide 4d58364104
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Has been skipped
CI / PHP 8.4 / mariadb:10.6 (pull_request) Has been skipped
CI / PHP 8.3 / mariadb:11.4 (pull_request) Has been skipped
CI / PHP 8.4 / mariadb:11.4 (pull_request) Has been skipped
CI / PHP 8.3 / mysql:8.0 (pull_request) Has been skipped
CI / PHP 8.4 / mysql:8.0 (pull_request) Has been skipped
CI / PHP 8.3 / mysql:8.4 (pull_request) Has been skipped
CI / PHP 8.4 / mysql:8.4 (pull_request) Has been skipped
CI / Browser-Tests (pull_request) Successful in 14m21s
CI / PHP 8.3 / mysql:8.4-1 (pull_request) Successful in 19m7s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 5m20s
CI / Build-Artefakte aktuell (pull_request) Successful in 5m46s
Frag das Portal als schwebende Blase, Suchliste im Bild (0.65.0)
- AskBubble unten rechts (abschaltbar), Gespräch bleibt beim Seitenwechsel
- Antwortanzeige als gemeinsame Komponente AskAnswer
- Trefferliste der Kopfzeilen-Suche in der App-Oberfläche linksbündig
- CI: optionale Kern-Plugins für Browser-Tests einschalten, Suchtest mit Demo-Inhalt

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 19:02:18 +00:00

1 line
No EOL
7.3 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{Et as e,M as t,Ot as n,P as ee,j as r}from"./ui-DY0WbyhT.js";import{At as i,C as a,Dt as o,O as s,S as c,T as l,Tt as u,Y as te,_t as d,a as f,d as p,g as m,h as ne,k as h,ot as g,q as _,st as v,v as y,w as b,x}from"./framework-Cy4cevSy.js";import{t as re}from"./circle-alert-DbMsxJO9.js";import{t as S}from"./paperclip-Oh-2njeI.js";import{t as C}from"./send-cXiW05LR.js";import{a as w,d as T,f as ie,gt as ae,kt as oe,l as E,p as D}from"./app-k1_9tffg.js";var O={class:`grid gap-2`,role:`radiogroup`,"aria-label":`Gerät`},k=[`value`],A={class:`grid size-9 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},j={class:`min-w-0`},M={class:`block text-sm font-medium`},N={class:`block truncate text-xs text-muted-foreground`},P={class:`grid size-9 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},F={key:0,class:`flex items-center gap-2 text-xs text-muted-foreground`},I={class:`grid gap-4`},L={class:`grid gap-4 sm:grid-cols-2`},R={class:`grid gap-1.5`},z={key:1,class:`flex items-center gap-3 rounded-lg border bg-muted/40 px-3 py-2.5 text-sm`},B={class:`min-w-0 flex-1 truncate`},V={class:`shrink-0 text-xs text-muted-foreground`},se={key:2,class:`text-[13px] text-destructive`},H={class:`flex justify-end border-t pt-4`},U=10485760,W={__name:`TicketCreate`,props:{assetId:{type:Number,default:null},assets:{type:Object,required:!0},options:{type:Object,required:!0},defaultLocation:{type:Number,default:null}},setup(W){let G=W,K=x(()=>G.assets.ok?G.assets.data:[]),q=x(()=>G.options.ok?G.options.data.categories:[]),J=x(()=>G.options.ok?G.options.data.locations:[]),Y=f({asset_id:K.value.some(e=>e.id===G.assetId)?G.assetId:null,subject:``,description:``,category_id:null,location_id:G.defaultLocation,attachment:null}),X=d(null),Z=d(!1),Q=d(``);function $(e){if(Q.value=``,e){if(e.size>U){Q.value=`Die Datei ist zu groß (höchstens 10 MB).`;return}Y.attachment=e}}function ce(e){Z.value=!1,$(e.dataTransfer?.files?.[0])}function le(){Y.attachment=null,X.value&&(X.value.value=``)}let ue=e=>e>1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function de(){Y.transform(e=>({...e,asset_id:e.asset_id||null,category_id:e.category_id?Number(e.category_id):null,location_id:e.location_id?Number(e.location_id):null})).post(`/it-service/tickets`,{forceFormData:!0})}return(d,f)=>(_(),a(ie,{title:`Ticket erstellen`},{default:g(()=>[h(D,{title:`Ticket erstellen`,breadcrumbs:[{label:`Meine IT`,href:`/it-service`}],description:`Beschreiben Sie kurz, was nicht funktioniert – die IT meldet sich.`}),c(`form`,{class:`grid grid-cols-1 items-start gap-6 lg:grid-cols-12`,onSubmit:m(de,[`prevent`])},[h(T,{title:`Worum geht es?`,class:`lg:col-span-5 xl:col-span-4`},{default:g(()=>[c(`div`,O,[(_(!0),l(y,null,te(K.value,e=>(_(),l(`label`,{key:e.id,class:o([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,u(Y).asset_id===e.id?`border-brand bg-brand-soft/60 ring-1 ring-brand`:`hover:bg-accent/60`])},[v(c(`input`,{"onUpdate:modelValue":f[0]||=e=>u(Y).asset_id=e,type:`radio`,value:e.id,class:`sr-only`},null,8,k),[[p,u(Y).asset_id]]),c(`span`,A,[h(u(ae),{class:`size-4`})]),c(`span`,j,[c(`span`,M,i(e.name),1),c(`span`,N,i([e.type,e.serial&&`SN ${e.serial}`].filter(Boolean).join(` · `)),1)])],2))),128)),c(`label`,{class:o([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,u(Y).asset_id?`hover:bg-accent/60`:`border-brand bg-brand-soft/60 ring-1 ring-brand`])},[v(c(`input`,{"onUpdate:modelValue":f[1]||=e=>u(Y).asset_id=e,type:`radio`,value:null,class:`sr-only`},null,512),[[p,u(Y).asset_id]]),c(`span`,P,[h(u(oe),{class:`size-4`})]),f[11]||=c(`span`,null,[c(`span`,{class:`block text-sm font-medium`},`Allgemeines Anliegen`),c(`span`,{class:`block text-xs text-muted-foreground`},`ohne bestimmtes Gerät, z. B. Zugang, Software, Frage`)],-1)],2),W.assets.ok?b(``,!0):(_(),l(`p`,F,[h(u(re),{class:`size-3.5`}),f[12]||=s(` Ihre Geräte konnten nicht geladen werden.`,-1)]))])]),_:1}),h(T,{title:`Beschreibung`,class:`lg:col-span-7 xl:col-span-8`},{default:g(()=>[c(`div`,I,[c(`div`,L,[h(E,{id:`category`,label:`Kategorie`,error:u(Y).errors.category_id,hint:q.value.length?``:`Kategorien konnten nicht geladen werden.`},{default:g(()=>[h(w,{id:`category`,modelValue:u(Y).category_id,"onUpdate:modelValue":f[2]||=e=>u(Y).category_id=e,options:q.value,"search-placeholder":`Kategorie suchen …`,disabled:!q.value.length,"aria-invalid":!!u(Y).errors.category_id},null,8,[`modelValue`,`options`,`disabled`,`aria-invalid`])]),_:1},8,[`error`,`hint`]),h(E,{id:`location`,label:`Standort`,error:u(Y).errors.location_id,hint:J.value.length?`Wo tritt das Problem auf?`:`Standorte konnten nicht geladen werden.`},{default:g(()=>[h(w,{id:`location`,modelValue:u(Y).location_id,"onUpdate:modelValue":f[3]||=e=>u(Y).location_id=e,options:J.value,"search-placeholder":`Standort suchen …`,disabled:!J.value.length,"aria-invalid":!!u(Y).errors.location_id},null,8,[`modelValue`,`options`,`disabled`,`aria-invalid`])]),_:1},8,[`error`,`hint`])]),h(E,{id:`subject`,label:`Betreff`,error:u(Y).errors.subject},{default:g(()=>[h(u(t),{id:`subject`,modelValue:u(Y).subject,"onUpdate:modelValue":f[4]||=e=>u(Y).subject=e,maxlength:`200`,placeholder:`z. B. Drucker im 2. OG druckt nicht`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),h(E,{id:`description`,label:`Nachricht`,error:u(Y).errors.description,hint:`Was ist passiert? Seit wann? Gibt es eine Fehlermeldung? Was haben Sie schon versucht?`},{default:g(()=>[h(u(r),{id:`description`,modelValue:u(Y).description,"onUpdate:modelValue":f[5]||=e=>u(Y).description=e,rows:`14`,maxlength:`20000`,class:`min-h-72`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),c(`div`,R,[f[15]||=c(`span`,{class:`text-[13px] font-medium`},`Anhang (optional)`,-1),u(Y).attachment?(_(),l(`div`,z,[h(u(S),{class:`size-4 shrink-0 text-muted-foreground`}),c(`span`,B,i(u(Y).attachment.name),1),c(`span`,V,i(ue(u(Y).attachment.size)),1),c(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,"aria-label":`Anhang entfernen`,onClick:le},[h(u(e),{class:`size-4`})])])):(_(),l(`div`,{key:0,class:o([`flex cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed px-4 py-6 text-center text-sm text-muted-foreground transition-colors`,Z.value?`border-brand bg-brand-soft/50`:`hover:border-brand-300 hover:bg-accent/40`]),role:`button`,tabindex:`0`,onClick:f[6]||=e=>X.value?.click(),onKeydown:f[7]||=ne(m(e=>X.value?.click(),[`prevent`]),[`enter`]),onDragover:f[8]||=m(e=>Z.value=!0,[`prevent`]),onDragleave:f[9]||=e=>Z.value=!1,onDrop:m(ce,[`prevent`])},[h(u(S),{class:`size-5`}),f[13]||=c(`span`,null,[c(`span`,{class:`font-medium text-foreground`},`Datei auswählen`),s(` oder hierher ziehen`)],-1),f[14]||=c(`span`,{class:`text-xs`},`z. B. Screenshot oder Fehlermeldung – Bild, PDF, Text oder Word, höchstens 10 MB`,-1)],34)),c(`input`,{ref_key:`fileInput`,ref:X,type:`file`,class:`hidden`,accept:`image/*,.pdf,.txt,.doc,.docx`,onChange:f[10]||=e=>$(e.target.files?.[0])},null,544),Q.value||u(Y).errors.attachment?(_(),l(`p`,se,i(Q.value||u(Y).errors.attachment),1)):b(``,!0)]),c(`div`,H,[h(u(ee),{type:`submit`,disabled:u(Y).processing},{default:g(()=>[u(Y).processing?(_(),a(u(n),{key:0,class:`animate-spin`})):(_(),a(u(C),{key:1})),f[16]||=s(` Ticket absenden `,-1)]),_:1},8,[`disabled`])])])]),_:1})],32)]),_:1}))}};export{W as default};