Browse Source

恢复路由

preview
13176889840 4 years ago
parent
commit
92ff8e94c1
  1. BIN
      epmet-oper-web/src/assets/img/index/bg.png
  2. BIN
      epmet-oper-web/src/assets/img/index/logo-1.png
  3. BIN
      epmet-oper-web/src/assets/img/index/logo-2.png
  4. BIN
      epmet-oper-web/src/assets/img/index/zhuangshi.png
  5. BIN
      epmet-oper-web/src/assets/img/login/bg.png
  6. BIN
      epmet-oper-web/src/assets/img/login/mima.png
  7. BIN
      epmet-oper-web/src/assets/img/login/zhanghao.png
  8. BIN
      epmet-oper-web/src/assets/img/shequ/function/daichulishixiang.png
  9. BIN
      epmet-oper-web/src/assets/img/shequ/function/daichulixiangmu.png
  10. BIN
      epmet-oper-web/src/assets/img/shequ/function/daichuliyiti.png
  11. BIN
      epmet-oper-web/src/assets/img/shequ/function/fuwuguanli.png
  12. BIN
      epmet-oper-web/src/assets/img/shequ/function/laorenguanhuai.png
  13. BIN
      epmet-oper-web/src/assets/img/shequ/function/qunzuguanli.png
  14. BIN
      epmet-oper-web/src/assets/img/shequ/function/tianjiayingyong.png
  15. BIN
      epmet-oper-web/src/assets/img/shequ/function/tongxingjilu.png
  16. BIN
      epmet-oper-web/src/assets/img/shequ/function/weixiugongdan.png
  17. BIN
      epmet-oper-web/src/assets/img/shequ/function/wuyefuwu.png
  18. BIN
      epmet-oper-web/src/assets/img/shequ/logo.png
  19. BIN
      epmet-oper-web/src/assets/img/shequ/search.png
  20. 115
      epmet-oper-web/src/assets/scss/pages/indexWork.scss
  21. 4
      epmet-oper-web/src/assets/scss/pages/login.scss
  22. 167
      epmet-oper-web/src/assets/scss/pages/loginWork.scss
  23. 1
      epmet-oper-web/src/js/store/index.js
  24. 128
      epmet-oper-web/src/router/index.js
  25. 195
      epmet-oper-web/src/views/main-navbar.vue
  26. 57
      epmet-oper-web/src/views/main-sidebar.vue
  27. 42
      epmet-oper-web/src/views/main-theme-tools.vue
  28. 129
      epmet-oper-web/src/views/main.vue
  29. 33
      epmet-oper-web/src/views/modules/shequ/index.vue
  30. 86
      epmet-oper-web/src/views/pages/indexWork.vue
  31. 375
      epmet-oper-web/src/views/pages/loginWork.vue

BIN
epmet-oper-web/src/assets/img/index/bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

BIN
epmet-oper-web/src/assets/img/index/logo-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
epmet-oper-web/src/assets/img/index/logo-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
epmet-oper-web/src/assets/img/index/zhuangshi.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
epmet-oper-web/src/assets/img/login/bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

BIN
epmet-oper-web/src/assets/img/login/mima.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

BIN
epmet-oper-web/src/assets/img/login/zhanghao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

BIN
epmet-oper-web/src/assets/img/shequ/function/daichulishixiang.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
epmet-oper-web/src/assets/img/shequ/function/daichulixiangmu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
epmet-oper-web/src/assets/img/shequ/function/daichuliyiti.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
epmet-oper-web/src/assets/img/shequ/function/fuwuguanli.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
epmet-oper-web/src/assets/img/shequ/function/laorenguanhuai.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
epmet-oper-web/src/assets/img/shequ/function/qunzuguanli.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
epmet-oper-web/src/assets/img/shequ/function/tianjiayingyong.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
epmet-oper-web/src/assets/img/shequ/function/tongxingjilu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
epmet-oper-web/src/assets/img/shequ/function/weixiugongdan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
epmet-oper-web/src/assets/img/shequ/function/wuyefuwu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
epmet-oper-web/src/assets/img/shequ/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
epmet-oper-web/src/assets/img/shequ/search.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

115
epmet-oper-web/src/assets/scss/pages/indexWork.scss

@ -0,0 +1,115 @@
@import "~@/assets/scss/c/config.scss";
@import "~@/assets/scss/c/function.scss";
.g-bd {
&::before,
&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
content: "";
}
&::before {
background-image: url(~@/assets/img/index/bg.png);
background-size: cover;
}
&::after {
// background-color: rgba(38, 50, 56, 0.1);
}
}
.m-list {
position: fixed;
top: 50%;
left: 0;
right: 0;
margin: auto;
transform: translateY(-50%);
.list {
display: flex;
justify-content: space-around;
width: 100%;
.item {
width: 612px;
max-width: 612px;
text-align: center;
cursor: pointer;
&.z-on {
.name {
color: #ffffff;
background-color: transparent;
border-color: #ffffff;
&::before {
background-color: #ffffff;
}
}
}
.logo {
width: 100%;
}
.name {
position: relative;
width: auto;
display: inline-block;
text-align: center;
margin: 8px auto;
padding-left: 48px;
padding-right: 20px;
height: 42px;
line-height: 40px;
background: #ffffff;
border: 1px solid #b9b9b9;
border-radius: 21px;
font-size: 22px;
font-family: PingFang SC;
font-weight: 500;
color: #002fec;
&::before {
content: "";
position: absolute;
display: block;
top: 0;
bottom: 0;
left: 20px;
margin: auto;
width: 14px;
height: 14px;
background: #0065f6;
border-radius: 50%;
}
}
.tip {
display: block;
margin: 0 auto;
}
}
}
}
.m-footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 20px;
color: rgba(255, 255, 255, 0.6);
text-align: center;
p {
margin: 10px 0;
}
a {
padding: 0 5px;
color: rgba(255, 255, 255, 0.6);
&:focus,
&:hover {
color: #fff;
}
}
}

4
epmet-oper-web/src/assets/scss/pages/login.scss

