pages-commonPage-allApp-index.CEHsmskV.js 11 KB

1
  1. import{aE as t,bd as e,p as s,m as l,w as a,q as i,E as o,a1 as n,ad as r,o as u,n as c,$ as d,b as h,k as p,X as m,t as f,B as y,C as g,F as k,v as b,G as x,a as w,h as L,z as _,ac as C}from"./index-C9TJPork.js";import{_ as v}from"./u-search.DOsDiA_z.js";import{r as T}from"./uni-app.es.CUt9gedF.js";import{_ as S}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{_ as N}from"./u-button.C_4h_wUh.js";import{_ as O}from"./mescroll-uni.AlrM8mta.js";import{M as j}from"./mescroll-mixins.C2YUWJKd.js";import{C as A}from"./index.CblAK2O1.js";import{N as D}from"./index.BeMkBjFo.js";import{g as I,f as U,s as $,b as F,h as B,i as z,j as J}from"./apply.xOM-eZhr.js";import{r as V}from"./resources.DEPsJg7u.js";import"./u-icon.BNGPST4x.js";import"./renderjs.Cg3LvhxW.js";import"./u-tabs.CYgabJiD.js";import"./u-badge.BHkDpFBd.js";import"./u-popup.7vl_vYde.js";const q=S({name:"u-sticky",emits:["fixed","unfixed"],props:{offsetTop:{type:[Number,String],default:0},index:{type:[Number,String],default:""},enable:{type:Boolean,default:!0},h5NavHeight:{type:[Number,String],default:44},bgColor:{type:String,default:"#ffffff"},zIndex:{type:[Number,String],default:""}},data(){return{fixed:!1,height:"auto",stickyTop:0,elClass:this.$u.guid(),left:0,width:"auto"}},watch:{offsetTop(t){this.initObserver()},enable(t){0==t?(this.fixed=!1,this.disconnectObserver("contentObserver")):this.initObserver()}},computed:{uZIndex(){return this.zIndex?this.zIndex:this.$u.zIndex.sticky}},mounted(){this.initObserver()},methods:{initObserver(){this.enable&&(this.stickyTop=0!=this.offsetTop?t(this.offsetTop)+this.h5NavHeight:this.h5NavHeight,this.disconnectObserver("contentObserver"),this.$uGetRect("."+this.elClass).then((t=>{this.height=t.height,this.left=t.left,this.width=t.width,this.$nextTick((()=>{this.observeContent()}))})))},observeContent(){this.disconnectObserver("contentObserver");const t=e(this,{thresholds:[.95,.98,1]});t.relativeToViewport({top:-this.stickyTop}),t.observe("."+this.elClass,(t=>{this.enable&&this.setFixed(t.boundingClientRect.top)})),this.contentObserver=t},setFixed(t){const e=t<this.stickyTop;e?this.$emit("fixed",this.index):this.fixed&&this.$emit("unfixed",this.index),this.fixed=e},disconnectObserver(t){const e=this[t];e&&e.disconnect()}},beforeUnmount(){this.disconnectObserver("contentObserver")}},[["render",function(t,e,c,d,h,p){const m=u;return s(),l(m,{class:""},{default:a((()=>[i(m,{class:o(["u-sticky-wrap",[h.elClass]]),style:n({height:h.fixed?h.height+"px":"auto",backgroundColor:c.bgColor})},{default:a((()=>[i(m,{class:"u-sticky",style:n({position:h.fixed?"fixed":"static",top:h.stickyTop+"px",left:h.left+"px",width:"auto"==h.width?"auto":h.width+"px",zIndex:p.uZIndex})},{default:a((()=>[r(t.$slots,"default",{},void 0,!0)])),_:3},8,["style"])])),_:3},8,["class","style"])])),_:3})}],["__scopeId","data-v-381aec6a"]]);const M=S({components:{allAppWorkFlow:S({mixins:[j],components:{CommonTabs:A,NoData:D},props:{categoryList:{type:Array,default:()=>[]}},data(){return{usualList:[],current:0,customStyle:{width:"128rpx",fontSize:"24rpx",height:"60rpx"},downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:20,time:null},empty:{use:!1,icon:V.message.nodata,tip:this.$t("common.noData"),fixed:!0,top:"860rpx"},textNoMore:this.$t("app.apply.noMoreData")},category:"",allList:[],type:"1",fullName:"",keyword:""}},methods:{search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.list=[],this.menuList=[],this.mescroll.resetUpScroll()}),300)},init(){this.getFlowUsualList()},getFlowUsualList(){I({category:"commonFlow",flowType:0}).then((t=>{this.usualList=t.data.list.map((t=>{const e=t.objectData?JSON.parse(t.objectData):{};return{...t,...e}}))}))},upCallback(t){let e={currentPage:t.num,pageSize:t.size,category:0==this.category?"":this.category,flowType:0,keyword:this.keyword};U(e,{load:1==t.num}).then((e=>{this.mescroll.endSuccess(e.data.list.length),1==t.num&&(this.allList=[]);const s=e.data.list||[];this.allList=this.allList.concat(s)})).catch((()=>{this.mescroll.endSuccess(0),this.mescroll.endErr()}))},Jump(t){const e={id:"",flowId:t.id,opType:"-1"};c({url:"/pages/workFlow/flowBefore/index?config="+this.jnpf.base64.encode(JSON.stringify(e))})},handelAdd(t){$(t.id).then((e=>{this.usualList.push(t),t.isCommonFlow=!0,d("updateUsualList"),h({title:e.msg})}))},handelDel(t){$(t.id).then((e=>{t.isCommonFlow=!1,this.getFlowUsualList(),d("updateUsualList"),h({title:e.msg})}))},change(t){this.current=t,this.keyword="",this.category=this.categoryList[t].id?this.categoryList[t].id:"",this.allList=[],this.mescroll.resetUpScroll()}}},[["render",function(t,e,r,c,d,h){const w=T(p("u-search"),v),L=u,_=x,C=m("CommonTabs"),S=T(p("u-sticky"),q),j=T(p("u-button"),N),A=m("NoData"),D=T(p("mescroll-uni"),O);return s(),l(L,{class:"allApp-v"},{default:a((()=>[i(L,{class:"notice-warp"},{default:a((()=>[i(L,{class:"search-box"},{default:a((()=>[i(w,{placeholder:t.$t("app.apply.pleaseKeyword"),modelValue:d.keyword,"onUpdate:modelValue":e[0]||(e[0]=t=>d.keyword=t),height:"72","show-action":!1,onChange:h.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["placeholder","modelValue","onChange"])])),_:1})])),_:1}),i(D,{ref:"mescrollRef",onInit:t.mescrollInit,onDown:t.downCallback,onUp:h.upCallback,down:d.downOption,up:d.upOption,bottombar:!1,sticky:!1},{default:a((()=>[i(L,null,{default:a((()=>[i(L,{class:"usualList"},{default:a((()=>[i(L,{class:"caption u-m-b-20"},{default:a((()=>[f("常用流程")])),_:1}),i(L,{class:"u-flex u-flex-wrap"},{default:a((()=>[(s(!0),y(k,null,g(d.usualList,((t,e)=>(s(),l(L,{class:"item u-flex-col u-col-center",key:e},{default:a((()=>[i(_,{class:o(["u-font-40 item-icon",t.icon]),style:n({background:t.iconBackground||"#008cff"}),onClick:e=>h.Jump(t)},null,8,["class","style","onClick"]),i(_,{class:"u-font-24 u-line-1 item-text"},{default:a((()=>[f(b(t.fullName),1)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1}),i(S,null,{default:a((()=>[i(C,{list:r.categoryList,onChange:h.change,current:d.current,ref:"CommonTabs",isBoxShadow:""},null,8,["list","onChange","current"])])),_:1}),d.allList.length?(s(),l(L,{key:0,class:"allList u-m-t-20"},{default:a((()=>[(s(!0),y(k,null,g(d.allList,((t,e)=>(s(),l(L,{key:e},{default:a((()=>[i(L,{class:"u-flex childList-item"},{default:a((()=>[i(_,{class:o(["u-font-40 item-icon",t.icon]),style:n({background:t.iconBackground||"#008cff"}),onClick:e=>h.Jump(t)},null,8,["class","style","onClick"]),i(_,{class:"item-text u-m-l-28 u-m-r-28 u-line-2"},{default:a((()=>[f(b(t.fullName),1)])),_:2},1024),i(L,{class:"btnBox"},{default:a((()=>[t.isCommonFlow?(s(),l(j,{key:1,"custom-style":d.customStyle,type:"error",onClick:e=>h.handelDel(t)},{default:a((()=>[f(" 移除 ")])),_:2},1032,["custom-style","onClick"])):(s(),l(j,{key:0,"custom-style":d.customStyle,onClick:e=>h.handelAdd(t)},{default:a((()=>[f("添加 ")])),_:2},1032,["custom-style","onClick"]))])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])),_:1})):(s(),l(A,{key:1,paddingTop:"100"}))])),_:1})])),_:1},8,["onInit","onDown","onUp","down","up"])])),_:1})}],["__scopeId","data-v-443818bc"]]),allAppApply:S({components:{CommonTabs:A,NoData:D},data:()=>({current:0,usualList:[],allList:[],customStyle:{width:"128rpx",fontSize:"24rpx",height:"60rpx"},type:"2",keyword:""}),methods:{init(){w({title:"加载中"}),this.getUsualList()},search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.allList=[],this.usualList=[],this.current=0,this.getUsualList()}),300)},getUsualList(){F().then((t=>{this.usualList=t.data.list.map((t=>{const e=t.objectData?JSON.parse(t.objectData):{};return{...t,...e}}))})),this.getAllList()},getAllList(){B({keyword:this.keyword}).then((t=>{L();let e=JSON.parse(JSON.stringify(t.data.list));for(let s=0;s<e.length;s++){let t=e[s].children;if(Array.isArray(t)&&t.length)for(let e=0;e<t.length;e++){let s="",l="";if(t[e].propertyJson){let a=JSON.parse(t[e].propertyJson);s=a.iconBackgroundColor||"",l=a.moduleId||""}this.$set(t[e],"iconBackground",s),this.$set(t[e],"moduleId",l)}}this.allList=e.filter((t=>t.children))}))},handelAdd(t){z(t.id).then((e=>{this.usualList.push(t),t.isData=!0,d("updateUsualList"),h({title:e.msg})}))},handelDel(t){J(t.id).then((e=>{this.usualList=this.usualList.filter((e=>e.id!==t.id)),t.isData=!1,d("updateUsualList"),h({title:e.msg})}))},change(t){this.current=t}}},[["render",function(t,e,r,c,d,h){const w=T(p("u-search"),v),L=u,C=x,S=m("CommonTabs"),O=T(p("u-button"),N),j=m("NoData");return s(),l(L,{class:"allApp-v"},{default:a((()=>[i(L,{class:"notice-warp"},{default:a((()=>[i(L,{class:"search-box"},{default:a((()=>[i(w,{placeholder:t.$t("app.apply.pleaseKeyword"),modelValue:d.keyword,"onUpdate:modelValue":e[0]||(e[0]=t=>d.keyword=t),height:"72","show-action":!1,onChange:h.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["placeholder","modelValue","onChange"])])),_:1})])),_:1}),i(L,{class:"usualList"},{default:a((()=>[i(L,{class:"caption u-m-b-20"},{default:a((()=>[f("常用菜单")])),_:1}),i(L,{class:"u-flex u-flex-wrap"},{default:a((()=>[(s(!0),y(k,null,g(d.usualList,((t,e)=>(s(),l(L,{class:"item u-flex-col u-col-center",key:e},{default:a((()=>[i(C,{class:o(["u-font-40 item-icon",t.icon]),style:n({background:t.iconBackground||"#008cff"})},null,8,["class","style"]),i(C,{class:"u-font-24 u-line-1 item-text"},{default:a((()=>[f(b(t.fullName),1)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1}),i(S,{list:d.allList,onChange:h.change,current:d.current,ref:"CommonTabs",isBoxShadow:""},null,8,["list","onChange","current"]),d.allList.length?(s(),l(L,{key:0,class:"allList u-m-t-20"},{default:a((()=>[(s(!0),y(k,null,g(d.allList,((t,e)=>(s(),l(L,{class:"u-m-t-20",key:e},{default:a((()=>{var r;return[e==d.current&&(null==(r=null==t?void 0:t.children)?void 0:r.length)?(s(!0),y(k,{key:0},g(t.children,((t,e)=>(s(),l(L,{class:"u-flex childList-item u-p-b-28",key:e},{default:a((()=>[i(C,{class:o(["u-font-40 item-icon",t.icon]),style:n({background:t.iconBackground||"#008cff"})},null,8,["class","style"]),i(C,{class:"u-font-32 item-text u-m-l-28 u-m-r-28 u-line-2"},{default:a((()=>[f(b(t.fullName),1)])),_:2},1024),i(L,{class:"btnBox"},{default:a((()=>[t.isData?(s(),l(O,{key:1,"custom-style":d.customStyle,type:"error",onClick:e=>h.handelDel(t)},{default:a((()=>[f("移除 ")])),_:2},1032,["custom-style","onClick"])):(s(),l(O,{key:0,"custom-style":d.customStyle,onClick:e=>h.handelAdd(t)},{default:a((()=>[f("添加 ")])),_:2},1032,["custom-style","onClick"]))])),_:2},1024)])),_:2},1024)))),128)):_("",!0)]})),_:2},1024)))),128))])),_:1})):(s(),l(j,{key:1,paddingTop:450}))])),_:1})}],["__scopeId","data-v-711dfad3"]])},data:()=>({type:"1",categoryList:[]}),onLoad(t){this.type=t.type||"1",C({title:"1"==this.type?"收藏流程":"收藏菜单"}),this.categoryList=t.categoryList?JSON.parse(decodeURIComponent(t.categoryList)):[],this.init()},methods:{init(t){this.$nextTick((()=>{1==this.type?this.$refs.allAppWorkFlow.init():this.$refs.allAppApply.init()}))}}},[["render",function(t,e,o,n,r,c){const d=m("allAppWorkFlow"),h=u,p=m("allAppApply");return s(),l(h,null,{default:a((()=>[1==r.type?(s(),l(h,{key:0,class:""},{default:a((()=>[i(d,{ref:"allAppWorkFlow",categoryList:r.categoryList},null,8,["categoryList"])])),_:1})):_("",!0),2==r.type?(s(),l(h,{key:1,class:""},{default:a((()=>[i(p,{ref:"allAppApply"},null,512)])),_:1})):_("",!0)])),_:1})}],["__scopeId","data-v-2e3e983c"]]);export{M as default};