GitBucket
4.6.0
Toggle navigation
Sign in
Files
Branches
1
Tags
Issues
Pull Requests
Labels
Milestones
Wiki
08335
/
hivui-platform-template
hivui平台项目模板
Browse code
@中文描述:自定义配置参数修改
@升级登记:1 @同步后端:0 @同步数据库:0 @同步配置:0 @向下兼容:1
master
1 parent
cf3125d
commit
0bcfb346200daffe4afd975fba13710d2aa47ea9
20278
authored
on 21 Jun 2023
Showing
3 changed files
assets_platform/customSysCfg/index.js
project/hivuiLogin/App.vue
project/hivuiMain/App.vue
Ignore Space
Show notes
View
assets_platform/customSysCfg/index.js
var __guid=new Date().valueOf(); //切换布局 function changeLayout(name) { window.localStorage.setItem('layout', name); window.location.reload(); } window.customSysCofig = { //默认门户 对应自定义门户功能 sysSetTabs: [ { title: eap.lang.get('customSysCfg_taskcenter'), id: __guid++, close: false, url: '#taskCenter', }, { title: eap.lang.get('customSysCfg_mainpage'), id: __guid++, close: false, url:"/eapdev/home/index/func/index.func", //actived: true //默认选中 } ], //默认 打开功能 sysDefTabs: [ // { // id: __guid++, // title:"设计", // url:'http://192.168.7.109:9090/#/design', // close:true, // }, ], //头部菜单 sysFuncMenus: [ /*{ id: __guid++, name: '<font color=red>邮件系统</font>', url: 'http://hcmail.histron.cn:8001/webmail/index.do?osName=windows', iconClass: 'icon-mail', target: '_blank', },*/ { type: 'split' }, { id: __guid++, name: eap.lang.get('customSysCfg_layout'), type: 'layout', iconClass: 'icon-user', children: [ { id: 'vertical', name: eap.lang.get('customSysCfg_updownlayout'), handler: function () { changeLayout(this.id) } }, { id: 'level', name: eap.lang.get('customSysCfg_leftrightlayout'), handler: function () { changeLayout(this.id) } } ] }, { type: 'split' }, { id: __guid++, name: eap.lang.get('customSysCfg_messagecenter'), type: 'withNumTips', iconClass: 'icon-bell', target:'tab', url:'/platf/msg/func/query.func',//消息中心地址 numIntervalTime:1000*30,//循环时间,默认30秒 //消息提示文字 messageText:function(res){ return _formatLang("unreadmessage").replace("{0}",res.num); }, //获取未读消息数量 numFunc:function(){ return new Promise((resolve, reject) => { let param = new eap.dataHelper.Param(); let where = new eap.dataHelper.Where(); let orders = new eap.dataHelper.Orders(); if (window.Scp.User.fuserid) { where.eq("freceiver", window.Scp.User.fuserid); } where.setPage(1, -1); param.where = where; eap.dataHelper.query( param, "/platf/msg/entity/MsgUnReadBizEntity.xml", ).then(res=>{ let __data=res.dataPack.rows; resolve({ num: (__data && __data.length > 0) ? __data.length : 0 }); }).catch(err=>{ reject(err); }); }); }, }, { type: 'split' }, ], //浏览器标签logo //favicon: '/render/' + window.global.pName + "/setting/desktop/sysAssets/favicon.png", //首页加载logo sysLoadLogo: { src: '/render/' + window.global.pName + '/setting/desktop/sysAssets/sy_loading.png', title: eap.lang.get('customSysCfg_companyname') }, //首页头部logo sysLogo: { src: '/render/' + window.global.pName + '/setting/desktop/sysAssets/sy_logo.png', title: eap.lang.get('customSysCfg_companyname'), //width:null, //height:null, }, //首页左右结构头部logo /*sysLogoHorizon: { src: '/render/' +window.global.pName + '/setting/desktop/sysAssets/sy_logo_horizon.png', title: eap.lang.get('customSysCfg_companyname'), //width:null, //height:null, },*/ //首页左右结构mini图标logo MsysLogo: { src: '/render/' + window.global.pName + '/setting/desktop/sysAssets/sy_minLogo.png', title: eap.lang.get('customSysCfg_companyname'), //width:null, //height:null, }, //默认布局类型 top:上下结构;left:左右结构; //layout:"left", //左右布局菜单项文字是否单行显示 //isMenuWordwrap:true, //是否开启单页模式 //isSinglePage:true, //是否开启功能页缓存模式 //isPageCache:true, //是否开启全部功能菜单,不配置默认开启 //isShowAllFunc:false, //左右结构菜单宽度设置 //leftMenuWidth:200, //多岗列表文本展示模板 //orgBzTpl:"${fbzname}/${fbzid}", //是否显示多语言选择按钮 //showChangeLangBtn:true, //引用第三方资源 /*thirdParty:[ { type:"js", link:"脚本资源路径", } ],*/ //登录页配置 //登录页logo loginLogo: '/render/' + window.global.pName + "/setting/desktop/sysAssets/login_logo.png", //logo高 loginLogo_h: null, //logo宽 loginLogo_w: null, //登录页背景 loginBgImg: '/render/' + window.global.pName + "/setting/desktop/sysAssets/login_bg.png", //登录标签 loginTitle: eap.lang.get('customSysCfg_pageTitle'), //首页标签 syTitle: eap.lang.get('customSysCfg_pageTitle'), //版权 copyright: eap.lang.get('customSysCfg_copyright'), //app二维码 //appQRcode:"", //是否开启扫码登录 //isScan:false, //登录隐藏注册入口 hideRegister:true, }
var __guid=new Date().valueOf(); //切换布局 function changeLayout(name) { window.localStorage.setItem('layout', name); window.location.reload(); } window.default_customSysCfg = { //默认门户 对应自定义门户功能 sysSetTabs: [ { title: eap.lang.get('customSysCfg_taskcenter'), id: __guid++, close: false, url: '#taskCenter', }, { title: eap.lang.get('customSysCfg_mainpage'), id: __guid++, close: false, url:"/eapdev/home/index/func/index.func", //actived: true //默认选中 } ], //默认 打开功能 sysDefTabs: [ // { // id: __guid++, // title:"设计", // url:'http://192.168.7.109:9090/#/design', // close:true, // }, ], //头部菜单 sysFuncMenus: [ /*{ id: __guid++, name: '<font color=red>邮件系统</font>', url: 'http://hcmail.histron.cn:8001/webmail/index.do?osName=windows', iconClass: 'icon-mail', target: '_blank', },*/ { type: 'split' }, { id: __guid++, name: eap.lang.get('customSysCfg_layout'), type: 'layout', iconClass: 'icon-user', children: [ { id: 'vertical', name: eap.lang.get('customSysCfg_updownlayout'), handler: function () { changeLayout(this.id) } }, { id: 'level', name: eap.lang.get('customSysCfg_leftrightlayout'), handler: function () { changeLayout(this.id) } } ] }, { type: 'split' }, { id: __guid++, name: eap.lang.get('customSysCfg_messagecenter'), type: 'withNumTips', iconClass: 'icon-bell', target:'tab', url:'/platf/msg/func/query.func',//消息中心地址 numIntervalTime:1000*30,//循环时间,默认30秒 //消息提示文字 messageText:function(res){ return _formatLang("unreadmessage").replace("{0}",res.num); }, //获取未读消息数量 numFunc:function(){ return new Promise((resolve, reject) => { let param = new eap.dataHelper.Param(); let where = new eap.dataHelper.Where(); let orders = new eap.dataHelper.Orders(); if (window.Scp.User.fuserid) { where.eq("freceiver", window.Scp.User.fuserid); } where.setPage(1, -1); param.where = where; eap.dataHelper.query( param, "/platf/msg/entity/MsgUnReadBizEntity.xml", ).then(res=>{ let __data=res.dataPack.rows; resolve({ num: (__data && __data.length > 0) ? __data.length : 0 }); }).catch(err=>{ reject(err); }); }); }, }, { type: 'split' }, ], //浏览器标签logo //favicon: '/render/' + window.global.pName + "/setting/desktop/sysAssets/favicon.png", //首页加载logo sysLoadLogo: { src: '/render/' + window.global.pName + '/setting/desktop/sysAssets/sy_loading.png', title: eap.lang.get('customSysCfg_companyname') }, //首页头部logo sysLogo: { src: '/render/' + window.global.pName + '/setting/desktop/sysAssets/sy_logo.png', title: eap.lang.get('customSysCfg_companyname'), //width:null, //height:null, }, //首页左右结构头部logo /*sysLogoHorizon: { src: '/render/' +window.global.pName + '/setting/desktop/sysAssets/sy_logo_horizon.png', title: eap.lang.get('customSysCfg_companyname'), //width:null, //height:null, },*/ //首页左右结构mini图标logo MsysLogo: { src: '/render/' + window.global.pName + '/setting/desktop/sysAssets/sy_minLogo.png', title: eap.lang.get('customSysCfg_companyname'), //width:null, //height:null, }, //默认布局类型 top:上下结构;left:左右结构; //layout:"left", //左右布局菜单项文字是否单行显示 //isMenuWordwrap:true, //是否开启单页模式 //isSinglePage:true, //是否开启功能页缓存模式 //isPageCache:true, //是否开启全部功能菜单,不配置默认开启 //isShowAllFunc:false, //左右结构菜单宽度设置 //leftMenuWidth:200, //多岗列表文本展示模板 //orgBzTpl:"${fbzname}/${fbzid}", //是否显示多语言选择按钮 //showChangeLangBtn:true, //引用第三方资源 /*thirdParty:[ { type:"js", link:"脚本资源路径", } ],*/ //登录页配置 //登录页logo loginLogo: '/render/' + window.global.pName + "/setting/desktop/sysAssets/login_logo.png", //logo高 loginLogo_h: null, //logo宽 loginLogo_w: null, //登录页背景 loginBgImg: '/render/' + window.global.pName + "/setting/desktop/sysAssets/login_bg.png", //登录标签 loginTitle: eap.lang.get('customSysCfg_pageTitle'), //首页标签 syTitle: eap.lang.get('customSysCfg_pageTitle'), //版权 copyright: eap.lang.get('customSysCfg_copyright'), //app二维码 //appQRcode:"", //是否开启扫码登录 //isScan:false, //登录隐藏注册入口 hideRegister:true, }
Ignore Space
Show notes
View
project/hivuiLogin/App.vue
<template> <router-view/> </template> <script> import { projectName } from "./config"; import { getUrlSearch } from "./utils/index"; import merge from 'lodash/merge'; export default { components: {}, data() { return { }; }, computed: { }, created() { let _pt=window.__loginCfg&&window.__loginCfg.pageType; let _red=window.__loginCfg&&window.__loginCfg.redirect; let _param=this.getParam(); if(_pt){ switch(_pt){ case "mini": this.$router.replace({ name:"miniLogin", params:_param, }); break; case "middle": this.$router.replace({ name:"middlePage", params:_param, }); break; case "sso-middle": this.$router.replace({ name:"ssoMiddlePage", params:_param, }); break; } } }, mounted(){ //window.customSysCofig=merge(window.default_customSysCfg,window.customSysCofig||{}); }, methods: { getParam(){ let hash=location.hash; let result={}; result=getUrlSearch("?"+hash.substring(2)); return result; }, }, }; </script> <style lang="scss"> </style>
<template> <router-view/> </template> <script> import { projectName } from "./config"; import { getUrlSearch } from "./utils/index"; import merge from 'lodash/merge'; export default { components: {}, data() { return { }; }, computed: { }, created() { let _pt=window.__loginCfg&&window.__loginCfg.pageType; let _red=window.__loginCfg&&window.__loginCfg.redirect; let _param=this.getParam(); if(_pt){ switch(_pt){ case "mini": this.$router.replace({ name:"miniLogin", params:_param, }); break; case "middle": this.$router.replace({ name:"middlePage", params:_param, }); break; case "sso-middle": this.$router.replace({ name:"ssoMiddlePage", params:_param, }); break; } } }, mounted(){ window.customSysCofig=merge(window.default_customSysCfg,window.customSysCofig||{}); }, methods: { getParam(){ let hash=location.hash; let result={}; result=getUrlSearch("?"+hash.substring(2)); return result; }, }, }; </script> <style lang="scss"> </style>
Ignore Space
Show notes
View
project/hivuiMain/App.vue
<template> <div class="app"> <transition> <router-view v-if="$store.state.appStatus=='success'" /> </transition> <transition> <div v-if="$store.state.appStatus!='success'" class="loader" > <div class="pl-logo-lg fadeInUp animated"> <img :src="logoSrc" v-if="logoSrc!=''" > </div> <span class="txt"> <span v-for="(str,index) in loadTexts" :key="index">{{str}}</span> <span v-if="$store.state.appStatus=='loading'">{{$t('hivuiMain_sysLoading')}}</span> <span v-if="$store.state.appStatus!='loading'" style="color:red" @click="handleReload" >{{$store.state.appStatusMsg||$t('hivuiMain_loadedFailClickRefresh')}}</span> </span> </div> </transition> </div> </template> <script> import Cookies from 'js-cookie' import LoginPic from "@main/assets/logo_max.png" import { getUrlValue, setUrlValue,getUrlSearch } from "@main/utils"; import { getToken } from '@main/utils/auth' export default { data() { return { loadTexts: "", logoSrc: "" }; }, methods: { handleReload() { window.location.reload(); }, detectZoom (){ var ratio = 0, screen = window.screen, ua = navigator.userAgent.toLowerCase(); if (window.devicePixelRatio !== undefined) { ratio = window.devicePixelRatio; } else if (~ua.indexOf('msie')) { if (screen.deviceXDPI && screen.logicalXDPI) { ratio = screen.deviceXDPI / screen.logicalXDPI; } } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) { ratio = window.outerWidth / window.innerWidth; } if (ratio){ ratio = Math.round(ratio * 100); } return ratio; }, checkZoom(){ let ratio = this.detectZoom(); if(ratio!=100){ // this.$message.error('警告,浏览器没有按正常比例显示会影响部份功能!') } }, }, mounted() { // this.checkZoom(); // window.addEventListener('resize',()=>{ // this.checkZoom(); // }); let me=this; //如果token不一致,替换掉然后重新载入 let urlToken=getUrlValue(location.href,"access_token"); let nowToken=getToken(); if(!window._global&&urlToken&&nowToken&&(urlToken!=nowToken)){//正式环境 let newUrl=setUrlValue(decodeURIComponent(location.href),"access_token",nowToken); location=newUrl; location.reload(); } //系统间跳转,将ticket去除 if(!window._global&&getUrlValue(decodeURIComponent(location.href),"ticket")){ let newUrl=setUrlValue(decodeURIComponent(location.href),"ticket",""); location=newUrl.replace("&ticket=","")+"#/"; //location.reload(); } window.Scp = { User: { id: "admin", name: "管理员", deptId: "", deptName: "", positionId: "GLY", postionName: "管理员", bzId: "admin_3", bzName: "管理员岗位3", bzDeptId: ".WLDJT.DGS", bzDeptName: "D公司", bzPositionId: "HQRY", bzPositionName: "后勤人员", orgId: "admin_3", defOrgId: "admin_3" } } if(!window.localStorage.getItem("locale")){ window.localStorage.setItem("locale",JSON.stringify({ desc:"中文", name:"zh-CN", })); Cookies.set("locale","zh-CN"); } window.__guid = new Date().valueOf(); //window.customSysCofig=_.merge(window.default_customSysCfg,window.customSysCofig||{}); window.customSysCofig&&window.customSysCofig.thirdParty&&window.customSysCofig.thirdParty.forEach((item)=>{//第三方脚本样式资源引用 let _dom; switch(item.type){ case "js": _dom=document.createElement("script"); _dom.type="text/javascript"; _dom.src=item.link; break; case "css": _dom=document.createElement("link"); _dom.rel="stylesheet"; _dom.href=item.link; break; } document.querySelector("head").appendChild(_dom); }); setTimeout(()=>{ window.__sysConfig = _.merge({ events: { onLoad1: function () { } }, projectName: "eaptpl", /*sysProjectMange: { id: __guid++, name: '工程树', iconClass: 'icon-tree', uri: 'amreport/designer/tree/design.do', url: '/amrept-web/amreport/designer/tree/design.do' },*/ sysList: [ ], langList:{ id: __guid++, name: (window.localStorage.getItem("locale")?(JSON.parse(window.localStorage.getItem("locale")).desc):"中文"), type: 'lang', iconClass: 'icon-edit', children: [ { id: __guid++, name:"中文", handler:function(){ window.localStorage.setItem("locale",JSON.stringify({ desc:"中文", name:"zh-CN", })); Cookies.set("locale","zh-CN"); window.location.reload(); }, }, { id: __guid++, name:"English", handler:function(){ window.localStorage.setItem("locale",JSON.stringify({ desc:"English", name:"en", })); Cookies.set("locale","en"); window.location.reload(); }, }, ] }, userInfo:{ id: __guid++, name: '${fusername}', type: 'userInfo', iconClass: 'icon-user', children: [ { id: __guid++, name:me.$t('hivuiMain_app_user')+':${fusername}/${fuserid}', iconClass:'icon-user', }, { id: __guid++, name:me.$t('hivuiMain_app_orgbz')+':${fbzname}/${fbzid}', iconClass:'icon-user', type:"orgBz", }, { id: __guid++, name:me.$t('hivuiMain_app_orgname')+':${forgname}/${forgid}', iconClass:'icon-user', }, { id: __guid++, name:me.$t('hivuiMain_app_rolename')+':${frolename}/${froleid}', iconClass:'icon-user', }, { id: __guid++, name:me.$t('hivuiMain_app_personal_Center'), iconClass:'icon-user', type: "personalCenter" }, /*{ id: __guid++, iconClass:'icon-edit', name:'修改用户信息', type:'modifyUserInfo', },*/ { id: __guid++, iconClass:'icon-edit', name:me.$t('hivuiMain_app_modifyPw'), type:'modifyPw', }, ] }, },window.customSysCofig); this.$store.dispatch("app/getSysConfig").then(res=>{ let cfg = this.$store.state.app.config || {}; let loadText = (cfg.sysLoadLogo && cfg.sysLoadLogo.title) || ""; let logoSrc = (cfg.sysLoadLogo && cfg.sysLoadLogo.src) || ""; this.loadTexts=loadText.split(""); this.logoSrc=logoSrc||LoginPic; }); },0); } }; </script> <style scoped> .app { height: 100%; background: linear-gradient( rgb(255, 255, 255) 0px, rgb(243, 248, 253) 50%, rgb(229, 240, 250) ); } .animated { -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-fill-mode: both; animation-fill-mode: both; } @-webkit-keyframes fadeInUp { 0% { opacity: 0; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } to { opacity: 1; -webkit-transform: translateZ(0); transform: translateZ(0); } } @keyframes fadeInUp { 0% { opacity: 0; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } to { opacity: 1; -webkit-transform: translateZ(0); transform: translateZ(0); } } .fadeInUp { -webkit-animation-name: fadeInUp; animation-name: fadeInUp; } @-webkit-keyframes fadeInDown { 0% { opacity: 0; -webkit-transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0); } to { opacity: 1; -webkit-transform: translateZ(0); transform: translateZ(0); } } @keyframes fadeInDown { 0% { opacity: 0; -webkit-transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0); } to { opacity: 1; -webkit-transform: translateZ(0); transform: translateZ(0); } } .fadeInDown { -webkit-animation-name: fadeInDown; animation-name: fadeInDown; } .loader { position: absolute; top: 50%; left: 50%; margin-top: -50px; -webkit-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); -mos-transform: translate(-50%, -50%); -o-transform: translate(-50%, -50%); transform: translate(-50%, -50%); text-align: center; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: default; } .loader .txt { display: inline-block; word-break: normal; white-space: nowrap; margin: auto; text-shadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1), 0 3px 5px rgba(0, 0, 0, 0.1), 0 5px 10px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.1), 0 20px 20px rgba(0, 0, 0, 0.15); } .loader .txt span { display: inline-block; font-size: 68px !important; padding: 0 5px; -webkit-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; -moz-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; -moz-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; -ms-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; -o-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; color: #0066cc; } .loader .txt span:nth-child(1) { -webkit-animation-delay: 0ms; -moz-animation-delay: 0ms; -ms-animation-delay: 0ms; -o-animation-delay: 0ms; animation-delay: 0ms; } .loader .txt span:nth-child(2) { -webkit-animation-delay: 100ms; -moz-animation-delay: 100ms; -ms-animation-delay: 100ms; -o-animation-delay: 100ms; animation-delay: 100ms; } .loader .txt span:nth-child(3) { -webkit-animation-delay: 200ms; -moz-animation-delay: 200ms; -ms-animation-delay: 200ms; -o-animation-delay: 200ms; animation-delay: 200ms; } .loader .txt span:nth-child(4) { -webkit-animation-delay: 300ms; -moz-animation-delay: 300ms; -ms-animation-delay: 300ms; -o-animation-delay: 300ms; animation-delay: 300ms; } .loader .txt span:nth-child(5) { -webkit-animation-delay: 400ms; -moz-animation-delay: 400ms; -ms-animation-delay: 400ms; -o-animation-delay: 400ms; animation-delay: 400ms; } .loader .txt span:nth-child(6) { -webkit-animation-delay: 500ms; -moz-animation-delay: 500ms; -ms-animation-delay: 500ms; -o-animation-delay: 500ms; animation-delay: 500ms; } .loader .txt span:nth-child(7) { -webkit-animation-delay: 600ms; -moz-animation-delay: 600ms; -ms-animation-delay: 600ms; -o-animation-delay: 600ms; animation-delay: 600ms; } .loader .txt span:nth-child(8) { -webkit-animation-delay: 700ms; -moz-animation-delay: 700ms; -ms-animation-delay: 700ms; -o-animation-delay: 700ms; animation-delay: 700ms; } .loader .txt span:nth-child(9) { -webkit-animation-delay: 800ms; -moz-animation-delay: 800ms; -ms-animation-delay: 800ms; -o-animation-delay: 800ms; animation-delay: 800ms; } .loader .txt span:nth-child(10) { -webkit-animation-delay: 900ms; -moz-animation-delay: 900ms; -ms-animation-delay: 900ms; -o-animation-delay: 900ms; animation-delay: 900ms; } .loader .txt span:last-child { display: block; padding-top: 15px; font-size: 16px !important; text-shadow: none; color: #0272bd; text-shadow: none; animation: none; -webkit-animation: none; } @-webkit-keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } @-moz-keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } @-mos-keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } @-o-keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } @keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } </style>
<template> <div class="app"> <transition> <router-view v-if="$store.state.appStatus=='success'" /> </transition> <transition> <div v-if="$store.state.appStatus!='success'" class="loader" > <div class="pl-logo-lg fadeInUp animated"> <img :src="logoSrc" v-if="logoSrc!=''" > </div> <span class="txt"> <span v-for="(str,index) in loadTexts" :key="index">{{str}}</span> <span v-if="$store.state.appStatus=='loading'">{{$t('hivuiMain_sysLoading')}}</span> <span v-if="$store.state.appStatus!='loading'" style="color:red" @click="handleReload" >{{$store.state.appStatusMsg||$t('hivuiMain_loadedFailClickRefresh')}}</span> </span> </div> </transition> </div> </template> <script> import Cookies from 'js-cookie' import LoginPic from "@main/assets/logo_max.png" import { getUrlValue, setUrlValue,getUrlSearch } from "@main/utils"; import { getToken } from '@main/utils/auth' export default { data() { return { loadTexts: "", logoSrc: "" }; }, methods: { handleReload() { window.location.reload(); }, detectZoom (){ var ratio = 0, screen = window.screen, ua = navigator.userAgent.toLowerCase(); if (window.devicePixelRatio !== undefined) { ratio = window.devicePixelRatio; } else if (~ua.indexOf('msie')) { if (screen.deviceXDPI && screen.logicalXDPI) { ratio = screen.deviceXDPI / screen.logicalXDPI; } } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) { ratio = window.outerWidth / window.innerWidth; } if (ratio){ ratio = Math.round(ratio * 100); } return ratio; }, checkZoom(){ let ratio = this.detectZoom(); if(ratio!=100){ // this.$message.error('警告,浏览器没有按正常比例显示会影响部份功能!') } }, }, mounted() { // this.checkZoom(); // window.addEventListener('resize',()=>{ // this.checkZoom(); // }); let me=this; //如果token不一致,替换掉然后重新载入 let urlToken=getUrlValue(location.href,"access_token"); let nowToken=getToken(); if(!window._global&&urlToken&&nowToken&&(urlToken!=nowToken)){//正式环境 let newUrl=setUrlValue(decodeURIComponent(location.href),"access_token",nowToken); location=newUrl; location.reload(); } //系统间跳转,将ticket去除 if(!window._global&&getUrlValue(decodeURIComponent(location.href),"ticket")){ let newUrl=setUrlValue(decodeURIComponent(location.href),"ticket",""); location=newUrl.replace("&ticket=","")+"#/"; //location.reload(); } window.Scp = { User: { id: "admin", name: "管理员", deptId: "", deptName: "", positionId: "GLY", postionName: "管理员", bzId: "admin_3", bzName: "管理员岗位3", bzDeptId: ".WLDJT.DGS", bzDeptName: "D公司", bzPositionId: "HQRY", bzPositionName: "后勤人员", orgId: "admin_3", defOrgId: "admin_3" } } if(!window.localStorage.getItem("locale")){ window.localStorage.setItem("locale",JSON.stringify({ desc:"中文", name:"zh-CN", })); Cookies.set("locale","zh-CN"); } window.__guid = new Date().valueOf(); window.customSysCofig=_.merge(window.default_customSysCfg,window.customSysCofig||{}); window.customSysCofig&&window.customSysCofig.thirdParty&&window.customSysCofig.thirdParty.forEach((item)=>{//第三方脚本样式资源引用 let _dom; switch(item.type){ case "js": _dom=document.createElement("script"); _dom.type="text/javascript"; _dom.src=item.link; break; case "css": _dom=document.createElement("link"); _dom.rel="stylesheet"; _dom.href=item.link; break; } document.querySelector("head").appendChild(_dom); }); setTimeout(()=>{ window.__sysConfig = _.merge({ events: { onLoad1: function () { } }, projectName: "eaptpl", /*sysProjectMange: { id: __guid++, name: '工程树', iconClass: 'icon-tree', uri: 'amreport/designer/tree/design.do', url: '/amrept-web/amreport/designer/tree/design.do' },*/ sysList: [ ], langList:{ id: __guid++, name: (window.localStorage.getItem("locale")?(JSON.parse(window.localStorage.getItem("locale")).desc):"中文"), type: 'lang', iconClass: 'icon-edit', children: [ { id: __guid++, name:"中文", handler:function(){ window.localStorage.setItem("locale",JSON.stringify({ desc:"中文", name:"zh-CN", })); Cookies.set("locale","zh-CN"); window.location.reload(); }, }, { id: __guid++, name:"English", handler:function(){ window.localStorage.setItem("locale",JSON.stringify({ desc:"English", name:"en", })); Cookies.set("locale","en"); window.location.reload(); }, }, ] }, userInfo:{ id: __guid++, name: '${fusername}', type: 'userInfo', iconClass: 'icon-user', children: [ { id: __guid++, name:me.$t('hivuiMain_app_user')+':${fusername}/${fuserid}', iconClass:'icon-user', }, { id: __guid++, name:me.$t('hivuiMain_app_orgbz')+':${fbzname}/${fbzid}', iconClass:'icon-user', type:"orgBz", }, { id: __guid++, name:me.$t('hivuiMain_app_orgname')+':${forgname}/${forgid}', iconClass:'icon-user', }, { id: __guid++, name:me.$t('hivuiMain_app_rolename')+':${frolename}/${froleid}', iconClass:'icon-user', }, { id: __guid++, name:me.$t('hivuiMain_app_personal_Center'), iconClass:'icon-user', type: "personalCenter" }, /*{ id: __guid++, iconClass:'icon-edit', name:'修改用户信息', type:'modifyUserInfo', },*/ { id: __guid++, iconClass:'icon-edit', name:me.$t('hivuiMain_app_modifyPw'), type:'modifyPw', }, ] }, },window.customSysCofig); this.$store.dispatch("app/getSysConfig").then(res=>{ let cfg = this.$store.state.app.config || {}; let loadText = (cfg.sysLoadLogo && cfg.sysLoadLogo.title) || ""; let logoSrc = (cfg.sysLoadLogo && cfg.sysLoadLogo.src) || ""; this.loadTexts=loadText.split(""); this.logoSrc=logoSrc||LoginPic; }); },0); } }; </script> <style scoped> .app { height: 100%; background: linear-gradient( rgb(255, 255, 255) 0px, rgb(243, 248, 253) 50%, rgb(229, 240, 250) ); } .animated { -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-fill-mode: both; animation-fill-mode: both; } @-webkit-keyframes fadeInUp { 0% { opacity: 0; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } to { opacity: 1; -webkit-transform: translateZ(0); transform: translateZ(0); } } @keyframes fadeInUp { 0% { opacity: 0; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } to { opacity: 1; -webkit-transform: translateZ(0); transform: translateZ(0); } } .fadeInUp { -webkit-animation-name: fadeInUp; animation-name: fadeInUp; } @-webkit-keyframes fadeInDown { 0% { opacity: 0; -webkit-transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0); } to { opacity: 1; -webkit-transform: translateZ(0); transform: translateZ(0); } } @keyframes fadeInDown { 0% { opacity: 0; -webkit-transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0); } to { opacity: 1; -webkit-transform: translateZ(0); transform: translateZ(0); } } .fadeInDown { -webkit-animation-name: fadeInDown; animation-name: fadeInDown; } .loader { position: absolute; top: 50%; left: 50%; margin-top: -50px; -webkit-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); -mos-transform: translate(-50%, -50%); -o-transform: translate(-50%, -50%); transform: translate(-50%, -50%); text-align: center; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: default; } .loader .txt { display: inline-block; word-break: normal; white-space: nowrap; margin: auto; text-shadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1), 0 3px 5px rgba(0, 0, 0, 0.1), 0 5px 10px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.1), 0 20px 20px rgba(0, 0, 0, 0.15); } .loader .txt span { display: inline-block; font-size: 68px !important; padding: 0 5px; -webkit-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; -moz-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; -moz-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; -ms-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; -o-animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; animation: text cubic-bezier(0.75, 0, 0.5, 1) 1.2s infinite; color: #0066cc; } .loader .txt span:nth-child(1) { -webkit-animation-delay: 0ms; -moz-animation-delay: 0ms; -ms-animation-delay: 0ms; -o-animation-delay: 0ms; animation-delay: 0ms; } .loader .txt span:nth-child(2) { -webkit-animation-delay: 100ms; -moz-animation-delay: 100ms; -ms-animation-delay: 100ms; -o-animation-delay: 100ms; animation-delay: 100ms; } .loader .txt span:nth-child(3) { -webkit-animation-delay: 200ms; -moz-animation-delay: 200ms; -ms-animation-delay: 200ms; -o-animation-delay: 200ms; animation-delay: 200ms; } .loader .txt span:nth-child(4) { -webkit-animation-delay: 300ms; -moz-animation-delay: 300ms; -ms-animation-delay: 300ms; -o-animation-delay: 300ms; animation-delay: 300ms; } .loader .txt span:nth-child(5) { -webkit-animation-delay: 400ms; -moz-animation-delay: 400ms; -ms-animation-delay: 400ms; -o-animation-delay: 400ms; animation-delay: 400ms; } .loader .txt span:nth-child(6) { -webkit-animation-delay: 500ms; -moz-animation-delay: 500ms; -ms-animation-delay: 500ms; -o-animation-delay: 500ms; animation-delay: 500ms; } .loader .txt span:nth-child(7) { -webkit-animation-delay: 600ms; -moz-animation-delay: 600ms; -ms-animation-delay: 600ms; -o-animation-delay: 600ms; animation-delay: 600ms; } .loader .txt span:nth-child(8) { -webkit-animation-delay: 700ms; -moz-animation-delay: 700ms; -ms-animation-delay: 700ms; -o-animation-delay: 700ms; animation-delay: 700ms; } .loader .txt span:nth-child(9) { -webkit-animation-delay: 800ms; -moz-animation-delay: 800ms; -ms-animation-delay: 800ms; -o-animation-delay: 800ms; animation-delay: 800ms; } .loader .txt span:nth-child(10) { -webkit-animation-delay: 900ms; -moz-animation-delay: 900ms; -ms-animation-delay: 900ms; -o-animation-delay: 900ms; animation-delay: 900ms; } .loader .txt span:last-child { display: block; padding-top: 15px; font-size: 16px !important; text-shadow: none; color: #0272bd; text-shadow: none; animation: none; -webkit-animation: none; } @-webkit-keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } @-moz-keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } @-mos-keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } @-o-keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } @keyframes text { 0% { color: #0066cc; } 40% { color: #fff; } 70%, 100% { color: #0066cc; } } </style>
Show line notes below