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,mn as u,nn as d,t as f,w as p}from"./_plugin-vue_export-helper-C0lsYS1a.js";import{t as m}from"./GxDialog-DixGJxSz.js";import{t as h}from"./directive-2hBfY9mU.js";var g=n({name:`AdapDetailDialog`,components:{GxDialog:m},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`)}}}),_={class:`detail-value`};function v(n,u,f,g,v,y){let b=m,x=h;return i(),p(b,{modelValue:n.dialogVisible,"onUpdate:modelValue":u[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:d([`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:d([`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`,_,o(r.value||``),1)],2))),128))],2)),[[x,n.loading]])]),_:1},8,[`modelValue`,`title`,`size`,`onClose`])}var y=f(g,[[`render`,v],[`__scopeId`,`data-v-cbbb013b`]]);export{y as t};