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