import{_ as w,r as c,o as t,c as o,a as e,j as m,v as k,b as r,F as f,e as I,t as b,g as x,l as S,s as B,x as N}from"./app-211db244.js";import{i as y}from"./http-6b833e16.js";const a=_=>(B("data-v-04d8426c"),_=_(),N(),_),U=a(()=>e("div",null,[e("h3",null,"发工单")],-1)),D=a(()=>e("h5",null,"有遇到什么问题吗？",-1)),F=x(" 您可以选择以下常见问题： "),M=x("   "),j={class:"input-group mb-3"},E={key:0,class:"input-group"},L={key:1},R={key:0},q=a(()=>e("h5",{class:"mt-3"},"选择发工单的平台",-1)),z=a(()=>e("p",null,"如果您在选中的平台没有账号，我们将会帮您自动创建一个。",-1)),A={class:"form-group form-check"},G=["id","value"],H=["textContent","for"],J={key:1},K=a(()=>e("h5",{class:"mt-3"},"暂时没有可用的提供商",-1)),O=[K],P={key:2},Q=["textContent","disabled"],W={key:0},X={key:1,class:"mt-3"},Y=a(()=>e("h5",null,"完成",-1)),Z=a(()=>e("p",null,"如果您浏览器没有打开新的创建，请点击以下链接来打开。",-1)),$=["href"],ee={name:"Ticket",setup(_){const u=c([]),v=c(""),l=c(""),n=c(""),p=c(""),d=c(!1);y.get("providers").then(h=>{u.value=h.data,u.value.length>0&&(v.value=u.value[0])});function g(){d.value=!0,y.post("providers/"+v.value+"/ticket",{title:l.value,content:n.value}).then(h=>{p.value=h.data.redirect_url,setTimeout(()=>{window.open(p.value,"_blank")})}).finally(()=>{d.value=!1})}function C(){l.value="域名 {你的域名} 过白。",n.value="您好，我的域名已备案，请将我的域名 {你的域名} 加入白名单，谢谢。"}function T(){l.value="{节点} 的隧道无法连接。",n.value="您好，这个节点无法连接，请检查。"}return(h,i)=>(t(),o(f,null,[U,e("div",null,[D,e("div",{class:"mb-3"},[F,e("a",{onClick:C,class:"link"},"域名白名单"),M,e("a",{onClick:T,class:"link"},"映射问题")]),e("div",j,[m(e("input",{autofocus:"",type:"text",class:"form-control",placeholder:"简要概述您遇到的问题","onUpdate:modelValue":i[0]||(i[0]=s=>l.value=s)},null,512),[[k,l.value]])]),l.value?(t(),o("div",E,[m(e("textarea",{class:"form-control","onUpdate:modelValue":i[1]||(i[1]=s=>n.value=s),placeholder:"详细说明您遇到的问题..."},null,512),[[k,n.value]])])):r("",!0),l.value?(t(),o("div",L,[u.value?(t(),o("div",R,[q,z,(t(!0),o(f,null,I(u.value,s=>(t(),o("div",A,[m(e("input",{type:"radio",class:"form-check-input",name:"provider",id:"providers_"+s,value:s,"onUpdate:modelValue":i[2]||(i[2]=V=>v.value=V)},null,8,G),[[S,v.value,void 0,{value:!0}]]),e("label",{textContent:b(s),class:"form-check-label",for:"providers_"+s},null,8,H)]))),256))])):(t(),o("div",J,O)),n.value?(t(),o("div",P,[e("button",{class:"btn btn-primary mt-3",onClick:g,textContent:b(d.value?"请稍后":"创建工单"),disabled:d.value},null,8,Q)])):r("",!0)])):r("",!0)]),d.value?(t(),o("p",W,"正在打开工单...")):r("",!0),p.value?(t(),o("div",X,[Y,Z,e("a",{href:p.value,class:"link",target:"_blank"},"打开工单",8,$)])):r("",!0)],64))}},se=w(ee,[["__scopeId","data-v-04d8426c"]]);export{se as default};
