Loheide-eu-mitarbeiterplatt.../public/build/assets/TicketCreate-B0_nfL4Q.js
Friederich Loheide 800e267e1c
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m29s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m31s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 9m3s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 9m36s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 13m33s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 13m56s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 12m35s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 11m58s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 50s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m13s
Neue Seitenköpfe, global wählbar (0.48.0)
- PageHeader: Kopfband (Standard, kompakt), Kopfband mit Symbol, mit Symbol,
  kräftiger Titel – Einstellung page_header im Erscheinungsbild
- Symbol vom passenden Menüpunkt (aktiv oder per Adresse), Prop icon
- In Spalten (z. B. Downloads) schlichte Form statt Band
- Zurück-Links als breadcrumbs (IT-Service), Profil bearbeiten mit PageHeader
- Plugin-Assets: Fingerabdruck berücksichtigt Änderungszeiten der Dateien

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 20:05:37 +00:00

1 line
No EOL
7.3 KiB
JavaScript
Raw 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 ee,P as te,j as n}from"./ui-DTELwomD.js";import{C as r,Et as i,O as a,S as o,T as s,Y as ne,_t as c,a as l,d as u,g as d,h as re,k as f,kt as p,ot as m,q as h,st as g,v as ie,w as _,wt as v,x as y}from"./framework-CFqPLBV8.js";import{t as ae}from"./circle-alert-3v1aHtY0.js";import{t as b}from"./paperclip-Bi3mdP3P.js";import{t as x}from"./send-BEFYa2vh.js";import{bt as S,d as C,l as w,r as T,s as E,st as oe,u as D}from"./app-DPANCdgI.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=y(()=>G.assets.ok?G.assets.data:[]),q=y(()=>G.options.ok?G.options.data.categories:[]),J=y(()=>G.options.ok?G.options.data.locations:[]),Y=l({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=c(null),Z=c(!1),Q=c(``);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(c,l)=>(h(),r(C,{title:`Ticket erstellen`},{default:m(()=>[f(D,{title:`Ticket erstellen`,breadcrumbs:[{label:`Meine IT`,href:`/it-service`}],description:`Beschreiben Sie kurz, was nicht funktioniert – die IT meldet sich.`}),o(`form`,{class:`grid grid-cols-1 items-start gap-6 lg:grid-cols-12`,onSubmit:d(de,[`prevent`])},[f(w,{title:`Worum geht es?`,class:`lg:col-span-5 xl:col-span-4`},{default:m(()=>[o(`div`,O,[(h(!0),s(ie,null,ne(K.value,e=>(h(),s(`label`,{key:e.id,class:i([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,v(Y).asset_id===e.id?`border-brand bg-brand-soft/60 ring-1 ring-brand`:`hover:bg-accent/60`])},[g(o(`input`,{"onUpdate:modelValue":l[0]||=e=>v(Y).asset_id=e,type:`radio`,value:e.id,class:`sr-only`},null,8,k),[[u,v(Y).asset_id]]),o(`span`,A,[f(v(oe),{class:`size-4`})]),o(`span`,j,[o(`span`,M,p(e.name),1),o(`span`,N,p([e.type,e.serial&&`SN ${e.serial}`].filter(Boolean).join(` · `)),1)])],2))),128)),o(`label`,{class:i([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,v(Y).asset_id?`hover:bg-accent/60`:`border-brand bg-brand-soft/60 ring-1 ring-brand`])},[g(o(`input`,{"onUpdate:modelValue":l[1]||=e=>v(Y).asset_id=e,type:`radio`,value:null,class:`sr-only`},null,512),[[u,v(Y).asset_id]]),o(`span`,P,[f(v(S),{class:`size-4`})]),l[11]||=o(`span`,null,[o(`span`,{class:`block text-sm font-medium`},`Allgemeines Anliegen`),o(`span`,{class:`block text-xs text-muted-foreground`},`ohne bestimmtes Gerät, z. B. Zugang, Software, Frage`)],-1)],2),W.assets.ok?_(``,!0):(h(),s(`p`,F,[f(v(ae),{class:`size-3.5`}),l[12]||=a(` Ihre Geräte konnten nicht geladen werden.`,-1)]))])]),_:1}),f(w,{title:`Beschreibung`,class:`lg:col-span-7 xl:col-span-8`},{default:m(()=>[o(`div`,I,[o(`div`,L,[f(E,{id:`category`,label:`Kategorie`,error:v(Y).errors.category_id,hint:q.value.length?``:`Kategorien konnten nicht geladen werden.`},{default:m(()=>[f(T,{id:`category`,modelValue:v(Y).category_id,"onUpdate:modelValue":l[2]||=e=>v(Y).category_id=e,options:q.value,"search-placeholder":`Kategorie suchen …`,disabled:!q.value.length,"aria-invalid":!!v(Y).errors.category_id},null,8,[`modelValue`,`options`,`disabled`,`aria-invalid`])]),_:1},8,[`error`,`hint`]),f(E,{id:`location`,label:`Standort`,error:v(Y).errors.location_id,hint:J.value.length?`Wo tritt das Problem auf?`:`Standorte konnten nicht geladen werden.`},{default:m(()=>[f(T,{id:`location`,modelValue:v(Y).location_id,"onUpdate:modelValue":l[3]||=e=>v(Y).location_id=e,options:J.value,"search-placeholder":`Standort suchen …`,disabled:!J.value.length,"aria-invalid":!!v(Y).errors.location_id},null,8,[`modelValue`,`options`,`disabled`,`aria-invalid`])]),_:1},8,[`error`,`hint`])]),f(E,{id:`subject`,label:`Betreff`,error:v(Y).errors.subject},{default:m(()=>[f(v(t),{id:`subject`,modelValue:v(Y).subject,"onUpdate:modelValue":l[4]||=e=>v(Y).subject=e,maxlength:`200`,placeholder:`z. B. Drucker im 2. OG druckt nicht`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),f(E,{id:`description`,label:`Nachricht`,error:v(Y).errors.description,hint:`Was ist passiert? Seit wann? Gibt es eine Fehlermeldung? Was haben Sie schon versucht?`},{default:m(()=>[f(v(n),{id:`description`,modelValue:v(Y).description,"onUpdate:modelValue":l[5]||=e=>v(Y).description=e,rows:`14`,maxlength:`20000`,class:`min-h-72`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),o(`div`,R,[l[15]||=o(`span`,{class:`text-[13px] font-medium`},`Anhang (optional)`,-1),v(Y).attachment?(h(),s(`div`,z,[f(v(b),{class:`size-4 shrink-0 text-muted-foreground`}),o(`span`,B,p(v(Y).attachment.name),1),o(`span`,V,p(ue(v(Y).attachment.size)),1),o(`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},[f(v(e),{class:`size-4`})])])):(h(),s(`div`,{key:0,class:i([`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:l[6]||=e=>X.value?.click(),onKeydown:l[7]||=re(d(e=>X.value?.click(),[`prevent`]),[`enter`]),onDragover:l[8]||=d(e=>Z.value=!0,[`prevent`]),onDragleave:l[9]||=e=>Z.value=!1,onDrop:d(ce,[`prevent`])},[f(v(b),{class:`size-5`}),l[13]||=o(`span`,null,[o(`span`,{class:`font-medium text-foreground`},`Datei auswählen`),a(` oder hierher ziehen`)],-1),l[14]||=o(`span`,{class:`text-xs`},`z. B. Screenshot oder Fehlermeldung – Bild, PDF, Text oder Word, höchstens 10 MB`,-1)],34)),o(`input`,{ref_key:`fileInput`,ref:X,type:`file`,class:`hidden`,accept:`image/*,.pdf,.txt,.doc,.docx`,onChange:l[10]||=e=>$(e.target.files?.[0])},null,544),Q.value||v(Y).errors.attachment?(h(),s(`p`,se,p(Q.value||v(Y).errors.attachment),1)):_(``,!0)]),o(`div`,H,[f(v(te),{type:`submit`,disabled:v(Y).processing},{default:m(()=>[v(Y).processing?(h(),r(v(ee),{key:0,class:`animate-spin`})):(h(),r(v(x),{key:1})),l[16]||=a(` Ticket absenden `,-1)]),_:1},8,[`disabled`])])])]),_:1})],32)]),_:1}))}};export{W as default};