detailForm-69f76fb5.js 4.1 KB

1
  1. /* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{c as e}from"./index-4e3e1f92.js";import{f as a}from"./index-439a75fb.js";import{d as l,V as t,m as s,x as r,Z 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,a7 as _,a5 as g,a6 as b,A as y,B as x,W as j,a0 as V,a2 as C,R as w,S as k,_ as F}from"./index-de1b16f5.js";/* empty css */import"./http-770a7659.js";/* empty css */const U=e=>(w("data-v-392e5f81"),e=e(),k(),e),q=U((()=>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"},J=U((()=>u("div",{style:{width:"80px","text-align":"end"},class:"mb-3 mr-2"},"首充模板:",-1))),N={class:"flex items-center"},W=U((()=>u("div",{style:{width:"80px","text-align":"end"},class:"mr-2"},"非首充模板:",-1))),Z={class:"flex justify-end"},$=F(l({__name:"detailForm",props:{primary:Object},emits:["close"],setup(l,{emit:w}){var k;const F=l,U=t(),$=s(),A=s({});s(!1);const B=s(!1),I=s([]),L=s([]);F.primary&&(F.primary,(null==(k=F.primary)?void 0:k.video_id)&&(A.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})}},R=()=>{U.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=y,k=x,F=j,T=V,z=C;return i((o(),m(T,{model:A.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:A.value.name,"onUpdate:modelValue":l[0]||(l[0]=e=>A.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:A.value.series_name,"onUpdate:modelValue":l[1]||(l[1]=e=>A.value.series_name=e),name:"author",clearable:""},null,8,["modelValue"])])),_:1}),n(s,{label:"充值模板配置"},{label:d((()=>[q])),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:R},"充值管理"),p("进行添加 ")])]),u("div",O,[u("div",S,[J,n(k,{modelValue:A.value.first_charge_template_id,"onUpdate:modelValue":l[2]||(l[2]=e=>A.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",N,[W,n(k,{modelValue:A.value.not_first_charge_template_id,"onUpdate:modelValue":l[3]||(l[3]=e=>A.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",Z,[n(F,{type:"primary",onClick:l[4]||(l[4]=a=>{return l=$.value,A.value.first_charge_template_id?A.value.not_first_charge_template_id?void(l&&l.validate((a=>{a&&e(A.value).then((e=>{_.success(e.message),B.value=!1,w("close"),U.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"])),[[z,a.loading]])}}}),[["__scopeId","data-v-392e5f81"]]);export{$ as default};