import{u as _}from"./useNav.5e73c372.js";import{u as v}from"./hooks.9f8f44e2.js";import{a as C,f as l,b5 as h,b6 as E,b as F,x as B,I as b,r as g,a7 as w,Z as x,c as k,j as N,u as y,J as s,b7 as j,b8 as A,av as I,au as P}from"./index.4d061c66.js";import{r as T}from"./responseHandle.fe68d5aa.js";import{h as q}from"./good.75e37e88.js";const z={title:{type:String},colNumber:{type:Number,default:24},columns:{type:Array},data:{type:Object},labelWidth:{type:String},show:{type:Boolean,default:!0}};const O=C({name:"BasicDescriptions",props:z,setup(e,{slots:a}){return()=>{const{title:t,colNumber:o,columns:p,data:u,labelWidth:r,show:i}=e;return i?l(E,{title:t,border:!0,column:o,size:"small"},{default:()=>[p.map(n=>l(h,{label:n.label,key:n.field,span:n.span?n.span:6},{default:()=>[l("div",{class:"col-item"},[l("p",{class:"col-label",style:{width:r+"px"}},[n.label]),l("p",{class:"col-value"},[n.render?n.render(u[n.field],u):u[n.field]])])]})),a.custom&&a.custom(e.data)]}):l("div",{style:{display:"flex",width:"100%",justifyContent:"center",flexDirection:"column",alignItems:"center"}},[l(F("el-button"),{text:!0,size:"large",icon:v("warning-filled"),disabled:!0},null),l("span",null,[B("\u6682\u65E0\u6570\u636E")])])}}}),R=O,V={contentConfig:{type:Object,required:!0}},M=C({__name:"page-detail",props:V,setup(e,{expose:a}){const t=e,{logout:o}=_(),p=b(()=>t.contentConfig.columns),u=b(()=>t.contentConfig.apis),r=g({}),i=g(!1),n=async c=>{i.value=!0;const{code:m,data:d,message:D}=await u.value.httpDetail(c);T({code:m,message:D,logout:o,handler:()=>{r.value=d}}),i.value=!1};return a({reload:c=>{n(c)}}),(c,m)=>{const d=w("loading");return x((k(),N(y(R),{data:r.value,columns:y(p)},null,8,["data","columns"])),[[d,i.value]])}}});function W(e,a,t=200){return s("div",{style:{display:"flex",justifyContent:"space-between"}},{default:()=>[s("span",null,e),s(j,{placement:"top",content:a,width:t},{reference:()=>s(A,{link:!0,icon:v("information-line")})})]})}function f(e){const a=Array.isArray(e)?e:e==null?void 0:e.split(",");return a?a.map(t=>s(I,{src:t,previewSrcList:[t],style:{height:"20px",width:"20px"}})):null}function Q(e,a){const t=e.find(o=>o.value===String(a));return s(P,{type:t!=null&&t.type?t.type:""},{default:()=>t!=null&&t.label?t.label:""})}const $=[{field:"good_name",label:"\u5546\u54C1\u540D\u79F0",span:24,render:(e,{good_code:a})=>W(e,"\u5546\u54C1\u7F16\u53F7 : "+a,360)},{label:"\u56FE\u7247",field:"good_cover_img",span:6,render:e=>f(e)},{field:"type",label:"\u5546\u54C1\u7C7B\u578B",span:6},{label:"\u552E\u4EF7",field:"price",span:6},{label:"\u5355\u4F4D",field:"unit",span:6},{label:"\u8D77\u8BA2\u91CF",field:"moq",span:6},{label:"\u6B65\u957F",field:"step",span:6},{field:"updatetime",label:"\u66F4\u65B0\u65F6\u95F4",span:6},{field:"good_banner_img",label:"\u8F6E\u64AD\u56FE",span:12,render:e=>f(e)},{field:"good_cover_img",label:"\u8BE6\u60C5\u56FE",span:12,render:e=>f(e)},{field:"good_remark",label:"\u5546\u54C1\u5907\u6CE8",span:24}],H={columns:$,apis:{httpDetail:q}},U=H;export{M as _,Q as c,U as g};
