import{T as G}from"./index.bab41dc1.js";import{d as L,r as n,ai as u,o as c,c as _,a as t,S as v,M,O as s,R as T,U as a,F as R,a8 as N,T as P,aF as H,aG as J}from"./vue.adf17aba.js";import{_ as K}from"./_plugin-vue_export-helper.c27b6911.js";const f=d=>(H("data-v-af927736"),d=d(),J(),d),Q={class:"mx-5"},W=f(()=>t("div",{class:"asj-h2"},"分时调价",-1)),X={class:"mt-3.5"},Y=f(()=>t("div",{class:"tag-content"},[t("strong",null,"自动化分时规则："),t("p",null," 1. 应用分时调价后，如需手动修改竞价，只能在此操作。在亚马逊后台或其他第三方系统进行的调价操作，竞价将会被当前时段的自动化执行结果覆盖。 "),t("p",null,"2. 广告活动开启分时调价，规则的修改将在下一个整点生效。")],-1)),Z=f(()=>t("span",{class:"asj-h3"},"模板名称",-1)),ee=f(()=>t("span",{class:"asj-h3"},"设置竞价",-1)),le={class:"flex flex-col"},ae={class:"flex gap-2 my-2"},te={key:0,style:{"font-size":"12px"}},oe={class:"auto-page-foot"},se=L({__name:"timer-bid",props:{mode:{},data:{},submitFormData:{type:Function}},emits:["refresh"],setup(d,{emit:D}){const b=d,O=D,h=n(),r=n(b.data),y=n(null),g=n("Option1"),V=n("Option1"),p=n("1.0"),i=n(""),S=[{value:"Option1",label:"24小时: 00:00-23:59"},{value:"Option2",label:"凌晨: 00:00-06:59"},{value:"Option3",label:"上午: 7:00-11:59"},{value:"Option4",label:"工作时: 9:00-16:59"},{value:"Option5",label:"下午: 12:00-16:59"},{value:"Option6",label:"晚上: 17:00-20:59"},{value:"Option7",label:"深夜: 21:00-23:59"}],U=[{value:"Option1",label:"每一天"},{value:"Option2",label:"仅在工作日"},{value:"Option3",label:"仅在周末"}],k=n(!0);if(b.mode==="add")for(let o=0;o<7;o++){const l=[];for(let m=0;m<24;m++)l.push(1);r.value.rule.conditions.push(l)}function j(){k.value=!1}const I=async()=>{h.value.validate(async o=>{o?(await b.submitFormData(),O("refresh")):console.log("验证失败")})},E=()=>{O("refresh")};function C(o){o===""?i.value="":Number(o)>=100||Number(o)<=0?i.value="请输入数值大于0且小于100的数值，可精确到小数点后2位":i.value=""}function q(o){C(o)}const z=()=>{C(p.value),!i.value&&y.value&&y.value.applyBid(g.value,V.value,parseFloat(p.value))};return(o,l)=>{const m=u("el-tag"),B=u("el-input"),w=u("el-form-item"),$=u("el-option"),F=u("el-select"),x=u("el-button"),A=u("el-form");return c(),_("div",Q,[W,t("div",X,[v(" 规则执行时区: PDT "),t("div",null,[k.value?(c(),M(m,{key:0,class:"custom-tag",closable:"",color:"#e7edf4",onClose:j},{default:s(()=>[Y]),_:1})):T("",!0)])]),a(A,{ref_key:"formRef",ref:h,model:r.value,"label-position":"top",style:{"margin-top":"20px"}},{default:s(()=>[a(w,{rules:{required:!0,message:"必填项",trigger:"blur"},prop:"name"},{label:s(()=>[Z]),default:s(()=>[a(B,{modelValue:r.value.name,"onUpdate:modelValue":l[0]||(l[0]=e=>r.value.name=e),style:{width:"30%"}},null,8,["modelValue"])]),_:1}),a(w,{prop:"rule.conditions"},{label:s(()=>[ee]),default:s(()=>[t("div",le,[t("div",ae,[a(F,{modelValue:g.value,"onUpdate:modelValue":l[1]||(l[1]=e=>g.value=e),style:{width:"186px"}},{default:s(()=>[(c(),_(R,null,N(S,e=>a($,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),a(F,{modelValue:V.value,"onUpdate:modelValue":l[2]||(l[2]=e=>V.value=e),style:{width:"186px"}},{default:s(()=>[(c(),_(R,null,N(U,e=>a($,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),a(B,{modelValue:p.value,"onUpdate:modelValue":l[3]||(l[3]=e=>p.value=e),clearable:"",oninput:"value=value.replace(/[^\\d.]/g, '').replace(/\\.{2,}/g, '.').replace('.', '$#$').replace(/\\./g, '').replace('$#$', '.').replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, '$1$2.$3').replace(/^\\./g, '')",placeholder:"1.0",style:{width:"150px"},onChange:q},null,8,["modelValue"]),i.value?(c(),_("div",te,P(i.value),1)):T("",!0),a(x,{class:"active-btn",link:"",style:{color:"#3c58af"},onClick:z},{default:s(()=>[v("应用 ")]),_:1})])])]),_:1})]),_:1},8,["model"]),a(G,{ref_key:"tableRef",ref:y,data:r.value.rule.conditions,onClick:l[4]||(l[4]=e=>h.value.clearValidate("rule.conditions"))},null,8,["data"]),t("div",oe,[a(x,{style:{width:"200px"},onClick:E},{default:s(()=>[v("取消")]),_:1}),a(x,{style:{width:"200px"},type:"primary",onClick:I},{default:s(()=>[v("提交")]),_:1})])])}}});const de=K(se,[["__scopeId","data-v-af927736"]]);export{de as default};
