/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  *//* empty css                 *//* empty css               *//* empty css                  *//* empty css                     *//* empty css                  */import{a as e}from"./index-7475c2a5.js";import{a}from"./index-d821df42.js";import{f as l}from"./index-f8a69d0c.js";import{d as r,R as t,m as s,x as i,X as m,f as o,o as d,l as n,w as u,a as p,c,F as _,y as f,e as h,b as g,t as v,a5 as b,a3 as y,a4 as x,A as j,B as V,U as k,Z as C,a0 as q}from"./index-0ffeeea6.js";/* empty css                 *//* empty css                   */const w=h("div",{class:"flex items-center"},[h("span",{class:"mr-1 text-red-600"},"*"),g("充值模板配置 ")],-1),F={class:"flex flex-col"},U={class:"flex items-center"},S=h("div",{style:{width:"80px","text-align":"end"},class:"mb-3 mr-2"},"首充模板:",-1),N={class:"flex items-center"},J=h("div",{style:{width:"80px","text-align":"end"},class:"mr-2"},"非首充模板:",-1),O={class:"flex justify-end"},A=r({__name:"create",props:{primary:String|Number},emits:["close"],setup(r,{emit:A}){const B=r,E=t(),H=s(!1),I=s(),M=s([]),R=s([]),X=s([]),Z=s({});B.primary&&(Z.value=JSON.parse(JSON.stringify(B.primary)),B.primary);const $=(e,a)=>{switch(a){case"firstCharge":D("firstCharge",{name:e});break;case"notFirstCharge":D("notFirstCharge",{name:e})}},z=()=>{E.push({path:"/chargeManage/charge"})},D=(e,a)=>{switch(e){case"firstCharge":l({limit:999,type:1,...a}).then((e=>{M.value=e.data}));break;case"notFirstCharge":l({limit:999,type:2,...a}).then((e=>{R.value=e.data}))}};return i((()=>{var a;D("firstCharge"),D("notFirstCharge"),e({video_id:B.primary.video_id,limit:999,...a}).then((e=>{X.value=e.data}))})),(e,l)=>{const r=y,t=x,s=j,i=V,E=k,D=C,G=q;return m((d(),n(D,{model:o(Z),"label-width":"120px",ref_key:"form",ref:I,class:"pr-4"},{default:u((()=>[p(t,{label:"推广名称",prop:"name",rules:[{required:!1,message:"推广名称必须填写"}]},{default:u((()=>[p(r,{disabled:"",modelValue:B.primary.name,"onUpdate:modelValue":l[0]||(l[0]=e=>B.primary.name=e),clearable:""},null,8,["modelValue"])])),_:1}),p(t,{label:"入口剧集",prop:"series_sequence",rules:[{required:!0,message:"入口剧集必须填写",trigger:"change"}]},{default:u((()=>[p(i,{modelValue:o(Z).series_sequence,"onUpdate:modelValue":l[1]||(l[1]=e=>o(Z).series_sequence=e),filterable:"",clearable:"",placeholder:"选择入口剧集"},{default:u((()=>[(d(!0),c(_,null,f(o(X),((e,a)=>(d(),n(s,{key:a,label:e.series_name,value:e.series_sequence},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),p(t,{label:"充值模板配置"},{label:u((()=>[w])),default:u((()=>[h("div",{class:"items-center w-full withdraw-popup-warn"},[h("div",null,[g("如果没有目标充值模板，请前往"),h("span",{class:"text-lg font-bold text-blue-400 cursor-pointer",onClick:z},"充值管理"),g("进行添加 ")])]),h("div",F,[h("div",U,[S,p(i,{modelValue:o(Z).first_charge_template_id,"onUpdate:modelValue":l[2]||(l[2]=e=>o(Z).first_charge_template_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{$(e,"firstCharge")},placeholder:"请选择首充模板"},{default:u((()=>[(d(!0),c(_,null,f(o(M),((e,a)=>(d(),n(s,{key:a,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue","remote-method"])]),h("div",N,[J,p(i,{modelValue:o(Z).not_first_charge_template_id,"onUpdate:modelValue":l[3]||(l[3]=e=>o(Z).not_first_charge_template_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{$(e,"notFirstCharge")},placeholder:"请选择非首充模板"},{default:u((()=>[(d(!0),c(_,null,f(o(R),((e,a)=>(d(),n(s,{key:a,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue","remote-method"])])])])),_:1}),p(t,{label:"备注",prop:"name",rules:[{required:!1,message:"备注必须填写"}]},{default:u((()=>[p(r,{modelValue:o(Z).remark,"onUpdate:modelValue":l[4]||(l[4]=e=>o(Z).remark=e),clearable:""},null,8,["modelValue"])])),_:1}),h("div",O,[p(E,{type:"primary",onClick:l[5]||(l[5]=e=>{return l=o(I),Z.value.first_charge_template_id?Z.value.not_first_charge_template_id?(H.value=!0,void(l&&l.validate((e=>{if(e){const e={id:Z.value.id,series_sequence:Z.value.series_sequence,remark:Z.value.remark,first_charge_template_id:Z.value.first_charge_template_id,not_first_charge_template_id:Z.value.not_first_charge_template_id};a(e).then((e=>{b.success(e.message),A("close"),H.value=!1})).catch((e=>{H.value=!1}))}else H.value=!1})).then((()=>{})))):b.error("请选择非首充模板"):b.error("请选择首充模板");var l})},{default:u((()=>[g(v(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[G,o(H)]])}}});export{A as _};
