import{A as e,C as t,D as n,E as r,M as i,S as a,St as o,T as ee,X as s,Z as c,bt as l,dt as u,h as d,in as f,kt as p,mn as te,nn as m,ot as h,t as g,w as _,z as v}from"./_plugin-vue_export-helper-C0lsYS1a.js";import{t as y}from"./dialog-C-zlcBiu.js";import{Bt as b,Ht as x,Vr as S,Xt as C,Zn as w,nr as T,pi as E,yt as D,zt as ne}from"./stores-PVUTfPb_.js";var re={key:2,class:`flex flex-col fjs-editor-container fjs-form-container flex-grow`,style:{"min-height":`100px`}},ie={class:`flex flex-col fjs-editor-container fjs-form-container flex-grow`,style:{"min-height":`30px`}},O=`gx-pc-dialog-footer`,k=g(i({__name:`DialogFormPreview`,props:v({itemElement:{},title:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:v([`upload-screenshot-success`],[`update:visible`]),setup(i,{expose:te,emit:g}){let v=D(),k=g;c(S,T);let A=o(!0);c(`isPreviewForm`,A);let j=i,M=a(()=>j.itemElement),N=a(()=>j.itemElement?.type===`gx-pc-dialog`),{getPorpertyValue:P,boolCheck:F}=E(j),I=h(i,`visible`),L=a(()=>P(`title`)||P(`bind-user-intf-name`)||j.title||`标题`),R=a(()=>P(`width`)||`50%`),z=a(()=>P(`height`)||`unset`),B=a(()=>F(`modal`,`true`)),V=a(()=>P(`inner-label-layout`,`左边`)),H=a(()=>P(`inner-label-width`,`100`));a(()=>F(`close-switch`,`true`)),a(()=>F(`confirm-switch`,`true`)),a(()=>F(`append-to-body`,`false`)),a(()=>F(`close-on-press-escape`,`true`));let ae=a(()=>P(`bind-user-intf-id`)),U=a(()=>P(`bind-user-intf-no`)),W=o(),G=a(()=>{let e=W.value;return e&&e.dialogContentRef?.$el||null}),K=a(()=>{let e=P(`prototype-type`);return console.log(`gx-pc-dialog: prototypeType -`,e),e}),q=a(()=>K.value===`URL`),J=a(()=>K.value===`IMG`);a(()=>!q.value&&!J.value);let oe=a(()=>{let e=q.value,t=J.value,n=M.value;if(e||t)return!1;let r=n.rawXmlObj;return r?!Object.keys(r).some(e=>e!==O&&e.startsWith(`gx-pc-`)):!1}),{formContentType:se,exposeMethoods:Y}=C(P,{props:j}),X=null,ce=e=>{I.value=!0,X=e||null},Z=e=>{if(I.value=!1,e&&X&&X.callerRef){let t=X.callerRef.exposed;t&&typeof t.triggerDialogClosedCallback==`function`&&t.triggerDialogClosedCallback(e)}};te({dialogVisible:I,exposeMethoods:[...Y,{key:`openDialog`,label:`打开弹框`,value:ce},{key:`closeDialog`,label:`关闭弹框`,value:Z}]}),c(`adapFormUuid`,j.itemElement?.id),c(`closeDialog`,Z);let Q=j.itemElement.rawXmlObj?._formUUID;c(`formUuid`,Q);let le=l({width:R.value,height:z.value}),ue=e=>e!==`gx-pc-dialog`&&e!==`gx-pc-dialog-footer`,$=a(()=>{let e=j.itemElement.rawXmlObj||null,t=e&&e[`gx-pc-dialog-footer`]||null;return Array.isArray(t)&&(t=t[0]),t?{id:t&&t._controlUUID||``,index:`0`,type:`gx-pc-dialog-footer`,attributes:void 0,parentId:``,rawXmlObj:t,isRootPanel:!0,localFormUuid:j.itemElement.localFormUuid,rootPanelFormUuid:j.itemElement.rootPanelFormUuid}:null});return(i,a)=>{let o=y;return s(),r(`div`,{onClick:a[2]||=d(()=>{},[`stop`])},[e(o,{ref_key:`dialogRef`,ref:W,class:m([`preview-form-dialog fjs-container`,`gx-pc-dialog`]),"data-uuid":j.itemElement.id,modelValue:I.value,"onUpdate:modelValue":a[1]||=e=>I.value=e,title:L.value,width:R.value,modal:B.value,"append-to-body":!0,"close-on-click-modal":!1,"close-on-press-escape":!0,style:f(le)},n({default:u(()=>[q.value?(s(),_(b,{key:0,class:`!h-60`,itemElement:M.value,updateRootElementFlag:0,onFlushRootXml:e=>null},null,8,[`itemElement`])):J.value?(s(),_(ne,{key:1,class:`!h-60`,itemElement:M.value,updateRootElementFlag:0,onFlushRootXml:e=>null},null,8,[`itemElement`])):(s(),r(`div`,re,[(s(),_(p(w),{"item-element":M.value,"is-root-panel":!0,group:`draggable-group`,innerLabelLayout:V.value,innerLabelWidth:H.value,subItemMatch:ue,childEnvObject:void 0,key:oe.value?`non-child`:`exist-child`},null,8,[`item-element`,`innerLabelLayout`,`innerLabelWidth`]))])),N.value?(s(),_(p(x),{key:3,"review-type":`adap-root-panel`,"form-uuid":p(Q),"bind-user-intf-id":ae.value,"bind-user-intf-no":U.value,layout:`left`,"hidden-business-rule":!1,"zxl-prd-id":p(v).zxlPrdId,isPreviewForm:A.value,formMainEl:G.value,onUploadScreenshotSuccess:a[0]||=e=>k(`upload-screenshot-success`)},null,8,[`form-uuid`,`bind-user-intf-id`,`bind-user-intf-no`,`zxl-prd-id`,`isPreviewForm`,`formMainEl`])):ee(``,!0)]),_:2},[$.value?{name:`footer`,fn:u(()=>[t(`div`,ie,[e(p(w),{"item-element":$.value,"is-root-panel":!0,group:`draggable-group`,forceRowAlignCenter:!0,stopRowMove:!0},null,8,[`item-element`])])]),key:`0`}:void 0]),1032,[`data-uuid`,`modelValue`,`title`,`width`,`modal`,`style`])])}}}),[[`__scopeId`,`data-v-bd1df2a3`]]);export{k as t};