detailForm-4227ec8e.js 3.9 KB

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