import{d,_ as c}from"./index-sxX6oYqj.js";/* empty css                   */import{d as p,V as h,N as a,W as f,X as g,M as l,a0 as y,ad as w,R as i,O as s,Q as D,$ as n}from"./vue-ChXMuCsz.js";import{x as _}from"./element-plus-xvP3-5Ws.js";const V=p({name:"AdapDetailDialog",components:{GxDialog:d},props:{modelValue:{type:Boolean,default:!1},title:{type:[String,Function],required:!0},layout:{type:String,default:"single-column"},dataTemplate:{type:Function,required:!0},loadDataFunction:{type:Function,required:!0},labelWidth:{type:String,required:!1}},emits:["update:modelValue","close"],data(){return{loading:!1,rawData:null}},computed:{dialogVisible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},computedTitle(){return typeof this.title=="function"?this.title(this.rawData):this.title},detailItems(){return this.dataTemplate(this.rawData)}},watch:{modelValue(e){e?this.loadDetailData():this.rawData=null}},methods:{async loadDetailData(){this.loading=!0;try{const e=await this.loadDataFunction();this.rawData=e||null}catch(e){console.error("加载详情数据失败:",e),this.rawData=null}finally{this.loading=!1}},handleClose(){this.$emit("close")}}}),b={class:"detail-value"};function v(e,o,C,$,F,k){const r=d,u=_;return a(),h(r,{modelValue:e.dialogVisible,"onUpdate:modelValue":o[0]||(o[0]=t=>e.dialogVisible=t),title:e.computedTitle,size:e.layout==="single-column"?"small":"default","close-on-click-modal":!1,mode:"description",onClose:e.handleClose},{default:f(()=>[g((a(),l("div",{class:i(["detail-content",{"two-column-layout":e.layout==="two-column"}])},[(a(!0),l(y,null,w(e.detailItems,(t,m)=>(a(),l("div",{key:m,class:i(["detail-item",{"two-column-item":e.layout==="two-column"&&!t.fullWidth,"full-width-item":e.layout==="two-column"&&t.fullWidth}])},[s("span",{class:"detail-label",style:D({width:e.labelWidth})},n(t.label),5),s("span",b,n(t.value||""),1)],2))),128))],2)),[[u,e.loading]])]),_:1},8,["modelValue","title","size","onClose"])}const z=c(V,[["render",v],["__scopeId","data-v-cbbb013b"]]);export{z as _};
