import{C as e,E as t,M as n,Q as r,X as i,_ as a,cn as o,dt as s,ft as c,in as l,nn as u,t as d,w as f}from"./_plugin-vue_export-helper-9JxOV_6y.js";import{t as p}from"./GxDialog-D15Qks3A.js";import{t as m}from"./directive-CkUp73VW.js";var h=n({name:`AdapDetailDialog`,components:{GxDialog:p},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{this.rawData=await this.loadDataFunction()||null}catch(e){console.error(`加载详情数据失败:`,e),this.rawData=null}finally{this.loading=!1}},handleClose(){this.$emit(`close`)}}}),g={class:`detail-value`};function _(n,d,h,_,v,y){let b=p,x=m;return i(),f(b,{modelValue:n.dialogVisible,"onUpdate:modelValue":d[0]||=e=>n.dialogVisible=e,title:n.computedTitle,size:n.layout===`single-column`?`small`:`default`,"close-on-click-modal":!1,mode:`description`,onClose:n.handleClose},{default:s(()=>[c((i(),t(`div`,{class:u([`detail-content`,{"two-column-layout":n.layout===`two-column`}])},[(i(!0),t(a,null,r(n.detailItems,(r,a)=>(i(),t(`div`,{key:a,class:u([`detail-item`,{"two-column-item":n.layout===`two-column`&&!r.fullWidth,"full-width-item":n.layout===`two-column`&&r.fullWidth}])},[e(`span`,{class:`detail-label`,style:l({width:n.labelWidth})},o(r.label),5),e(`span`,g,o(r.value||``),1)],2))),128))],2)),[[x,n.loading]])]),_:1},8,[`modelValue`,`title`,`size`,`onClose`])}var v=d(h,[[`render`,_],[`__scopeId`,`data-v-cbbb013b`]]);export{v as t};