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-BYcXwl4U.js";import{i as b,c as I}from"./app-a6cKceqE.js";import{_ as w}from"./app-D3Et4GTp.js";import{_ as x}from"./app-Ufpj4Ll4.js";import{_ as C}from"./app-CQ-vNlMj.js";import{T as $}from"./app-CO4sV-Ic.js";import{_ as S}from"./app-DY-0PadZ.js";import{_ as V}from"./app-BS0eerYg.js";import{_ as D}from"./app-CignoBaV.js";import{_ as N}from"./app-DiDEoOb6.js";import{D as B}from"./app-7GBSHA5C.js";import"./app-DCd54JMo.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DPDEogA0.js";import"./app-DxjODhok.js";import"./app-CabATHnR.js";import"./app-BhzV4gWo.js";import"./app-ysQ8KbGS.js";import"./app-yt37eDzA.js";import"./app-BG60hdvp.js";import"./app-BQ5ggxk2.js";import"./app-SxAW7vhf.js";import"./app-D3zbrzdO.js";import"./app-DNz6g4aI.js";import"./app--MWyBMkA.js";import"./app-D5k1HLu9.js";import"./app-D2Wz0BUQ.js";import"./app-CrjU8lgK.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};
