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-SC54XQDl.js";import{i as b,c as I}from"./app-Ba7ZqSpq.js";import{_ as w}from"./app-CW8jtsM2.js";import{_ as x}from"./app-CVQkwzlf.js";import{_ as C}from"./app-DFulsyXy.js";import{T as $}from"./app-C28obFWS.js";import{_ as S}from"./app-T1ysvErZ.js";import{_ as V}from"./app-BPiEnth_.js";import{_ as D}from"./app-DWUwCFNm.js";import{_ as N}from"./app-huVLEujn.js";import{D as B}from"./app-ZeVDYyDS.js";import"./app-CL60OiIv.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-BjSCO7rC.js";import"./app-Dhl-Bw0H.js";import"./app-B2C_dtYI.js";import"./app-COidJXl1.js";import"./app-DnXuoh8P.js";import"./app-CkINxBL9.js";import"./app-PPG0ZS4d.js";import"./app--Lj8zATS.js";import"./app-Ch8j4za4.js";import"./app-C2mBgI5Z.js";import"./app-DPYq7hh-.js";import"./app-BPIIxVwk.js";import"./app-Dw0jKdCD.js";import"./app-DoVkxbmA.js";import"./app-CNHjdV6U.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};
