import{u as q,c_ as H,c$ as J,d0 as C,d3 as Z,d4 as ee,E as te,da as oe,db as le,_ as ne}from"./index-share-B6-9kT2P.js";import{d as ae,aP as U,f as D,e as t,aQ as ie,p as d,r as se,M as _,O as i,_ as re,a4 as I,a0 as de,W as ue,aj as ce,Y as j,R as me,u,X as f,U as pe}from"./vue-CrDyBScg.js";import{k as fe}from"./element-plus-BbvtkfL8.js";const ge={key:2,class:"flex flex-col fjs-editor-container fjs-form-container flex-grow",style:{"min-height":"100px"}},ve={class:"flex flex-col fjs-editor-container fjs-form-container flex-grow",style:{"min-height":"30px"}},be="gx-pc-dialog-footer",he=ae({__name:"DialogFormPreview",props:U({itemElement:{},title:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:U(["upload-screenshot-success"],["update:visible"]),setup(b,{expose:P,emit:M}){const V=q(),L=M;d(le,oe);const h=D(!0);d("isPreviewForm",h);const l=b,c=t(()=>l.itemElement),O=t(()=>l.itemElement?.type==="gx-pc-dialog"),{getPorpertyValue:n,boolCheck:s}=H(l),r=ie(b,"visible"),S=t(()=>n("title")||n("bind-user-intf-name")||l.title||"标题"),y=t(()=>n("width")||"50%"),X=t(()=>n("height")||"unset"),z=t(()=>s("modal","true")),A=t(()=>n("inner-label-layout","左边")),W=t(()=>n("inner-label-width","100"));t(()=>s("close-switch","true")),t(()=>s("confirm-switch","true")),t(()=>s("append-to-body","false")),t(()=>s("close-on-press-escape","true"));const $=t(()=>n("bind-user-intf-id")),B=t(()=>n("bind-user-intf-no")),x=D(),N=t(()=>{const o=x.value;return o&&o.dialogContentRef?.$el||null}),E=t(()=>{const o=n("prototype-type");return console.log("gx-pc-dialog: prototypeType -",o),o}),g=t(()=>E.value==="URL"),v=t(()=>E.value==="IMG");t(()=>!g.value&&!v.value);const K=t(()=>{const o=g.value,e=v.value,p=c.value;if(o||e)return!1;const a=p.rawXmlObj;return a?!Object.keys(a).some(k=>k!==be&&k.startsWith("gx-pc-")):!1}),{exposeMethoods:T}=J(n);let m=null;const G=o=>{r.value=!0,m=o||null},w=o=>{if(r.value=!1,o&&m&&m.callerRef){const e=m.callerRef.exposed;e&&typeof e.triggerDialogClosedCallback=="function"&&e.triggerDialogClosedCallback(o)}};P({dialogVisible:r,exposeMethoods:[...T,{key:"openDialog",label:"打开弹框",value:G},{key:"closeDialog",label:"关闭弹框",value:w}]}),d("adapFormUuid",l.itemElement?.id),d("closeDialog",w);let F=l.itemElement.rawXmlObj?._formUUID;d("formUuid",F);const Q=se({width:y.value,height:X.value}),Y=o=>o!=="gx-pc-dialog"&&o!=="gx-pc-dialog-footer",R=t(()=>{const o=l.itemElement.rawXmlObj||null;let e=o&&o["gx-pc-dialog-footer"]||null;return Array.isArray(e)&&(e=e[0]),e?{id:e&&e._controlUUID||"",index:"0",type:"gx-pc-dialog-footer",attributes:void 0,parentId:"",rawXmlObj:e,isRootPanel:!0,localFormUuid:l.itemElement.localFormUuid,rootPanelFormUuid:l.itemElement.rootPanelFormUuid}:null});return(o,e)=>{const p=fe;return i(),_("div",{onClick:e[2]||(e[2]=re(()=>{},["stop"]))},[I(p,{ref_key:"dialogRef",ref:x,class:ue(["preview-form-dialog fjs-container","gx-pc-dialog"]),"data-uuid":l.itemElement.id,modelValue:r.value,"onUpdate:modelValue":e[1]||(e[1]=a=>r.value=a),title:S.value,width:y.value,modal:z.value,"append-to-body":!0,"close-on-click-modal":!1,"close-on-press-escape":!0,style:de(Q)},ce({default:j(()=>[g.value?(i(),f(Z,{key:0,class:"!h-60",itemElement:c.value,updateRootElementFlag:0,onFlushRootXml:a=>null},null,8,["itemElement"])):v.value?(i(),f(ee,{key:1,class:"!h-60",itemElement:c.value,updateRootElementFlag:0,onFlushRootXml:a=>null},null,8,["itemElement"])):(i(),_("div",ge,[(i(),f(u(C),{"item-element":c.value,"is-root-panel":!0,group:"draggable-group",innerLabelLayout:A.value,innerLabelWidth:W.value,subItemMatch:Y,childEnvObject:void 0,key:K.value?"non-child":"exist-child"},null,8,["item-element","innerLabelLayout","innerLabelWidth"]))])),O.value?(i(),f(u(te),{key:3,"review-type":"adap-root-panel","form-uuid":u(F),"bind-user-intf-id":$.value,"bind-user-intf-no":B.value,layout:"left","hidden-business-rule":!1,"zxl-prd-id":u(V).zxlPrdId,isPreviewForm:h.value,formMainEl:N.value,onUploadScreenshotSuccess:e[0]||(e[0]=a=>L("upload-screenshot-success"))},null,8,["form-uuid","bind-user-intf-id","bind-user-intf-no","zxl-prd-id","isPreviewForm","formMainEl"])):pe("",!0)]),_:2},[R.value?{name:"footer",fn:j(()=>[me("div",ve,[I(u(C),{"item-element":R.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"])])}}}),Re=ne(he,[["__scopeId","data-v-bd1df2a3"]]);export{Re as D};
