import{d as e}from"./index-a3908905.js";/* empty css             *//* empty css                   */import{d as a,k as r,H as l,p as s,r as t,K as u,J as i,o,j as d,w as m,e as c,a as n,b as p,t as g,f as h,O as f}from"./index-018fb6dd.js";const v={class:"flex flex-row justify-between"},y={class:"w-full"},b=c("span",{class:"ml-3 text-gray-400"},"范围:1-30",-1),_={class:"flex items-center w-full"},x=c("span",{class:"ml-3 text-gray-400"},"范围:50-300",-1),w={class:"flex justify-end"},q=a({__name:"subscribeSet",props:{primary:String|Number},emits:["close"],setup(a,{emit:q}){const V=a,j=r(),S=r({status:2,miniProgramIds:[]}),C=l({chargeType:[{required:!0,message:"请选择收费模式",trigger:"change"}],chargeSequence:[{required:!0,message:"请输入起始集",trigger:"blur"},{validator:(e,a,r)=>{a<1||a>30?r(new Error("范围必须在 1 到 30 之间")):r()},trigger:"blur"}],chargeCoin:[{required:!0,message:"请输入单集定价",trigger:"blur"},{validator:(e,a,r)=>{a<50||a>300?r(new Error("范围必须在 50 到 300 之间")):r()},trigger:"blur"}]}),T=r(!1);return V.primary&&(S.value.id=V.primary.id,S.value.chargeCoin=V.primary.charge_coin,S.value.chargeType=V.primary.d_charge_type,S.value.chargeSequence=V.primary.charge_sequence),s((()=>{})),(a,r)=>{const l=t("el-radio"),s=t("el-radio-group"),V=t("el-form-item"),k=t("el-input-number"),U=t("el-button"),E=t("el-form"),I=u("loading");return i((o(),d(E,{model:S.value,"label-width":"120px",ref_key:"ruleForm",ref:j,rules:h(C),class:"pr-4"},{default:m((()=>[c("div",v,[c("div",y,[n(V,{label:"收费模式",prop:"chargeType"},{default:m((()=>[n(s,{modelValue:S.value.chargeType,"onUpdate:modelValue":r[0]||(r[0]=e=>S.value.chargeType=e)},{default:m((()=>[n(l,{label:1},{default:m((()=>[p("单集固定收费")])),_:1})])),_:1},8,["modelValue"])])),_:1}),n(V,{label:"起始集",prop:"chargeSequence"},{default:m((()=>[n(k,{style:{width:"200px"},modelValue:S.value.chargeSequence,"onUpdate:modelValue":r[1]||(r[1]=e=>S.value.chargeSequence=e),modelModifiers:{number:!0},step:1,"step-strictly":"",placeholder:"请输入起始集"},null,8,["modelValue"]),b])),_:1}),n(V,{label:"单集定价",prop:"chargeCoin"},{default:m((()=>[c("div",_,[n(k,{style:{width:"200px"},modelValue:S.value.chargeCoin,"onUpdate:modelValue":r[2]||(r[2]=e=>S.value.chargeCoin=e),modelModifiers:{number:!0},step:1,"step-strictly":"",placeholder:"请输入单集定价"},null,8,["modelValue"]),x])])),_:1})])]),c("div",w,[n(U,{type:"primary",onClick:r[3]||(r[3]=a=>{return r=j.value,S.value,void(r&&r.validate((a=>{a?e({...S.value}).then((e=>{f.success(e.message),q("close")})):T.value=!1})).then((()=>{})));var r})},{default:m((()=>[p(g(a.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model","rules"])),[[I,T.value]])}}});export{q as _};
