import{a as t,a2 as a,X as o,o as s,p as e,w as r,q as l,t as i,v as n,D as m,E as p,F as h,O as f}from"./index-P0fyQ2Em.js";import{_ as d}from"./index.BuZ8YmVY.js";import{r as c}from"./uni-app.es.DOtS5Ldl.js";import{_ as u}from"./mescroll-body.CszwJbBy.js";import{p as y}from"./index.BKbDh3D5.js";import{M as D}from"./mescroll-mixins.C2YUWJKd.js";import{a as g,g as j}from"./portal.BblJR1cW.js";import{_ as k}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./resources.DEPsJg7u.js";import"./renderjs.BXp1P0Wg.js";import"./u-tabs.DEel8MQB.js";import"./u-badge.CWPuZ-w1.js";import"./u-line.D-FzmOwL.js";import"./u-image.RNxpLaRU.js";import"./u-icon.wXcRZHbn.js";import"./mp-html.DI6DI7Ml.js";import"./flowEngine.Ke7vpfzj.js";import"./u-time-line.q7UXLQNV.js";const w=k({mixins:[D],components:{portalItem:y},data(){return{mpPortalUrl:"",id:"",show:!1,formData:[],dataList:[],fullName:"",downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:50,time:null},empty:{use:!1},textNoMore:this.$t("app.apply.noMoreData")},portalType:1,token:"",portalConfig:{},key:+new Date}},onLoad(o){this.fullName=o.fullName,t({title:this.fullName||"门户预览"}),this.id=o.id,this.portalType=o.portalType,a("refresh",(()=>{this.formData=[],this.mescroll.resetUpScroll()}))},methods:{upCallback(t){const a=1==this.portalType?g:j;1!=this.portalType&&this.mescroll.lockDownScroll(!0),a(this.id).then((t=>{this.portalConfig=t.data||{};let a=t.data.formData?JSON.parse(t.data.formData):{};this.formData=a.layout?JSON.parse(JSON.stringify(a.layout)):[],this.mescroll.endSuccess(this.formData.length),this.formData.length&&this.handelFormData(a)})).catch((()=>{this.mescroll.endSuccess(0),this.mescroll.endErr()}))},handelFormData(t){const a=o=>{o.forEach((o=>{o.allRefresh=t.refresh,o.show=!1,o.visibility&&o.visibility.length&&o.visibility.includes("app")&&(o.show=!0),o.children&&o.children.length&&a(o.children)})),this.key=+new Date};a(this.formData),this.dataList=this.formData.filter((t=>t.show)),this.dataList.length<1&&(this.formData=this.dataList)}}},[["render",function(t,a,y,D,g,j){const k=o("portalItem"),w=l,_=f,b=c(s("JnpfEmpty"),d),v=c(s("mescroll-body"),u);return i(),e(w,{class:"scan-v"},{default:r((()=>[n(v,{ref:"mescrollRef",onDown:t.downCallback,down:g.downOption,sticky:!0,onUp:j.upCallback,up:g.upOption,bottombar:!1,style:{"min-height":"100%"},onInit:t.mescrollInit},{default:r((()=>[n(w,{class:"portal-v"},{default:r((()=>[g.formData.length?(i(),e(w,{key:0},{default:r((()=>[(i(!0),m(h,null,p(g.formData,((t,a)=>(i(),e(w,{class:"portal-box",key:a},{default:r((()=>[(i(),e(k,{item:t,ref_for:!0,ref:"portalItem",portalData:g.formData,key:g.key},null,8,["item","portalData"]))])),_:2},1024)))),128))])),_:1})):!g.formData.length&&1==g.portalConfig.linkType&&g.portalConfig.customUrl?(i(),e(w,{key:1},{default:r((()=>[n(_,{src:g.portalConfig.customUrl,style:{height:"100vh"}},null,8,["src"])])),_:1})):(i(),e(b,{key:2}))])),_:1})])),_:1},8,["onDown","down","onUp","up","onInit"])])),_:1})}],["__scopeId","data-v-95e3acdd"]]);export{w as default};