import{r as a,H as u,p as c,X as m}from"./index.ad3efb29.js";import"./elementPlus.4833989a.js";import{SdBaseColumn as h}from"./commonTabColumn.c5d53eee.js";import{B as p}from"./vue.adf17aba.js";const r="/api/ad_manage/sd-ad-product/report/";function f(t){return a({url:"/api/ad_manage/sd-ad-product/report/list",method:"get",params:t})}function w(t){return a({url:r,method:"post",data:t})}function g(t){return a({url:r+t.id+"/",method:"put",data:t})}function b(t){return a({url:r+t+"/",method:"delete",data:{id:t}})}function D(t){return a({url:r+"amount",method:"GET",params:t})}function G(t){return a({url:r+"trend/daily",method:"GET",params:t})}function R(t){return a({url:r+"trend/weekly",method:"GET",params:t})}function S(t){return a({url:r+"trend/monthly",method:"GET",params:t})}const y=function({crudExpose:t,context:n}){const s=async e=>{const o=c(n.value);return m.assign(e,o),await f(e)},i=async({form:e,row:o})=>(e.id=o.id,await g(e)),d=async({row:e})=>await b(e.id),l=async({form:e})=>await w(e);return p("$hasPermissions"),{crudOptions:{table:{height:800,headerCellStyle:{backgroundColor:"#f6f7fa",height:"20px",borderRight:"none"},cellStyle:{border:"none",borderBottom:"0.5px solid #ddd"},showSummary:!0,stripe:!1},container:{fixedHeight:!1},actionbar:{show:!1,buttons:{add:{show:!1}}},search:{show:!1},toolbar:{buttons:{search:{show:!0},compact:{show:!1}}},request:{pageRequest:s,addRequest:l,editRequest:i,delRequest:d},rowHandle:{fixed:"right",width:100,align:"center",buttons:{view:{show:!1},edit:{iconRight:"Edit",type:"text",text:null},remove:{show:!1}}},columns:{id:{title:"ID",column:{show:!1},form:{show:!1}},commodity:{title:"商品",column:{fixed:"left",width:320}},state:{title:"状态",column:{width:"90px",align:"center",sortable:!0},type:"dict-select",search:{show:!0},dict:u({data:[{value:"paused",label:"已暂停",color:"warning"},{value:"enabled",label:"投放中",color:"success"}]})},campaignName:{title:"广告活动名称",column:{width:180}},adGroupName:{title:"广告组名称",column:{width:180}},...h}}}},_=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:y},Symbol.toStringTag,{value:"Module"}));export{S as a,R as b,G as c,y as d,_ as e,D as g};
