Loheide-eu-mitarbeiterplatt.../public/build/assets/TicketCreate-B9aHc6jg.js
Friederich Loheide cf5b71cdd9
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m40s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m27s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m6s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m14s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m55s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m54s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m59s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m57s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m43s
Fehlerprotokoll im Systemzustand, Bilder in Stellen- und Terminbeschreibungen (0.28.1)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 10:32:14 +00:00

1 line
No EOL
7.7 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{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{a as re,i as ie}from"./dist--2OKCVzt.js";import{t as ae}from"./arrow-left-DROE4wuA.js";import{t as oe}from"./circle-alert-AqOvEy07.js";import{t as g}from"./loader-circle-Wr6tQn-J.js";import{t as _}from"./paperclip-BU1eARzf.js";import{t as v}from"./send-B_gp9Kto.js";import{t as y}from"./x-DU8daajy.js";import{C as b,Ft as se,T as ce,b as x,d as S,g as C,p as w,qt as T,u as E,w as D}from"./app-CNTwhoXr.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(ce,{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(ae),{class:`size-4`}),f[11]||=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:m(pe,[`prevent`])},[e(b,{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(se),{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(T),{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(oe),{class:`size-3.5`}),f[13]||=t(` Ihre Geräte konnten nicht geladen werden.`,-1)]))])]),_:1}),e(b,{title:`Beschreibung`,class:`lg:col-span-7 xl:col-span-8`},{default:l(()=>[a(`div`,I,[a(`div`,L,[e(x,{id:`category`,label:`Kategorie`,error:n(Y).errors.category_id,hint:q.value.length?``:`Kategorien konnten nicht geladen werden.`},{default:l(()=>[e(C,{id:`category`,modelValue:n(Y).category_id,"onUpdate:modelValue":f[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(x,{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(C,{id:`location`,modelValue:n(Y).location_id,"onUpdate:modelValue":f[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(x,{id:`subject`,label:`Betreff`,error:n(Y).errors.subject},{default:l(()=>[e(n(S),{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(x,{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(E),{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(_),{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(_),{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(w),{type:`submit`,disabled:n(Y).processing},{default:l(()=>[n(Y).processing?(c(),d(n(g),{key:0,class:`animate-spin`})):(c(),d(n(v),{key:1})),f[17]||=t(` Ticket absenden `,-1)]),_:1},8,[`disabled`])])])]),_:1})],32)]),_:1}))}};export{W as default};