import{ac as t,Y as a,X as s,k as o,m as e,w as l,o as r,p as i,q as m,B as n,C as p,F as h,t as f,v as c,M as u,G as d}from"./index-C9TJPork.js";import{_ as g}from"./u-image.rajv-jH8.js";import{r as y}from"./uni-app.es.CUt9gedF.js";import{_ as D}from"./mescroll-body.DWp9Rb53.js";import{p as j}from"./index.BIrLJMDN.js";import{M as _}from"./mescroll-mixins.C2YUWJKd.js";import{a as w,g as b}from"./portal.B5oHNAz3.js";import{r as k}from"./resources.DEPsJg7u.js";import{_ as x}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-icon.BNGPST4x.js";import"./renderjs.Cg3LvhxW.js";import"./u-tabs.CYgabJiD.js";import"./u-badge.BHkDpFBd.js";import"./u-line.DT3xflsc.js";import"./mp-html.2sjiF9X0.js";import"./flowEngine.DQGtFE3U.js";import"./u-time-line.5hGOY-3W.js";const v=x({mixins:[_],components:{portalItem:j},data(){return{mpPortalUrl:"",id:"",show:!1,formData:[],dataList:[],emptyImg:k.message.nodata,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:{}}},onLoad(s){this.fullName=s.fullName,t({title:this.fullName||"门户预览"}),this.id=s.id,this.portalType=s.portalType,a("refresh",(()=>{this.formData=[],this.mescroll.resetUpScroll()}))},methods:{upCallback(t){const a=1==this.portalType?w:b;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=s=>{s.forEach((s=>{s.allRefresh=t.refresh,s.show=!1,s.visibility&&s.visibility.length&&s.visibility.includes("app")&&(s.show=!0),s.children&&s.children.length&&a(s.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,j,_,w,b){const k=s("portalItem"),x=r,v=u,C=y(o("u-image"),g),I=d,N=y(o("mescroll-body"),D);return i(),e(x,{class:"scan-v"},{default:l((()=>[m(N,{ref:"mescrollRef",onDown:t.downCallback,down:w.downOption,sticky:!0,onUp:b.upCallback,up:w.upOption,bottombar:!1,style:{"min-height":"100%"},onInit:t.mescrollInit},{default:l((()=>[m(x,{class:"portal-v"},{default:l((()=>[w.formData.length?(i(),e(x,{key:0},{default:l((()=>[(i(!0),n(h,null,p(w.formData,((t,a)=>(i(),e(x,{class:"portal-box",key:a},{default:l((()=>[m(k,{item:t,ref_for:!0,ref:"portalItem",portalData:w.formData},null,8,["item","portalData"])])),_:2},1024)))),128))])),_:1})):!w.formData.length&&1==w.portalConfig.linkType&&w.portalConfig.customUrl?(i(),e(x,{key:1},{default:l((()=>[m(v,{src:w.portalConfig.customUrl,style:{height:"100vh"}},null,8,["src"])])),_:1})):(i(),e(x,{key:2,class:"portal-v portal-nodata"},{default:l((()=>[m(x,{class:"u-flex-col",style:{"align-items":"center"}},{default:l((()=>[m(C,{width:"280rpx",height:"280rpx",src:w.emptyImg},null,8,["src"]),m(I,{class:"u-m-t-20",style:{color:"#909399"}},{default:l((()=>[f(c(t.$t("common.noData")),1)])),_:1})])),_:1})])),_:1}))])),_:1})])),_:1},8,["onDown","down","onUp","up","onInit"])])),_:1})}],["__scopeId","data-v-31c28ff1"]]);export{v as default};