import{C as e,S as t,T as n,Y as r,Z as i,cn as a,dt as o,ft as s,g as c,in as l,j as u,nn as d}from"./vue.runtime.esm-bundler-DpGzKKN4.js";import"./GxPagination-DOexUzbO.js";import{t as f}from"./directive-9SA1IQHd.js";import{t as p}from"./_plugin-vue_export-helper-CnS4QQza.js";import{t as m}from"./GxDialog-BUqY5Fq3.js";import"./css-CW_FwBqc2.js";var h=u({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{let e=await this.loadDataFunction();this.rawData=e||null}catch(e){console.error(`加载详情数据失败:`,e),this.rawData=null}finally{this.loading=!1}},handleClose(){this.$emit(`close`)}}}),g=[`innerHTML`],_={key:1,class:`detail-value`};function v(u,p,h,v,y,b){let x=m,S=f;return r(),e(x,{modelValue:u.dialogVisible,"onUpdate:modelValue":p[0]||=e=>u.dialogVisible=e,title:u.computedTitle,size:u.layout===`single-column`?`small`:`default`,"close-on-click-modal":!1,mode:`description`,onClose:u.handleClose},{default:o(()=>[s((r(),n(`div`,{class:d([`detail-content`,{"two-column-layout":u.layout===`two-column`}])},[(r(!0),n(c,null,i(u.detailItems,(e,i)=>(r(),n(`div`,{key:i,class:d([`detail-item`,{"two-column-item":u.layout===`two-column`&&!e.fullWidth,"full-width-item":u.layout===`two-column`&&e.fullWidth}])},[t(`span`,{class:`detail-label`,style:l({width:u.labelWidth})},a(e.label),5),e.isPre?(r(),n(`pre`,{key:0,class:`detail-value normal-font-family`,innerHTML:e.value},null,8,g)):(r(),n(`span`,_,a(e.value||``),1))],2))),128))],2)),[[S,u.loading]])]),_:1},8,[`modelValue`,`title`,`size`,`onClose`])}var y=p(h,[[`render`,v],[`__scopeId`,`data-v-c53f39e6`]]);export{y as t};