import{G as d,U as c,D as m,A as p}from"./api.7e8ee3c4.js";import{H as r,h as o}from"./index.ad3efb29.js";import"./elementPlus.4833989a.js";import{BaseColumn as h}from"./commonTabColumn.c5d53eee.js";import{e as s}from"./emitter.bff31cdd.js";import{B as f}from"./vue.adf17aba.js";import"./echarts.72dc8373.js";const D=function({crudExpose:g,context:b}){let a=0;const i=async e=>(a++,s.emit("protfolios-update",{update:a,query:e}),await d(e)),l=async({form:e,row:t})=>(e.id=t.id,await c(e)),n=async({row:e})=>await m(e.id),u=async({form:e})=>{const t=await p(e);return s.emit("protfolios-createProtfolios",t),t};return f("$hasPermissions"),{crudOptions:{table:{height:800},container:{fixedHeight:!1},request:{pageRequest:i,addRequest:u,editRequest:l,delRequest:n},rowHandle:{fixed:"right",width:80,buttons:{view:{show:!1},edit:{iconRight:"Edit",type:"text",text:null},remove:{iconRight:"Delete",type:"text",text:null}}},actionbar:{buttons:{add:{text:"新建广告组合"}}},toolbar:{buttons:{search:{show:!0},compact:{show:!1}}},columns:{name:{title:"广告组合",column:{width:"150px"},search:{show:!0,autoSearchTrigger:!1,component:{props:{clearable:!0},placeholder:"请输入广告组合"}},form:{rules:[{required:!0,message:"必填项"}]}},state:{title:"状态",column:{width:"90px",align:"center"},type:"dict-select",dict:r({data:[{value:"enabled",label:"投放中"},{value:"disable",label:"禁用"}]}),form:{show:!1}},budget_policy:{title:"预算类型",column:{width:"120px",align:"left"},type:"dict-select",dict:r({data:[{value:"",label:"无预算上限"},{value:"dateRange",label:"日期范围"},{value:"monthlyRecurring",label:"按月"}]}),form:{value:""}},budget_startDate:{title:"开始日期",type:"date",form:{show:o(e=>e.form.budget_policy==="dateRange"),rules:[{required:!0,message:"必填项"}]}},budget_endDate:{title:"结束日期",type:"date",form:{show:o(e=>e.form.budget_policy!=="")}},budget_amount:{title:"预算",type:"number",form:{value:0,show:o(e=>e.form.budget_policy!==""),rules:[{required:!0,message:"必填项"}],component:{min:0,precision:2,controlsPosition:"right"}}},inBudget:{title:"是否预算内",column:{width:"120px",align:"left"},form:{show:!1}},...h}}}};export{D as createCrudOptions};
