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