import{r,p as c,X as d}from"./index.ad3efb29.js";import{BaseColumn as m}from"./commonTabColumn.c5d53eee.js";import{B as h}from"./vue.adf17aba.js";import"./elementPlus.4833989a.js";import"./echarts.72dc8373.js";const a="/api/ad_manage/sbplacement/";function p(t){return r({url:a+"list/",method:"get",params:t})}function f(t){return r({url:a,method:"post",data:t})}function g(t){return r({url:a+t.id+"/",method:"put",data:t})}function w(t){return r({url:a+t+"/",method:"delete",data:{id:t}})}const R=function({crudExpose:t,context:s}){const o=async e=>{const n=c(s.value);return d.assign(e,n),await p(e)},i=async({form:e,row:n})=>(e.id=n.id,await g(e)),l=async({row:e})=>await w(e.id),u=async({form:e})=>await f(e);return h("$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:o,addRequest:u,editRequest:i,delRequest:l},rowHandle:{fixed:"right",width:80,buttons:{view:{show:!1},edit:{iconRight:"Edit",type:"text",text:null},remove:{iconRight:"Delete",type:"text",text:null}}},columns:{id:{title:"ID",column:{show:!1},form:{show:!1}},campaignName:{title:"广告活动名称",column:{width:"210px",fixed:"left",align:"left"},search:{show:!0,component:{props:{clearable:!0}}},form:{rules:[{required:!0,message:"必填项"}]}},placement:{title:"广告位",column:{align:"left",width:"160px",fixed:"left",formatter:e=>{switch(e.value){case"Other on-Amazon":return"其他页面";case"Product pages":return"产品页面";case"Top of search (first page)":return"首页";case"Detail Page on-Amazon":return"详细信息首页";case"Other Placements":return"其他位置";default:return"--"}}}},bidOptimization:{title:"竞价策略",column:{align:"center",width:"160px",formatter:e=>{switch(e.value){case 1:return"自动竞价";case 0:return"自定义竞价";default:return"--"}}}},bidAdjustment:{title:"竞价调整",column:{align:"right",width:"100px",formatter:e=>(console.log(e.value),e.value!=null?e.value:"--")}},...m}}}};export{R as createCrudOptions};
