import{T as H}from"./index.7bd36d79.js";import{S as Q}from"./select-tmpl.7bb8ee31.js";import{u as W}from"./common.c6665d9b.js";import X from"./save-rule-dialog.8623428c.js";import{d as Y,r as i,w as Z,a9 as d,o as c,c as v,a,K as b,E as ee,G as n,J as R,M as l,u,F as w,a0 as D,L as le,aq as ae,ar as te}from"./vue.65d9dadc.js";import{_ as oe}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.373e4c1e.js";import"./elementPlus.c5b0e04f.js";import"./echarts.72dc8373.js";import"./api.c8bd63ae.js";const h=p=>(ae("data-v-54462fa9"),p=p(),te(),p),se={class:"mx-5"},ne=h(()=>a("div",{class:"asj-h2"},"分时调价",-1)),ue={class:"mt-3.5"},ie=h(()=>a("div",{class:"tag-content"},[a("strong",null,"自动化分时规则："),a("p",null," 1. 应用分时调价后，如需手动修改竞价，只能在此操作。在亚马逊后台或其他第三方系统进行的调价操作，竞价将会被当前时段的自动化执行结果覆盖。 "),a("p",null,"2. 广告活动开启分时调价，规则的修改将在下一个整点生效。")],-1)),de=h(()=>a("span",{class:"custom-title-icon"},null,-1)),re=h(()=>a("span",{class:"asj-h3"},"设置竞价",-1)),pe={class:"flex flex-col"},ce={class:"flex gap-2 my-2"},me={key:0,style:{"font-size":"12px"}},fe={class:"auto-page-foot"},_e=Y({__name:"timer-bid",props:{data:{},RuleStatusButton:{}},emits:["refresh","updateRuleStatusButton"],setup(p,{emit:$}){const N=p,y=$,m=i(),{formData:t,submitFormData:F,ruleStatusButton:I}=W(N),g=i(null),V=i("Option1"),x=i("Option1"),f=i("1.0"),r=i(""),U=[{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"}],E=[{value:"Option1",label:"每一天"},{value:"Option2",label:"仅在工作日"},{value:"Option3",label:"仅在周末"}],B=i(!0),_=i(!1);async function O(){m.value.validate(async o=>{o?(await F(),y("refresh"),_.value=!0):console.log("验证失败")})}function j(){y("refresh")}function L(){t.value.useTmpl?O():_.value=!0}function q(){B.value=!1}function S(o){o===""?r.value="":Number(o)>=100||Number(o)<=0?r.value="请输入数值大于0且小于100的数值，可精确到小数点后2位":r.value=""}function z(o){S(o)}const A=()=>{S(f.value),!r.value&&g.value&&g.value.applyBid(V.value,x.value,parseFloat(f.value))};return Z(I,o=>{y("updateRuleStatusButton",o)},{deep:!0}),(o,s)=>{const G=d("el-tag"),T=d("el-option"),C=d("el-select"),J=d("el-input"),k=d("el-button"),K=d("el-form-item"),M=d("el-form"),P=d("el-card");return c(),v("div",se,[ne,a("div",ue,[b(" 规则执行时区: PDT "),a("div",null,[B.value?(c(),ee(G,{key:0,class:"custom-tag",closable:"",color:"#e7edf4",onClose:q},{default:n(()=>[ie]),_:1})):R("",!0)])]),l(Q,{data:u(t)},null,8,["data"]),l(P,{class:"mt-3"},{default:n(()=>[l(M,{ref_key:"formRef",ref:m,model:u(t),"label-position":"top",style:{"margin-top":"20px"}},{default:n(()=>[l(K,{prop:"rule.conditions"},{label:n(()=>[de,re]),default:n(()=>[a("div",pe,[a("div",ce,[l(C,{modelValue:V.value,"onUpdate:modelValue":s[0]||(s[0]=e=>V.value=e),disabled:u(t).useTmpl,style:{width:"186px"}},{default:n(()=>[(c(),v(w,null,D(U,e=>l(T,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","disabled"]),l(C,{modelValue:x.value,"onUpdate:modelValue":s[1]||(s[1]=e=>x.value=e),disabled:u(t).useTmpl,style:{width:"186px"}},{default:n(()=>[(c(),v(w,null,D(E,e=>l(T,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","disabled"]),l(J,{modelValue:f.value,"onUpdate:modelValue":s[2]||(s[2]=e=>f.value=e),disabled:u(t).useTmpl,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:z},null,8,["modelValue","disabled"]),r.value?(c(),v("div",me,le(r.value),1)):R("",!0),l(k,{disabled:u(t).useTmpl,class:"active-btn",link:"",style:{color:"#3c58af"},onClick:A},{default:n(()=>[b("应用 ")]),_:1},8,["disabled"])])])]),_:1})]),_:1},8,["model"]),l(H,{ref_key:"tableRef",ref:g,data:u(t).rule.conditions,disabled:u(t).useTmpl,onClick:s[3]||(s[3]=e=>m.value.clearValidate("rule.conditions"))},null,8,["data","disabled"])]),_:1}),l(X,{modelValue:_.value,"onUpdate:modelValue":s[4]||(s[4]=e=>_.value=e),formData:u(t),formRef:m.value,onSubmit:O},null,8,["modelValue","formData","formRef"]),a("div",fe,[l(k,{style:{width:"200px"},onClick:j},{default:n(()=>[b("取消")]),_:1}),l(k,{style:{width:"200px"},type:"primary",onClick:L},{default:n(()=>[b("提交")]),_:1})])])}}});const Se=oe(_e,[["__scopeId","data-v-54462fa9"]]);export{Se as default};
