import{e as Y,bl as Z,bm as H,bn as R,bq as J,br as ee,bt as te,by as oe,bz as le,d as ne}from"./index-mobile-Cdp4yXnt.js";import{d as ae,aP as U,f as D,e as t,aQ as ie,p as u,r as se,P as I,Q as i,a0 as re,m as _,a2 as ue,Y as de,aj as me,_ as P,U as ce,u as d,Z as f,X as pe}from"./vue-C-_v7KcX.js";import{k as fe}from"./element-plus-iuNPLb4-.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:j,emit:V}){const M=Y(),L=V;u(le,oe);const h=D(!0);u("isPreviewForm",h);const l=b,m=t(()=>l.itemElement),O=t(()=>l.itemElement?.type==="gx-pc-dialog"),{getPorpertyValue:n,boolCheck:s}=Z(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","左边")),B=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 N=t(()=>n("bind-user-intf-id")),W=t(()=>n("bind-user-intf-no")),x=D(),$=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=m.value;if(o||e)return!1;const a=p.rawXmlObj;return a?!Object.keys(a).some(C=>C!==be&&C.startsWith("gx-pc-")):!1}),{exposeMethoods:Q}=H(n);let c=null;const T=o=>{r.value=!0,c=o||null},w=o=>{if(r.value=!1,o&&c&&c.callerRef){const e=c.callerRef.exposed;e&&typeof e.triggerDialogClosedCallback=="function"&&e.triggerDialogClosedCallback(o)}};j({dialogVisible:r,exposeMethoods:[...Q,{key:"openDialog",label:"打开弹框",value:T},{key:"closeDialog",label:"关闭弹框",value:w}]}),u("adapFormUuid",l.itemElement?.id),u("closeDialog",w);let F=l.itemElement.rawXmlObj?._formUUID;u("formUuid",F);const q=se({width:y.value,height:X.value}),G=o=>o!=="gx-pc-dialog"&&o!=="gx-pc-dialog-footer",k=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(),I("div",{onClick:e[2]||(e[2]=re(()=>{},["stop"]))},[_(p,{ref_key:"dialogRef",ref:x,class:de(["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:ue(q)},me({default:P(()=>[g.value?(i(),f(J,{key:0,class:"!h-60",itemElement:m.value,updateRootElementFlag:0,onFlushRootXml:a=>null},null,8,["itemElement"])):v.value?(i(),f(ee,{key:1,class:"!h-60",itemElement:m.value,updateRootElementFlag:0,onFlushRootXml:a=>null},null,8,["itemElement"])):(i(),I("div",ge,[(i(),f(d(R),{"item-element":m.value,"is-root-panel":!0,group:"draggable-group",innerLabelLayout:A.value,innerLabelWidth:B.value,subItemMatch:G,childEnvObject:void 0,key:K.value?"non-child":"exist-child"},null,8,["item-element","innerLabelLayout","innerLabelWidth"]))])),O.value?(i(),f(d(te),{key:3,"review-type":"adap-root-panel","form-uuid":d(F),"bind-user-intf-id":N.value,"bind-user-intf-no":W.value,layout:"left","hidden-business-rule":!1,"zxl-prd-id":d(M).zxlPrdId,isPreviewForm:h.value,formMainEl:$.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},[k.value?{name:"footer",fn:P(()=>[ce("div",ve,[_(d(R),{"item-element":k.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"])])}}}),ke=ne(he,[["__scopeId","data-v-bd1df2a3"]]);export{ke as D};
