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