import{T as P}from"./index.8ae2fabd.js";import{S as H}from"./select-tmpl.a975ce18.js";import{u as Q}from"./common.f714fcb5.js";import W from"./save-rule-dialog.206b07b0.js";import{d as X,r as i,a8 as d,o as p,c as v,a,K as b,E as Y,G as s,J as R,M as l,u as n,F as S,$,L as Z,ap as ee,aq as le}from"./vue.95e072e2.js";import{_ as ae}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.8a64ecdf.js";import"./elementPlus.58179425.js";import"./echarts.72dc8373.js";import"./api.bf14d834.js";const g=r=>(ee("data-v-82c53d54"),r=r(),le(),r),te={class:"mx-5"},oe=g(()=>a("div",{class:"asj-h2"},"分时调价",-1)),se={class:"mt-3.5"},ne=g(()=>a("div",{class:"tag-content"},[a("strong",null,"自动化分时规则："),a("p",null," 1. 应用分时调价后，如需手动修改竞价，只能在此操作。在亚马逊后台或其他第三方系统进行的调价操作，竞价将会被当前时段的自动化执行结果覆盖。 "),a("p",null,"2. 广告活动开启分时调价，规则的修改将在下一个整点生效。")],-1)),ue=g(()=>a("span",{class:"custom-title-icon"},null,-1)),ie=g(()=>a("span",{class:"asj-h3"},"设置竞价",-1)),de={class:"flex flex-col"},ce={class:"flex gap-2 my-2"},re={key:0,style:{"font-size":"12px"}},pe={class:"auto-page-foot"},me=X({__name:"timer-bid",props:{data:{},RuleStatusButton:{}},emits:["refresh"],setup(r,{emit:w}){const N=r,k=w,m=i(),{formData:t,submitFormData:F}=Q(N),y=i(null),h=i("Option1"),V=i("Option1"),_=i("1.0"),c=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),f=i(!1);async function T(){m.value.validate(async u=>{u?(await F(),console.log("formData",t.value),k("refresh"),f.value=!0):console.log("验证失败")})}function E(){k("refresh")}function j(){t.value.useTmpl?T():f.value=!0}function L(){O.value=!1}function C(u){u===""?c.value="":Number(u)>=100||Number(u)<=0?c.value="请输入数值大于0且小于100的数值，可精确到小数点后2位":c.value=""}function q(u){C(u)}const z=()=>{C(_.value),!c.value&&y.value&&y.value.applyBid(h.value,V.value,parseFloat(_.value))};return(u,o)=>{const A=d("el-tag"),B=d("el-option"),D=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})):R("",!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",ce,[l(D,{modelValue:h.value,"onUpdate:modelValue":o[0]||(o[0]=e=>h.value=e),disabled:n(t).useTmpl},{default:s(()=>[(p(),v(S,null,$(I,e=>l(B,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","disabled"]),l(D,{modelValue:V.value,"onUpdate:modelValue":o[1]||(o[1]=e=>V.value=e),disabled:n(t).useTmpl},{default:s(()=>[(p(),v(S,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:_.value,"onUpdate:modelValue":o[2]||(o[2]=e=>_.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"]),c.value?(p(),v("div",re,Z(c.value),1)):R("",!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:y,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:f.value,"onUpdate:modelValue":o[4]||(o[4]=e=>f.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-82c53d54"]]);export{Oe as default};
