import{d as R,r as _,j as I,ai as B,o as v,M as c,O as s,U as u,a as p,a2 as g,R as i,n as T,aF as w,aG as x}from"./vue.adf17aba.js";import U from"./timer-bid.38e79968.js";import M from"./switch-campaign.cb5f0639.js";import N from"./target-rule.c6fd20c2.js";/* empty css                   */import{E as k}from"./elementPlus.4833989a.js";import{_ as $}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.bab41dc1.js";import"./select-tmpl.1269a265.js";import"./api.ecc2e6e0.js";import"./index.ad3efb29.js";import"./echarts.72dc8373.js";import"./api.39068aff.js";import"./common.89e0f16e.js";import"./save-rule-dialog.e22020b1.js";import"./index.fdb4f26c.js";import"./index.ec96ead5.js";import"./freq-setting.ecd99b01.js";import"./enum.cd3ef671.js";import"./target-select.40bd090b.js";import"./index.vue_vue_type_script_setup_true_lang.577ff081.js";import"./view-target-rules.600653bb.js";import"./select-target.vue_vue_type_script_setup_true_lang.1ff66d81.js";import"./enum.111a4a5d.js";import"./target-rule-setting.326c7c80.js";const y=r=>(w("data-v-ac19365f"),r=r(),x(),r),z={class:"tab-label"},E=y(()=>p("span",null,"分时调价",-1)),j={class:"tab-label"},A=y(()=>p("span",null,"开启/暂停广告活动",-1)),D={class:"tab-label"},F=y(()=>p("span",null,"定向规则",-1)),G="sd",O=R({__name:"index",props:{campaignId:{},profileId:{}},setup(r){const S=r,l=_(1),t=_({1:0,2:0,3:0,4:0,5:0,6:0}),m=_({campaignId:S.campaignId,campaignType:G,profileId:S.profileId,ruleType:l});async function f(n,e){const d={...m.value,ruleType:Number(e),status:n};try{const o=await postCampaignStatus(d);o.code===2e3?k.success("更新状态成功"):o.code==5e3?k.warning(`${o.data.description}`):k.error("状态更新失败")}catch(o){console.log("error:",o)}}function V(n){n!==void 0?t.value={...t.value,...n}:console.error("接收到的 newValue 是 undefined")}async function b(n){l.value=0,T(()=>{l.value=n})}return I(async()=>{}),(n,e)=>{const d=B("el-switch"),o=B("el-tab-pane"),C=B("el-tabs");return v(),c(C,{modelValue:l.value,"onUpdate:modelValue":e[12]||(e[12]=a=>l.value=a),"tab-position":"left",onTabChange:n.changeTab},{default:s(()=>[u(o,{name:1,label:"分时调价"},{label:s(()=>[p("div",z,[u(d,{modelValue:t.value[1],"onUpdate:modelValue":e[0]||(e[0]=a=>t.value[1]=a),"active-value":1,disabled:t.value[1]==="-","inactive-value":0,size:"small",onChange:e[1]||(e[1]=a=>f(a,"1")),onClick:e[2]||(e[2]=g(()=>{},["stop"]))},null,8,["modelValue","disabled"]),E])]),default:s(()=>[l.value===1?(v(),c(U,{key:0,RuleStatusButton:t.value,data:m.value,onRefresh:e[3]||(e[3]=a=>b(1)),onUpdateRuleStatusButton:V},null,8,["RuleStatusButton","data"])):i("",!0)]),_:1}),i("",!0),u(o,{name:3,label:"开启/暂停广告活动"},{label:s(()=>[p("div",j,[u(d,{modelValue:t.value[3],"onUpdate:modelValue":e[4]||(e[4]=a=>t.value[3]=a),"active-value":1,disabled:t.value[3]==="-","inactive-value":0,size:"small",onChange:e[5]||(e[5]=a=>f(a,"3")),onClick:e[6]||(e[6]=g(()=>{},["stop"]))},null,8,["modelValue","disabled"]),A])]),default:s(()=>[l.value===3?(v(),c(M,{key:0,RuleStatusButton:t.value,data:m.value,onRefresh:e[7]||(e[7]=a=>b(3))},null,8,["RuleStatusButton","data"])):i("",!0)]),_:1}),u(o,{name:4,label:"定向规则"},{label:s(()=>[p("div",D,[u(d,{modelValue:t.value[4],"onUpdate:modelValue":e[8]||(e[8]=a=>t.value[4]=a),"active-value":1,disabled:t.value[4]==="-","inactive-value":0,size:"small",onChange:e[9]||(e[9]=a=>f(a,"4")),onClick:e[10]||(e[10]=g(()=>{},["stop"]))},null,8,["modelValue","disabled"]),F])]),default:s(()=>[l.value===4?(v(),c(N,{key:0,RuleStatusButton:t.value,data:m.value,onRefresh:e[11]||(e[11]=a=>b(4))},null,8,["RuleStatusButton","data"])):i("",!0)]),_:1}),i("",!0),i("",!0)]),_:1},8,["modelValue","onTabChange"])}}});const ve=$(O,[["__scopeId","data-v-ac19365f"]]);export{ve as default};
