import{h as B}from"./good.45265f96.js";import{aJ as r,aK as F,p as t,br as G,b as M,a3 as N,k as g,ac as $,o as C,h as I,A as O,a as R,K,c as j,j as S,f as T,l as H,aL as J,_ as U}from"./index.4d3e3847.js";import"./basic-form.vue_vue_type_style_index_0_scoped_d6f0d2ed_lang.3165143d.js";import{a as W}from"./useNav.afbe69e0.js";import"./image.7849d972.js";import{u as X}from"./use-page-search.da34a19a.js";import{r as Y}from"./responseHandle.db1518c7.js";import{r as Q,a as Z}from"./column-helper.adef10ea.js";const{VITE_PROXY_DOMAIN_REAL:u}=F();async function de(o={}){return r.request("post",`${u}admin/companyGoodAdd`,{data:o})}async function ee(o={}){return r.request("post",`${u}admin/companyGoodList`,{data:o})}async function me(o={}){return r.request("post",`${u}admin/companyGoodRead`,{data:o})}async function fe(o={}){return r.request("post",`${u}admin/companyGoodStatus`,{data:o})}async function _e(o={}){return r.request("post",`${u}admin/companyGoodDelete`,{data:o})}function oe(){return{columns:t([{type:"selection",width:30},{label:"\u5546\u54C1\u7F16\u53F7",prop:"good_code",width:160,showOverflowTooltip:!0},{label:"\u5546\u54C1\u7C7B\u578B",prop:"type",width:85,showOverflowTooltip:!0,...Q(G,"type")},{label:"\u56FE\u7247",prop:"good_cover_img",width:60,showOverflowTooltip:!0,...Z("good_cover_img")},{label:"\u5546\u54C1\u540D\u79F0",prop:"good_name",minWidth:160},{label:"\u5355\u4F4D",prop:"unit",width:80,showOverflowTooltip:!0},{label:"\u8D77\u8BA2\u91CF",prop:"moq",width:80,showOverflowTooltip:!0},{label:"\u6B65\u957F",prop:"step",width:80,showOverflowTooltip:!0},{label:"\u552E\u4EF7",prop:"price",width:110,showOverflowTooltip:!0}])}}const te={relative:""},ae=M({__name:"pageListModal",emits:["reload","save-btn-click"],setup(o,{expose:k,emit:D}){const{columns:L}=oe(),{logout:x}=W(),i=t(!1),m=t(!1),w=t([]),P=t(),y=t([]),E={page:1,size:10},c=N({total:0,pageSize:10,currentPage:1,background:!0});let f={};const p=t({...E}),_=t(""),b=t("");X(e=>(f=e,d(),{result:{},deleteProps:[]}),()=>{f={},d()});const A=e=>{p.value.page=e,d()};async function V(e,a=""){i.value=!0,_.value=e,b.value=a,await d()}function q(e){y.value=e}async function d(){m.value=!0;let e={};const a={group_id:_.value,type:b.value,status:"1",...f,...p.value};_.value===""?e=await B(a):e=await ee(a);const{code:h,data:s,message:v}=e;Y({code:h,message:v,logout:x,handler:()=>{const{list:n,count:l}=s!=null?s:{};w.value=n!=null?n:[],c.total=l!=null?l:0,c.pageSize=p.value.size,c.currentPage=p.value.page}}),m.value=!1}function z(){const e=T(y);if(e.length===0)return J.error("\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u5546\u54C1\uFF01");D("save-btn-click",e),i.value=!1}return k({show:V}),(e,a)=>{const h=g("PureTable"),s=g("el-button"),v=g("el-dialog"),n=$("loading");return C(),I(v,{modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=l=>i.value=l),"close-on-press-escape":!1,center:"","append-to-body":"","destroy-on-close":"",top:"5vh",title:"\u6DFB\u52A0\u5546\u54C1",width:"1040px"},{default:O(()=>[R("div",te,[K((C(),j("div",null,[S(h,{ref_key:"tableRef",ref:P,border:"",align:"left","row-key":"id","table-layout":"auto",size:"small",data:w.value,columns:T(L),pagination:c,paginationSmall:!0,"header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:q,onCurrentChange:A},null,8,["data","columns","pagination"])])),[[n,m.value]]),S(s,{absolute:"","bottom-0px":"",right:"20px",type:"primary",onClick:z,size:"small"},{default:O(()=>[H("\u4FDD\u5B58")]),_:1})])]),_:1},8,["modelValue"])}}});const he=U(ae,[["__scopeId","data-v-29deaac5"]]);export{ee as a,fe as b,_e as c,me as d,de as h,he as p};
