Compare commits
No commits in common. 'main' and 'ZBZ' have entirely different histories.
@ -1,15 +0,0 @@
|
||||
package com.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 登录用户信息
|
||||
*/
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface APPLoginUser {
|
||||
|
||||
}
|
@ -1,109 +0,0 @@
|
||||
<template>
|
||||
<el-breadcrumb class="app-breadcrumb" separator="|" style="height:50px;backgroundColor:rgba(88, 179, 81, 1);borderRadius:0px;padding:0px 20px 0px 20px;boxShadow:0px 0px 0px #f903d4;borderWidth:1px;borderStyle:none none double none;borderColor:rgba(88, 179, 81, 1);">
|
||||
<transition-group name="breadcrumb" class="box" :style="1==1?'justifyContent:flex-start;':1==2?'justifyContent:center;':'justifyContent:flex-end;'">
|
||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.name }}</span>
|
||||
<a v-else @click.prevent="handleLink(item)">{{ item.name }}</a>
|
||||
</el-breadcrumb-item>
|
||||
</transition-group>
|
||||
</el-breadcrumb>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pathToRegexp from 'path-to-regexp'
|
||||
import { generateTitle } from '@/utils/i18n'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
levelList: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.getBreadcrumb()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getBreadcrumb()
|
||||
this.breadcrumbStyleChange()
|
||||
},
|
||||
methods: {
|
||||
generateTitle,
|
||||
getBreadcrumb() {
|
||||
// only show routes with meta.title
|
||||
let route = this.$route
|
||||
let matched = route.matched.filter(item => item.meta)
|
||||
const first = matched[0]
|
||||
matched = [{ path: '/index' }].concat(matched)
|
||||
|
||||
this.levelList = matched.filter(item => item.meta)
|
||||
},
|
||||
isDashboard(route) {
|
||||
const name = route && route.name
|
||||
if (!name) {
|
||||
return false
|
||||
}
|
||||
return name.trim().toLocaleLowerCase() === 'Index'.toLocaleLowerCase()
|
||||
},
|
||||
pathCompile(path) {
|
||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
||||
const { params } = this.$route
|
||||
var toPath = pathToRegexp.compile(path)
|
||||
return toPath(params)
|
||||
},
|
||||
handleLink(item) {
|
||||
const { redirect, path } = item
|
||||
if (redirect) {
|
||||
this.$router.push(redirect)
|
||||
return
|
||||
}
|
||||
this.$router.push(path)
|
||||
},
|
||||
breadcrumbStyleChange(val) {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.app-breadcrumb .el-breadcrumb__separator').forEach(el=>{
|
||||
el.innerText = "|"
|
||||
el.style.color = "rgba(88, 179, 81, 1)"
|
||||
})
|
||||
document.querySelectorAll('.app-breadcrumb .el-breadcrumb__inner a').forEach(el=>{
|
||||
el.style.color = "rgba(88, 179, 81, 1)"
|
||||
})
|
||||
document.querySelectorAll('.app-breadcrumb .el-breadcrumb__inner .no-redirect').forEach(el=>{
|
||||
el.style.color = "rgba(88, 179, 81, 1)"
|
||||
})
|
||||
|
||||
let str = "vertical"
|
||||
if("vertical" === str) {
|
||||
let headHeight = "60px"
|
||||
headHeight = parseInt(headHeight) + 10 + 'px'
|
||||
document.querySelectorAll('.app-breadcrumb').forEach(el=>{
|
||||
el.style.marginTop = headHeight
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-breadcrumb {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
line-height: 50px;
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.no-redirect {
|
||||
color: #97a8be;
|
||||
cursor: text;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,60 +0,0 @@
|
||||
<template>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="header">
|
||||
<span>{{title}}</span>
|
||||
<span>
|
||||
<el-tag size="small" :type="titleTag">{{titleUnit}}</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
{{content}}
|
||||
<span class="unit">{{contentUnit}}</span>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<span>{{bottomTitle}}</span>
|
||||
<span>
|
||||
{{bottomContent}}
|
||||
<i :class="bottomIcon"></i>
|
||||
</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: [
|
||||
"title",
|
||||
"titleTag",
|
||||
"titleUnit",
|
||||
"content",
|
||||
"contentUnit",
|
||||
"bottomTitle",
|
||||
"bottomContent",
|
||||
"bottomIcon"
|
||||
]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.box-card {
|
||||
margin-right: 10px;
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.content {
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
.unit {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
.bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,101 +0,0 @@
|
||||
<template>
|
||||
<div class="home-comment">
|
||||
<div class="title">用户留言</div>
|
||||
<div class="comment-list">
|
||||
<div v-for="(item,index) in list" v-bind:key="index" class="comment-item">
|
||||
<div class="user-content">
|
||||
<el-image
|
||||
class="avator"
|
||||
:src="item.avator"
|
||||
></el-image>
|
||||
<span class="user">{{item.name}}</span>
|
||||
</div>
|
||||
<div class="comment">{{item.content}}</div>
|
||||
<div class="create-time">{{item.createTime}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
name: "MaskLin",
|
||||
avator:
|
||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
||||
content:
|
||||
"你以为只要长得漂亮就有男生喜欢?你以为只要有了钱漂亮妹子就自己贴上来了?你以为学霸就能找到好工作?我告诉你吧,这些都是真的!",
|
||||
createTime: "5月02日 00:00"
|
||||
},
|
||||
{
|
||||
name: "MaskLin",
|
||||
avator:
|
||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
||||
content: "作者太帅了",
|
||||
createTime: "5月04日 00:00"
|
||||
},
|
||||
{
|
||||
name: "MaskLin",
|
||||
avator:
|
||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
||||
content: "作者太帅了",
|
||||
createTime: "5月04日 00:00"
|
||||
},
|
||||
{
|
||||
name: "MaskLin",
|
||||
avator: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
||||
content: "作者太帅了",
|
||||
createTime: "5月04日 00:00"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.home-comment {
|
||||
background: #ffffff;
|
||||
.title {
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
}
|
||||
.comment-list {
|
||||
padding: 10px;
|
||||
.comment-item {
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
.user-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.user {
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
font-weight: bold;
|
||||
line-height: 50px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.avator {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.comment {
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
color: #888888;
|
||||
}
|
||||
.create-time {
|
||||
margin-top: 15px;
|
||||
font-size: 14px;
|
||||
color: #888888;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,55 +0,0 @@
|
||||
<template>
|
||||
<div class="home-progress">
|
||||
<div class="title">月访问量</div>
|
||||
<div class="tip">同上期增长</div>
|
||||
<el-progress
|
||||
class="progress"
|
||||
:text-inside="true"
|
||||
:stroke-width="24"
|
||||
:percentage="20"
|
||||
status="success"
|
||||
></el-progress>
|
||||
<div class="title">月用户量</div>
|
||||
<div class="tip">同上期增长</div>
|
||||
<el-progress
|
||||
class="progress"
|
||||
:text-inside="true"
|
||||
:stroke-width="24"
|
||||
:percentage="50"
|
||||
status="success"
|
||||
></el-progress>
|
||||
<div class="title">月收入</div>
|
||||
<div class="tip">同上期减少</div>
|
||||
<el-progress
|
||||
class="progress"
|
||||
:text-inside="true"
|
||||
:stroke-width="24"
|
||||
:percentage="28"
|
||||
status="exception"
|
||||
></el-progress>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.home-progress {
|
||||
background: #ffffff;
|
||||
height: 400px;
|
||||
padding: 20px;
|
||||
.title {
|
||||
color: #666666;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.tip {
|
||||
color: #888888;
|
||||
font-size: 16px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.progress {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,56 +0,0 @@
|
||||
<template>
|
||||
<el-aside class="index-aside" width="200px">
|
||||
<div class="index-aside-inner">
|
||||
<el-menu default-active="1">
|
||||
<el-menu-item @click="menuHandler('/')" index="1">
|
||||
<!-- <i class="el-icon-s-home"></i> -->
|
||||
首页
|
||||
</el-menu-item>
|
||||
<sub-menu
|
||||
v-for="menu in menuList"
|
||||
:key="menu.menuId"
|
||||
:menu="menu"
|
||||
:dynamicMenuRoutes="dynamicMenuRoutes"
|
||||
></sub-menu>
|
||||
</el-menu>
|
||||
</div>
|
||||
</el-aside>
|
||||
</template>
|
||||
<script>
|
||||
import SubMenu from "@/components/index/IndexAsideSub";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
dynamicMenuRoutes: []
|
||||
};
|
||||
},
|
||||
components: {
|
||||
SubMenu
|
||||
},
|
||||
mounted() {
|
||||
// 获取动态菜单数据并且渲染
|
||||
this.menuList = JSON.parse(sessionStorage.getItem("menuList") || "[]");
|
||||
this.dynamicMenuRoutes = JSON.parse(
|
||||
sessionStorage.getItem("dynamicMenuRoutes") || "[]"
|
||||
);
|
||||
},
|
||||
methods: {
|
||||
menuHandler(path) {
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.index-aside {
|
||||
margin-top: 80px;
|
||||
overflow: hidden;
|
||||
.index-aside-inner {
|
||||
width: 217px;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,240 +0,0 @@
|
||||
<template>
|
||||
<el-aside class="index-aside" height="100vh" width="180px">
|
||||
<div class="index-aside-inner menulist" style="height:100%">
|
||||
<div v-for="item in menuList" :key="item.roleName" v-if="role==item.roleName" class="menulist-item" style="height:100%;broder:0;background-color:#58B351">
|
||||
<div class="menulistImg" style="backgroundColor:#58B351;padding:25px 0" v-if="false && menulistStyle == 'vertical'">
|
||||
<el-image v-if="'http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg'" src="http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg" fit="cover" />
|
||||
</div>
|
||||
<el-menu mode="vertical" :unique-opened="true" class="el-menu-demo" style="height:100%;" background-color="#58B351" text-color="#FFFFFF" active-text-color="#F2DD3D" default-active="0">
|
||||
<el-menu-item index="(0).toString()" :style="menulistBorderBottom" @click="menuHandler('')"><i v-if="true" class="el-icon-s-home" />首页</el-menu-item>
|
||||
<el-submenu :index="(1).toString()" :style="menulistBorderBottom">
|
||||
<template slot="title">
|
||||
<i v-if="true" class="el-icon-user-solid" />
|
||||
<span>个人中心</span>
|
||||
</template>
|
||||
<el-menu-item :index="(1-1).toString()" @click="menuHandler('updatePassword')">修改密码</el-menu-item>
|
||||
<el-menu-item :index="(1-2).toString()" @click="menuHandler('center')">个人信息</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-submenu :style="menulistBorderBottom" v-for=" (menu,index) in item.backMenu" :key="menu.menu" :index="(index+2).toString()">
|
||||
<template slot="title">
|
||||
<i v-if="true" :class="icons[index]" />
|
||||
<span>{{ menu.menu }}</span>
|
||||
</template>
|
||||
<el-menu-item v-for=" (child,sort) in menu.child" :key="sort" :index="((index+2)+'-'+sort).toString()" @click="menuHandler(child.tableName)">{{ child.menu }}</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</el-aside>
|
||||
</template>
|
||||
<script>
|
||||
import menu from '@/utils/menu'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
dynamicMenuRoutes: [],
|
||||
role: '',
|
||||
icons: [
|
||||
'el-icon-s-cooperation',
|
||||
'el-icon-s-order',
|
||||
'el-icon-s-platform',
|
||||
'el-icon-s-fold',
|
||||
'el-icon-s-unfold',
|
||||
'el-icon-s-operation',
|
||||
'el-icon-s-promotion',
|
||||
'el-icon-s-release',
|
||||
'el-icon-s-ticket',
|
||||
'el-icon-s-management',
|
||||
'el-icon-s-open',
|
||||
'el-icon-s-shop',
|
||||
'el-icon-s-marketing',
|
||||
'el-icon-s-flag',
|
||||
'el-icon-s-comment',
|
||||
'el-icon-s-finance',
|
||||
'el-icon-s-claim',
|
||||
'el-icon-s-custom',
|
||||
'el-icon-s-opportunity',
|
||||
'el-icon-s-data',
|
||||
'el-icon-s-check',
|
||||
'el-icon-s-grid',
|
||||
'el-icon-menu',
|
||||
'el-icon-chat-dot-square',
|
||||
'el-icon-message',
|
||||
'el-icon-postcard',
|
||||
'el-icon-position',
|
||||
'el-icon-microphone',
|
||||
'el-icon-close-notification',
|
||||
'el-icon-bangzhu',
|
||||
'el-icon-time',
|
||||
'el-icon-odometer',
|
||||
'el-icon-crop',
|
||||
'el-icon-aim',
|
||||
'el-icon-switch-button',
|
||||
'el-icon-full-screen',
|
||||
'el-icon-copy-document',
|
||||
'el-icon-mic',
|
||||
'el-icon-stopwatch',
|
||||
],
|
||||
menulistStyle: 'vertical',
|
||||
menulistBorderBottom: {},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const menus = menu.list()
|
||||
this.menuList = menus
|
||||
this.role = this.$storage.get('role')
|
||||
},
|
||||
created(){
|
||||
setTimeout(()=>{
|
||||
this.menulistStyleChange()
|
||||
},10)
|
||||
this.icons.sort(()=>{
|
||||
return (0.5-Math.random())
|
||||
})
|
||||
this.lineBorder()
|
||||
},
|
||||
methods: {
|
||||
lineBorder() {
|
||||
let style = 'vertical'
|
||||
let w = '1px'
|
||||
let s = 'dashed'
|
||||
let c = '#F8D303'
|
||||
if(style == 'vertical') {
|
||||
this.menulistBorderBottom = {
|
||||
borderBottomWidth: w,
|
||||
borderBottomStyle: s,
|
||||
borderBottomColor: c
|
||||
}
|
||||
} else {
|
||||
this.menulistBorderBottom = {
|
||||
borderRightWidth: w,
|
||||
borderRightStyle: s,
|
||||
borderRightColor: c
|
||||
}
|
||||
}
|
||||
},
|
||||
menuHandler(name) {
|
||||
let router = this.$router
|
||||
name = '/'+name
|
||||
router.push(name).catch(err => err)
|
||||
},
|
||||
// 菜单
|
||||
setMenulistHoverColor(){
|
||||
let that = this
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.menulist .el-menu-item').forEach(el=>{
|
||||
el.addEventListener("mouseenter", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "rgba(129, 187, 124, 1)"
|
||||
})
|
||||
el.addEventListener("mouseleave", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "#58B351"
|
||||
})
|
||||
el.addEventListener("focus", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "rgba(129, 187, 124, 1)"
|
||||
})
|
||||
})
|
||||
document.querySelectorAll('.menulist .el-submenu__title').forEach(el=>{
|
||||
el.addEventListener("mouseenter", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "rgba(129, 187, 124, 1)"
|
||||
})
|
||||
el.addEventListener("mouseleave", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "#58B351"
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
setMenulistIconColor() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.menulist .el-submenu__title .el-submenu__icon-arrow').forEach(el=>{
|
||||
el.style.color = "rgba(254, 253, 253, 1)"
|
||||
})
|
||||
})
|
||||
},
|
||||
menulistStyleChange() {
|
||||
this.setMenulistIconColor()
|
||||
this.setMenulistHoverColor()
|
||||
this.setMenulistStyleHeightChange()
|
||||
let str = "vertical"
|
||||
if("horizontal" === str) {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.el-container .el-container').forEach(el=>{
|
||||
el.style.display = "block"
|
||||
el.style.paddingTop = "60px" // header 高度
|
||||
})
|
||||
document.querySelectorAll('.el-aside').forEach(el=>{
|
||||
el.style.width = "100%"
|
||||
el.style.height = "60px"
|
||||
el.style.paddingTop = '0'
|
||||
})
|
||||
document.querySelectorAll('.index-aside .index-aside-inner').forEach(el=>{
|
||||
el.style.paddingTop = '0'
|
||||
})
|
||||
})
|
||||
}
|
||||
if("vertical" === str) {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.index-aside .index-aside-inner').forEach(el=>{
|
||||
el.style.paddingTop = "60px"
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
setMenulistStyleHeightChange() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.menulist-item>.el-menu--horizontal>.el-menu-item').forEach(el=>{
|
||||
el.style.height = "60px"
|
||||
el.style.lineHeight = "60px"
|
||||
})
|
||||
document.querySelectorAll('.menulist-item>.el-menu--horizontal>.el-submenu>.el-submenu__title').forEach(el=>{
|
||||
el.style.height = "60px"
|
||||
el.style.lineHeight = "60px"
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.index-aside {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.menulistImg {
|
||||
padding: 24px 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
.el-image {
|
||||
margin: 0 auto;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.index-aside-inner {
|
||||
height: 100%;
|
||||
margin-right: -17px;
|
||||
margin-bottom: -17px;
|
||||
overflow: scroll;
|
||||
overflow-x: hidden !important;
|
||||
padding-top: 60px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.el-menu {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,51 +0,0 @@
|
||||
<template>
|
||||
<el-submenu v-if="menu.list && menu.list.length >= 1" :index="menu.menuId + ''">
|
||||
<template slot="title">
|
||||
<span>{{ menu.name }}</span>
|
||||
</template>
|
||||
<sub-menu
|
||||
v-for="item in menu.list"
|
||||
:key="item.menuId"
|
||||
:menu="item"
|
||||
:dynamicMenuRoutes="dynamicMenuRoutes"
|
||||
></sub-menu>
|
||||
</el-submenu>
|
||||
<el-menu-item v-else :index="menu.menuId + ''" @click="gotoRouteHandle(menu)">
|
||||
<span>{{ menu.name }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SubMenu from "./IndexAsideSub";
|
||||
export default {
|
||||
name: "sub-menu",
|
||||
props: {
|
||||
menu: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
dynamicMenuRoutes: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SubMenu
|
||||
},
|
||||
methods: {
|
||||
// 通过menuId与动态(菜单)路由进行匹配跳转至指定路由
|
||||
gotoRouteHandle(menu) {
|
||||
var route = this.dynamicMenuRoutes.filter(
|
||||
item => item.meta.menuId === menu.menuId
|
||||
);
|
||||
if (route.length >= 1) {
|
||||
if (route[0].component != null) {
|
||||
this.$router.replace({ name: route[0].name });
|
||||
} else {
|
||||
this.$router.push({ name: "404" });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,185 +0,0 @@
|
||||
<template>
|
||||
<!-- <el-header>
|
||||
<el-menu background-color="#00c292" text-color="#FFFFFF" active-text-color="#FFFFFF" mode="horizontal">
|
||||
<div class="fl title">{{this.$project.projectName}}</div>
|
||||
<div class="fr logout" style="display:flex;">
|
||||
<el-menu-item index="3">
|
||||
<div>{{this.$storage.get('role')}} {{this.$storage.get('adminName')}}</div>
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="onLogout" index="2">
|
||||
<div>退出登录</div>
|
||||
</el-menu-item>
|
||||
</div>
|
||||
</el-menu>
|
||||
</el-header> -->
|
||||
<div class="navbar" :style="{backgroundColor:heads.headBgColor,height:heads.headHeight,boxShadow:heads.headBoxShadow,lineHeight:heads.headHeight}">
|
||||
<div class="title-menu" :style="{justifyContent:heads.headTitleStyle=='1'?'flex-start':'center'}">
|
||||
<el-image v-if="heads.headTitleImg" class="title-img" :style="{width:heads.headTitleImgWidth,height:heads.headTitleImgHeight,boxShadow:heads.headTitleImgBoxShadow,borderRadius:heads.headTitleImgBorderRadius}" :src="heads.headTitleImgUrl" fit="cover"></el-image>
|
||||
<div class="title-name" :style="{color:heads.headFontColor,fontSize:heads.headFontSize}">{{this.$project.projectName}}</div>
|
||||
<!-- <img src="../../../../img/logo.jpg" style="width: 60px;height: 60px;border-radius:60px"> -->
|
||||
</div>
|
||||
<div class="right-menu">
|
||||
<div class="user-info" :style="{color:heads.headUserInfoFontColor,fontSize:heads.headUserInfoFontSize}">{{this.$storage.get('role')}} {{this.$storage.get('adminName')}}</div>
|
||||
<div class="logout" :style="{color:heads.headLogoutFontColor,fontSize:heads.headLogoutFontSize}" @click="onIndexTap">退出到前台</div>
|
||||
<div class="logout" :style="{color:heads.headLogoutFontColor,fontSize:heads.headLogoutFontSize}" @click="onLogout">退出登录</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
ruleForm: {},
|
||||
user: {},
|
||||
heads: {"headLogoutFontHoverColor":"#fff","headFontSize":"20px","headUserInfoFontColor":"rgba(251, 250, 250, 1)","headBoxShadow":"0 5px 0px #DCDCDC","headTitleImgHeight":"44px","headLogoutFontHoverBgColor":"rgba(251, 250, 250, 1)","headFontColor":"rgba(251, 250, 250, 1)","headTitleImg":false,"headHeight":"60px","headTitleImgBorderRadius":"22px","headTitleImgUrl":"http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg","headBgColor":"#58B351","headTitleImgBoxShadow":"0 1px 6px #444","headLogoutFontColor":"rgba(251, 250, 250, 1)","headUserInfoFontSize":"16px","headTitleImgWidth":"44px","headTitleStyle":"2","headLogoutFontSize":"16px"},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.setHeaderStyle()
|
||||
},
|
||||
mounted() {
|
||||
let sessionTable = this.$storage.get("sessionTable")
|
||||
this.$http({
|
||||
url: sessionTable + '/session',
|
||||
method: "get"
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.user = data.data;
|
||||
} else {
|
||||
let message = this.$message
|
||||
message.error(data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
onLogout() {
|
||||
let storage = this.$storage
|
||||
let router = this.$router
|
||||
storage.clear()
|
||||
router.replace({
|
||||
name: "login"
|
||||
});
|
||||
},
|
||||
onIndexTap(){
|
||||
window.location.href = `${this.$base.indexUrl}`
|
||||
},
|
||||
setHeaderStyle() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.navbar .right-menu .logout').forEach(el=>{
|
||||
el.addEventListener("mouseenter", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = this.heads.headLogoutFontHoverBgColor
|
||||
el.style.color = this.heads.headLogoutFontHoverColor
|
||||
})
|
||||
el.addEventListener("mouseleave", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "transparent"
|
||||
el.style.color = this.heads.headLogoutFontColor
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbar {
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
width: 100%;
|
||||
padding: 0 34px;
|
||||
box-sizing: border-box;
|
||||
background-color: #ff00ff;
|
||||
position: relative;
|
||||
z-index: 111;
|
||||
|
||||
.right-menu {
|
||||
position: absolute;
|
||||
right: 34px;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
z-index: 111;
|
||||
|
||||
.user-info {
|
||||
font-size: 16px;
|
||||
color: red;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
.logout {
|
||||
font-size: 16px;
|
||||
color: red;
|
||||
padding: 0 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.title-menu {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.title-img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 22px;
|
||||
box-shadow: 0 1px 6px #444;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.title-name {
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
// .el-header .fr {
|
||||
// float: right;
|
||||
// }
|
||||
|
||||
// .el-header .fl {
|
||||
// float: left;
|
||||
// }
|
||||
|
||||
// .el-header {
|
||||
// width: 100%;
|
||||
// color: #333;
|
||||
// text-align: center;
|
||||
// line-height: 60px;
|
||||
// padding: 0;
|
||||
// z-index: 99;
|
||||
// }
|
||||
|
||||
// .logo {
|
||||
// width: 60px;
|
||||
// height: 60px;
|
||||
// margin-left: 70px;
|
||||
// }
|
||||
|
||||
// .avator {
|
||||
// width: 40px;
|
||||
// height: 40px;
|
||||
// background: #ffffff;
|
||||
// border-radius: 50%;
|
||||
// }
|
||||
|
||||
// .title {
|
||||
// color: #ffffff;
|
||||
// font-size: 20px;
|
||||
// font-weight: bold;
|
||||
// margin-left: 20px;
|
||||
// }
|
||||
</style>
|
@ -1,124 +0,0 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<bread-crumbs :title="title" class="bread-crumbs"></bread-crumbs>
|
||||
<router-view class="router-view"></router-view>
|
||||
</el-main>
|
||||
</template>
|
||||
<script>
|
||||
import menu from "@/utils/menu";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
role: "",
|
||||
currentIndex: -2,
|
||||
itemMenu: [],
|
||||
title: ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let menus = menu.list();
|
||||
this.menuList = menus;
|
||||
this.role = this.$storage.get("role");
|
||||
},
|
||||
methods: {
|
||||
menuHandler(menu) {
|
||||
this.$router.push({
|
||||
name: menu.tableName
|
||||
});
|
||||
this.title = menu.menu;
|
||||
},
|
||||
titleChange(index, menus) {
|
||||
this.currentIndex = index
|
||||
this.itemMenu = menus;
|
||||
console.log(menus);
|
||||
},
|
||||
homeChange(index) {
|
||||
this.itemMenu = [];
|
||||
this.title = ""
|
||||
this.currentIndex = index
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
});
|
||||
},
|
||||
centerChange(index) {
|
||||
this.itemMenu = [{
|
||||
"buttons": ["新增", "查看", "修改", "删除"],
|
||||
"menu": "修改密码",
|
||||
"tableName": "updatePassword"
|
||||
}, {
|
||||
"buttons": ["新增", "查看", "修改", "删除"],
|
||||
"menu": "个人信息",
|
||||
"tableName": "center"
|
||||
}];
|
||||
this.title = ""
|
||||
this.currentIndex = index
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
background: #00c292;
|
||||
}
|
||||
|
||||
.nav-list {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
margin-top: 20px;
|
||||
|
||||
.nav-title {
|
||||
display: inline-block;
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
padding: 15px 25px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.nav-title.active {
|
||||
color: #555;
|
||||
cursor: default;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
margin-top: 20px;
|
||||
background: #FFFFFF;
|
||||
padding: 15px 0;
|
||||
|
||||
.menu {
|
||||
padding: 15px 25px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-main {
|
||||
background-color: #F6F8FA;
|
||||
padding: 0 24px;
|
||||
// padding-top: 60px;
|
||||
}
|
||||
|
||||
.router-view {
|
||||
padding: 10px;
|
||||
margin-top: 10px;
|
||||
background: #FFFFFF;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.bread-crumbs {
|
||||
width: 100%;
|
||||
// border-bottom: 1px solid #e9eef3;
|
||||
// border-top: 1px solid #e9eef3;
|
||||
margin-top: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,17 @@
|
||||
const api = {
|
||||
// 积分订单
|
||||
orderpage: 'orders/page',
|
||||
orderdelete: 'orders/delete',
|
||||
orderinfo: 'orders/info/',
|
||||
ordersave: 'orders/save',
|
||||
orderupdate: 'orders/update',
|
||||
// 配置
|
||||
configpage: 'config/page',
|
||||
configdelete: 'config/delete',
|
||||
configinfo: 'config/info/',
|
||||
configsave: 'config/save',
|
||||
configupdate: 'config/update'
|
||||
|
||||
}
|
||||
|
||||
export default api
|
@ -0,0 +1,16 @@
|
||||
const base = {
|
||||
get() {
|
||||
return {
|
||||
url : "http://localhost:8080/shuiguozaixianxiaoshou/",
|
||||
name: "shuiguozaixianxiaoshou",
|
||||
// 退出到首页链接
|
||||
indexUrl: 'http://localhost:8080/shuiguozaixianxiaoshou/front/index.html'
|
||||
};
|
||||
},
|
||||
getProjectName(){
|
||||
return {
|
||||
projectName: "精品水果线上销售网站"
|
||||
}
|
||||
}
|
||||
}
|
||||
export default base
|
@ -0,0 +1,29 @@
|
||||
import axios from 'axios'
|
||||
import router from '@/router/router-static'
|
||||
import storage from '@/utils/storage'
|
||||
|
||||
const http = axios.create({
|
||||
timeout: 1000 * 86400,
|
||||
withCredentials: true,
|
||||
baseURL: '/shuiguozaixianxiaoshou',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8'
|
||||
}
|
||||
})
|
||||
// 请求拦截
|
||||
http.interceptors.request.use(config => {
|
||||
config.headers['Token'] = storage.get('Token') // 请求头带上token
|
||||
return config
|
||||
}, error => {
|
||||
return Promise.reject(error)
|
||||
})
|
||||
// 响应拦截
|
||||
http.interceptors.response.use(response => {
|
||||
if (response.data && response.data.code === 401) { // 401, token失效
|
||||
router.push({ name: 'login' })
|
||||
}
|
||||
return response
|
||||
}, error => {
|
||||
return Promise.reject(error)
|
||||
})
|
||||
export default http
|
@ -0,0 +1,12 @@
|
||||
// translate router.meta.title, be used in breadcrumb sidebar tagsview
|
||||
export function generateTitle(title) {
|
||||
const hasKey = this.$te('route.' + title)
|
||||
|
||||
if (hasKey) {
|
||||
// $t :this method from vue-i18n, inject in @/lang/index.js
|
||||
const translatedTitle = this.$t('route.' + title)
|
||||
|
||||
return translatedTitle
|
||||
}
|
||||
return title
|
||||
}
|
@ -0,0 +1,306 @@
|
||||
const menu = {
|
||||
list() {
|
||||
return [
|
||||
{
|
||||
"backMenu":[
|
||||
{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"删除",
|
||||
"修改"
|
||||
],
|
||||
"menu":"公告类型管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"dictionaryGonggao"
|
||||
}
|
||||
,
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"删除",
|
||||
"修改"
|
||||
],
|
||||
"menu":"商家信用类型管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"dictionaryShangjiaXingji"
|
||||
}
|
||||
,
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"删除",
|
||||
"修改"
|
||||
],
|
||||
"menu":"一级分类管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"dictionaryShuiguo"
|
||||
}
|
||||
],
|
||||
"menu":"基础数据管理"
|
||||
}
|
||||
,{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"修改",
|
||||
"删除"
|
||||
],
|
||||
"menu":"公告管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"gonggao"
|
||||
}
|
||||
],
|
||||
"menu":"公告管理"
|
||||
}
|
||||
,{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"修改",
|
||||
"删除"
|
||||
],
|
||||
"menu":"水果管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguo"
|
||||
}
|
||||
,
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"修改",
|
||||
"删除"
|
||||
],
|
||||
"menu":"水果评价管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguoCommentback"
|
||||
}
|
||||
,
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"删除"
|
||||
],
|
||||
"menu":"水果收藏管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguoCollection"
|
||||
}
|
||||
,
|
||||
{
|
||||
"buttons":[
|
||||
"订单",
|
||||
"查看",
|
||||
"删除"
|
||||
],
|
||||
"menu":"水果订单管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguoOrder"
|
||||
}
|
||||
],
|
||||
"menu":"水果管理"
|
||||
}
|
||||
,{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"修改",
|
||||
"删除"
|
||||
],
|
||||
"menu":"单页数据管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"singleSeach"
|
||||
}
|
||||
],
|
||||
"menu":"单页数据管理"
|
||||
}
|
||||
,{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"修改",
|
||||
"删除"
|
||||
],
|
||||
"menu":"用户管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"yonghu"
|
||||
}
|
||||
],
|
||||
"menu":"用户管理"
|
||||
}
|
||||
,{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"审核",
|
||||
"修改",
|
||||
"删除"
|
||||
],
|
||||
"menu":"商家管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shangjia"
|
||||
}
|
||||
],
|
||||
"menu":"商家管理"
|
||||
}
|
||||
,{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"修改",
|
||||
"删除"
|
||||
],
|
||||
"menu":"轮播图管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"config"
|
||||
}
|
||||
],
|
||||
"menu":"轮播图信息"
|
||||
}
|
||||
],
|
||||
"frontMenu":[],
|
||||
"hasBackLogin":"是",
|
||||
"hasBackRegister":"否",
|
||||
"hasFrontLogin":"否",
|
||||
"hasFrontRegister":"否",
|
||||
"roleName":"管理员",
|
||||
"tableName":"users"
|
||||
}
|
||||
,
|
||||
{
|
||||
"backMenu":[
|
||||
{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看"
|
||||
],
|
||||
"menu":"公告管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"gonggao"
|
||||
}
|
||||
],
|
||||
"menu":"公告管理"
|
||||
}
|
||||
,{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"新增",
|
||||
"修改",
|
||||
"删除"
|
||||
],
|
||||
"menu":"水果管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguo"
|
||||
}
|
||||
,
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"修改"
|
||||
],
|
||||
"menu":"水果评价管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguoCommentback"
|
||||
}
|
||||
,
|
||||
{
|
||||
"buttons":[
|
||||
"订单",
|
||||
"查看"
|
||||
],
|
||||
"menu":"水果订单管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguoOrder"
|
||||
}
|
||||
],
|
||||
"menu":"水果管理"
|
||||
}
|
||||
],
|
||||
"frontMenu":[],
|
||||
"hasBackLogin":"是",
|
||||
"hasBackRegister":"否",
|
||||
"hasFrontLogin":"否",
|
||||
"hasFrontRegister":"否",
|
||||
"roleName":"商家",
|
||||
"tableName":"shangjia"
|
||||
}
|
||||
,
|
||||
{
|
||||
"backMenu":[
|
||||
{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看"
|
||||
],
|
||||
"menu":"公告管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"gonggao"
|
||||
}
|
||||
],
|
||||
"menu":"公告管理"
|
||||
}
|
||||
,{
|
||||
"child":[
|
||||
{
|
||||
"buttons":[
|
||||
"查看"
|
||||
],
|
||||
"menu":"水果评价管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguoCommentback"
|
||||
}
|
||||
,
|
||||
{
|
||||
"buttons":[
|
||||
"查看",
|
||||
"删除"
|
||||
],
|
||||
"menu":"水果收藏管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguoCollection"
|
||||
}
|
||||
,
|
||||
{
|
||||
"buttons":[
|
||||
"订单",
|
||||
"查看"
|
||||
],
|
||||
"menu":"水果订单管理",
|
||||
"menuJump":"列表",
|
||||
"tableName":"shuiguoOrder"
|
||||
}
|
||||
],
|
||||
"menu":"水果管理"
|
||||
}
|
||||
],
|
||||
"frontMenu":[],
|
||||
"hasBackLogin":"是",
|
||||
"hasBackRegister":"否",
|
||||
"hasFrontLogin":"否",
|
||||
"hasFrontRegister":"否",
|
||||
"roleName":"用户",
|
||||
"tableName":"yonghu"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
export default menu;
|
@ -0,0 +1,18 @@
|
||||
const storage = {
|
||||
set(key, value) {
|
||||
localStorage.setItem(key, JSON.stringify(value));
|
||||
},
|
||||
get(key) {
|
||||
return localStorage.getItem(key)?localStorage.getItem(key).replace('"','').replace('"',''):"";
|
||||
},
|
||||
getObj(key) {
|
||||
return localStorage.getItem(key)?JSON.parse(localStorage.getItem(key)):null;
|
||||
},
|
||||
remove(key) {
|
||||
localStorage.removeItem(key);
|
||||
},
|
||||
clear() {
|
||||
localStorage.clear();
|
||||
}
|
||||
}
|
||||
export default storage;
|
@ -0,0 +1,94 @@
|
||||
/* 全局list页面按钮样式 */
|
||||
.slt {
|
||||
margin: 0 !important;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.ad {
|
||||
margin: 0 !important;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.pages {
|
||||
& /deep/ el-pagination__sizes{
|
||||
& /deep/ el-input__inner {
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.el-button+.el-button {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.tables {
|
||||
& /deep/ .el-button--success {
|
||||
height: 36px;
|
||||
color: rgba(40, 167, 69, 1);
|
||||
font-size: 10px;
|
||||
border-width: 0px;
|
||||
border-style: solid;
|
||||
border-color: #DCDFE6;
|
||||
border-radius: 0px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
& /deep/ .el-button--primary {
|
||||
height: 36px;
|
||||
color: rgba(255, 193, 7, 1);
|
||||
font-size: 10px;
|
||||
border-width: 0px;
|
||||
border-style: solid;
|
||||
border-color: #DCDFE6;
|
||||
border-radius: 0px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
& /deep/ .el-button--danger {
|
||||
height: 36px;
|
||||
color: rgba(220, 53, 69, 1);
|
||||
font-size: 10px;
|
||||
border-width: 0px;
|
||||
border-style: solid;
|
||||
border-color: #DCDFE6;
|
||||
border-radius: 0px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
& /deep/ .el-button {
|
||||
margin: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 全局add-or-update页面按钮样式 */
|
||||
.editor{
|
||||
height: 500px;
|
||||
|
||||
& /deep/ .ql-container {
|
||||
height: 310px;
|
||||
}
|
||||
}
|
||||
.amap-wrapper {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
.search-box {
|
||||
position: absolute;
|
||||
}
|
||||
.addEdit-block {
|
||||
margin: -10px;
|
||||
}
|
||||
.detail-form-content {
|
||||
padding: 12px;
|
||||
}
|
||||
.btn .el-button {
|
||||
padding: 0;
|
||||
}
|
||||
/*IndexMain.vue页面 list页面样式
|
||||
//背景颜色
|
||||
.el-main
|
||||
//list页面的边框颜色
|
||||
.router-view
|
||||
*/
|
@ -0,0 +1,9 @@
|
||||
const style = {
|
||||
listStyle(){
|
||||
return {"searchBtnFontColor":"rgba(106, 0, 138, 1)","pagePosition":"1","inputFontSize":"14px","inputBorderRadius":"0px","tableBtnDelFontColor":"rgba(88, 179, 81, 1)","tableBtnIconPosition":"1","searchBtnHeight":"40px","inputIconColor":"rgba(88, 179, 81, 1)","searchBtnBorderRadius":"4px","tableStripe":true,"btnAdAllWarnFontColor":"rgba(88, 179, 81, 1)","tableBtnDelBgColor":"#fff","searchBtnIcon":"1","tableSize":"mini","searchBtnBorderStyle":"solid","tableSelection":false,"searchBtnBorderWidth":"2px","tableContentFontSize":"14px","searchBtnBgColor":"#fff","inputTitleSize":"14px","btnAdAllBorderColor":"rgba(88, 179, 81, 1)","pageJumper":true,"btnAdAllIconPosition":"1","searchBoxPosition":"3","tableBtnDetailFontColor":"rgba(88, 179, 81, 1)","tableBtnHeight":"30px","pagePager":true,"searchBtnBorderColor":"rgba(88, 179, 81, 1)","tableHeaderFontColor":"rgba(255, 255, 255, 1)","inputTitle":"1","tableBtnBorderRadius":"0px","btnAdAllFont":"1","btnAdAllDelFontColor":"rgba(88, 179, 81, 1)","tableBtnIcon":"1","btnAdAllHeight":"40px","btnAdAllWarnBgColor":"#fff","btnAdAllBorderWidth":"2px","tableStripeFontColor":"#606266","tableBtnBorderStyle":"none none solid none","inputHeight":"40px","btnAdAllBorderRadius":"4px","btnAdAllDelBgColor":"#fff","pagePrevNext":true,"btnAdAllAddBgColor":"rgba(250, 212, 0, 1)","searchBtnFont":"1","tableIndex":true,"btnAdAllIcon":"1","tableSortable":false,"pageSizes":true,"tableFit":true,"pageBtnBG":true,"searchBtnFontSize":"14px","tableBtnEditBgColor":"#fff","inputBorderWidth":"1px","inputFontPosition":"1","inputFontColor":"rgba(88, 179, 81, 1)","pageEachNum":10,"tableHeaderBgColor":"rgba(88, 179, 81, 1)","inputTitleColor":"rgba(88, 179, 81, 1)","btnAdAllBoxPosition":"1","tableBtnDetailBgColor":"#fff","inputIcon":"1","searchBtnIconPosition":"1","btnAdAllFontSize":"10px","inputBorderStyle":"none none solid none ","inputBgColor":"#fff","pageStyle":false,"pageTotal":true,"btnAdAllAddFontColor":"rgba(88, 179, 81, 1)","tableBtnFont":"1","tableContentFontColor":"#606266","inputBorderColor":"rgba(88, 179, 81, 1)","tableShowHeader":true,"tableBtnFontSize":"12px","tableBtnBorderColor":"rgba(88, 179, 81, 1)","inputIconPosition":"2","tableBorder":true,"btnAdAllBorderStyle":"solid","tableBtnBorderWidth":"1px","tableStripeBgColor":"rgba(227, 225, 225, 1)","tableBtnEditFontColor":"rgba(88, 179, 81, 1)","tableAlign":"left"}
|
||||
},
|
||||
addStyle(){
|
||||
return {"btnSaveFontColor":"#fff","selectFontSize":"14px","btnCancelBorderColor":"#DCDFE6","inputBorderRadius":"4px","inputFontSize":"14px","textareaBgColor":"#fff","btnSaveFontSize":"14px","textareaBorderRadius":"4px","uploadBgColor":"#fff","textareaBorderStyle":"solid","btnCancelWidth":"88px","textareaHeight":"120px","dateBgColor":"#fff","btnSaveBorderRadius":"4px","uploadLableFontSize":"14px","textareaBorderWidth":"1px","inputLableColor":"rgba(199, 21, 133, 1)","addEditBoxColor":"rgba(242, 241, 242, 1)","dateIconFontSize":"14px","btnSaveBgColor":"rgba(199, 21, 133, 1)","uploadIconFontColor":"#8c939d","textareaBorderColor":"#DCDFE6","btnCancelBgColor":"rgba(253, 252, 254, 1)","selectLableColor":"rgba(199, 21, 133, 1)","btnSaveBorderStyle":"solid","dateBorderWidth":"1px","dateLableFontSize":"14px","dateBorderRadius":"4px","btnCancelBorderStyle":"solid","selectLableFontSize":"14px","selectBorderStyle":"solid","selectIconFontColor":"#C0C4CC","btnCancelHeight":"44px","inputHeight":"40px","btnCancelFontColor":"rgba(106, 0, 138, 1)","dateBorderColor":"#DCDFE6","dateIconFontColor":"#C0C4CC","uploadBorderStyle":"solid","dateBorderStyle":"solid","dateLableColor":"rgba(199, 21, 133, 1)","dateFontSize":"14px","inputBorderWidth":"1px","uploadIconFontSize":"28px","selectHeight":"40px","inputFontColor":"#606266","uploadHeight":"148px","textareaLableColor":"rgba(199, 21, 133, 1)","textareaLableFontSize":"14px","btnCancelFontSize":"14px","inputBorderStyle":"solid","btnCancelBorderRadius":"4px","inputBgColor":"#fff","inputLableFontSize":"14px","uploadLableColor":"rgba(199, 21, 133, 1)","uploadBorderRadius":"4px","btnSaveHeight":"44px","selectBgColor":"rgba(255, 255, 255, 1)","btnSaveWidth":"88px","selectIconFontSize":"14px","dateHeight":"40px","selectBorderColor":"#DCDFE6","inputBorderColor":"#DCDFE6","uploadBorderColor":"#DCDFE6","textareaFontColor":"#606266","selectBorderWidth":"1px","dateFontColor":"#606266","btnCancelBorderWidth":"1px","uploadBorderWidth":"1px","textareaFontSize":"14px","selectBorderRadius":"4px","selectFontColor":"rgba(10, 10, 10, 1)","btnSaveBorderColor":"#409EFF","btnSaveBorderWidth":"0px"}
|
||||
}
|
||||
}
|
||||
export default style;
|
@ -1,53 +0,0 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
|
||||
<div class="text main-text">欢迎使用 {{this.$project.projectName}}</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import router from '@/router/router-static'
|
||||
export default {
|
||||
mounted(){
|
||||
this.init();
|
||||
},
|
||||
methods:{
|
||||
init(){
|
||||
if(this.$storage.get('Token')){
|
||||
this.$http({
|
||||
url: `${this.$storage.get('sessionTable')}/session`,
|
||||
method: "get"
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code != 0) {
|
||||
router.push({ name: 'login' })
|
||||
}
|
||||
});
|
||||
}else{
|
||||
router.push({ name: 'login' })
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 500px;
|
||||
text-align: center;
|
||||
.main-text{
|
||||
font-size: 38px;
|
||||
font-weight: bold;
|
||||
margin-top: 15%;
|
||||
}
|
||||
.text {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,43 +0,0 @@
|
||||
<template>
|
||||
<svg :class="svgClass" aria-hidden="true" v-on="$listeners">
|
||||
<use :xlink:href="iconName" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SvgIcon',
|
||||
props: {
|
||||
iconClass: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iconName() {
|
||||
return `#icon-${this.iconClass}`
|
||||
},
|
||||
svgClass() {
|
||||
if (this.className) {
|
||||
return 'svg-icon ' + this.className
|
||||
} else {
|
||||
return 'svg-icon'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.svg-icon {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
@ -1,398 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="container loginIn" style="backgroundImage: url(/shuiguozaixianxiaoshou/img/back-img-bg.jpg)">
|
||||
|
||||
<div :class="2 == 1 ? 'left' : 2 == 2 ? 'left center' : 'left right'" style="backgroundColor: rgba(74, 204, 64, 0.25)">
|
||||
<el-form class="login-form" label-position="left" :label-width="2 == 3 ? '56px' : '0px'">
|
||||
<div class="title-container"><h3 class="title" style="color: rgba(248, 243, 246, 1)">精品水果线上销售网站</h3></div>
|
||||
<el-form-item :label="2 == 3 ? '用户名' : ''" :class="'style'+2">
|
||||
<span v-if="2 != 3" class="svg-container" style="color:rgba(255, 255, 255, 1);line-height:44px"><svg-icon icon-class="user" /></span>
|
||||
<el-input placeholder="请输入用户名" name="username" type="text" v-model="rulesForm.username" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="2 == 3 ? '密码':''" :class="'style'+2">
|
||||
<span v-if="2 != 3" class="svg-container" style="color:rgba(255, 255, 255, 1);line-height:44px"><svg-icon icon-class="password" /></span>
|
||||
<el-input placeholder="请输入密码" name="password" type="password" v-model="rulesForm.password" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="0 == '1'" class="code" :label="2 == 3 ? '验证码' : ''" :class="'style'+2">
|
||||
<span v-if="2 != 3" class="svg-container" style="color:rgba(255, 255, 255, 1);line-height:44px"><svg-icon icon-class="code" /></span>
|
||||
<el-input placeholder="请输入验证码" name="code" type="text" v-model="rulesForm.code" />
|
||||
<div class="getCodeBt" @click="getRandCode(4)" style="height:44px;line-height:44px">
|
||||
<span v-for="(item, index) in codes" :key="index" :style="{color:item.color,transform:item.rotate,fontSize:item.size}">{{ item.num }}</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="loginInRole" class="role">
|
||||
<el-radio
|
||||
v-for="item in menus"
|
||||
v-if="item.hasBackLogin=='是'"
|
||||
v-bind:key="item.roleName"
|
||||
v-model="rulesForm.role"
|
||||
:label="item.roleName"
|
||||
>{{item.roleName}}</el-radio>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="login()" class="loginInBt" style="padding:0;font-size:16px;border-radius:4px;height:44px;line-height:44px;width:100%;backgroundColor:rgba(88, 179, 81, 1); borderColor:rgba(88, 179, 81, 1); color:rgba(255, 255, 255, 1)">{{'1' == '1' ? '登录' : 'login'}}</el-button>
|
||||
<el-form-item class="setting">
|
||||
<div style="color:rgba(248, 245, 245, 1)" class="register" @click="register('yonghu')">用户注册</div>
|
||||
<div style="color:rgba(248, 245, 245, 1)" class="register" @click="register('shangjia')">商家注册</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import menu from "@/utils/menu";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rulesForm: {
|
||||
username: "",
|
||||
password: "",
|
||||
role: "",
|
||||
code: '',
|
||||
},
|
||||
menus: [],
|
||||
tableName: "",
|
||||
codes: [{
|
||||
num: 1,
|
||||
color: '#000',
|
||||
rotate: '10deg',
|
||||
size: '16px'
|
||||
},{
|
||||
num: 2,
|
||||
color: '#000',
|
||||
rotate: '10deg',
|
||||
size: '16px'
|
||||
},{
|
||||
num: 3,
|
||||
color: '#000',
|
||||
rotate: '10deg',
|
||||
size: '16px'
|
||||
},{
|
||||
num: 4,
|
||||
color: '#000',
|
||||
rotate: '10deg',
|
||||
size: '16px'
|
||||
}],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let menus = menu.list();
|
||||
this.menus = menus;
|
||||
},
|
||||
created() {
|
||||
this.setInputColor()
|
||||
this.getRandCode()
|
||||
},
|
||||
methods: {
|
||||
setInputColor(){
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.loginIn .el-input__inner').forEach(el=>{
|
||||
el.style.backgroundColor = "rgba(255, 255, 255, 1)"
|
||||
el.style.color = "rgba(51, 51, 51, 1)"
|
||||
el.style.height = "44px"
|
||||
el.style.lineHeight = "44px"
|
||||
el.style.borderRadius = "4px"
|
||||
})
|
||||
document.querySelectorAll('.loginIn .style3 .el-form-item__label').forEach(el=>{
|
||||
el.style.height = "44px"
|
||||
el.style.lineHeight = "44px"
|
||||
})
|
||||
document.querySelectorAll('.loginIn .el-form-item__label').forEach(el=>{
|
||||
el.style.color = "rgba(255, 255, 255, 1)"
|
||||
})
|
||||
setTimeout(()=>{
|
||||
document.querySelectorAll('.loginIn .role .el-radio__label').forEach(el=>{
|
||||
el.style.color = "#fff"
|
||||
})
|
||||
},350)
|
||||
})
|
||||
|
||||
},
|
||||
register(tableName){
|
||||
this.$storage.set("loginTable", tableName);
|
||||
this.$router.push({path:'/register'})
|
||||
},
|
||||
// 登陆
|
||||
login() {
|
||||
let code = ''
|
||||
for(let i in this.codes) {
|
||||
code += this.codes[i].num
|
||||
}
|
||||
if ('0' == '1' && !this.rulesForm.code) {
|
||||
this.$message.error("请输入验证码");
|
||||
return;
|
||||
}
|
||||
if ('0' == '1' && this.rulesForm.code.toLowerCase() != code.toLowerCase()) {
|
||||
this.$message.error("验证码输入有误");
|
||||
this.getRandCode()
|
||||
return;
|
||||
}
|
||||
if (!this.rulesForm.username) {
|
||||
this.$message.error("请输入用户名");
|
||||
return;
|
||||
}
|
||||
if (!this.rulesForm.password) {
|
||||
this.$message.error("请输入密码");
|
||||
return;
|
||||
}
|
||||
if (!this.rulesForm.role) {
|
||||
this.$message.error("请选择角色");
|
||||
return;
|
||||
}
|
||||
let menus = this.menus;
|
||||
for (let i = 0; i < menus.length; i++) {
|
||||
if (menus[i].roleName == this.rulesForm.role) {
|
||||
this.tableName = menus[i].tableName;
|
||||
}
|
||||
}
|
||||
this.$http({
|
||||
url: `${this.tableName}/login?username=${this.rulesForm.username}&password=${this.rulesForm.password}`,
|
||||
method: "post"
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$storage.set("Token", data.token);
|
||||
this.$storage.set("userId", data.userId);
|
||||
this.$storage.set("role", this.rulesForm.role);
|
||||
this.$storage.set("sessionTable", this.tableName);
|
||||
this.$storage.set("adminName", this.rulesForm.username);
|
||||
this.$router.replace({ path: "/index/" });
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
getRandCode(len = 4){
|
||||
this.randomString(len)
|
||||
},
|
||||
randomString(len = 4) {
|
||||
let chars = [
|
||||
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
|
||||
"l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
|
||||
"w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G",
|
||||
"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
|
||||
"S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2",
|
||||
"3", "4", "5", "6", "7", "8", "9"
|
||||
]
|
||||
let colors = ["0", "1", "2","3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]
|
||||
let sizes = ['14', '15', '16', '17', '18']
|
||||
|
||||
let output = [];
|
||||
for (let i = 0; i < len; i++) {
|
||||
// 随机验证码
|
||||
let key = Math.floor(Math.random()*chars.length)
|
||||
this.codes[i].num = chars[key]
|
||||
// 随机验证码颜色
|
||||
let code = '#'
|
||||
for (let j = 0; j < 6; j++) {
|
||||
let key = Math.floor(Math.random()*colors.length)
|
||||
code += colors[key]
|
||||
}
|
||||
this.codes[i].color = code
|
||||
// 随机验证码方向
|
||||
let rotate = Math.floor(Math.random()*60)
|
||||
let plus = Math.floor(Math.random()*2)
|
||||
if(plus == 1) rotate = '-'+rotate
|
||||
this.codes[i].rotate = 'rotate('+rotate+'deg)'
|
||||
// 随机验证码字体大小
|
||||
let size = Math.floor(Math.random()*sizes.length)
|
||||
this.codes[i].size = sizes[size]+'px'
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.loginIn {
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
|
||||
.left {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 360px;
|
||||
height: 100%;
|
||||
|
||||
.login-form {
|
||||
background-color: transparent;
|
||||
width: 100%;
|
||||
right: inherit;
|
||||
padding: 0 12px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.title-container {
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
|
||||
.title {
|
||||
margin: 20px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
position: relative;
|
||||
|
||||
.svg-container {
|
||||
padding: 6px 5px 6px 15px;
|
||||
color: #889aa4;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
padding: 0;
|
||||
line-height: 40px;
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
display: inline-block;
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
|
||||
& /deep/ input {
|
||||
background: transparent;
|
||||
border: 0px;
|
||||
-webkit-appearance: none;
|
||||
padding: 0 15px 0 30px;
|
||||
color: #fff;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.center {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 360px;
|
||||
transform: translate3d(-50%,-50%,0);
|
||||
height: 446px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.right {
|
||||
position: absolute;
|
||||
left: inherit;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 360px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.code {
|
||||
.el-form-item__content {
|
||||
position: relative;
|
||||
|
||||
.getCodeBt {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
line-height: 40px;
|
||||
width: 100px;
|
||||
background-color: rgba(51,51,51,0.4);
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 0 4px 4px 0;
|
||||
height: 40px;
|
||||
overflow: hidden;
|
||||
|
||||
span {
|
||||
padding: 0 5px;
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.el-input {
|
||||
& /deep/ input {
|
||||
padding: 0 130px 0 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting {
|
||||
& /deep/ .el-form-item__content {
|
||||
padding: 0 15px;
|
||||
box-sizing: border-box;
|
||||
line-height: 32px;
|
||||
height: 32px;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
margin: 0 !important;
|
||||
|
||||
.register {
|
||||
float: left;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.reset {
|
||||
float: right;
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.style2 {
|
||||
padding-left: 30px;
|
||||
|
||||
.svg-container {
|
||||
left: -30px !important;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
& /deep/ input {
|
||||
padding: 0 15px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.code.style2, .code.style3 {
|
||||
.el-input {
|
||||
& /deep/ input {
|
||||
padding: 0 115px 0 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.style3 {
|
||||
& /deep/ .el-form-item__label {
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
& /deep/ input {
|
||||
padding: 0 15px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.role {
|
||||
& /deep/ .el-form-item__label {
|
||||
width: 56px !important;
|
||||
}
|
||||
|
||||
& /deep/ .el-radio {
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
@ -1,118 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form
|
||||
class="detail-form-content"
|
||||
ref="ruleForm"
|
||||
:rules="rules"
|
||||
:model="ruleForm"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="原密码" prop="password">
|
||||
<el-input v-model="ruleForm.password" show-password></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码" prop="newpassword">
|
||||
<el-input type="password" v-model="ruleForm.newpassword" show-password></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="repassword">
|
||||
<el-input type="password" v-model="ruleForm.repassword" show-password></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onUpdateHandler">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
ruleForm: {},
|
||||
user: {},
|
||||
rules: {
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
message: "密码不能为空",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
newpassword: [
|
||||
{
|
||||
required: true,
|
||||
message: "新密码不能为空",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
repassword: [
|
||||
{
|
||||
required: true,
|
||||
message: "确认密码不能为空",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$http({
|
||||
url: `${this.$storage.get("sessionTable")}/session`,
|
||||
method: "get"
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.user = data.data;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
onLogout() {
|
||||
this.$storage.remove("Token");
|
||||
this.$router.replace({ name: "login" });
|
||||
},
|
||||
// 修改密码
|
||||
onUpdateHandler() {
|
||||
this.$refs["ruleForm"].validate(valid => {
|
||||
if (valid) {
|
||||
var password = "";
|
||||
if (this.user.mima) {
|
||||
password = this.user.mima;
|
||||
} else if (this.user.password) {
|
||||
password = this.user.password;
|
||||
}
|
||||
if (this.ruleForm.password != password) {
|
||||
this.$message.error("原密码错误");
|
||||
return;
|
||||
}
|
||||
if (this.ruleForm.newpassword != this.ruleForm.repassword) {
|
||||
this.$message.error("两次密码输入不一致");
|
||||
return;
|
||||
}
|
||||
this.user.password = this.ruleForm.newpassword;
|
||||
this.user.mima = this.ruleForm.newpassword;
|
||||
this.$http({
|
||||
url: `${this.$storage.get("sessionTable")}/update`,
|
||||
method: "post",
|
||||
data: this.user
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "修改密码成功,下次登录系统生效",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
Loading…
Reference in new issue