@ -7,7 +7,7 @@
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: -1; z-index: -1;
content: ''; content: "";
} }
&::before { &::before {
background-image: url(~@/assets/img/login_bg.jpg); background-image: url(~@/assets/img/login_bg.jpg);
@ -90,7 +90,7 @@
right: 0; right: 0;
left: 0; left: 0;
z-index: 1; z-index: 1;
content: ''; content: "";
height: 1px; height: 1px;
margin-top: -0.5px; margin-top: -0.5px;
background-color: $--border-color-base; background-color: $--border-color-base;

167
epmet-oper-web/src/assets/scss/pages/loginWork.scss

@ -0,0 +1,167 @@
@import "~@/assets/scss/c/config.scss";
@import "~@/assets/scss/c/function.scss";
.g-bd {
&::before,
&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
content: "";
}
&::before {
background-image: url(~@/assets/img/login/bg.png);
background-size: cover;
}
&::after {
// background-color: rgba(38, 50, 56, 0.1);
}
}
.m-fm {
position: absolute;
top: 0;
bottom: 0;
right: 13%;
margin: auto;
width: 484px;
height: 429px;
background: #ffffff;
box-shadow: 0px 5px 10px 0px rgba(213, 225, 238, 0.5);
border-radius: 12px 12px 12px 12px;
.wrap {
padding-top: 5px;
.title {
margin: 0 auto;
width: 400px;
line-height: 80px;
border-bottom: 1px solid #d4d4d4;
font-size: 34px;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
text-align: center;
}
.fm {
padding: 15px 30px;
.fm-item {
box-sizing: border-box;
margin: 0 auto;
margin-top: 16px;
width: 400px;
height: 46px;
line-height: 46px;
border: 1px solid #c6c6c6;
border-radius: 4px;
display: flex;
align-items: center;
.input {
width: 85%;
input {
display: block;
padding-left: 15px;
line-height: 44px;
height: 44px;
width: 100%;
border: none;
}
}
.ico {
position: relative;
width: 35px;
height: 46px;
img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
}
}
.fm-captcha {
box-sizing: border-box;
margin: 0 auto;
margin-top: 16px;
width: 400px;
display: flex;
align-items: center;
.fm-item {
margin: 0;
width: 200px;
}
.captcha {
position: relative;
margin-left: auto;
width: 180px;
height: 46px;
img {
display: block;
width: 100%;
height: 100%;
background-color: #eee;
border: none;
}
}
}
.fm-btn {
box-sizing: border-box;
margin: 0 auto;
margin-top: 40px;
width: 400px;
height: 56px;
line-height: 56px;
background: linear-gradient(90deg, #1a5afd, #26c4ff);
border-radius: 4px;
font-size: 23px;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
text-align: center;
cursor: pointer;
}
}
.hint {
display: none;
padding-left: 40px;
color: rgb(255, 80, 80);
}
}
}
.m-footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 20px;
color: rgba(255, 255, 255, 0.6);
text-align: center;
p {
margin: 10px 0;
}
a {
padding: 0 5px;
color: rgba(255, 255, 255, 0.6);
&:focus,
&:hover {
color: #fff;
}
}
}

1
epmet-oper-web/src/js/store/index.js

@ -19,6 +19,7 @@ export default new Vuex.Store({
// 侧边栏, 菜单 // 侧边栏, 菜单
sidebarMenuList: [], sidebarMenuList: [],
sidebarMenuActiveName: '', sidebarMenuActiveName: '',
LevelOneMenuActiveName: '',
// 内容, 是否需要刷新 // 内容, 是否需要刷新
contentIsNeedRefresh: false, contentIsNeedRefresh: false,
// 内容, 标签页(默认添加首页) // 内容, 标签页(默认添加首页)

128
epmet-oper-web/src/router/index.js

@ -1,19 +1,22 @@
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import http from '@/utils/request' import http from '@/utils/request'
import { isURL } from '@/utils/validate' import {
isURL
} from '@/utils/validate'
import store from '@/js/store' import store from '@/js/store'
Vue.use(Router) Vue.use(Router)
// 页面路由(独立页面) // 页面路由(独立页面)
export const pageRoutes = [ export const pageRoutes = [{
{
path: '/404', path: '/404',
component: () => import('@/views/pages/404'), component: () => import('@/views/pages/404'),
name: '404', name: '404',
meta: { title: '404未找到' }, meta: {
beforeEnter (to, from, next) { title: '404未找到'
},
beforeEnter(to, from, next) {
// 拦截处理特殊业务场景 // 拦截处理特殊业务场景
// 如果, 重定向路由包含__双下划线, 为临时添加路由 // 如果, 重定向路由包含__双下划线, 为临时添加路由
if (/__.*/.test(to.redirectedFrom)) { if (/__.*/.test(to.redirectedFrom)) {
@ -26,13 +29,25 @@ export const pageRoutes = [
path: '/login', path: '/login',
component: () => import('@/views/pages/login'), component: () => import('@/views/pages/login'),
name: 'login', name: 'login',
meta: { title: '登录' } meta: {
title: '登录'
}
}, },
{ {
path: '/loginWork', path: '/loginWork',
component: () => import('@/views/pages/loginWork'), component: () => import('@/views/pages/loginWork'),
name: 'loginWork', name: 'loginWork',
meta: { title: '工作端登录' } meta: {
title: '工作端登录'
}
},
{
path: '/indexWork',
component: () => import('@/views/pages/indexWork'),
name: 'indexWork',
meta: {
title: '工作端首页'
}
} }
] ]
@ -41,14 +56,20 @@ export const moduleRoutes = {
path: '/', path: '/',
component: () => import('@/views/main'), component: () => import('@/views/main'),
name: 'main', name: 'main',
redirect: { name: 'home' }, redirect: {
meta: { title: '主入口布局' }, name: 'home'
children: [ },
{ meta: {
title: '主入口布局'
},
children: [{
path: '/home', path: '/home',
component: () => import('@/views/modules/home'), component: () => import('@/views/modules/home'),
name: 'home', name: 'home',
meta: { title: '首页', isTab: true } meta: {
title: '首页',
isTab: true
}
} }
// { // {
// path: '/homeWork', // path: '/homeWork',
@ -59,14 +80,17 @@ export const moduleRoutes = {
] ]
} }
export function addDynamicRoute (routeParams, router) { export function addDynamicRoute(routeParams, router) {
// 组装路由名称, 并判断是否已添加, 如是: 则直接跳转 // 组装路由名称, 并判断是否已添加, 如是: 则直接跳转
var routeName = routeParams.routeName var routeName = routeParams.routeName
var dynamicRoute = window.SITE_CONFIG['dynamicRoutes'].filter( var dynamicRoute = window.SITE_CONFIG['dynamicRoutes'].filter(
(item) => item.name === routeName (item) => item.name === routeName
)[0] )[0]
if (dynamicRoute) { if (dynamicRoute) {
return router.push({ name: routeName, params: routeParams.params }) return router.push({
name: routeName,
params: routeParams.params
})
} }
// 否则: 添加并全局变量保存, 再跳转 // 否则: 添加并全局变量保存, 再跳转
dynamicRoute = { dynamicRoute = {
@ -79,20 +103,23 @@ export function addDynamicRoute (routeParams, router) {
title: `${routeParams.title}` title: `${routeParams.title}`
} }
} }
router.addRoutes([ router.addRoutes([{
{ ...moduleRoutes,
...moduleRoutes, name: `main-dynamic__${dynamicRoute.name}`,
name: `main-dynamic__${dynamicRoute.name}`, children: [dynamicRoute]
children: [dynamicRoute] }])
}
])
window.SITE_CONFIG['dynamicRoutes'].push(dynamicRoute) window.SITE_CONFIG['dynamicRoutes'].push(dynamicRoute)
router.push({ name: dynamicRoute.name, params: routeParams.params }) router.push({
name: dynamicRoute.name,
params: routeParams.params
})
} }
const router = new Router({ const router = new Router({
mode: 'hash', mode: 'hash',
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({
y: 0
}),
routes: pageRoutes.concat(moduleRoutes) routes: pageRoutes.concat(moduleRoutes)
}) })
@ -120,6 +147,7 @@ router.beforeEach((to, from, next) => {
const userType = localStorage.getItem('userType') const userType = localStorage.getItem('userType')
if (userType === 'work') { if (userType === 'work') {
const customerId = localStorage.getItem('customerId') const customerId = localStorage.getItem('customerId')
console.log('customerId:', customerId) console.log('customerId:', customerId)
@ -175,39 +203,58 @@ router.beforeEach((to, from, next) => {
// }else{ // }else{
http http
.get('/gov/access/menu/nav') .get('/gov/access/menu/nav')
.then(({ data: res }) => { .then(({
data: res
}) => {
if (res.code !== 0) { if (res.code !== 0) {
// Vue.prototype.$message.error(res.msg) // Vue.prototype.$message.error(res.msg)
return next({ name: 'loginWork' }) return next({
name: 'loginWork'
})
} }
window.SITE_CONFIG['menuList'] = res.data window.SITE_CONFIG['menuList'] = res.data
console.log('menulist', res.data)
fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList']) fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
// next({ ...to, replace: true }) // next({ ...to, replace: true })
next({ ...to, replace: true }) next({
...to,
replace: true
})
}) })
.catch(() => { .catch(() => {
next({ name: 'loginWork' }) next({
name: 'loginWork'
})
}) })
// } // }
// localStorage.getItem('customerId') // localStorage.getItem('customerId')
// 1e68188b8f7e9ab15658c164bd5b3676 // 1e68188b8f7e9ab15658c164bd5b3676
} else { } else {
http http
.get('/oper/access/menu/nav') .get('/oper/access/menu/nav')
.then(({ data: res }) => { .then(({
data: res
}) => {
if (res.code !== 0) { if (res.code !== 0) {
// Vue.prototype.$message.error(res.msg) // Vue.prototype.$message.error(res.msg)
return next({ name: 'login' }) return next({
name: 'login'
})
} }
window.SITE_CONFIG['menuList'] = res.data window.SITE_CONFIG['menuList'] = res.data
fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList']) fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
// next({ ...to, replace: true }) // next({ ...to, replace: true })
next({ ...to, replace: true }) next({
...to,
replace: true
})
}) })
.catch(() => { .catch(() => {
next({ name: 'login' }) next({
name: 'login'
})
}) })
} }
}) })
@ -217,7 +264,7 @@ router.beforeEach((to, from, next) => {
* @param {*} route 当前路由 * @param {*} route 当前路由
* @param {*} pageRoutes 页面路由 * @param {*} pageRoutes 页面路由
*/ */
function fnCurrentRouteIsPageRoute (route, pageRoutes = []) { function fnCurrentRouteIsPageRoute(route, pageRoutes = []) {
var temp = [] var temp = []
for (var i = 0; i < pageRoutes.length; i++) { for (var i = 0; i < pageRoutes.length; i++) {
if (route.path === pageRoutes[i].path) { if (route.path === pageRoutes[i].path) {
@ -235,7 +282,7 @@ function fnCurrentRouteIsPageRoute (route, pageRoutes = []) {
* @param {*} menuList 菜单列表 * @param {*} menuList 菜单列表
* @param {*} routes 递归创建的动态(菜单)路由 * @param {*} routes 递归创建的动态(菜单)路由
*/ */
function fnAddDynamicMenuRoutes (menuList = [], routes = []) { function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
var temp = [] var temp = []
for (var i = 0; i < menuList.length; i++) { for (var i = 0; i < menuList.length; i++) {
if (menuList[i].children && menuList[i].children.length >= 1) { if (menuList[i].children && menuList[i].children.length >= 1) {
@ -271,15 +318,20 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
return fnAddDynamicMenuRoutes(temp, routes) return fnAddDynamicMenuRoutes(temp, routes)
} }
// 添加路由 // 添加路由
router.addRoutes([ router.addRoutes([{
{
...moduleRoutes, ...moduleRoutes,
name: 'main-dynamic-menu', name: 'main-dynamic-menu',
children: routes children: routes
}, },
{ path: '*', redirect: { name: '404' } } {
path: '*',
redirect: {
name: '404'
}
}
]) ])
window.SITE_CONFIG['dynamicMenuRoutes'] = routes window.SITE_CONFIG['dynamicMenuRoutes'] = routes
window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true
} }
export default router
export default router

195
epmet-oper-web/src/views/main-navbar.vue

@ -1,31 +1,56 @@
<template> <template>
<div> <div>
<nav v-if="showHeader" <nav
class="aui-navbar" v-if="showHeader"
:class="`aui-navbar--${$store.state.navbarLayoutType}`"> class="aui-navbar"
:class="`aui-navbar--${$store.state.navbarLayoutType}`"
>
<div class="aui-navbar__header"> <div class="aui-navbar__header">
<h1 class="aui-navbar__brand" <h1 class="aui-navbar__brand" @click="$router.push({ name: 'home' })">
@click="$router.push({ name: 'home' })"> <a class="aui-navbar__brand-lg" href="javascript:;">{{
<a class="aui-navbar__brand-lg" userType === 'work' ? customerName : $t('brand.lg')
href="javascript:;">{{ userType==='work'?customerName :$t('brand.lg') }}</a> }}</a>
<a class="aui-navbar__brand-mini" <a class="aui-navbar__brand-mini" href="javascript:;">{{
href="javascript:;">{{ $t('brand.mini') }}</a> $t('brand.mini')
}}</a>
</h1> </h1>
</div> </div>
<div class="aui-navbar__body"> <div class="aui-navbar__body">
<el-menu class="aui-navbar__menu mr-auto" <el-menu class="aui-navbar__menu mr-auto" mode="horizontal">
mode="horizontal"> <el-menu-item
<el-menu-item index="1" index="1"
@click="$store.state.sidebarFold = !$store.state.sidebarFold"> @click="$store.state.sidebarFold = !$store.state.sidebarFold"
<svg class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--switch" >
aria-hidden="true"> <svg
class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--switch"
aria-hidden="true"
>
<use xlink:href="#icon-outdent"></use> <use xlink:href="#icon-outdent"></use>
</svg> </svg>
</el-menu-item> </el-menu-item>
</el-menu>
<el-menu
v-if="userType == 'work'"
:default-active="$store.state.LevelOneMenuActiveName"
:collapse="$store.state.sidebarFold"
:unique-opened="true"
:collapseTransition="false"
mode="horizontal"
class="aui-navbar__menu mr-auto"
>
<el-menu-item
v-for="menu in $store.state.sidebarMenuList"
:key="menu.id"
:menu="menu"
:index="menu.id"
@click="gotoRouteHandle(menu.id)"
>
<span>{{ menu.name }}</span>
</el-menu-item>
</el-menu> </el-menu>
<el-menu class="aui-navbar__menu"
mode="horizontal"> <el-menu class="aui-navbar__menu" mode="horizontal">
<!-- <el-menu-item index="1"> <!-- <el-menu-item index="1">
<el-dropdown placement="bottom" <el-dropdown placement="bottom"
:show-timeout="0"> :show-timeout="0">
@ -53,42 +78,40 @@
<use xlink:href="#icon-fullscreen"></use> <use xlink:href="#icon-fullscreen"></use>
</svg> </svg>
</el-menu-item> --> </el-menu-item> -->
<el-menu-item index="2" <el-menu-item index="2" @click="refresh()">
@click="refresh()"> <svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
<svg class="icon-svg aui-navbar__icon-menu"
aria-hidden="true">
<use xlink:href="#icon-sync"></use> <use xlink:href="#icon-sync"></use>
</svg> </svg>
</el-menu-item> </el-menu-item>
<el-menu-item index="4" <el-menu-item index="4" class="aui-navbar__avatar">
class="aui-navbar__avatar"> <el-dropdown placement="bottom" :show-timeout="0">
<el-dropdown placement="bottom"
:show-timeout="0">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<img v-if="$store.state.user.gender ==='2'" <img
src="~@/assets/img/staff-default-avatar-girl.png"> v-if="$store.state.user.gender === '2'"
<img v-else src="~@/assets/img/staff-default-avatar-girl.png"
src="~@/assets/img/staff-default-avatar-boy.png"> />
<img v-else src="~@/assets/img/staff-default-avatar-boy.png" />
<span>{{ $store.state.user.realName }}</span> <span>{{ $store.state.user.realName }}</span>
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<!-- <el-dropdown-item @click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}</el-dropdown-item> --> <!-- <el-dropdown-item @click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}</el-dropdown-item> -->
<el-dropdown-item @click.native="logoutHandle()">{{ $t('logout') }}</el-dropdown-item> <el-dropdown-item @click.native="logoutHandle()">{{
$t('logout')
}}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
</div> </div>
<!-- 弹窗, 修改密码 --> <!-- 弹窗, 修改密码 -->
<update-password v-if="updatePassowrdVisible" <update-password
ref="updatePassowrd"></update-password> v-if="updatePassowrdVisible"
ref="updatePassowrd"
></update-password>
</nav> </nav>
<nav v-else <nav v-else class="aui-navbar main-line"></nav>
class="aui-navbar main-line"></nav>
</div> </div>
</template> </template>
<script> <script>
@ -99,39 +122,49 @@ import UpdatePassword from './main-navbar-update-password'
import { clearLoginInfo } from '@/utils' import { clearLoginInfo } from '@/utils'
export default { export default {
inject: ['refresh'], inject: ['refresh'],
data () { data() {
return { return {
showHeader: true, showHeader: true,
i18nMessages: messages, i18nMessages: messages,
updatePassowrdVisible: false, updatePassowrdVisible: false,
customerName: localStorage.getItem('customerName') customerName: localStorage.getItem('customerName')
} }
}, },
components: { components: {
UpdatePassword UpdatePassword
}, },
created () { created() {
let platformToken = localStorage.getItem('showHeader') || ''; let platformToken = localStorage.getItem('showHeader') || ''
if (typeof platformToken !== 'undefined' && platformToken !== 'undefined' && platformToken !== '') { if (
typeof platformToken !== 'undefined' &&
platformToken !== 'undefined' &&
platformToken !== ''
) {
this.showHeader = false this.showHeader = false
} }
console.log('=============================', this.userType)
}, },
computed: { computed: {
userType () { userType() {
return localStorage.getItem('userType') return localStorage.getItem('userType')
}, }
}, },
methods: { methods: {
changeCustomerName (customerName) { // menuId()
gotoRouteHandle(menuId) {
var route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(
(item) => item.meta.menuId === menuId
)[0]
if (route) {
this.$router.push({ name: route.name })
}
this.$store.state.LevelOneMenuActiveName = menuId
},
changeCustomerName(customerName) {
this.customerName = localStorage.getItem('customerName') this.customerName = localStorage.getItem('customerName')
}, },
// //
fullscreenHandle () { fullscreenHandle() {
if (!screenfull.enabled) { if (!screenfull.enabled) {
return this.$message({ return this.$message({
message: this.$t('fullscreen.prompt'), message: this.$t('fullscreen.prompt'),
@ -142,42 +175,51 @@ export default {
screenfull.toggle() screenfull.toggle()
}, },
// //
updatePasswordHandle () { updatePasswordHandle() {
this.updatePassowrdVisible = true this.updatePassowrdVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.updatePassowrd.init() this.$refs.updatePassowrd.init()
}) })
}, },
// 退 // 退
logoutHandle () { logoutHandle() {
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('logout') }), this.$t('prompt.title'), { this.$confirm(
confirmButtonText: this.$t('confirm'), this.$t('prompt.info', { handle: this.$t('logout') }),
cancelButtonText: this.$t('cancel'), this.$t('prompt.title'),
type: 'warning' {
}).then(() => { confirmButtonText: this.$t('confirm'),
// cancelButtonText: this.$t('cancel'),
// tabs, type: 'warning'
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name === 'home') }
)
.then(() => {
this.$http.post('/auth/login/logout').then(({ data: res }) => { //
if (res.code !== 0) { // tabs,
// 退 this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
if (res.code !== 10007){ (item) => item.name === 'home'
this.$message.error(res.msg) )
}
}
clearLoginInfo() this.$http
.post('/auth/login/logout')
.then(({ data: res }) => {
if (res.code !== 0) {
// 退
if (res.code !== 10007) {
this.$message.error(res.msg)
}
}
if (localStorage.getItem('userType') === 'work') { clearLoginInfo()
this.$router.push({ name: 'loginWork' })
} else {
this.$router.push({ name: 'login' })
}
}).catch(() => { }) if (localStorage.getItem('userType') === 'work') {
}).catch(() => { }) this.$router.push({ name: 'loginWork' })
} else {
this.$router.push({ name: 'login' })
}
})
.catch(() => {})
})
.catch(() => {})
} }
} }
} }
@ -188,4 +230,3 @@ export default {
background: #eeeeee; background: #eeeeee;
} }
</style> </style>

57
epmet-oper-web/src/views/main-sidebar.vue

@ -1,14 +1,39 @@
<template> <template>
<aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]"> <aside
:class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]"
>
<div class="aui-sidebar__inner"> <div class="aui-sidebar__inner">
<el-menu :default-active="$store.state.sidebarMenuActiveName" <el-menu
:collapse="$store.state.sidebarFold" v-if="userType !== 'work'"
:unique-opened="true" :default-active="$store.state.sidebarMenuActiveName"
:collapseTransition="false" :collapse="$store.state.sidebarFold"
class="aui-sidebar__menu"> :unique-opened="true"
<sub-menu v-for="menu in $store.state.sidebarMenuList" :collapseTransition="false"
:key="menu.id" class="aui-sidebar__menu"
:menu="menu" /> >
<sub-menu
v-for="menu in $store.state.sidebarMenuList"
:key="menu.id"
:menu="menu"
/>
</el-menu>
<el-menu
:default-active="$store.state.sidebarMenuActiveName"
:collapse="$store.state.sidebarFold"
:unique-opened="true"
:collapseTransition="false"
class="aui-sidebar__menu"
v-else
>
<template v-for="item in $store.state.sidebarMenuList">
<sub-menu
v-if="$store.state.LevelOneMenuActiveName == item.id"
v-for="menu in item.children"
:key="menu.id"
:menu="menu"
/>
</template>
</el-menu> </el-menu>
</div> </div>
</aside> </aside>
@ -16,16 +41,22 @@
<script> <script>
import SubMenu from './main-sidebar-sub-menu' import SubMenu from './main-sidebar-sub-menu'
export default { export default {
data () { data() {
return { return {}
}
}, },
components: { components: {
SubMenu SubMenu
}, },
created () { computed: {
userType() {
return localStorage.getItem('userType')
}
},
created() {
this.$store.state.sidebarMenuList = window.SITE_CONFIG['menuList'] this.$store.state.sidebarMenuList = window.SITE_CONFIG['menuList']
console.log(this.$store.state.sidebarMenuList)
} }
} }
</script> </script>

42
epmet-oper-web/src/views/main-theme-tools.vue

@ -1,21 +1,34 @@
<template> <template>
<div class="aui-theme-tools" :class="{ 'aui-theme-tools--open': isOpen }"> <div class="aui-theme-tools" :class="{ 'aui-theme-tools--open': isOpen }">
<div class="aui-theme-tools__toggle" @click="isOpen = !isOpen"> <div class="aui-theme-tools__toggle" @click="isOpen = !isOpen">
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-setting"></use></svg> <svg class="icon-svg" aria-hidden="true">
<use xlink:href="#icon-setting"></use>
</svg>
</div> </div>
<div class="aui-theme-tools__content"> <div class="aui-theme-tools__content">
<div class="aui-theme-tools__item"> <div class="aui-theme-tools__item">
<h3>Navbar</h3> <h3>Navbar</h3>
<el-checkbox v-model="$store.state.navbarLayoutType" true-label="colorful">colorful 鲜艳</el-checkbox> <el-checkbox
v-model="$store.state.navbarLayoutType"
true-label="colorful"
>colorful 鲜艳</el-checkbox
>
</div> </div>
<div class="aui-theme-tools__item"> <div class="aui-theme-tools__item">
<h3>Sidebar</h3> <h3>Sidebar</h3>
<el-checkbox v-model="$store.state.sidebarLayoutSkin" true-label="dark">dark 黑色</el-checkbox> <el-checkbox v-model="$store.state.sidebarLayoutSkin" true-label="dark"
>dark 黑色</el-checkbox
>
</div> </div>
<div class="aui-theme-tools__item"> <div class="aui-theme-tools__item">
<h3>Theme</h3> <h3>Theme</h3>
<el-radio-group v-model="themeColor" @change="themeColorChangeHandle"> <el-radio-group v-model="themeColor" @change="themeColorChangeHandle">
<el-radio v-for="item in themeList" :key="item.name" :label="item.name">{{ `${item.name} ${item.desc}` }}</el-radio> <el-radio
v-for="item in themeList"
:key="item.name"
:label="item.name"
>{{ `${item.name} ${item.desc}` }}</el-radio
>
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
@ -24,23 +37,34 @@
<script> <script>
export default { export default {
data () { data() {
return { return {
isOpen: false, isOpen: false,
themeList: require('@/element-ui/config.js'), themeList: require('@/element-ui/config.js'),
themeColor: 'turquoise' themeColor: ''
} }
}, },
created() {
let color = window.localStorage.getItem('themeColor') || 'blue'
this.themeColorChangeHandle(color)
this.themeColor = color
},
methods: { methods: {
themeColorChangeHandle (val) { themeColorChangeHandle(val) {
window.localStorage.setItem('themeColor', val)
var styleList = [ var styleList = [
{ {
id: 'J_elementTheme', id: 'J_elementTheme',
url: `${process.env.BASE_URL}element-theme/${val}/index.css?t=${new Date().getTime()}` url: `${
process.env.BASE_URL
}element-theme/${val}/index.css?t=${new Date().getTime()}`
}, },
{ {
id: 'J_auiTheme', id: 'J_auiTheme',
url: `${process.env.BASE_URL}element-theme/${val}/aui.css?t=${new Date().getTime()}` url: `${
process.env.BASE_URL
}element-theme/${val}/aui.css?t=${new Date().getTime()}`
} }
] ]
for (var i = 0; i < styleList.length; i++) { for (var i = 0; i < styleList.length; i++) {

129
epmet-oper-web/src/views/main.vue

@ -1,13 +1,17 @@
<template> <template>
<div v-loading.fullscreen.lock="loading" <div
:element-loading-text="$t('loading')" v-loading.fullscreen.lock="loading"
:class="['aui-wrapper', { 'aui-sidebar--fold': $store.state.sidebarFold }]"> :element-loading-text="$t('loading')"
:class="['aui-wrapper', { 'aui-sidebar--fold': $store.state.sidebarFold }]"
>
<template v-if="!loading"> <template v-if="!loading">
<main-navbar ref="ref_navbar" /> <main-navbar ref="ref_navbar" />
<main-sidebar /> <main-sidebar />
<div class="aui-content__wrapper"> <div class="aui-content__wrapper">
<main-content v-if="!$store.state.contentIsNeedRefresh" <main-content
@changeCustomerName="changeCustomerName" /> v-if="!$store.state.contentIsNeedRefresh"
@changeCustomerName="changeCustomerName"
/>
</div> </div>
<main-theme-tools /> <main-theme-tools />
</template> </template>
@ -22,10 +26,10 @@ import MainThemeTools from './main-theme-tools'
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
provide () { provide() {
return { return {
// //
refresh () { refresh() {
this.$store.state.contentIsNeedRefresh = true this.$store.state.contentIsNeedRefresh = true
this.$nextTick(() => { this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false this.$store.state.contentIsNeedRefresh = false
@ -33,7 +37,7 @@ export default {
} }
} }
}, },
data () { data() {
return { return {
loading: true loading: true
} }
@ -47,84 +51,103 @@ export default {
watch: { watch: {
$route: 'routeHandle' $route: 'routeHandle'
}, },
created () { created() {
this.windowResizeHandle() this.windowResizeHandle()
this.routeHandle(this.$route) this.routeHandle(this.$route)
if (localStorage.getItem('userType') === 'work') { if (localStorage.getItem('userType') === 'work') {
Promise.all([ Promise.all([this.getWorkUserInfo()]).then(() => {
this.getWorkUserInfo(),
]).then(() => {
this.loading = false this.loading = false
}) })
} else { } else {
Promise.all([ Promise.all([this.getUserInfo()]).then(() => {
this.getUserInfo(),
]).then(() => {
this.loading = false this.loading = false
}) })
} }
},
computed: {
}, },
computed: {},
methods: { methods: {
changeCustomerName (customerName) { changeCustomerName(customerName) {
this.$refs['ref_navbar'].changeCustomerName(customerName) this.$refs['ref_navbar'].changeCustomerName(customerName)
}, },
// //
windowResizeHandle () { windowResizeHandle() {
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false this.$store.state.sidebarFold =
window.addEventListener('resize', debounce(() => { document.documentElement['clientWidth'] <= 992 || false
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false window.addEventListener(
}, 150)) 'resize',
debounce(() => {
this.$store.state.sidebarFold =
document.documentElement['clientWidth'] <= 992 || false
}, 150)
)
}, },
// , // ,
routeHandle (route) { routeHandle(route) {
if (!route.meta.isTab) { if (!route.meta.isTab) {
return false return false
} }
var tab = this.$store.state.contentTabs.filter(item => item.name === route.name)[0] var tab = this.$store.state.contentTabs.filter(
(item) => item.name === route.name
)[0]
if (!tab) { if (!tab) {
tab = { tab = {
...window.SITE_CONFIG['contentTabDefault'], ...window.SITE_CONFIG['contentTabDefault'],
...route.meta, ...route.meta,
'name': route.name, name: route.name,
'params': { ...route.params }, params: { ...route.params },
'query': { ...route.query } query: { ...route.query }
} }
this.$store.state.contentTabs = this.$store.state.contentTabs.concat(tab) this.$store.state.contentTabs = this.$store.state.contentTabs.concat(
tab
)
} }
this.$store.state.sidebarMenuActiveName = tab.menuId this.$store.state.sidebarMenuActiveName = tab.menuId
this.$store.state.contentTabsActiveName = tab.name this.$store.state.contentTabsActiveName = tab.name
this.syncLevelOneMenuActive(tab.menuId)
},
syncLevelOneMenuActive(menuId) {
const fn = (item) => {
console.log('++++++++++++++', item)
if (item.id == menuId) {
return true
} else if (item.children.length > 0) {
return item.children.findIndex(fn) !== -1
} else {
return false
}
}
let idx = this.$store.state.sidebarMenuList.findIndex(fn)
this.$store.state.LevelOneMenuActiveName =
idx !== -1 ? this.$store.state.sidebarMenuList[idx].id : ''
}, },
// //
getUserInfo () { getUserInfo() {
const url = '/epmetuser/operuser/queryOperUserDto' const url = '/epmetuser/operuser/queryOperUserDto'
return this.$http.get(url).then(({ data: res }) => { return this.$http
if (res.code !== 0) { .get(url)
return this.$message.error(res.msg) .then(({ data: res }) => {
} if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$store.state.user.id = res.data.id this.$store.state.user.id = res.data.id
this.$store.state.user.realName = res.data.realName this.$store.state.user.realName = res.data.realName
this.$store.state.user.superAdmin = res.data.superAdmin this.$store.state.user.superAdmin = res.data.superAdmin
this.$store.state.user.gender = data.gender this.$store.state.user.gender = data.gender
localStorage.setItem('customerId', '') localStorage.setItem('customerId', '')
}).catch(() => { }) })
.catch(() => {})
}, },
// //
getWorkUserInfo () { getWorkUserInfo() {
const url = '/epmetuser/customerstaff/staffbasicinfo' const url = '/epmetuser/customerstaff/staffbasicinfo'
let params = { let params = {}
} window.app.ajax.post(
window.app.ajax.post(url, params, url,
params,
(data, rspMsg) => { (data, rspMsg) => {
this.$store.state.user.id = data.id this.$store.state.user.id = data.id
this.$store.state.user.realName = data.realName this.$store.state.user.realName = data.realName
this.$store.state.user.superAdmin = data.superAdmin this.$store.state.user.superAdmin = data.superAdmin
@ -133,18 +156,16 @@ export default {
localStorage.setItem('customerId', data.customerId) localStorage.setItem('customerId', data.customerId)
// this.$store.state.user.roleList = data.roleList // this.$store.state.user.roleList = data.roleList
// this.$store.state.user.customerId = data.customerId // this.$store.state.user.customerId = data.customerId
}, },
(rspMsg, data) => { (rspMsg, data) => {
this.$message.error(rspMsg) this.$message.error(rspMsg)
}) }
)
// return this.$http.get(url).then(({ data: res }) => { // return this.$http.get(url).then(({ data: res }) => {
// if (res.code !== 0) { // if (res.code !== 0) {
// return this.$message.error(res.msg) // return this.$message.error(res.msg)
// } // }
// }).catch(() => { }) // }).catch(() => { })
} }
} }

33
epmet-oper-web/src/views/modules/shequ/index.vue

@ -0,0 +1,33 @@
<template>
<div>
<div class="m-info">
<h2>社区查询</h2>
</div>
</div>
</template>
<script>
export default {
data() {
return {
// i18nMessages: messages,
updatePassowrdVisible: false,
customerName: localStorage.getItem('customerName'),
userType: localStorage.getItem('userType')
}
},
components: {},
mounted() {
//
// tabs,
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name === 'home'
)
},
methods: {
changeCustomerName(customerName) {
this.$emit('changeCustomerName', customerName)
}
}
}
</script>

86
epmet-oper-web/src/views/pages/indexWork.vue

@ -0,0 +1,86 @@
<template>
<div class="g-app">
<div class="g-bd" v-if="true">
<div class="m-list">
<div class="list">
<div class="item" @click="handleClickItem(1)">
<img class="logo" src="@/assets/img/index/logo-1.png" alt="" />
<div class="name">党建引领基层治理互联管理平台</div>
<img src="@/assets/img/index/zhuangshi.png" class="tip" />
</div>
<div class="item z-on" @click="handleClickItem(2)">
<img class="logo" src="@/assets/img/index/logo-2.png" alt="" />
<div class="name">数据分析可视化平台</div>
<img src="@/assets/img/index/zhuangshi.png" class="tip" />
</div>
</div>
</div>
<div class="m-footer">
<div class="login-footer">
<p>
<a href="" target="_blank">{{ $t('login.copyright') }}</a>
</p>
</div>
</div>
</div>
</div>
</template>
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
import { messages } from '@/i18n'
import { getUUID } from '@/utils'
import { Loading } from 'element-ui' // Loading
import JSEncrypt from 'jsencrypt' //
let loading //
export default {
data() {
return {
pubKey: null, //
isShowLogin: true,
i18nMessages: messages
}
},
components: {},
computed: {},
created() {},
mounted() {},
methods: {
handleClickItem(k) {
if (k == 1) {
this.$router.replace({ name: 'home' })
} else if (k == 2) {
this.$router.replace({ name: 'home' })
}
},
//
getAutoLogin(platformToken) {
this.dataForm.thirdToken = platformToken
this.dataForm.platform = 'pyld'
this.$http
.post(`/auth/sso/oper/third/login`, this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
if (res.code == 8302) {
return this.$message.error(res.msg)
}
return this.$message.error(res.msg)
}
localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0')
Cookies.set('token', res.data.token)
this.$router.replace({ name: 'home' })
})
.catch(() => {})
// epmet-ext9.elinkservice.cn/platform-admin
}
}
}
</script>
<style lang="scss" src="@/assets/scss/pages/indexWork.scss"></style>

375
epmet-oper-web/src/views/pages/loginWork.vue

@ -1,141 +1,93 @@
<template> <template>
<div v-if="isShowLogin" <div class="g-app">
class="aui-wrapper aui-page__login"> <div class="g-bd" v-if="isShowLogin || true">
<div class="m-fm">
<div class="aui-content__wrapper"> <div class="wrap">
<main class="aui-content"> <h2 class="title">{{ $t('brand.work') }}</h2>
<div class="login-header"> <div class="fm">
<h2 class="login-brand">{{ $t('brand.work') }}</h2> <el-form
</div> :model="dataForm"
<div class="login-body"> :rules="dataRule"
<h3 class="login-title">{{ $t('login.title') }}</h3> ref="dataForm"
<el-form :model="dataForm" @keyup.enter.native="dataFormSubmitHandle()"
:rules="dataRule" status-icon
ref="dataForm" >
@keyup.enter.native="dataFormSubmitHandle()" <div class="fm-item">
status-icon> <div class="ico">
<!-- <el-form-item> <img src="@/assets/img/login/zhanghao.png" alt="" />
<el-select v-model="$i18n.locale" </div>
class="w-percent-100"> <div class="input">
<el-option v-for="(val, key) in i18nMessages" <input
:key="key" type="text"
:label="val._lang" v-model="dataForm.phone"
:value="key"></el-option> placeholder="账号"
</el-select> />
</el-form-item> --> </div>
<el-form-item prop="phone"> </div>
<el-input v-model="dataForm.phone" <div class="fm-item">
placeholder="手机号"> <div class="ico">
<span slot="prefix" <img src="@/assets/img/login/mima.png" alt="" />
class="el-input__icon"> </div>
<svg class="icon-svg" <div class="input">
aria-hidden="true"> <input
<use xlink:href="#icon-user"></use> type="password"
</svg> v-model="dataForm.password"
</span> :placeholder="$t('login.password')"
</el-input> />
</el-form-item> </div>
<el-form-item prop="password"> </div>
<el-input v-model="dataForm.password" <div class="fm-captcha">
type="password" <div class="fm-item">
:placeholder="$t('login.password')"> <div class="input">
<span slot="prefix" <input
class="el-input__icon"> type="text"
<svg class="icon-svg" v-model="dataForm.captcha"
aria-hidden="true"> placeholder="验证码"
<use xlink:href="#icon-lock"></use> />
</svg> </div>
</span> </div>
</el-input> <div class="captcha">
</el-form-item> <img :src="captchaPath" @click="getCaptcha()" />
<el-form-item prop="captcha"> </div>
<el-row :gutter="20"> </div>
<el-col :span="14">
<el-input v-model="dataForm.captcha"
:placeholder="$t('login.captcha')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-safetycertificate"></use>
</svg>
</span>
</el-input>
</el-col>
<el-col :span="10"
class="login-captcha">
<img :src="captchaPath"
@click="getCaptcha()">
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="dataFormSubmitHandle()"
class="w-percent-100">{{ $t('login.title') }}</el-button>
</el-form-item>
</el-form>
<div class="div_tip">
<p class="p_tip">
{{ '请使用小程序端的账号密码登录'}}
</p>
<div class="fm-btn" @click="dataFormSubmitHandle()">
{{ $t('login.title') }}
</div>
<div class="hint">请使用小程序端的账号密码登录</div>
</el-form>
</div> </div>
</div> </div>
</div>
<div class="m-footer">
<div class="login-footer"> <div class="login-footer">
<p> <p>
<a href="https://demo.cloud.renren.io/renren-cloud" <a href="" target="_blank">{{ $t('login.copyright') }}</a>
target="_blank">{{ $t('login.demo') }}</a>
</p> </p>
<!-- 2020 © renren.io -->
<p><a href="https://www.renren.io/"
target="_blank">{{ $t('login.copyright') }}</a></p>
</div> </div>
</main> </div>
</div> </div>
<c-dialog :showFooter='false'
:title="'选择客户'" <c-dialog
:isNest="false" :showFooter="false"
:visible="diaVisible" :title="'选择客户'"
:dialogHeight="0.8" :isNest="false"
:width="30" :visible="diaVisible"
:top="'120px'" :dialogHeight="0.8"
@cancel="diaCancel"> :width="30"
:top="'120px'"
@cancel="diaCancel"
>
<!-- <div class="div_total"> --> <!-- <div class="div_total"> -->
<div v-for="(item,index) in tableData" <div v-for="(item, index) in tableData" :key="index" class="div_row">
:key=index <span @click="selectCustomer(item)" class="span_name">{{
class="div_row"> item.customerName
<span @click="selectCustomer(item)" }}</span>
class="span_name">{{item.customerName}}</span>
</div> </div>
<!-- </div> -->
<!-- <el-table v-loading="tableLoading"
:data="tableData"
border
style="width: 100%;">
<el-table-column prop="customerName"
label="客户名称"
header-align="left"
align="left"
width="300"></el-table-column>
<el-table-column label="操作"
fixed="right"
header-align="right"
align="right">
<template slot-scope="scope">
<el-button size="small"
@click="selectCustomer(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table> -->
</c-dialog> </c-dialog>
</div> </div>
</template> </template>
<script> <script>
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import CDialog from '@c/CDialog' import CDialog from '@c/CDialog'
@ -143,11 +95,11 @@ import debounce from 'lodash/debounce'
import { messages } from '@/i18n' import { messages } from '@/i18n'
import { getUUID } from '@/utils' import { getUUID } from '@/utils'
import { Loading } from 'element-ui' // Loading import { Loading } from 'element-ui' // Loading
import JSEncrypt from 'jsencrypt'// import JSEncrypt from 'jsencrypt' //
let loading // let loading //
export default { export default {
data () { data() {
return { return {
pubKey: null, // pubKey: null, //
isShowLogin: true, isShowLogin: true,
@ -173,11 +125,9 @@ export default {
CDialog CDialog
}, },
computed: { computed: {
dataRule () { dataRule() {
return { return {
phone: [ phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
{ required: true, message: '手机号不能为空', trigger: 'blur' }
],
password: [ password: [
{ required: true, message: '密码不能为空', trigger: 'blur' } { required: true, message: '密码不能为空', trigger: 'blur' }
], ],
@ -187,10 +137,10 @@ export default {
} }
} }
}, },
created () { created() {
// //
if (this.$route.query.platformToken) { if (this.$route.query.platformToken) {
this.isShowLogin = false; this.isShowLogin = false
this.getAutoLogin(this.$route.query.platformToken) this.getAutoLogin(this.$route.query.platformToken)
} else { } else {
this.getCaptcha() this.getCaptcha()
@ -198,29 +148,31 @@ export default {
this.getPubKey() this.getPubKey()
} }
}, },
mounted () { mounted() {
localStorage.removeItem('showHeader'); localStorage.removeItem('showHeader')
}, },
methods: { methods: {
// //
getPubKey () { getPubKey() {
this.$http.post('/auth/govweb/getKey').then(({ data: res }) => { this.$http
if (res.code !== 0) { .post('/auth/govweb/getKey')
return this.$message.error(res.msg) .then(({ data: res }) => {
} if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.pubKey = res.data; // ; this.pubKey = res.data // ;
}).catch(() => { })
}) .catch(() => {})
}, },
// //
getCaptcha () { getCaptcha() {
this.dataForm.uuid = getUUID() this.dataForm.uuid = getUUID()
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}` this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}`
}, },
// //
dataFormSubmitHandle () { dataFormSubmitHandle() {
this.$refs['dataForm'].validate((valid, messageObj) => { this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) { if (!valid) {
app.util.validateRule(messageObj) app.util.validateRule(messageObj)
@ -232,10 +184,11 @@ export default {
phone: this.dataForm.phone phone: this.dataForm.phone
} }
window.app.ajax.post( window.app.ajax.post(
url, params, url,
params,
(data, rspMsg) => { (data, rspMsg) => {
if (data.length === 0) {
if (data.length === 0) {// //
this.$message.error('账号不存在') this.$message.error('账号不存在')
this.endLoading() this.endLoading()
} else if (data.length === 1) { } else if (data.length === 1) {
@ -251,65 +204,66 @@ export default {
(rspMsg, data) => { (rspMsg, data) => {
this.endLoading() this.endLoading()
this.$message.error(rspMsg) this.$message.error(rspMsg)
}) }
)
}) })
}, },
// //
getAutoLogin (platformToken) { getAutoLogin(platformToken) {
this.dataForm.thirdToken = platformToken; this.dataForm.thirdToken = platformToken
this.dataForm.platform = "pyld"; this.dataForm.platform = 'pyld'
this.$http.post(`/auth/sso/oper/third/login`, this.dataForm).then(({ data: res }) => { this.$http
if (res.code !== 0) { .post(`/auth/sso/oper/third/login`, this.dataForm)
if (res.code == 8302) { .then(({ data: res }) => {
if (res.code !== 0) {
if (res.code == 8302) {
return this.$message.error(res.msg)
}
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
return this.$message.error(res.msg) localStorage.setItem('customerId', res.data.customerId)
} localStorage.setItem('userType', 'work')
localStorage.setItem('customerId', res.data.customerId) localStorage.setItem('showHeader', '0')
localStorage.setItem('userType', 'work') Cookies.set('token', res.data.token)
localStorage.setItem('showHeader', '0') this.$router.replace({ name: 'home' })
Cookies.set('token', res.data.token) })
this.$router.replace({ name: 'home' }) .catch(() => {})
}).catch(() => {
})
// epmet-ext9.elinkservice.cn/platform-admin // epmet-ext9.elinkservice.cn/platform-admin
}, },
// //
selectCustomer (row) { selectCustomer(row) {
localStorage.setItem('customerId', row.customerId) localStorage.setItem('customerId', row.customerId)
localStorage.setItem('customerName', row.customerName) localStorage.setItem('customerName', row.customerName)
this.startLoading() this.startLoading()
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/auth/govweb/login' // const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/auth/govweb/login'
const url = '/auth/govweb/login' const url = '/auth/govweb/login'
this.dataForm.customerId = row.customerId this.dataForm.customerId = row.customerId
let param = {}; let param = {}
Object.assign(param, this.dataForm); Object.assign(param, this.dataForm)
param.password = this.encryptedData(this.pubKey, this.dataForm.password); param.password = this.encryptedData(this.pubKey, this.dataForm.password)
this.$http.post(url, param).then(({ data: res }) => { this.$http
if (res.code !== 0) { .post(url, param)
this.getCaptcha() .then(({ data: res }) => {
return this.$message.error(res.msg) if (res.code !== 0) {
} this.getCaptcha()
this.diaVisible = false return this.$message.error(res.msg)
}
this.diaVisible = false
localStorage.setItem('userType', 'work') localStorage.setItem('userType', 'work')
Cookies.set('token', res.data.token) Cookies.set('token', res.data.token)
this.$router.replace({ name: 'home' }).catch(() => { }) this.$router.replace({ name: 'indexWork' }).catch(() => {})
}).catch(() => { })
}) .catch(() => {})
this.endLoading() this.endLoading()
}, },
// //
diaCancel () { diaCancel() {
this.diaVisible = false this.diaVisible = false
}, },
// //
startLoading () { startLoading() {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: '正在加载……', // text: '正在加载……', //
@ -317,64 +271,23 @@ export default {
}) })
}, },
// //
endLoading () { endLoading() {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close() loading.close()
} }
}, },
// //
encryptedData (key, data) { encryptedData(key, data) {
// JSEncrypt // JSEncrypt
let encryptor = new JSEncrypt(); let encryptor = new JSEncrypt()
// //
encryptor.setPublicKey(key); encryptor.setPublicKey(key)
// //
return encryptor.encrypt(data); return encryptor.encrypt(data)
} }
} }
} }
</script> </script>
<style scoped>
.div_tip {
float: left;
}
.p_tip {
color: rgb(255, 80, 80);
}
.div_total {
height: 80%;
width: 100%;
text-align: center;
}
.el-dialog__body {
width: 500px;
padding: 0px 0px 0px 20px;
}
.div_row {
height: 50px;
text-align: center;
line-height: 50px;
/* width: 100px; */ <style lang="scss" src="@/assets/scss/pages/loginWork.scss"></style>
/* background-color: rgb(241, 241, 241); */
}
.div_row:hover {
color: rgb(2, 119, 173);
font-weight: bold;
text-decoration: underline;
}
.i_icon {
width: 15px;
height: 15px;
margin-right: 10px;
float: left;
}
.span_name {
font-size: 18px;
cursor: pointer;
/* color: rgb(37, 156, 235); */
}
</style>

Loading…
Cancel
Save