/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  *//* empty css                        *//* empty css                 *//* empty css                       *//* empty css                 */import{d as e}from"./index-403f799c.js";/* empty css                 *//* empty css                   */import{d as a,m as r,U as l,x as s,W as t,o as i,l as u,w as o,e as m,a as d,b as p,t as c,f as n,a4 as g,ab as h,ac as f,a3 as v,aa as y,S as b,Y as j,$ as _}from"./index-2b50ecca.js";const x={class:"flex flex-row justify-between"},w={class:"w-full"},q=m("span",{class:"ml-3 text-gray-400"},"范围:1-30",-1),V={class:"flex items-center w-full"},S=m("span",{class:"ml-3 text-gray-400"},"范围:50-300",-1),C={class:"flex justify-end"},T=a({__name:"subscribeSet",props:{primary:String|Number},emits:["close"],setup(a,{emit:T}){const U=a,k=r(),E=r({status:2,miniProgramIds:[]}),M=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"}]}),Y=r(!1);return U.primary&&(E.value.id=U.primary.id,E.value.chargeCoin=U.primary.charge_coin,E.value.chargeType=U.primary.d_charge_type,E.value.chargeSequence=U.primary.charge_sequence),s((()=>{})),(a,r)=>{const l=h,s=f,U=v,$=y,B=b,F=j,I=_;return t((i(),u(F,{model:E.value,"label-width":"120px",ref_key:"ruleForm",ref:k,rules:n(M),class:"pr-4"},{default:o((()=>[m("div",x,[m("div",w,[d(U,{label:"收费模式",prop:"chargeType"},{default:o((()=>[d(s,{modelValue:E.value.chargeType,"onUpdate:modelValue":r[0]||(r[0]=e=>E.value.chargeType=e)},{default:o((()=>[d(l,{label:1},{default:o((()=>[p("单集固定收费")])),_:1})])),_:1},8,["modelValue"])])),_:1}),d(U,{label:"起始集",prop:"chargeSequence"},{default:o((()=>[d($,{style:{width:"200px"},modelValue:E.value.chargeSequence,"onUpdate:modelValue":r[1]||(r[1]=e=>E.value.chargeSequence=e),modelModifiers:{number:!0},step:1,"step-strictly":"",placeholder:"请输入起始集"},null,8,["modelValue"]),q])),_:1}),d(U,{label:"单集定价",prop:"chargeCoin"},{default:o((()=>[m("div",V,[d($,{style:{width:"200px"},modelValue:E.value.chargeCoin,"onUpdate:modelValue":r[2]||(r[2]=e=>E.value.chargeCoin=e),modelModifiers:{number:!0},step:1,"step-strictly":"",placeholder:"请输入单集定价"},null,8,["modelValue"]),S])])),_:1})])]),m("div",C,[d(B,{type:"primary",onClick:r[3]||(r[3]=a=>{return r=k.value,E.value,void(r&&r.validate((a=>{a?e({...E.value}).then((e=>{g.success(e.message),T("close")})):Y.value=!1})).then((()=>{})));var r})},{default:o((()=>[p(c(a.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model","rules"])),[[I,Y.value]])}}});export{T as _};
