import{d as B,r as _,w as v,ai as o,o as V,M as D,O as e,a as u,U as l,S as i,c as U,R as S}from"./vue.adf17aba.js";import{_ as O}from"./_plugin-vue_export-helper.c27b6911.js";const q={style:{display:"block"}},E={style:{display:"block"}},I={key:0},M={class:"dialog-footer"},T=B({__name:"save-rule-dialog",props:{modelValue:{type:Boolean},formRef:{},formData:{}},emits:["update:modelValue","submit"],setup(g,{emit:b}){const m=g,c=b,r=_(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"),R=o("el-form"),f=o("el-button"),w=o("el-dialog");return V(),D(w,{modelValue:t.value,"onUpdate:modelValue":n[2]||(n[2]=s=>t.value=s),"align-center":"",title:"保存",width:"30%"},{footer:e(()=>[u("div",M,[l(f,{onClick:k},{default:e(()=>[i("取消")]),_:1}),l(f,{type:"primary",onClick:y},{default:e(()=>[i("保存")]),_:1})])]),default:e(()=>[u("div",null,[l(h,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=s=>r.value=s)},{default:e(()=>[u("div",q,[l(p,{label:1},{default:e(()=>[i("仅应用于当前广告活动")]),_:1})]),u("div",E,[l(p,{label:2},{default:e(()=>[i("应用于当前活动且保存为模板")]),_:1})])]),_:1},8,["modelValue"])]),r.value===2?(V(),U("div",I,[l(R,{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"])])):S("",!0)]),_:1},8,["modelValue"])}}});const A=O(T,[["__scopeId","data-v-f1d851b9"]]);export{A as default};
