/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  *//* empty css                 *//* empty css               *//* empty css                  *//* empty css                     *//* empty css                  */import{c as e}from"./index-d821df42.js";import{f as a}from"./index-f8a69d0c.js";import{d as l,R as t,m as s,x as r,X as i,o,l as m,w as d,a as n,e as u,b as p,c,F as v,y as h,t as f,a5 as _,a3 as g,a4 as b,A as y,B as x,U as j,Z as C,a0 as V,av as w,aw as k,_ as F}from"./index-0ffeeea6.js";/* empty css                 *//* empty css                   */import"./http-ffb58baa.js";/* empty css                   */const q=e=>(w("data-v-2d100164"),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"},I=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))),A={class:"flex justify-end"},B=F(l({__name:"detailForm",props:{primary:Object},emits:["close"],setup(l,{emit:w}){var k;const F=l,q=t(),B=s(),E=s({});s(!1);const H=s(!1),L=s([]),M=s([]);F.primary&&(F.primary,(null==(k=F.primary)?void 0:k.video_id)&&(E.value=JSON.parse(JSON.stringify(F.primary))));const R=(e,a)=>{switch(a){case"firstCharge":Z("firstCharge",{name:e});break;case"notFirstCharge":Z("notFirstCharge",{name:e})}},X=()=>{q.push({path:"/chargeManage/charge"})},Z=(e,l)=>{switch(e){case"firstCharge":a({limit:999,type:1,...l}).then((e=>{L.value=e.data}));break;case"notFirstCharge":a({limit:999,type:2,...l}).then((e=>{M.value=e.data}))}};return r((()=>{Z("firstCharge"),Z("notFirstCharge")})),(a,l)=>{const t=g,s=b,r=y,k=x,F=j,Z=C,$=V;return i((o(),m(Z,{model:E.value,"label-width":"120px",ref_key:"form",ref:B,class:"pr-4"},{default:d((()=>[n(s,{label:"推广名称",prop:"name",rules:[{required:!0,message:"推广名称必须填写"}]},{default:d((()=>[n(t,{modelValue:E.value.name,"onUpdate:modelValue":l[0]||(l[0]=e=>E.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:E.value.series_name,"onUpdate:modelValue":l[1]||(l[1]=e=>E.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:X},"充值管理"),p("进行添加 ")])]),u("div",O,[u("div",S,[I,n(k,{modelValue:E.value.first_charge_template_id,"onUpdate:modelValue":l[2]||(l[2]=e=>E.value.first_charge_template_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{R(e,"firstCharge")},placeholder:"请选择首充模板"},{default:d((()=>[(o(!0),c(v,null,h(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"])]),u("div",J,[N,n(k,{modelValue:E.value.not_first_charge_template_id,"onUpdate:modelValue":l[3]||(l[3]=e=>E.value.not_first_charge_template_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{R(e,"notFirstCharge")},placeholder:"请选择非首充模板"},{default:d((()=>[(o(!0),c(v,null,h(M.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",A,[n(F,{type:"primary",onClick:l[4]||(l[4]=a=>{return l=B.value,E.value.first_charge_template_id?E.value.not_first_charge_template_id?void(l&&l.validate((a=>{a&&e(E.value).then((e=>{_.success(e.message),H.value=!1,w("close"),q.push({path:"/promotion/promotionList",query:{tab:0}})}))})).then((()=>{}))):_.error("请选择非首充模板"):_.error("请选择首充模板");var l})},{default:d((()=>[p(f(a.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[$,a.loading]])}}}),[["__scopeId","data-v-2d100164"]]);export{B as default};
