pages-commonPage-morePage-index.CGGvJuRg.js 8.7 KB

1
  1. import{a as e,h as t,n as s,k as l,X as a,p as r,m as i,w as o,q as n,t as u,v as c,B as h,C as d,F as m,o as p,E as f,a1 as y,G as g,g as k,Y as w,ac as C,z as T}from"./index-C9TJPork.js";import{_ as N}from"./u-search.DOsDiA_z.js";import{r as _}from"./uni-app.es.CUt9gedF.js";import{N as b}from"./index.BeMkBjFo.js";import{C as x}from"./index.CblAK2O1.js";import{d as L,e as v}from"./apply.xOM-eZhr.js";import{_ as j}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{_ as I}from"./mescroll-uni.AlrM8mta.js";import{r as $}from"./resources.DEPsJg7u.js";import{M as S}from"./mescroll-mixins.C2YUWJKd.js";import"./u-icon.BNGPST4x.js";import"./u-tabs.CYgabJiD.js";import"./u-badge.BHkDpFBd.js";import"./u-popup.7vl_vYde.js";import"./renderjs.Cg3LvhxW.js";const U=j({components:{allCommonFlow:j({components:{CommonTabs:x,NoData:b},data:()=>({activeFlow:{},keyword:"",category:"",current:0,categoryTree:[],fullName:"",list:[],searchCategoryTree:[]}),created(){e(),this.getFlowUsualList()},methods:{getFlowUsualList(){this.keyword="",L().then((e=>{var s;this.categoryTree=(null==(s=null==e?void 0:e.data)?void 0:s.list)||[],this.searchCategoryTree=JSON.parse(JSON.stringify(this.categoryTree)),this.list=[],this.$nextTick((()=>{var e,t;this.list=(null==(e=this.categoryTree[this.current])?void 0:e.children)||[],this.fullName=null==(t=this.categoryTree[this.current])?void 0:t.fullName})),t()})).catch((()=>{this.categoryTree=[],this.list=[]}))},search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{if(!this.keyword)return this.clear();let e=this.searchCategoryTree[this.current].children.filter((e=>e.fullName.includes(this.keyword)));this.$set(this.categoryTree[this.current],"children",e),this.list=this.categoryTree[this.current].children}),300)},clear(){this.getFlowUsualList()},change(e){this.list=this.categoryTree[e].children,this.fullName=this.categoryTree[e].fullName,this.keyword="",this.current=e},Jump(e){const t={id:"",flowId:e.id,opType:"-1"};this.current=0,this.category="",s({url:"/pages/workFlow/flowBefore/index?config="+this.jnpf.base64.encode(JSON.stringify(t))})}}},[["render",function(e,t,s,k,w,C){const T=_(l("u-search"),N),b=p,x=a("CommonTabs"),L=g,v=a("NoData");return r(),i(b,{class:"workFlow-v"},{default:o((()=>[n(b,{class:"notice-warp"},{default:o((()=>[n(b,{class:"search-box"},{default:o((()=>[n(T,{placeholder:e.$t("app.apply.pleaseKeyword"),modelValue:w.keyword,"onUpdate:modelValue":t[0]||(t[0]=e=>w.keyword=e),height:"72","show-action":!1,onChange:C.search,"bg-color":"#f0f2f6",shape:"square",onClear:C.clear},null,8,["placeholder","modelValue","onChange","onClear"])])),_:1}),n(b,{class:"commonTabs-box"},{default:o((()=>[n(x,{list:w.categoryTree,onChange:C.change,current:w.current,ref:"CommonTabs",isScroll:w.categoryTree.length>=4},null,8,["list","onChange","current","isScroll"])])),_:1})])),_:1}),n(b,{class:"workFlow-list",style:{}},{default:o((()=>[w.list.length?(r(),i(b,{key:0,class:"part"},{default:o((()=>[n(b,{class:"caption u-line-1"},{default:o((()=>[u(c(w.fullName),1)])),_:1}),n(b,{class:"u-flex u-flex-wrap"},{default:o((()=>[(r(!0),h(m,null,d(w.list,((e,t)=>(r(),i(b,{class:"item u-flex-col u-col-center",key:t,onClick:t=>C.Jump(e)},{default:o((()=>[n(L,{class:f(["u-font-40 item-icon",e.icon]),style:y({background:e.iconBackground||"#008cff"})},null,8,["class","style"]),n(L,{class:"u-font-24 u-line-1 item-text"},{default:o((()=>[u(c(e.fullName),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})):(r(),i(v,{key:1}))])),_:1})])),_:1})}],["__scopeId","data-v-d8f91e80"]]),allCommonMenus:j({mixins:[S],components:{NoData:b,CommonTabs:x},data:()=>({showPopup:!1,topSearch:80,current:0,usualList:[],tabsMenuList:[],menuList:[],downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:50,time:null},empty:{use:!1,icon:$.message.nodata,tip:"暂无数据",fixed:!0,top:"560rpx"},textNoMore:""},keyword:"",userInfo:{systemIds:[]},modelId:"",config:{},key:+new Date}),computed:{baseURL(){return this.define.baseURL},token:()=>k("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}},created(){w("refresh",(()=>{this.menuList=[],this.current=0,this.mescroll.resetUpScroll()}))},methods:{classifyItem(e){this.showPopup=!1,this.change(e)},upCallback(s){let l={keyword:this.keyword,type:2};e({title:"正在加载",mask:!0}),v(l).then((e=>{let s=e.data.list||[];s.length||(this.current=0),this.tabsMenuList=[{fullName:"全部功能"}],this.mescroll.endSuccess(s.length);for(let t=0;t<s.length;t++){let e=s[t].children,l={fullName:s[t].fullName};if(this.tabsMenuList.push(l),Array.isArray(e)&&e.length)for(let t=0;t<e.length;t++){let s="",l="";if(e[t].propertyJson){let a=JSON.parse(e[t].propertyJson);s=a.iconBackgroundColor||"",l=a.moduleId||""}this.$set(e[t],"iconBackground",s),this.$set(e[t],"moduleId",l)}}if(this.list=JSON.parse(JSON.stringify(s)),0===this.current){let e=[{fullName:"全部功能",children:this.jnpf.treeToArray(this.list).filter((e=>!e.hasChildren)),id:0}];this.menuList=e}else this.menuList=this.list;t(),this.key=+new Date,this.mescroll.endSuccess(this.menuList.length,!1)})).catch((()=>{this.mescroll.endSuccess(0),this.mescroll.endErr()}))},change(e){if(this.current=e,this.menuList=this.list,0===this.current){let e=[{fullName:"全部功能",children:this.jnpf.treeToArray(this.list).filter((e=>!e.hasChildren)),id:0}];this.menuList=e}else this.menuList=[this.list[e-1]]},search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.list=[],this.menuList=[],this.tabsMenuList=[],this.current=0,this.mescroll.resetUpScroll()}),300)},handleClick(e){if(2!=e.type){if(3==e.type){if(this.modelId=e.moduleId,!e.moduleId)return void this.$u.toast("暂无此页面");s({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 s({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 s({url:"/pages/portal/scanPortal/index?id="+e.moduleId+"&portalType=1&fullName="+e.fullName,fail:e=>{this.$u.toast("暂无此页面")}}):void this.$u.toast("暂无此页面"):void 0}s({url:e.urlAddress+"?menuId="+e.id+"&fullName="+e.fullName,fail:e=>{this.$u.toast("暂无此页面")}})}}},[["render",function(e,t,s,k,w,C){const T=_(l("u-search"),N),b=p,x=a("CommonTabs"),L=g,v=a("NoData"),j=_(l("mescroll-uni"),I);return r(),i(b,{class:"all-apply-v"},{default:o((()=>[n(b,{class:"notice-warp"},{default:o((()=>[n(b,{class:"search-box"},{default:o((()=>[n(T,{placeholder:e.$t("app.apply.pleaseKeyword"),modelValue:w.keyword,"onUpdate:modelValue":t[0]||(t[0]=e=>w.keyword=e),height:"72","show-action":!1,onChange:C.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["placeholder","modelValue","onChange"])])),_:1}),n(b,null,{default:o((()=>[n(x,{list:w.tabsMenuList,onChange:C.change,current:w.current,ref:"CommonTabs"},null,8,["list","onChange","current"])])),_:1})])),_:1}),n(j,{onInit:e.mescrollInit,onDown:e.downCallback,onUp:C.upCallback,down:w.downOption,up:w.upOption,top:"220"},{default:o((()=>[n(b,{class:"workFlow-list"},{default:o((()=>[w.menuList.length&&C.hasChildren?(r(!0),h(m,{key:0},d(w.menuList,((e,t)=>(r(),i(b,{class:"part",key:t},{default:o((()=>[n(b,{class:"caption u-line-1"},{default:o((()=>[u(c(e.fullName),1)])),_:2},1024),n(b,{class:"u-flex u-flex-wrap"},{default:o((()=>[(r(!0),h(m,null,d(e.children,((e,t)=>(r(),i(b,{class:"item u-flex-col u-col-center",key:t,onClick:t=>C.handleClick(e)},{default:o((()=>[n(L,{class:f(["u-font-40 item-icon",e.icon]),style:y({background:e.iconBackground||"#008cff"})},null,8,["class","style"]),n(L,{class:"u-font-24 u-line-1 item-text"},{default:o((()=>[u(c(e.fullName),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:2},1024)])),_:2},1024)))),128)):(r(),i(v,{key:1,paddingTop:400}))])),_:1})])),_:1},8,["onInit","onDown","onUp","down","up"])])),_:1})}],["__scopeId","data-v-87f32b64"]])},data:()=>({type:"1"}),onLoad(e){this.type=(null==e?void 0:e.type)||"1",C({title:"1"==this.type?"常用流程":"常用菜单"})},methods:{}},[["render",function(e,t,s,l,n,u){const c=a("allCommonFlow"),h=a("allCommonMenus"),d=p;return r(),i(d,{class:"morePage-v"},{default:o((()=>[1==n.type?(r(),i(c,{key:0,ref:"allCommonFlow"},null,512)):T("",!0),2==n.type?(r(),i(h,{key:1,ref:"allCommonMenus"},null,512)):T("",!0)])),_:1})}],["__scopeId","data-v-36448ebc"]]);export{U as default};