diff --git a/src/assets/img/cnbm.png b/src/assets/img/cnbm.png new file mode 100644 index 0000000..ed7d3fd Binary files /dev/null and b/src/assets/img/cnbm.png differ diff --git a/src/assets/img/login-back.png b/src/assets/img/login-back.png new file mode 100644 index 0000000..a98739e Binary files /dev/null and b/src/assets/img/login-back.png differ diff --git a/src/assets/img/login.gif b/src/assets/img/login.gif new file mode 100644 index 0000000..8c93120 Binary files /dev/null and b/src/assets/img/login.gif differ diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue new file mode 100644 index 0000000..b07ded2 --- /dev/null +++ b/src/components/SvgIcon/index.vue @@ -0,0 +1,62 @@ + + + + + + + + + + diff --git a/src/i18n/en.js b/src/i18n/en.js index 5a42fed..301b04a 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -4,8 +4,8 @@ t.loading = 'Loading...' t.createTime = 'Create Time' t.brand = {} -t.brand.lg = 'Monitoring System' -t.brand.mini = 'PMS' +t.brand.lg = 'Deep Processing SCADA Platform' +t.brand.mini = 'SCADA' t.routes = {} t.routes['产品池'] = 'Products Pool' @@ -381,6 +381,7 @@ t.login.password = 'Password' t.login.captcha = 'Captcha' t.login.demo = 'Demo' t.login.copyright = 'Copyright @Intelligent Automation Research Institute Co., Ltd Version: 1.0' +t.login.warning = 'Already Login!' t.schedule = {} t.schedule.beanName = 'Bean Name' diff --git a/src/i18n/zh-CN.js b/src/i18n/zh-CN.js index 4cbf1a4..e3f8daf 100644 --- a/src/i18n/zh-CN.js +++ b/src/i18n/zh-CN.js @@ -4,8 +4,8 @@ t.loading = '加载中...' t.createTime = '添加时间' t.brand = {} -t.brand.lg = '生产监控系统' -t.brand.mini = '监控' +t.brand.lg = '深加工SCADA平台' +t.brand.mini = 'SCADA' t.routes = {} // 一级 @@ -383,6 +383,7 @@ t.login.password = '密码' t.login.captcha = '验证码' t.login.demo = '在线演示' t.login.copyright = '版权所有:中建材智能自动化研究院有限公司 版本: 1.0' +t.login.warning = '已经登录过了' t.schedule = {} t.schedule.beanName = 'bean名称' diff --git a/src/icons/iconfont.js b/src/icons/iconfont.js index b438d8a..b45a3c3 100644 --- a/src/icons/iconfont.js +++ b/src/icons/iconfont.js @@ -1 +1,9 @@ -(function(window){var svgSprite='';var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file +/* + * @Descripttion: + * @version: + * @Author: fzq + * @Date: 2022-11-25 09:51:46 + * @LastEditors: fzq + * @LastEditTime: 2022-12-01 10:38:15 + */ +(function(window){var svgSprite='';var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file diff --git a/src/icons/index.js b/src/icons/index.js index 7ca71db..2234a06 100644 --- a/src/icons/index.js +++ b/src/icons/index.js @@ -1,4 +1,21 @@ import './iconfont' +import Vue from 'vue' +import SvgIcon from '@/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) const svgFiles = require.context('./svg', true, /\.svg$/) svgFiles.keys().map(item => svgFiles(item)) + +export default { + // 获取图标icon-(*).svg名称列表, 例如[shouye, xitong, zhedie, ...] + getNameList() { + return requireAll(req).map(item => item.default.id.replace('icon-', '')) + } +} + diff --git a/src/icons/svg/eye-open.svg b/src/icons/svg/eye-open.svg new file mode 100644 index 0000000..88dcc98 --- /dev/null +++ b/src/icons/svg/eye-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/eye.svg b/src/icons/svg/eye.svg new file mode 100644 index 0000000..16ed2d8 --- /dev/null +++ b/src/icons/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 4f6d57c..6ddb25d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -30,7 +30,7 @@ export const pageRoutes = [ meta: { title: '登录' }, beforeEnter(to, from, next) { if (Cookies.get('token')) { - Vue.prototype.$message({ message: '已经登录过了', type: 'error' }) + Vue.prototype.$message({ message: $t('login.warning'), type: 'error' }) next(false) } else { next() diff --git a/src/utils/validate.js b/src/utils/validate.js index c8edcac..14e3bb0 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -1,3 +1,11 @@ +/* + * @Descripttion: + * @version: + * @Author: fzq + * @Date: 2022-11-25 09:51:46 + * @LastEditors: fzq + * @LastEditTime: 2022-11-30 15:09:05 + */ /** * 邮箱 * @param {*} s @@ -29,3 +37,11 @@ export function isPhone (s) { export function isURL (s) { return /^http[s]?:\/\/.*/.test(s) } + +/** + * @param {string} path + * @returns {Boolean} + */ + export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} \ No newline at end of file diff --git a/src/views/main.vue b/src/views/main.vue index 2a223d3..9b9ce7a 100644 --- a/src/views/main.vue +++ b/src/views/main.vue @@ -53,6 +53,7 @@ export default { this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false window.addEventListener( 'resize', + // 防抖 debounce(() => { this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false }, 150) diff --git a/src/views/pages/login.vue b/src/views/pages/login.vue index 4738ad4..5663a76 100644 --- a/src/views/pages/login.vue +++ b/src/views/pages/login.vue @@ -1,69 +1,116 @@ - - - - - {{ $t('brand.lg') }} - - - {{ $t('login.title') }} - - - - - - - - - - - - - - - - - - {{ $t('login.title') }} - - - - - + + + + {{ $t('brand.lg') }} + + + + + + + + + + + + + + + + + + + + {{ $t('login.title') }} + + + + + 中文 + + | + + English + + + + {{ $t('login.copyright') }} + + + + + + + + + +