crud.c0f26325.js 1.5 KB

1
  1. import{r as a,p as l,X as c}from"./index.b098562c.js";import{BaseColumn as p}from"./commonTabColumn.c5d53eee.js";import{B as h}from"./vue.adf17aba.js";const s="/api/ad_manage/spgroupdetail/adproduct/";function m(t){return a({url:s+"list/",method:"get",params:t})}function f(t){return a({url:s,method:"post",data:t})}function w(t){return a({url:s+t.id+"/",method:"put",data:t})}function g(t){return a({url:s+t+"/",method:"delete",data:{id:t}})}function R(t){return a({url:s+"total/",method:"GET",params:t})}function j(t){return t.dateRangeType="D",a({url:s+"daily/",method:"GET",params:t})}const b=function({crudExpose:t,context:n}){const o=async e=>{const r=l(n.value);return c.assign(e,r),await m(e)},i=async({form:e,row:r})=>(e.id=r.id,await w(e)),u=async({row:e})=>await g(e.id),d=async({form:e})=>await f(e);return h("$hasPermissions"),{crudOptions:{table:{},container:{fixedHeight:!1},actionbar:{show:!1,buttons:{add:{show:!1}}},search:{show:!0,buttons:{search:{show:!1},reset:{show:!1}}},toolbar:{buttons:{search:{show:!0},compact:{show:!1}}},request:{pageRequest:o,addRequest:d,editRequest:i,delRequest:u},rowHandle:{fixed:"right",width:80,buttons:{view:{show:!1},edit:{iconRight:"Edit",type:"text",text:null},remove:{iconRight:"Delete",type:"text",text:null}}},columns:{asin:{title:"asin",column:{width:"120px"}},sku:{title:"sku",column:{width:"180px"}},state:{title:"状态",column:{width:"100px"}},...p}}}},D=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:b},Symbol.toStringTag,{value:"Module"}));export{j as a,D as b,b as c,R as g};