Loheide-eu-mitarbeiterplatt.../public/build/assets/TicketCreate-BBhCkfbv.js
Friederich Loheide 64d9e0bbed
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m47s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m50s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m4s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m13s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m43s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m44s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m55s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m14s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m1s
Plugin-Updates über update_url (0.24.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 08:06:22 +00:00

1 line
No EOL
7.7 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 l,qt as u,tr as d,v as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as te,w as h,y as g}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as ne,i as re}from"./dist--2OKCVzt.js";import{t as ie}from"./arrow-left-DROE4wuA.js";import{t as ae}from"./circle-alert-AqOvEy07.js";import{t as _}from"./loader-circle-Wr6tQn-J.js";import{t as v}from"./paperclip-BU1eARzf.js";import{t as y}from"./send-B_gp9Kto.js";import{t as b}from"./x-DU8daajy.js";import{E as x,Kt as oe,Pt as se,T as ce,_ as S,d as C,f as w,m as T,w as E,x as D}from"./app-ljw5ZzEq.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=ne({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=p(null),Z=p(!1),Q=p(``);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,p)=>(c(),f(x,{title:`Ticket erstellen`},{default:u(()=>[e(n(re),{href:`/it-service`,class:`mb-3 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:u(()=>[e(n(ie),{class:`size-4`}),p[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:h(pe,[`prevent`])},[e(E,{title:`Worum geht es?`,class:`lg:col-span-5 xl:col-span-4`},{default:u(()=>[a(`div`,O,[(c(!0),o(l,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":p[0]||=e=>n(Y).asset_id=e,type:`radio`,value:t.id,class:`sr-only`},null,8,k),[[g,n(Y).asset_id]]),a(`span`,A,[e(n(se),{class:`size-4`})]),a(`span`,j,[a(`span`,M,d(t.name),1),a(`span`,N,d([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":p[1]||=e=>n(Y).asset_id=e,type:`radio`,value:null,class:`sr-only`},null,512),[[g,n(Y).asset_id]]),a(`span`,P,[e(n(oe),{class:`size-4`})]),p[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?m(``,!0):(c(),o(`p`,F,[e(n(ae),{class:`size-3.5`}),p[13]||=t(` Ihre Geräte konnten nicht geladen werden.`,-1)]))])]),_:1}),e(E,{title:`Beschreibung`,class:`lg:col-span-7 xl:col-span-8`},{default:u(()=>[a(`div`,I,[a(`div`,L,[e(D,{id:`category`,label:`Kategorie`,error:n(Y).errors.category_id,hint:q.value.length?``:`Kategorien konnten nicht geladen werden.`},{default:u(()=>[e(S,{id:`category`,modelValue:n(Y).category_id,"onUpdate:modelValue":p[2]||=e=>n(Y).category_id=e,options:q.value,"search-placeholder":`Kategorie suchen …`,disabled:!q.value.length,"aria-invalid":!!n(Y).errors.category_id},null,8,[`modelValue`,`options`,`disabled`,`aria-invalid`])]),_:1},8,[`error`,`hint`]),e(D,{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:u(()=>[e(S,{id:`location`,modelValue:n(Y).location_id,"onUpdate:modelValue":p[3]||=e=>n(Y).location_id=e,options:J.value,"search-placeholder":`Standort suchen …`,disabled:!J.value.length,"aria-invalid":!!n(Y).errors.location_id},null,8,[`modelValue`,`options`,`disabled`,`aria-invalid`])]),_:1},8,[`error`,`hint`])]),e(D,{id:`subject`,label:`Betreff`,error:n(Y).errors.subject},{default:u(()=>[e(n(w),{id:`subject`,modelValue:n(Y).subject,"onUpdate:modelValue":p[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(D,{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:u(()=>[e(n(C),{id:`description`,modelValue:n(Y).description,"onUpdate:modelValue":p[5]||=e=>n(Y).description=e,rows:`14`,maxlength:`20000`,class:`min-h-72`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),a(`div`,le,[p[16]||=a(`span`,{class:`text-[13px] font-medium`},`Anhang (optional)`,-1),n(Y).attachment?(c(),o(`div`,R,[e(n(v),{class:`size-4 shrink-0 text-muted-foreground`}),a(`span`,z,d(n(Y).attachment.name),1),a(`span`,B,d(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(b),{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:p[6]||=e=>X.value?.click(),onKeydown:p[7]||=te(h(e=>X.value?.click(),[`prevent`]),[`enter`]),onDragover:p[8]||=h(e=>Z.value=!0,[`prevent`]),onDragleave:p[9]||=e=>Z.value=!1,onDrop:h(ue,[`prevent`])},[e(n(v),{class:`size-5`}),p[14]||=a(`span`,null,[a(`span`,{class:`font-medium text-foreground`},`Datei auswählen`),t(` oder hierher ziehen`)],-1),p[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:p[10]||=e=>$(e.target.files?.[0])},null,544),Q.value||n(Y).errors.attachment?(c(),o(`p`,V,d(Q.value||n(Y).errors.attachment),1)):m(``,!0)]),a(`div`,H,[e(n(T),{type:`submit`,disabled:n(Y).processing},{default:u(()=>[n(Y).processing?(c(),f(n(_),{key:0,class:`animate-spin`})):(c(),f(n(y),{key:1})),p[17]||=t(` Ticket absenden `,-1)]),_:1},8,[`disabled`])])])]),_:1})],32)]),_:1}))}};export{W as default};