/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  *//* empty css                 *//* empty css               *//* empty css                  *//* empty css                     *//* empty css                  */import{c as e}from"./index-df416b18.js";import{f as a}from"./index-24473529.js";import{d as l,Q as t,m as s,x as r,W as i,o,l as m,w as d,a as n,e as u,b as p,c,F as f,y as v,t as h,a4 as _,a2 as g,a3 as b,A as j,B as y,S as x,Y as C,$ as V,az as w,aA as k,_ as F}from"./index-2b50ecca.js";/* empty css                 *//* empty css                   */import"./http-aa208300.js";/* empty css                   */const q=e=>(w("data-v-836c481a"),e=e(),k(),e),U=q((()=>u("div",{class:"flex items-center"},[u("span",{class:"mr-1 text-red-600"},"*"),p("充值模板配置 ")],-1))),O={class:"flex flex-col"},S={class:"flex items-center"},A=q((()=>u("div",{style:{width:"80px","text-align":"end"},class:"mb-3 mr-2"},"首充模板:",-1))),J={class:"flex items-center"},N=q((()=>u("div",{style:{width:"80px","text-align":"end"},class:"mr-2"},"非首充模板:",-1))),Y={class:"flex justify-end"},$=F(l({__name:"detailForm",props:{primary:Object},emits:["close"],setup(l,{emit:w}){var k;const F=l,q=t(),$=s(),z=s({});s(!1);const B=s(!1),I=s([]),L=s([]);F.primary&&(F.primary,(null==(k=F.primary)?void 0:k.video_id)&&(z.value=JSON.parse(JSON.stringify(F.primary))));const M=(e,a)=>{switch(a){case"firstCharge":T("firstCharge",{name:e});break;case"notFirstCharge":T("notFirstCharge",{name:e})}},Q=()=>{q.push({path:"/chargeManage/charge"})},T=(e,l)=>{switch(e){case"firstCharge":a({limit:999,type:1,...l}).then((e=>{I.value=e.data}));break;case"notFirstCharge":a({limit:999,type:2,...l}).then((e=>{L.value=e.data}))}};return r((()=>{T("firstCharge"),T("notFirstCharge")})),(a,l)=>{const t=g,s=b,r=j,k=y,F=x,T=C,W=V;return i((o(),m(T,{model:z.value,"label-width":"120px",ref_key:"form",ref:$,class:"pr-4"},{default:d((()=>[n(s,{label:"推广名称",prop:"name",rules:[{required:!0,message:"推广名称必须填写"}]},{default:d((()=>[n(t,{modelValue:z.value.name,"onUpdate:modelValue":l[0]||(l[0]=e=>z.value.name=e),name:"name",clearable:""},null,8,["modelValue"])])),_:1}),n(s,{label:"入口章节",prop:"series_sequence",rules:[{required:!1,message:"入口章节必须填写"}]},{default:d((()=>[n(t,{disabled:"",modelValue:z.value.series_name,"onUpdate:modelValue":l[1]||(l[1]=e=>z.value.series_name=e),name:"author",clearable:""},null,8,["modelValue"])])),_:1}),n(s,{label:"充值模板配置"},{label:d((()=>[U])),default:d((()=>[u("div",{class:"items-center w-full withdraw-popup-warn"},[u("div",null,[p("如果没有目标充值模板，请前往"),u("span",{class:"text-lg font-bold text-blue-400 cursor-pointer",onClick:Q},"充值管理"),p("进行添加 ")])]),u("div",O,[u("div",S,[A,n(k,{modelValue:z.value.first_charge_template_id,"onUpdate:modelValue":l[2]||(l[2]=e=>z.value.first_charge_template_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{M(e,"firstCharge")},placeholder:"请选择首充模板"},{default:d((()=>[(o(!0),c(f,null,v(I.value,((e,a)=>(o(),m(r,{key:a,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue","remote-method"])]),u("div",J,[N,n(k,{modelValue:z.value.not_first_charge_template_id,"onUpdate:modelValue":l[3]||(l[3]=e=>z.value.not_first_charge_template_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{M(e,"notFirstCharge")},placeholder:"请选择非首充模板"},{default:d((()=>[(o(!0),c(f,null,v(L.value,((e,a)=>(o(),m(r,{key:a,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue","remote-method"])])])])),_:1}),u("div",Y,[n(F,{type:"primary",onClick:l[4]||(l[4]=a=>{return l=$.value,z.value.first_charge_template_id?z.value.not_first_charge_template_id?void(l&&l.validate((a=>{a&&e(z.value).then((e=>{_.success(e.message),B.value=!1,w("close"),q.push({path:"/promotion/promotionList",query:{tab:0}})}))})).then((()=>{}))):_.error("请选择非首充模板"):_.error("请选择首充模板");var l})},{default:d((()=>[p(h(a.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[W,a.loading]])}}}),[["__scopeId","data-v-836c481a"]]);export{$ as default};
