| 1 |
- import{g as e,Y as t,Z as s,n as l,U as o,a,u as i,h as n,W as r,k as c,X as p,m as u,w as h,o as d,p as m,q as f,t as y,v as g,E as k,z as w,a1 as I,B as x,C,F as _,G as S}from"./index-C9TJPork.js";import{_ as b}from"./uni-icons.RLS1HIfd.js";import{r as $}from"./uni-app.es.CUt9gedF.js";import{_ as L}from"./uni-nav-bar.BnYAzGxG.js";import{_ as j}from"./u-search.DOsDiA_z.js";import{_ as v}from"./u-icon.BNGPST4x.js";import{_ as U}from"./mescroll-body.DWp9Rb53.js";import{_ as N}from"./uni-popup.DMKcDE3C.js";import{a as T,b as D,c as A}from"./apply.xOM-eZhr.js";import{t as B}from"./index.B9slfH2V.js";import{r as H}from"./resources.DEPsJg7u.js";import{M as O}from"./mescroll-mixins.C2YUWJKd.js";import{I as P}from"./mixin.l9wQyb8S.js";import{_ as K}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./renderjs.Cg3LvhxW.js";import"./ly-tree.D703-q15.js";import"./u-popup.7vl_vYde.js";const J=K({mixins:[O,P],components:{treeCollapse:B},data(){return{mescrollTop:198,systemKeyword:"",showApply:!1,topSearch:"80px",appTopHeight:0,usualList:[],menuList:[],downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:50,time:null},empty:{use:!0,icon:H.message.nodata,tip:this.$t("common.noData"),fixed:!1,top:"560rpx"},textNoMore:this.$t("app.apply.noMoreData")},keyword:"",statusBarHeight:"",userInfo:{systemIds:[]},showSelect:!1,selectData:{name:"",id:""},modelId:"",fullName:"",key:+new Date,listChild:[],height:0,noticeWarpH:0}},computed:{baseURL(){return this.define.baseURL},token:()=>e("token"),report(){return this.define.report},hasChildren(){let e=!1;for(let t=0;t<this.menuList.length;t++)if(this.menuList[t].children&&this.menuList[t].children.length){e=!0;break}return e},filteredList(){return this.userInfo.systemIds.filter((e=>e.name.includes(this.systemKeyword)))}},onShow(){this.keyword="",this.systemKeyword="",this.$nextTick((()=>{this.mescroll.resetUpScroll()}))},mounted(){this.getContentHeight()},onLoad(){t("updateUsualList",(e=>{this.getUsualList()})),t("refresh",(()=>{this.menuList=[],this.mescroll.resetUpScroll()}))},onUnload(){s("updateUsualList")},methods:{async getContentHeight(){this.$u.sys().windowHeight;const[e,t,s,l]=await Promise.all([this.$uGetRect(".nav-bar-box"),this.$uGetRect(".notice-warp"),this.$uGetRect(".search-box")]),o=e.height,a=s.height;this.topSearch=`${o}px`,this.appTopHeight=o,this.noticeWarpH=`${a}`,this.mescrollTop=o+a},popupChange(e){this.showSelect=e.show},showSelectBox(e){"center"===e&&this.userInfo.systemIds.length>1&&(this.showApply&&(this.showApply=!1),this.showSelect&&this.$refs.popup.close(),this.$refs.popup.open("top")),"left"===e&&this.menuList.length&&(this.showSelect&&this.$refs.popup.close(),this.showApply=!this.showApply)},handelClick(e){if(this.showApply=!1,1!=e.type){if(2!=e.type){if(3==e.type||9==e.type){if(this.modelId=e.moduleId,!e.moduleId)return void this.$u.toast("暂无此页面");l({url:"/pages/apply/dynamicModel/index?config="+this.jnpf.base64.encode(JSON.stringify(e)),fail:e=>{this.$u.toast("暂无此页面")}})}if(7==e.type||5==e.type){let t=encodeURIComponent(e.urlAddress)+"&fullName="+e.fullName;return 5==e.type&&(t=encodeURIComponent(`${this.report}/preview.html?id=${e.moduleId}&token=${this.token}&page=1&from=menu`)),e.urlAddress||7!=e.type?void l({url:"/pages/apply/externalLink/index?url="+t+"&fullName="+e.fullName+"&type="+e.type,fail:e=>{this.$u.toast("暂无此页面")}}):void this.$u.toast("暂无此页面")}return 8==e.type?e.urlAddress?void l({url:"/pages/portal/scanPortal/index?id="+e.moduleId+"&portalType=1&fullName="+e.fullName,fail:e=>{this.$u.toast("暂无此页面")}}):void this.$u.toast("暂无此页面"):void 0}l({url:e.urlAddress+"?menuId="+e.id+"&fullName="+e.fullName,fail:e=>{this.$u.toast("暂无此页面")}})}else T(e.id).then((e=>{this.listChild=e.data||[],this.handleProperty(this.listChild),this.$nextTick((()=>{l({url:"/pages/apply/catalog/index?config="+this.jnpf.base64.encode(JSON.stringify(this.listChild[0])),fail:e=>{this.$u.toast("暂无此页面")}})}))}))},openPage(){l({url:"/pages/commonPage/morePage/index?type=2"})},onSearchInput(e){this.systemKeyword=e},initSysList(e){this.userInfo=e,this.userInfo.systemIds&&this.userInfo.systemIds.length&&this.userInfo.systemIds.forEach((e=>{e.id==this.userInfo.appSystemId&&(this.selectData=e)})),o().then((e=>{this.baseForm=e.data}))},processObject(e){const t=e.objectData?JSON.parse(e.objectData):{},s=JSON.parse(e.propertyJson).moduleId||"";return this.$set(e,"moduleId",s),{...e,...t}},getUsualList(){D().then((e=>{let t=e.data.list.map((e=>this.processObject(e))).slice(0,11);this.usualList=[...t]}))},upCallback(e){let t={keyword:this.keyword};a({title:"正在加载",mask:!0});i().getCurrentUser().then((e=>{this.initSysList(e),this.getUsualList(),A(t).then((e=>{let t=e.data.list||[];this.mescroll.endSuccess(t.length),this.list=t.filter((e=>e.children&&e.children.length)),this.menuList=this.list,this.handleProperty(this.list),n(),this.key=+new Date,this.mescroll.endSuccess(this.menuList.length,!1)})).catch((()=>{this.mescroll.endSuccess(0),this.mescroll.endErr()}))}))},handleProperty(e){const t=e=>{e.map((e=>{var s;if(null==e?void 0:e.propertyJson){let t=JSON.parse(e.propertyJson);this.$set(e,"iconBackground",t.iconBackgroundColor||""),this.$set(e,"moduleId",t.moduleId||"")}(null==e?void 0:e.children)&&(null==(s=null==e?void 0:e.children)?void 0:s.length)&&t(e.children)}))};t(e)},search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.list=[],this.menuList=[],this.mescroll.resetUpScroll()}),300)},moreApp(){l({url:"/pages/commonPage/allApp/index?type=2"})},selectItem(e,t){if(e.id===this.userInfo.appSystemId)return;let s={majorId:e.id,majorType:"System",menuType:1};r(s).then((s=>{200==s.code&&(this.changeSelData(e,t),this.keyword="",this.systemKeyword="",this.$u.toast(s.msg),this.$nextTick((()=>{this.mescroll.resetUpScroll()})))})).catch((e=>{this.$u.toast(e),setTimeout((()=>{this.$nextTick((()=>{this.mescroll.resetUpScroll()}))}),1200)}))},changeSelData(e,t){this.selectData=e,this.userInfo.appSystemId=e.id,this.$refs.popup.close()},getFullName(e){return e.enCode?this.$t("routes."+e.enCode.replace(/\./g,"-")):e.name}}},[["render",function(e,t,s,l,o,a){const i=d,n=$(c("uni-icons"),b),r=$(c("uni-nav-bar"),L),T=$(c("u-search"),j),D=S,A=$(c("u-icon"),v),B=$(c("mescroll-body"),U),H=$(c("uni-popup"),N),O=p("treeCollapse");return m(),u(i,{class:"apply-v"},{default:h((()=>[f(i,{class:"nav-bar-box"},{default:h((()=>[f(r,{fixed:!0,statusBar:!0,border:!1,"left-icon":"bars",onClickLeft:t[1]||(t[1]=e=>a.showSelectBox("left")),height:"44px"},{default:h((()=>[f(i,{class:"nav-left",onClick:t[0]||(t[0]=e=>a.showSelectBox("center"))},{default:h((()=>[f(i,{class:"nav-left-text"},{default:h((()=>[y(g(o.selectData.name),1)])),_:1}),o.userInfo.systemIds.length>1?(m(),u(n,{key:0,class:k(["right-icons",{"select-right-icons":o.showSelect}]),type:"down",color:"#000000",size:"14"},null,8,["class"])):w("",!0)])),_:1})])),_:1})])),_:1}),f(i,{class:"notice-warp",style:I({top:o.topSearch,height:o.noticeWarpH+"px"})},{default:h((()=>[f(i,{class:"search-box"},{default:h((()=>[f(T,{placeholder:e.$t("app.apply.pleaseKeyword"),modelValue:o.keyword,"onUpdate:modelValue":t[2]||(t[2]=e=>o.keyword=e),height:"72","show-action":!1,onChange:a.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["placeholder","modelValue","onChange"])])),_:1})])),_:1},8,["style"]),f(B,{ref:"mescrollRef",onDown:e.downCallback,down:o.downOption,sticky:!1,onUp:a.upCallback,up:o.upOption,bottombar:!1,onInit:e.mescrollInit,top:o.mescrollTop},{default:h((()=>[f(i,{class:"common-block"},{default:h((()=>[f(i,{class:"caption u-flex"},{default:h((()=>[f(D,{class:"caption-left"},{default:h((()=>[y("常用菜单")])),_:1}),f(i,{class:"u-flex",onClick:a.openPage},{default:h((()=>[f(D,{class:"caption-right"},{default:h((()=>[y(g(e.$t("common.moreText")),1)])),_:1}),f(A,{name:"arrow-right",size:"24"})])),_:1},8,["onClick"])])),_:1}),f(i,{class:"u-flex u-flex-wrap"},{default:h((()=>[(m(!0),x(_,null,C(o.usualList,((e,t)=>(m(),u(i,{class:"item u-flex-col u-col-center",key:t,onClick:t=>a.handelClick(e)},{default:h((()=>[f(D,{class:k(["u-font-40 item-icon",e.icon]),style:I({background:e.iconBackground||"#008cff"})},null,8,["class","style"]),f(D,{class:"u-font-24 u-line-1 item-text"},{default:h((()=>[y(g(e.fullName),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128)),f(i,{class:"item u-flex-col u-col-center",onClick:a.moreApp},{default:h((()=>[f(D,{class:"u-font-40 item-icon more"},{default:h((()=>[y("+")])),_:1}),f(D,{class:"u-font-24 u-line-1 item-text"},{default:h((()=>[y("添加")])),_:1})])),_:1},8,["onClick"])])),_:1})])),_:1}),f(i,{class:"workFlow-list"},{default:h((()=>[(m(!0),x(_,null,C(o.menuList,((e,t)=>(m(),u(i,{class:"part",key:t},{default:h((()=>{var t;return[(null==(t=null==e?void 0:e.children)?void 0:t.length)?(m(),u(i,{key:0,class:"caption u-line-1"},{default:h((()=>[y(g(e.fullName),1)])),_:2},1024)):w("",!0),f(i,{class:"u-flex u-flex-wrap"},{default:h((()=>[(m(!0),x(_,null,C(e.children,((e,t)=>(m(),u(i,{class:"item u-flex-col u-col-center",key:t,onClick:t=>a.handelClick(e)},{default:h((()=>[f(D,{class:k(["u-font-40 item-icon",e.icon]),style:I({background:e.iconBackground||"#008cff"})},null,8,["class","style"]),f(D,{class:"u-font-24 u-line-1 item-text"},{default:h((()=>[y(g(e.fullName),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:2},1024)]})),_:2},1024)))),128))])),_:1})])),_:1},8,["onDown","down","onUp","up","onInit","top"]),f(H,{ref:"popup","background-color":"#fff",onChange:a.popupChange},{default:h((()=>[f(i,{style:I({"margin-top":o.statusBarHeight+220+"rpx"})},null,8,["style"]),f(i,{class:"notice-warp",style:I({top:o.topSearch,height:o.noticeWarpH+"px"})},{default:h((()=>[f(i,{class:"search-box"},{default:h((()=>[f(T,{placeholder:e.$t("app.apply.pleaseKeyword"),modelValue:o.systemKeyword,"onUpdate:modelValue":t[3]||(t[3]=e=>o.systemKeyword=e),height:"72","show-action":!1,onChange:a.onSearchInput,"bg-color":"#f0f2f6",shape:"square"},null,8,["placeholder","modelValue","onChange"])])),_:1})])),_:1},8,["style"]),f(i,{class:"item popupItem"},{default:h((()=>[a.filteredList.length?(m(!0),x(_,{key:0},C(a.filteredList,((e,t)=>(m(),u(i,{key:t,class:"select-item",onClick:s=>a.selectItem(e,t)},{default:h((()=>[f(D,{class:k(["u-m-r-12 u-font-40",[e.icon,{currentItem:e.id===o.userInfo.appSystemId}]])},null,8,["class"]),f(D,{class:k(["item-text sysName",{currentItem:e.id===o.userInfo.appSystemId}])},{default:h((()=>[y(g(e.name),1)])),_:2},1032,["class"]),e.id===o.userInfo.appSystemId?(m(),u(A,{key:0,name:"checkbox-mark ",class:"currentItem"})):w("",!0)])),_:2},1032,["onClick"])))),128)):w("",!0)])),_:1})])),_:1},8,["onChange"]),o.showApply?(m(),u(O,{key:0,show:o.showApply,treeData:o.menuList,onChange:a.handelClick},null,8,["show","treeData","onChange"])):w("",!0)])),_:1})}],["__scopeId","data-v-4091a91b"]]);export{J as default};
|