import{u as q,v as H,dQ as J,dR as U,dT as Z,dU as ee,bk as te,aL as oe,ag as le,_ as ne}from"./index-design-C8wrC2s6.js";import{d as ae,aQ as C,f as D,e as t,aR as ie,p as d,r as se,M as I,O as i,_ as re,a4 as _,a0 as de,W as ue,aj as ce,Y as j,R as me,u,X as f,U as pe}from"./vue-BQyCGvUQ.js";import{k as fe}from"./element-plus-DXXGg0hD.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:C({itemElement:{},title:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:C(["upload-screenshot-success"],["update:visible"]),setup(b,{expose:M,emit:P}){const V=q(),L=P;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 B=t(()=>n("bind-user-intf-id")),N=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 T=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(F=>F!==be&&F.startsWith("gx-pc-")):!1}),{exposeMethoods:K}=J(n);let m=null;const Q=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)}};M({dialogVisible:r,exposeMethoods:[...K,{key:"openDialog",label:"打开弹框",value:Q},{key:"closeDialog",label:"关闭弹框",value:w}]}),d("adapFormUuid",l.itemElement?.id),d("closeDialog",w);let R=l.itemElement.rawXmlObj?._formUUID;d("formUuid",R);const G=se({width:y.value,height:X.value}),Y=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: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(G)},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(),I("div",ge,[(i(),f(u(U),{"item-element":c.value,"is-root-panel":!0,group:"draggable-group",innerLabelLayout:A.value,innerLabelWidth:W.value,subItemMatch:Y,childEnvObject:void 0,key:T.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(R),"bind-user-intf-id":B.value,"bind-user-intf-no":N.value,layout:"left","hidden-business-rule":!1,"zxl-prd-id":u(V).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:j(()=>[me("div",ve,[_(u(U),{"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};
