import{d as f,H as g,z as w,c as v,a,w as l,a$ as y,B as n,J as V,K as b,bn as x,L as E,i as C,h,b as B,C as r,o as N}from"./index-DqVhJ65C.js";/* empty css                *//* empty css                  */const U={class:"p-6"},z=f({__name:"Config",setup(F){const t=g({ticket_allow_create:1,ticket_auto_reply:"",ticket_categories:"技术支持,财务问题,投诉建议"}),_=async()=>{try{const o=await n.get("/admin/settings?group=ticket");if(o.code===0&&o.data){const e=o.data;e.ticket_allow_create!==void 0&&(t.ticket_allow_create=Number(e.ticket_allow_create)),e.ticket_auto_reply!==void 0&&(t.ticket_auto_reply=e.ticket_auto_reply),e.ticket_categories!==void 0&&(t.ticket_categories=e.ticket_categories)}}catch(o){console.error(o)}},d=async()=>{try{await n.post("/admin/settings",{...t,__group__:"ticket"}),r.success("保存成功")}catch(o){r.error(o.message)}};return w(()=>{_()}),(o,e)=>{const u=x,c=b,i=E,m=C,p=V,k=y;return N(),v("div",U,[a(k,{shadow:"hover"},{header:l(()=>[...e[3]||(e[3]=[B("span",{class:"font-bold"},"工单系统配置",-1)])]),default:l(()=>[a(p,{"label-width":"140px",class:"max-w-lg mt-4"},{default:l(()=>[a(c,{label:"允许创建工单"},{default:l(()=>[a(u,{modelValue:t.ticket_allow_create,"onUpdate:modelValue":e[0]||(e[0]=s=>t.ticket_allow_create=s),"active-text":"开启","inactive-text":"关闭","active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1}),a(c,{label:"自动回复内容"},{default:l(()=>[a(i,{modelValue:t.ticket_auto_reply,"onUpdate:modelValue":e[1]||(e[1]=s=>t.ticket_auto_reply=s),type:"textarea",rows:4,placeholder:"用户创建工单后的默认自动回复..."},null,8,["modelValue"])]),_:1}),a(c,{label:"工单分类"},{default:l(()=>[a(i,{modelValue:t.ticket_categories,"onUpdate:modelValue":e[2]||(e[2]=s=>t.ticket_categories=s),placeholder:"用逗号分隔，如：技术支持,财务问题,投诉建议"},null,8,["modelValue"])]),_:1}),a(c,{class:"mt-8"},{default:l(()=>[a(m,{type:"primary",onClick:d},{default:l(()=>[...e[4]||(e[4]=[h("保存配置",-1)])]),_:1})]),_:1})]),_:1})]),_:1})])}}});export{z as default};
