Loheide-eu-mitarbeiterplatt.../public/build/assets/TicketCreate-JJVa4wGJ.js
Friederich Loheide 72690f254f
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m38s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m34s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m10s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m59s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m23s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m30s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m49s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m45s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
Eckig gilt überall: Pillen-Radius folgt dem Erscheinungsbild
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 21:25:02 +00:00

1 line
No EOL
7.9 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{D as e,E as t,On as n,Yt as r,Zn as i,_ as a,b as o,bt as ee,g as s,mt as c,o as te,qt as l,tr as u,v as d,vn as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as ne,w as m,y as h}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as re,r as ie}from"./app-B4sfnfR-.js";import{O as ae}from"./dist-DtGNiYlK.js";import{G as oe,et as g}from"./AppIcon-Dap2csd5.js";import{t as _}from"./arrow-left-BMImfTf2.js";import{t as v}from"./AppLayout-THvSrLN0.js";import{v as y}from"./http-CAG9BrJF.js";import{t as b}from"./circle-alert-D8SqHL0j.js";import{t as x}from"./paperclip-DmVAQ5Y5.js";import{t as se}from"./send-6fmdiUe6.js";import{t as S}from"./FormField-BoFAO4pm.js";import{t as ce}from"./PageHeader-CHOiGuTC.js";import{n as C}from"./button-CwUSbS9X.js";import{t as w}from"./NativeSelect-G3km7PmI.js";import{t as T}from"./Panel-R71QUGZp.js";import{t as E}from"./Input-FGSb2-yK.js";import{t as D}from"./Textarea-DEFXqC2w.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`},le={class:`grid gap-1.5`},R={key:1,class:`flex items-center gap-3 rounded-lg border bg-muted/40 px-3 py-2.5 text-sm`},z={class:`min-w-0 flex-1 truncate`},B={class:`shrink-0 text-xs text-muted-foreground`},V={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=s(()=>G.assets.ok?G.assets.data:[]),q=s(()=>G.options.ok?G.options.data.categories:[]),J=s(()=>G.options.ok?G.options.data.locations:[]),Y=re({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=f(null),Z=f(!1),Q=f(``);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 ue(e){Z.value=!1,$(e.dataTransfer?.files?.[0])}function de(){Y.attachment=null,X.value&&(X.value.value=``)}let fe=e=>e>1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function pe(){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(s,f)=>(c(),d(v,{title:`Ticket erstellen`},{default:l(()=>[e(n(ie),{href:`/it-service`,class:`mb-3 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:l(()=>[e(n(_),{class:`size-4`}),f[11]||=t(` Meine IT`,-1)]),_:1}),e(ce,{title:`Ticket erstellen`,description:`Beschreiben Sie kurz, was nicht funktioniert – die IT meldet sich.`}),a(`form`,{class:`grid grid-cols-1 items-start gap-6 lg:grid-cols-12`,onSubmit:m(pe,[`prevent`])},[e(T,{title:`Worum geht es?`,class:`lg:col-span-5 xl:col-span-4`},{default:l(()=>[a(`div`,O,[(c(!0),o(te,null,ee(K.value,t=>(c(),o(`label`,{key:t.id,class:i([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,n(Y).asset_id===t.id?`border-brand bg-brand-soft/60 ring-1 ring-brand`:`hover:bg-accent/60`])},[r(a(`input`,{"onUpdate:modelValue":f[0]||=e=>n(Y).asset_id=e,type:`radio`,value:t.id,class:`sr-only`},null,8,k),[[h,n(Y).asset_id]]),a(`span`,A,[e(n(oe),{class:`size-4`})]),a(`span`,j,[a(`span`,M,u(t.name),1),a(`span`,N,u([t.type,t.serial&&`SN ${t.serial}`].filter(Boolean).join(` · `)),1)])],2))),128)),a(`label`,{class:i([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,n(Y).asset_id?`hover:bg-accent/60`:`border-brand bg-brand-soft/60 ring-1 ring-brand`])},[r(a(`input`,{"onUpdate:modelValue":f[1]||=e=>n(Y).asset_id=e,type:`radio`,value:null,class:`sr-only`},null,512),[[h,n(Y).asset_id]]),a(`span`,P,[e(n(g),{class:`size-4`})]),f[12]||=a(`span`,null,[a(`span`,{class:`block text-sm font-medium`},`Allgemeines Anliegen`),a(`span`,{class:`block text-xs text-muted-foreground`},`ohne bestimmtes Gerät, z. B. Zugang, Software, Frage`)],-1)],2),W.assets.ok?p(``,!0):(c(),o(`p`,F,[e(n(b),{class:`size-3.5`}),f[13]||=t(` Ihre Geräte konnten nicht geladen werden.`,-1)]))])]),_:1}),e(T,{title:`Beschreibung`,class:`lg:col-span-7 xl:col-span-8`},{default:l(()=>[a(`div`,I,[a(`div`,L,[e(S,{id:`category`,label:`Kategorie`,error:n(Y).errors.category_id,hint:q.value.length?``:`Kategorien konnten nicht geladen werden.`},{default:l(()=>[e(w,{id:`category`,modelValue:n(Y).category_id,"onUpdate:modelValue":f[2]||=e=>n(Y).category_id=e,options:q.value,placeholder:`– bitte wählen –`,required:q.value.length>0,disabled:!q.value.length},null,8,[`modelValue`,`options`,`required`,`disabled`])]),_:1},8,[`error`,`hint`]),e(S,{id:`location`,label:`Standort`,error:n(Y).errors.location_id,hint:J.value.length?`Wo tritt das Problem auf?`:`Standorte konnten nicht geladen werden.`},{default:l(()=>[e(w,{id:`location`,modelValue:n(Y).location_id,"onUpdate:modelValue":f[3]||=e=>n(Y).location_id=e,options:J.value,placeholder:`– bitte wählen –`,required:J.value.length>0,disabled:!J.value.length},null,8,[`modelValue`,`options`,`required`,`disabled`])]),_:1},8,[`error`,`hint`])]),e(S,{id:`subject`,label:`Betreff`,error:n(Y).errors.subject},{default:l(()=>[e(n(E),{id:`subject`,modelValue:n(Y).subject,"onUpdate:modelValue":f[4]||=e=>n(Y).subject=e,maxlength:`200`,placeholder:`z. B. Drucker im 2. OG druckt nicht`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),e(S,{id:`description`,label:`Nachricht`,error:n(Y).errors.description,hint:`Was ist passiert? Seit wann? Gibt es eine Fehlermeldung? Was haben Sie schon versucht?`},{default:l(()=>[e(n(D),{id:`description`,modelValue:n(Y).description,"onUpdate:modelValue":f[5]||=e=>n(Y).description=e,rows:`14`,maxlength:`20000`,class:`min-h-72`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),a(`div`,le,[f[16]||=a(`span`,{class:`text-[13px] font-medium`},`Anhang (optional)`,-1),n(Y).attachment?(c(),o(`div`,R,[e(n(x),{class:`size-4 shrink-0 text-muted-foreground`}),a(`span`,z,u(n(Y).attachment.name),1),a(`span`,B,u(fe(n(Y).attachment.size)),1),a(`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:de},[e(n(y),{class:`size-4`})])])):(c(),o(`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: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(ue,[`prevent`])},[e(n(x),{class:`size-5`}),f[14]||=a(`span`,null,[a(`span`,{class:`font-medium text-foreground`},`Datei auswählen`),t(` oder hierher ziehen`)],-1),f[15]||=a(`span`,{class:`text-xs`},`z. B. Screenshot oder Fehlermeldung – Bild, PDF, Text oder Word, höchstens 10 MB`,-1)],34)),a(`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||n(Y).errors.attachment?(c(),o(`p`,V,u(Q.value||n(Y).errors.attachment),1)):p(``,!0)]),a(`div`,H,[e(n(C),{type:`submit`,disabled:n(Y).processing},{default:l(()=>[n(Y).processing?(c(),d(n(ae),{key:0,class:`animate-spin`})):(c(),d(n(se),{key:1})),f[17]||=t(` Ticket absenden `,-1)]),_:1},8,[`disabled`])])])]),_:1})],32)]),_:1}))}};export{W as default};