Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m40s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m27s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m58s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m54s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m17s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m27s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m22s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m2s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 line
No EOL
5.7 KiB
JavaScript
1 line
No EOL
5.7 KiB
JavaScript
import{D as e,E as t,On as n,Yt as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as h,y as g}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as _,r as v}from"./app-BpMi0Mr-.js";import{O as y}from"./dist-DtGNiYlK.js";import{G as b,et as x}from"./AppIcon-B8qkzI4c.js";import{t as S}from"./arrow-left-BMImfTf2.js";import{t as C}from"./AppLayout-D_wU5oWa.js";import{t as w}from"./circle-alert-D8SqHL0j.js";import{t as T}from"./send-6fmdiUe6.js";import{t as E}from"./FormField-BoFAO4pm.js";import{t as D}from"./PageHeader-I6AvRMhh.js";import{n as O}from"./button-CwUSbS9X.js";import{t as k}from"./NativeSelect-G3km7PmI.js";import{t as A}from"./Panel-DAYQAcUD.js";import{t as j}from"./Input-FGSb2-yK.js";import{t as M}from"./Textarea-DEFXqC2w.js";var N={class:`grid gap-2`,role:`radiogroup`,"aria-label":`Gerät`},P=[`value`],F={class:`grid size-9 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},I={class:`min-w-0`},L={class:`block text-sm font-medium`},R={class:`block truncate text-xs text-muted-foreground`},z={class:`grid size-9 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},B={key:0,class:`flex items-center gap-2 text-xs text-muted-foreground`},V={class:`grid gap-4`},H={class:`grid gap-4 sm:grid-cols-2`},U={class:`flex justify-end border-t pt-4`},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=c(()=>G.assets.ok?G.assets.data:[]),q=c(()=>G.options.ok?G.options.data.categories:[]),J=c(()=>G.options.ok?G.options.data.locations:[]),Y=_({asset_id:K.value.some(e=>e.id===G.assetId)?G.assetId:null,subject:``,description:``,category_id:null,location_id:G.defaultLocation});function X(){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`)}return(c,_)=>(l(),p(C,{title:`Ticket erstellen`},{default:d(()=>[e(n(v),{href:`/it-service`,class:`mb-3 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:d(()=>[e(n(S),{class:`size-4`}),_[6]||=t(` Meine IT`,-1)]),_:1}),e(D,{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:h(X,[`prevent`])},[e(A,{title:`Worum geht es?`,class:`lg:col-span-5 xl:col-span-4`},{default:d(()=>[a(`div`,N,[(l(!0),o(u,null,s(K.value,t=>(l(),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":_[0]||=e=>n(Y).asset_id=e,type:`radio`,value:t.id,class:`sr-only`},null,8,P),[[g,n(Y).asset_id]]),a(`span`,F,[e(n(b),{class:`size-4`})]),a(`span`,I,[a(`span`,L,f(t.name),1),a(`span`,R,f([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":_[1]||=e=>n(Y).asset_id=e,type:`radio`,value:null,class:`sr-only`},null,512),[[g,n(Y).asset_id]]),a(`span`,z,[e(n(x),{class:`size-4`})]),_[7]||=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?m(``,!0):(l(),o(`p`,B,[e(n(w),{class:`size-3.5`}),_[8]||=t(` Ihre Geräte konnten nicht geladen werden.`,-1)]))])]),_:1}),e(A,{title:`Beschreibung`,class:`lg:col-span-7 xl:col-span-8`},{default:d(()=>[a(`div`,V,[a(`div`,H,[e(E,{id:`category`,label:`Kategorie`,error:n(Y).errors.category_id,hint:q.value.length?``:`Kategorien konnten nicht geladen werden.`},{default:d(()=>[e(k,{id:`category`,modelValue:n(Y).category_id,"onUpdate:modelValue":_[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(E,{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:d(()=>[e(k,{id:`location`,modelValue:n(Y).location_id,"onUpdate:modelValue":_[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(E,{id:`subject`,label:`Betreff`,error:n(Y).errors.subject},{default:d(()=>[e(n(j),{id:`subject`,modelValue:n(Y).subject,"onUpdate:modelValue":_[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(E,{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:d(()=>[e(n(M),{id:`description`,modelValue:n(Y).description,"onUpdate:modelValue":_[5]||=e=>n(Y).description=e,rows:`14`,maxlength:`20000`,class:`min-h-72`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),a(`div`,U,[e(n(O),{type:`submit`,disabled:n(Y).processing},{default:d(()=>[n(Y).processing?(l(),p(n(y),{key:0,class:`animate-spin`})):(l(),p(n(T),{key:1})),_[9]||=t(` Ticket absenden `,-1)]),_:1},8,[`disabled`])])])]),_:1})],32)]),_:1}))}};export{W as default}; |