import{d as R,r as _,w as v,a9 as o,o as V,E as D,G as e,a as u,M as l,K as r,c as U,J as E}from"./vue.65d9dadc.js";import{_ as S}from"./_plugin-vue_export-helper.c27b6911.js";const q={style:{display:"block"}},G={style:{display:"block"}},I={key:0},J={class:"dialog-footer"},K=R({__name:"save-rule-dialog",props:{modelValue:{type:Boolean},formRef:{},formData:{}},emits:["update:modelValue","submit"],setup(g,{emit:b}){const m=g,c=b,i=_(1),d=_({templateName:""}),N={templateName:[{required:!0,message:"请输入不大于150个字符的模板名称",trigger:"blur"}]},t=_(m.modelValue);v(()=>m.modelValue,a=>{t.value=a});function y(){m.formData.templateName=d.value.templateName,m.formRef.validate(a=>{a?(c("submit"),t.value=!1):console.log("验证失败")})}function k(){t.value=!1}return v(t,a=>{c("update:modelValue",a)}),(a,n)=>{const p=o("el-radio"),h=o("el-radio-group"),x=o("el-input"),C=o("el-form-item"),w=o("el-form"),f=o("el-button"),B=o("el-dialog");return V(),D(B,{modelValue:t.value,"onUpdate:modelValue":n[2]||(n[2]=s=>t.value=s),"align-center":"",title:"保存",width:"30%"},{footer:e(()=>[u("div",J,[l(f,{onClick:k},{default:e(()=>[r("取消")]),_:1}),l(f,{type:"primary",onClick:y},{default:e(()=>[r("保存")]),_:1})])]),default:e(()=>[u("div",null,[l(h,{modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=s=>i.value=s)},{default:e(()=>[u("div",q,[l(p,{label:1},{default:e(()=>[r("仅应用于当前广告活动")]),_:1})]),u("div",G,[l(p,{label:2},{default:e(()=>[r("应用于当前活动且保存为模板")]),_:1})])]),_:1},8,["modelValue"])]),i.value===2?(V(),U("div",I,[l(w,{ref:"formRef",model:d.value,rules:N,"label-width":"auto"},{default:e(()=>[l(C,{class:"custom-form-item",label:"模板名称",prop:"templateName"},{default:e(()=>[l(x,{modelValue:d.value.templateName,"onUpdate:modelValue":n[1]||(n[1]=s=>d.value.templateName=s),maxlength:"150",placeholder:"请输入不大于150个字符的字符"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])])):E("",!0)]),_:1},8,["modelValue"])}}});const T=S(K,[["__scopeId","data-v-f1d851b9"]]);export{T as default};
