import{_ as q}from"./index-sxX6oYqj.js";import{d as H,aQ as k,b as D,c as t,aR as J,p as u,r as Z,M as U,a1 as I,ac as ee,W as _,Q as te,R as oe,a5 as le,N as i,O as ne,u as d,V as f,Y as ae}from"./vue-ChXMuCsz.js";import{a as ie,am as se,an as re,ao as V,ar as ue,as as de,at as me,az as ce,aA as pe}from"./common-controller-tool-CauSZAqV.js";import"./add-or-edit.vue_vue_type_style_index_0_lang-DU4oKO67.js";import{d as fe}from"./element-plus-xvP3-5Ws.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=H({__name:"DialogFormPreview",props:k({itemElement:{},title:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:k(["upload-screenshot-success"],["update:visible"]),setup(b,{expose:j,emit:M}){const P=ie(),L=M;u(pe,ce);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}=se(l),r=J(b,"visible"),S=t(()=>n("title")||n("bind-user-intf-name")||l.title||"标题"),y=t(()=>n("width")||"50%"),z=t(()=>n("height")||"unset"),A=t(()=>s("modal","true")),X=t(()=>n("inner-label-layout","左边")),N=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 W=t(()=>n("bind-user-intf-id")),B=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}=re(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 R=l.itemElement.rawXmlObj?._formUUID;u("formUuid",R);const G=Z({width:y.value,height:z.value}),Y=o=>o!=="gx-pc-dialog"&&o!=="gx-pc-dialog-footer",F=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(),U("div",{onClick:e[2]||(e[2]=le(()=>{},["stop"]))},[I(p,{ref_key:"dialogRef",ref:x,class:oe(["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:A.value,"append-to-body":!0,"close-on-click-modal":!1,"close-on-press-escape":!0,style:te(G)},ee({default:_(()=>[g.value?(i(),f(ue,{key:0,class:"!h-60",itemElement:m.value,updateRootElementFlag:0,onFlushRootXml:a=>null},null,8,["itemElement"])):v.value?(i(),f(de,{key:1,class:"!h-60",itemElement:m.value,updateRootElementFlag:0,onFlushRootXml:a=>null},null,8,["itemElement"])):(i(),U("div",ge,[(i(),f(d(V),{"item-element":m.value,"is-root-panel":!0,group:"draggable-group",innerLabelLayout:X.value,innerLabelWidth:N.value,subItemMatch:Y,childEnvObject:void 0,key:K.value?"non-child":"exist-child"},null,8,["item-element","innerLabelLayout","innerLabelWidth"]))])),O.value?(i(),f(d(me),{key:3,"review-type":"adap-root-panel","form-uuid":d(R),"bind-user-intf-id":W.value,"bind-user-intf-no":B.value,layout:"left","hidden-business-rule":!1,"zxl-prd-id":d(P).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"])):ae("",!0)]),_:2},[F.value?{name:"footer",fn:_(()=>[ne("div",ve,[I(d(V),{"item-element":F.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=q(he,[["__scopeId","data-v-bd1df2a3"]]);export{ke as D};
