import{C as e,E as t,R as n,S as r,St as i,T as a,X as o,Y as s,at as c,bt as l,dt as u,in as d,j as f,k as p,kt as m,m as h,nn as g,w as _,x as v}from"./vue.runtime.esm-bundler-DpGzKKN4.js";import"./GxPagination-DOexUzbO.js";import{t as y}from"./dialog-BLJqz3g4.js";import{t as b}from"./_plugin-vue_export-helper-CnS4QQza.js";import"./css-DxP8XCTD.js";import{Fn as x,On as S,Vr as C,Xr as w,ga as T,jn as E,kn as ee,va as te,yt as ne}from"./stores-BWYw2E2w.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`}},D=`gx-pc-dialog-footer`,O=b(f({__name:`DialogFormPreview`,props:n({itemElement:{},title:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:n([`upload-screenshot-success`],[`update:visible`]),setup(n,{expose:f,emit:b}){let O=ne(),k=b;o(te,w);let A=i(!0);o(`isPreviewForm`,A);let j=n,M=v(()=>j.itemElement),N=v(()=>j.itemElement?.type===`gx-pc-dialog`),{getPorpertyValue:P,boolCheck:F}=T(j),I=c(n,`visible`),L=v(()=>P(`title`)||P(`bind-user-intf-name`)||j.title||`标题`),R=v(()=>P(`width`)||`50%`),z=v(()=>P(`height`)||`unset`),B=v(()=>F(`modal`,`true`)),V=v(()=>P(`inner-label-layout`,`左边`)),H=v(()=>P(`inner-label-width`,`100`));v(()=>F(`close-switch`,`true`)),v(()=>F(`confirm-switch`,`true`)),v(()=>F(`append-to-body`,`false`)),v(()=>F(`close-on-press-escape`,`true`));let ae=v(()=>P(`bind-user-intf-id`)),U=v(()=>P(`bind-user-intf-no`)),W=i(),G=v(()=>{let e=W.value;return e&&e.dialogContentRef?.$el||null}),K=v(()=>{let e=P(`prototype-type`);return console.log(`gx-pc-dialog: prototypeType -`,e),e}),q=v(()=>K.value===`URL`),J=v(()=>K.value===`IMG`);v(()=>!q.value&&!J.value);let Y=v(()=>{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!==D&&e.startsWith(`gx-pc-`)):!1}),{formContentType:oe,exposeMethoods:se}=x(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)}};f({dialogVisible:I,exposeMethoods:[...se,{key:`openDialog`,label:`打开弹框`,value:ce},{key:`closeDialog`,label:`关闭弹框`,value:Z}]}),o(`adapFormUuid`,j.itemElement?.id),o(`closeDialog`,Z);let Q=j.itemElement.rawXmlObj?._formUUID;o(`formUuid`,Q);let le=l({width:R.value,height:z.value}),ue=e=>e!==`gx-pc-dialog`&&e!==`gx-pc-dialog-footer`,$=v(()=>{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(n,i)=>{let o=y;return s(),a(`div`,{onClick:i[2]||=h(()=>{},[`stop`])},[p(o,{ref_key:`dialogRef`,ref:W,class:g([`preview-form-dialog fjs-container`,`gx-pc-dialog`]),"data-uuid":j.itemElement.id,modelValue:I.value,"onUpdate:modelValue":i[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:d(le)},t({default:u(()=>[q.value?(s(),e(ee,{key:0,class:`!h-60`,itemElement:M.value,updateRootElementFlag:0,onFlushRootXml:e=>null},null,8,[`itemElement`])):J.value?(s(),e(S,{key:1,class:`!h-60`,itemElement:M.value,updateRootElementFlag:0,onFlushRootXml:e=>null},null,8,[`itemElement`])):(s(),a(`div`,re,[(s(),e(m(C),{"item-element":M.value,"is-root-panel":!0,group:`draggable-group`,innerLabelLayout:V.value,innerLabelWidth:H.value,subItemMatch:ue,childEnvObject:void 0,key:Y.value?`non-child`:`exist-child`},null,8,[`item-element`,`innerLabelLayout`,`innerLabelWidth`]))])),N.value?(s(),e(m(E),{key:3,"review-type":`adap-root-panel`,"form-uuid":m(Q),"bind-user-intf-id":ae.value,"bind-user-intf-no":U.value,layout:`left`,"hidden-business-rule":!1,"zxl-prd-id":m(O).zxlPrdId,isPreviewForm:A.value,formMainEl:G.value,onUploadScreenshotSuccess:i[0]||=e=>k(`upload-screenshot-success`)},null,8,[`form-uuid`,`bind-user-intf-id`,`bind-user-intf-no`,`zxl-prd-id`,`isPreviewForm`,`formMainEl`])):_(``,!0)]),_:2},[$.value?{name:`footer`,fn:u(()=>[r(`div`,ie,[p(m(C),{"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{O as t};