pageListModal.b8e2dd01.js 3.7 KB

1
  1. import{a as z}from"./good.75e37e88.js";import{ak as n,al as A,r as o,a as B,W as F,b as g,a7 as M,c as C,j as N,h as O,m as I,Z as R,e as U,f as S,u as T,x as W,an as j,_ as H}from"./index.4d061c66.js";import"./remote-select.36ee67a3.js";import{u as X}from"./useNav.5e73c372.js";/* empty css *//* empty css */import{u as Y}from"./use-page-search.0f272301.js";import{r as Z}from"./responseHandle.fe68d5aa.js";import{G as J}from"./status.2b37e8be.js";import{r as K,a as Q}from"./column-helper.64ceba17.js";const{VITE_PROXY_DOMAIN_REAL:s}=A();async function fe(t={}){return n.request("post",`${s}admin/companyGoodAdd`,{data:t})}async function ee(t={}){return n.request("post",`${s}admin/companyGoodList`,{data:t})}async function _e(t={}){return n.request("post",`${s}admin/companyGoodRead`,{data:t})}async function he(t={}){return n.request("post",`${s}admin/companyGoodEdit`,{data:t})}async function ve(t={}){return n.request("post",`${s}admin/companyGoodStatus`,{data:t})}async function ge(t={}){return n.request("post",`${s}admin/companyGoodDelete`,{data:t})}function te(){return{columns:o([{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,...K(J,"type")},{label:"\u56FE\u7247",prop:"good_cover_img",width:60,showOverflowTooltip:!0,...Q("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 oe={relative:""},ae=B({__name:"pageListModal",emits:["reload","save-btn-click"],setup(t,{expose:k,emit:x}){const{columns:D}=te(),{logout:E}=X(),i=o(!1),m=o(!1),w=o([]),L=o(),y=o([]),P={page:1,size:10},c=F({total:0,pageSize:10,currentPage:1,background:!0});let f={};const p=o({...P}),_=o(""),b=o("");Y(e=>(f=e,d(),{result:{},deleteProps:[]}),()=>{f={},d()});const G=e=>{p.value.page=e,d()};async function q(e,a=""){i.value=!0,_.value=e,b.value=a,await d()}function V(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 z(a):e=await ee(a);const{code:h,data:l,message:v}=e;Z({code:h,message:v,logout:E,handler:()=>{const{list:r,count:u}=l!=null?l:{};w.value=r!=null?r:[],c.total=u!=null?u:0,c.pageSize=p.value.size,c.currentPage=p.value.page}}),m.value=!1}function $(){const e=T(y);if(e.length===0)return j.error("\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u5546\u54C1\uFF01");x("save-btn-click",e),i.value=!1}return k({show:q}),(e,a)=>{const h=g("PureTable"),l=g("el-button"),v=g("el-dialog"),r=M("loading");return C(),N(v,{modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=u=>i.value=u),"close-on-press-escape":!1,center:"","append-to-body":"","destroy-on-close":"",top:"5vh",title:"\u6DFB\u52A0\u5546\u54C1",width:"1040px"},{default:O(()=>[I("div",oe,[R((C(),U("div",null,[S(h,{ref_key:"tableRef",ref:L,border:"",align:"left","row-key":"id","table-layout":"auto",size:"small",data:w.value,columns:T(D),pagination:c,paginationSmall:!0,"header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:V,onCurrentChange:G},null,8,["data","columns","pagination"])])),[[r,m.value]]),S(l,{absolute:"","bottom-0px":"",right:"20px",type:"primary",onClick:$,size:"small"},{default:O(()=>[W("\u4FDD\u5B58")]),_:1})])]),_:1},8,["modelValue"])}}});const we=H(ae,[["__scopeId","data-v-29deaac5"]]);export{he as a,_e as b,ee as c,ve as d,ge as e,fe as h,we as p};