| 1 |
- import{P as e,g as t,o as a,t as o,p as s,w as l,v as n,x as i,y as r,D as d,E as u,F as p,B as m,q as c,I as h,H as f,Q as w,m as g,R as y,S as b,T as L,u as F,r as k,U as P,V as _,W as C,a as x,n as I,X as v,Y as D}from"./index-P0fyQ2Em.js";import{_ as U}from"./u-badge.CWPuZ-w1.js";import{r as S}from"./uni-app.es.DOtS5Ldl.js";import{_ as $}from"./u-sticky.DiHDpS-r.js";import{g as E}from"./flowEngine.Ke7vpfzj.js";import{_ as N}from"./u-tabs.DEel8MQB.js";import{_ as T}from"./u-icon.wXcRZHbn.js";import{_ as j}from"./index.BuZ8YmVY.js";import{_ as A}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{_ as M}from"./u-input.Cp2bygnN.js";import{_ as V,a as O}from"./u-form.B1LWETT2.js";import{_ as R}from"./u-image.RNxpLaRU.js";import{_ as J}from"./u-button.Chh1-6a-.js";import{_ as q}from"./u-popup.CXrq2y3n.js";import"./resources.DEPsJg7u.js";import"./emitter.DrjJCwnj.js";const B=A({props:{title:{type:String,default:"我的收藏"},menuList:{type:Array,default:()=>[]},flowList:{type:Array,default:()=>[]},showAdd:{type:Boolean,default:!1},type:{type:String,default:"collect"},flowEnabled:{type:Boolean,default:!1}},data:()=>({tabList:[{name:"应用功能",type:"menu"}],current:0,cardData:[],userInfo:{}}),computed:{tabType(){return this.tabList[this.current].type}},watch:{menuList:{handler(e){0!=this.current&&(this.cardData=this.flowList)},immediate:!0},flowList:{handler(e){0==this.current&&(this.cardData=this.menuList)},immediate:!0}},created(){this.userInfo=t("userInfo")||{},this.handleTabList()},methods:{handleTabList(){this.flowEnabled&&this.tabList.push({name:"发起审批",type:"flow"})},tabChange(e){this.current=e,"menu"===this.tabType&&(this.cardData=this.menuList),"flow"===this.tabType&&(this.cardData=this.flowList)},clickItem(e){this.$emit("launch",{...e,tabType:this.tabType})},openPage(){let e;e="collect"===this.type?"menu"===this.tabType?"/pages/commonPage/morePage/index?type=2":"/pages/commonPage/morePage/index?type=1":"menu"===this.tabType?"/pages/apply/menu/index":"/pages/workFlow/workFlow/index",this.$emit("openPage",e)},add(){let e="menu"===this.tabType?"/pages/apply/allAppApply/index":"/pages/workFlow/allAppWorkFlow/index";this.$emit("addApp",e)}}},[["render",function(e,t,g,y,b,L){const F=c,k=S(a("u-tabs"),N),P=S(a("u-icon"),T),_=h,C=S(a("JnpfEmpty"),j);return o(),s(F,{class:"card"},{default:l((()=>[n(F,{class:"card-content"},{default:l((()=>[n(F,{class:"card-tabs u-flex"},{default:l((()=>[n(F,{class:"u-flex card-left"},{default:l((()=>[n(F,{class:"card-title"},{default:l((()=>[i(r(g.title),1)])),_:1}),n(k,{list:b.tabList,"is-scroll":!0,modelValue:b.current,"onUpdate:modelValue":t[0]||(t[0]=e=>b.current=e),onChange:L.tabChange,"inactive-color":"#666","font-size":"28"},null,8,["list","modelValue","onChange"])])),_:1}),n(F,{onClick:L.openPage,class:"morebtn"},{default:l((()=>[i("更多"),n(P,{name:"arrow-right",class:"u-p-r-10",color:"#666"})])),_:1},8,["onClick"])])),_:1}),n(F,{class:"card-item"},{default:l((()=>[(o(!0),d(p,null,u(b.cardData,((e,t)=>(o(),s(F,{class:"item u-flex-col",key:t,onClick:t=>L.clickItem(e)},{default:l((()=>[n(F,{class:f(["item-icon",e.icon]),style:w({background:e.iconBackground||"#008cff"})},null,8,["class","style"]),n(F,{class:"item-title u-m-t-8"},{default:l((()=>[i(r(e.fullName),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128)),g.showAdd?(o(),s(F,{key:0,class:"item u-flex-col u-col-center",onClick:L.add},{default:l((()=>[n(_,{class:"u-font-40 item-icon more"},{default:l((()=>[i("+")])),_:1}),n(_,{class:"u-m-t-8 item-title"},{default:l((()=>[i("添加")])),_:1})])),_:1},8,["onClick"])):m("",!0)])),_:1}),b.cardData.length||"collect"==g.type?m("",!0):(o(),s(C,{key:0}))])),_:1})])),_:1})}],["__scopeId","data-v-b6d93c83"]]);const H=A({props:{passwordShow:{type:Boolean,default:!0},baseForm:{type:Object,default:()=>{}}},data(){return{showPopup:!1,imgUrl:"",timestamp:"",dataForm:{oldPassword:"",password:"",repeatPsd:"",code:"",timestamp:""},rules:{oldPassword:[{required:!0,message:"旧密码不能为空",trigger:"blur"}],password:[{required:!0,validator:(e,t,a)=>{const o=/[0-9]+/,s=/[a-z]+/,l=/[A-Z]+/,n=/\W/;""===t?a(new Error("新密码不能为空")):1==this.baseForm.passwordStrengthLimit?(this.baseForm.passwordLengthMin&&t.length<this.baseForm.passwordLengthMinNumber&&a(new Error("新密码长度不能小于"+this.baseForm.passwordLengthMinNumber+"位")),this.baseForm.containsNumbers&&(o.test(t)||a(new Error("新密码必须包含数字"))),this.baseForm.includeLowercaseLetters&&(s.test(t)||a(new Error("新密码必须包含小写字母"))),this.baseForm.includeUppercaseLetters&&(l.test(t)||a(new Error("新密码必须包含大写字字母"))),this.baseForm.containsCharacters&&(n.test(t)||a(new Error("新密码必须包含字符"))),a()):a()},trigger:"blur"}],repeatPsd:[{required:!0,validator:(e,t,a)=>{""===t?a(new Error("重复密码不能为空")):t!==this.dataForm.password?a(new Error("两次密码输入不一致")):a()},trigger:"blur"}],code:[{required:!0,message:"验证码不能为空",trigger:"blur"}]}}},computed:{baseURL(){return this.define.baseURL}},watch:{passwordShow(e){e&&(this.showPopup=e,this.$nextTick((()=>{this.$refs.dataForm.setRules(this.rules)})))}},created(){this.changeCode()},methods:{changeCode(){let e=Math.random();this.timestamp=e,this.imgUrl=`/api/file/ImageCode/${e}`},dataFormSubmit(){this.$refs.dataForm.validate((e=>{if(e){let e={oldPassword:g.md5(this.dataForm.oldPassword),password:g.md5(this.dataForm.password),code:this.dataForm.code,timestamp:this.timestamp};this.$emit("submit",e)}}))}}},[["render",function(e,t,d,u,p,m){const h=S(a("u-input"),M),f=S(a("u-form-item"),V),w=S(a("u-image"),R),g=c,b=S(a("u-button"),J),L=S(a("u-form"),O),F=S(a("u-popup"),q);return o(),s(F,{modelValue:p.showPopup,"onUpdate:modelValue":t[4]||(t[4]=e=>p.showPopup=e),mode:"center",length:"auto"},{default:l((()=>[n(g,{class:"jnpf-wrap jnpf-wrap-workflow"},{default:l((()=>[n(L,{model:p.dataForm,rules:p.rules,ref:"dataForm","label-position":"left","label-width":"150","label-align":"left"},{default:l((()=>[n(f,{label:"旧密码",prop:"oldPassword",required:""},{default:l((()=>[n(h,{modelValue:p.dataForm.oldPassword,"onUpdate:modelValue":t[0]||(t[0]=e=>p.dataForm.oldPassword=e),placeholder:"旧密码",type:"password"},null,8,["modelValue"])])),_:1}),n(f,{label:"新密码",prop:"password",required:""},{default:l((()=>[n(h,{modelValue:p.dataForm.password,"onUpdate:modelValue":t[1]||(t[1]=e=>p.dataForm.password=e),placeholder:"新密码",type:"password"},null,8,["modelValue"])])),_:1}),n(f,{label:"重复密码",prop:"repeatPsd",required:""},{default:l((()=>[n(h,{modelValue:p.dataForm.repeatPsd,"onUpdate:modelValue":t[2]||(t[2]=e=>p.dataForm.repeatPsd=e),placeholder:"重复密码",type:"password"},null,8,["modelValue"])])),_:1}),n(f,{label:"验证码",prop:"code",required:""},{default:l((()=>[n(g,{class:"u-flex"},{default:l((()=>[n(h,{modelValue:p.dataForm.code,"onUpdate:modelValue":t[3]||(t[3]=e=>p.dataForm.code=e),placeholder:"验证码"},null,8,["modelValue"]),n(g,{style:{flex:"0.1"}},{default:l((()=>[n(w,{showLoading:!0,src:m.baseURL+p.imgUrl,width:"130px",height:"38px",onClick:m.changeCode},null,8,["src","onClick"])])),_:1})])),_:1})])),_:1}),n(b,{class:"buttom-btn",type:"primary",onClick:y(m.dataFormSubmit,["stop"])},{default:l((()=>[i(r("保存"))])),_:1},8,["onClick"])])),_:1},8,["model","rules"])])),_:1})])),_:1},8,["modelValue"])}]]);b();const W=A({components:{CommonPane:B,PasswordPopup:H},data:()=>({homeData:[],count:0,offset:[20,-10],menuList:[],passwordShow:!1,baseForm:{passwordStrengthLimit:0,passwordLengthMin:!1,passwordLengthMinNumber:0,containsNumbers:!1,includeLowercaseLetters:!1,includeUppercaseLetters:!1,containsCharacters:!1,mandatoryModificationOfInitialPassword:0},userInfo:{}}),onLoad(){b().getSocket||L&&L.initSocket();const e=F();e.getCurrentUser().then((()=>{this.getSystemName()})).catch((()=>{setTimeout((()=>{e.resetToken(),setTimeout((()=>{k({url:"/pages/login/index"})}),500)}),1e3)}));const{changeLocale:t}=D();t(P())},onShow(e){this.init()},computed:{baseURL(){return this.define.baseURL},token:()=>t("token"),report(){return this.define.report},pcURL(){return this.define.pcURL}},methods:{init(){this.getHomeData(),this.getFlowCount(),this.getSystemConfig()},getSystemConfig(){_(),this.userInfo=t("userInfo")||{};const e=t("sysConfigInfo")||{};this.$nextTick((()=>{this.baseForm.passwordStrengthLimit=e.passwordStrengthLimit,this.baseForm.passwordLengthMin=e.passwordLengthMin,this.baseForm.passwordLengthMinNumber=e.passwordLengthMinNumber,this.baseForm.containsNumbers=e.containsNumbers,this.baseForm.includeLowercaseLetters=e.includeLowercaseLetters,this.baseForm.containsCharacters=e.containsCharacters,this.baseForm.mandatoryModificationOfInitialPassword=e.mandatoryModificationOfInitialPassword,null==this.userInfo.changePasswordDate&&1==e.mandatoryModificationOfInitialPassword&&(this.passwordShow=!0)}))},dataFormSubmit(e){C(e).then((e=>{F().logout().then((()=>{k({url:"/pages/login/index"})}))}))},getSystemName(){const e=t("userInfo");this.menuList=t("menuList"),x({title:e.systemName})},launch(e){return"flow"==e.tabType?this.JumpFlow(e):"menu"==e.tabType?this.JumpApply(e):void 0},JumpApply(e){if(1==e.type)return void getChildList(e.id).then((e=>{this.listChild=e.data||[],this.handleProperty(this.listChild),this.$nextTick((()=>{I({url:"/pages/apply/catalog/index?config="+this.jnpf.base64.encode(JSON.stringify(this.listChild[0])),fail:e=>{this.$u.toast("暂无此页面")}})}))}));let a="";if(2==e.type||11==e.type){if(!e.pageAddress)return void this.$u.toast("暂无此页面");a=e.pageAddress+"?menuId="+e.id+"&fullName="+e.fullName}if(3==e.type||9==e.type){if(!e.moduleId)return void this.$u.toast("暂无此页面");a="/pages/apply/dynamicModel/index?config="+this.jnpf.base64.encode(JSON.stringify(e))}if(7==e.type){if(!e.pageAddress)return void this.$u.toast("暂无此页面");a="/pages/apply/externalLink/index?url="+encodeURIComponent(e.pageAddress)+"&fullName="+e.fullName+"&type="+e.type}if(5==e.type){if(!e.moduleId)return void this.$u.toast("暂无此页面");userInfo=t("userInfo")||{};const o=userInfo.systemCode;a="/pages/apply/externalLink/index?url="+encodeURIComponent(`${this.report}/preview.html?id=${e.moduleId}&token=${this.token}&appCode=${o}&page=1&from=menu`)+"&fullName="+e.fullName+"&type="+e.type}if(10==e.type){if(!e.moduleId)return void this.$u.toast("暂无此页面");a="/pages/apply/externalLink/index?url="+encodeURIComponent(`${this.pcURL}/reportPreview?id=${e.moduleId}&token=${this.token}&from=app`)+"&fullName="+e.fullName+"&type="+e.type}if(8==e.type){if(!e.moduleId)return void this.$u.toast("暂无此页面");a="/pages/portal/scanPortal/index?id="+e.moduleId+"&portalType=1&fullName="+e.fullName}a&&I({url:a,fail:()=>{this.$u.toast("暂无此页面")}})},handleProperty(e){const t=e=>{e.map((e=>{var a;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==(a=null==e?void 0:e.children)?void 0:a.length)&&t(e.children)}))};t(e)},JumpFlow(e){const t={id:"",flowId:e.id,opType:"-1",isFlow:1};I({url:"/pages/workFlow/flowBefore/index?config="+this.jnpf.base64.encode(JSON.stringify(t))})},getFlowCount(){E().then((e=>{this.count=e.data.flowTodo||0}))},getHomeData(){e({url:"/api/system/HomeData/app",method:"get",options:{load:!0}}).then((e=>{for(let t=0;t<e.data.length;t++){const a=e.data[t];this.homeData[`${a.code}Enable`]=a.enable,this.homeData.flowEnabled=a.flowEnabled,this.handleProperty(a.appList),["commonUse","favorites","latelyUse"].includes(a.code)&&(this.homeData[`${a.code}MenuList`]=a.appList||[],this.homeData[`${a.code}FlowList`]=a.flowList||[])}})).catch((()=>{}))},openPage(e,t){var a,o;if("approve"===t){if(!(null==(o=null==(a=this.menuList.filter((e=>"workFlow"===e.enCode))[0])?void 0:a.children)?void 0:o.length))return this.$u.toast("暂无权限")}e&&I({url:e})},addApp(e){e&&I({url:e})}}},[["render",function(e,t,r,d,u,p){const f=h,w=S(a("u-badge"),U),g=c,y=S(a("u-sticky"),$),b=v("CommonPane"),L=v("PasswordPopup");return o(),s(g,{class:"index_v"},{default:l((()=>[n(y,null,{default:l((()=>[n(g,{class:"head-tabs u-flex"},{default:l((()=>[n(g,{class:"head-tabs-item",onClick:t[0]||(t[0]=e=>p.openPage("/pages/workFlow/flowTodo/index","approve"))},{default:l((()=>[n(f,{class:"icon-ym icon-ym-flowTodo-app u-m-r-4 icon-style"}),n(f,{class:"u-font-24 head-tabs-name"},{default:l((()=>[i("审批中心")])),_:1}),n(w,{type:"error",count:u.count,absolute:!0,offset:u.offset},null,8,["count","offset"])])),_:1}),n(g,{class:"head-tabs-item",onClick:t[1]||(t[1]=e=>p.openPage("/pages/workFlow/entrustAgent/index","entrust"))},{default:l((()=>[n(f,{class:"icon-ym icon-ym-flowDone-app u-m-r-4 icon-style"}),n(f,{class:"u-font-24 head-tabs-name"},{default:l((()=>[i("委托代理")])),_:1})])),_:1}),n(g,{class:"head-tabs-item",onClick:t[2]||(t[2]=e=>p.openPage("/pages/workFlow/schedule/index","schedule"))},{default:l((()=>[n(f,{class:"icon-ym icon-ym-flowDone-app u-m-r-4 icon-style"}),n(f,{class:"u-font-24 head-tabs-name"},{default:l((()=>[i("日程")])),_:1})])),_:1}),n(g,{class:"head-tabs-item",onClick:t[3]||(t[3]=e=>p.openPage("/pages/workFlow/document/index","document"))},{default:l((()=>[n(f,{class:"icon-ym icon-ym-flowCopy-app u-m-r-4 icon-style"}),n(f,{class:"u-font-24 head-tabs-name"},{default:l((()=>[i("文档")])),_:1})])),_:1})])),_:1})])),_:1}),u.homeData.favoritesEnable?(o(),s(b,{key:0,flowList:u.homeData.favoritesFlowList||[],menuList:u.homeData.favoritesMenuList||[],type:"collect",onLaunch:p.launch,onOpenPage:p.openPage,onAddApp:p.addApp,showAdd:!0,flowEnabled:u.homeData.flowEnabled},null,8,["flowList","menuList","onLaunch","onOpenPage","onAddApp","flowEnabled"])):m("",!0),u.homeData.latelyUseEnable?(o(),s(b,{key:1,title:"最近使用",flowList:u.homeData.latelyUseFlowList||[],type:"use",menuList:u.homeData.latelyUseMenuList||[],onLaunch:p.launch,onOpenPage:p.openPage,flowEnabled:u.homeData.flowEnabled},null,8,["flowList","menuList","onLaunch","onOpenPage","flowEnabled"])):m("",!0),u.homeData.commonUseEnable?(o(),s(b,{key:2,title:"最近常用",flowList:u.homeData.commonUseFlowList||[],type:"common",menuList:u.homeData.commonUseMenuList||[],onLaunch:p.launch,onOpenPage:p.openPage,flowEnabled:u.homeData.flowEnabled},null,8,["flowList","menuList","onLaunch","onOpenPage","flowEnabled"])):m("",!0),n(L,{onSubmit:p.dataFormSubmit,passwordShow:u.passwordShow,formData:u.baseForm},null,8,["onSubmit","passwordShow","formData"])])),_:1})}],["__scopeId","data-v-15d1358f"]]);export{W as default};
|