import{r as u,o as a,g as d,b as o,u as s,w as c,h as m,d as l,e as p,F as v,f as h,a as t,i as y,c as g,t as T}from"./app-DA7OTM4Q.js";import{i as b,c as I}from"./app-BT68AfZ-.js";import{_ as w}from"./app-CybU_KEp.js";import{_ as x}from"./app-DuUYZNNT.js";import{_ as C}from"./app-DokSVapq.js";import{T as $}from"./app-up4gT9D9.js";import{_ as S}from"./app-BMjG4tWp.js";import{_ as V}from"./app-DZWzqQm-.js";import{_ as D}from"./app-CKSEN_Rg.js";import{_ as N}from"./app-D2gM4iLU.js";import{D as B}from"./app-DNL2FXPk.js";import"./app-scFtFqL8.js";import"./app-DREBJ-ou.js";import"./app-CWBL8eTX.js";import"./app-CnGe5nlE.js";import"./app-OC5wWJiS.js";import"./app-BX4pd6U-.js";import"./app-Bhreb6Cm.js";import"./app-DSiZNBrr.js";import"./app-D29bbm9n.js";import"./app-Dxa5h-uG.js";import"./app-B_5dka6q.js";import"./app-BqY8p2gl.js";import"./app-CQwVTjAx.js";import"./app-o25MbL5M.js";import"./app-Bnbo6OlJ.js";import"./app-C-GI59rl.js";import"./app-BkWUIifj.js";import"./app-Zes_jb7S.js";function G(){b(this),this.addingType="one",this.$delay(function(){this.$refs.nameInput.focus(),this.changeUserId(0)}),this.success=this.$NotifySuccess("保存成功","/ns/domains"),this.setAddingType=function(n){switch(this.addingType=n,n){case"one":this.$delay(function(){this.$refs.nameInput.focus()});break;case"batch":this.$delay(function(){this.$refs.namesInput.focus()});break}},this.hasGroups=!1,this.changeUserId=function(n){this.$post("/ns/domains/groups/options").params({userId:n}).success(function(i){this.hasGroups=i.data.groups.length>0,this.hasGroups&&this.$delay(function(){this.$refs.groupSelector.reload(n)})})}}const q={key:0},A=["value"],M=t("td",{class:"title"},"域名 *",-1),F={class:"comment"},U={class:"comment"},E={colspan:"2"},O={key:0},R=t("td",null,"所属分组",-1),gt={__name:"create",setup(n){const i=u(),f=u(),_=u(),e=I(new G,{refs:{nameInput:i,namesInput:f,groupSelector:_}});return(j,r)=>(a(),d(v,null,[o(w,{"active-tab":"create"}),s(e).configIsValid?m("",!0):(a(),d("div",q,[o($,{error:""},{default:c(()=>[h("管理员尚未完成系统配置，暂时无法添加域名，请联系客服。")]),_:1})])),l(o(C,{action:"$",onSuccess:s(e).success},{default:c(()=>[t("input",{type:"hidden",name:"addingType",value:s(e).addingType},null,8,A),o(B,null,{default:c(()=>[t("tbody",null,[t("tr",null,[M,t("td",null,[l(t("div",null,[o(x,{name:"name",maxlength:"255",ref_key:"nameInput",ref:i,placeholder:"单个域名",class:"w-full"},null,512),t("p",F,[t("a",{href:"",onClick:r[0]||(r[0]=y(k=>s(e).setAddingType("batch"),["prevent"]))},"[批量添加]")])],512),[[p,s(e).addingType=="one"]]),l(t("div",null,[o(S,{rows:"10",name:"names",placeholder:"每行一个域名",ref_key:"namesInput",ref:f,class:"w-full"},null,512),t("p",U,[t("a",{href:"",onClick:r[1]||(r[1]=y(k=>s(e).setAddingType("one"),["prevent"]))},"[单个添加]")])],512),[[p,s(e).addingType=="batch"]])])]),t("tr",null,[t("td",E,[o(N)])])]),l(t("tbody",null,[s(e).hasGroups?(a(),d("tr",O,[R,t("td",null,[o(V,{ref_key:"groupSelector",ref:_},null,512)])])):m("",!0)],512),[[p,s(e).moreOptionsVisible]])]),_:1}),s(e).quotaCanCreate?(a(),g(D,{key:0})):m("",!0),s(e).quotaCanCreate?m("",!0):(a(),g($,{key:1,error:""},{default:c(()=>[h("已添加域名个数已超出最大限额（"+T(s(e).quotaMaxDomains)+"个域名），请升级套餐后重试。",1)]),_:1}))]),_:1},8,["onSuccess"]),[[p,s(e).configIsValid]])],64))}};export{gt as default};
