Commit fe31abee authored by xulili's avatar xulili

登录

parent 3f0ad157
<template> <template>
<div id="app"> <div id="app">
<top-bar></top-bar> <top-bar v-if="!$route.meta.noShowbar"></top-bar>
<breadcrumb v-if="$route.meta.showBreadcrumb"></breadcrumb> <breadcrumb v-if="$route.meta.showBreadcrumb"></breadcrumb>
<!-- <div :class="'appContent' {}"> --> <!-- <div :class="'appContent' {}"> -->
<div v-bind:class="[{ hasBread: $route.meta.showBreadcrumb }, 'appContent']"> <div v-bind:class="[{ hasBread: $route.meta.showBreadcrumb }, 'appContent']">
......
This image diff could not be displayed because it is too large. You can view the blob instead.
<template> <template>
<div id="backlogin"> <div id="backlogin">
<div class="content"> <div class="content">
<h1>虚拟营业厅管理平台</h1> <div class="page-title">
<h3>账户密码登录</h3> <p>中国国家博物馆建党百年展</p>
<el-form id="form" :model="loginForm" :rules="rules" ref="loginForm"> <p>点播院线服务平台</p>
</div>
<el-form id="form" :model="form" :rules="rules" ref="loginForm">
<el-form-item prop="username"> <el-form-item prop="username">
<div class="line"> <el-input
<img src="../../../static/images/icon/username.png" alt=""> v-model="form.username"
<input type="text" placeholder="账户" v-model="loginForm.username" autofocus clearable> type="text"
</div> placeholder="请输入用户名"
autofocus
clearable
>
<i class="icon-username icon-prefix" slot="prefix"> </i>
</el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<div class="line"> <el-input
<img src="../../../static/images/icon/password.png" alt=""> v-model="form.password"
<input type="password" placeholder="密码" v-model="loginForm.password" @keyup.enter="submitForm" clearable> type="password"
</div> placeholder="请输入密码"
autofocus
clearable
>
<i class="icon-pwd icon-prefix" slot="prefix"> </i>
</el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<div class="line"> <el-button
<img src="../../../static/images/icon/verifyCode.png" alt=""> class="login"
<input placeholder="验证码" v-model="loginForm.captcha" clearable> :disabled="flag"
<img :src="verifyCodeImg" alt="" class="verifyCodeImg"> type="submit"
<img src="../../../static/images/icon/refresh.png" alt="" class="verfyRefesh" @click="getVerifyCode"> @click="submitForm"
</div> >
</el-form-item> 登录
<el-form-item prop="rem"> </el-button>
<!--<el-checkbox v-model="checked">自动登录</el-checkbox>-->
<router-link to="/forgetPassword" class="forget-password r-float"><span>忘记密码</span></router-link>
</el-form-item>
<el-form-item>
<el-button class="login" :disabled="flag" type="submit" @click="submitForm">登录</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -37,273 +44,201 @@ ...@@ -37,273 +44,201 @@
</template> </template>
<script> <script>
import { baseUrl } from '@/config/env' import { baseUrl } from "@/config/env";
import axios from 'axios' import axios from "axios";
let i = 0; let i = 0;
export default { export default {
data() { data() {
return { return {
checked: '', form: {
loginForm: { username: "",
username: '', password: "",
password: '',
captcha:'',
},
CaptchaId:'',
verifyCodeImg:'',
rules: {
username: [
{required: true, message: '请输入用户名', trigger: 'blur,change'},
],
password: [
{required: true, message: '请输入密码', trigger: 'blur,change'}
]
},
flag:false,
}
},
mounted() {
this.initLogin();
// 获取验证码
this.getVerifyCode()
},
methods: {
getVerifyCode(){
axios({
method: 'get',
// url:'http://localhost:3001/api/verifyCode',
url:`${baseUrl}verifyCode1`,
responseType: 'arraybuffer'
}).then(res => {
this.CaptchaId = res.headers['captchaid'] || ''
this.verifyCodeImg = this.getUserPhoto(res)
})
}, },
getUserPhoto(res){ rules: {
let uInt8Array = new Uint8Array(res.data); username: [
let len = uInt8Array.length; { required: true, message: "请输入用户名", trigger: "blur,change" },
let binaryString = new Array(len); ],
while (len--) { password: [
binaryString[len] = String.fromCharCode(uInt8Array[len]); { required: true, message: "请输入密码", trigger: "blur,change" },
} ],
let data = window.btoa(binaryString.join(''));
let imageType = 'image/jpeg';
let imageUrl = "data:" + imageType + ";base64," + data
return imageUrl
}, },
initLogout() { flag: false,
let vm = this; };
let loginDate = vm.$qs.stringify({ },
username: vm.loginForm.username, mounted() {},
password: vm.loginForm.password, methods: {
captcha: vm.loginForm.captcha submitForm() {
}); let _this = this;
let headers = { this.$refs.loginForm.validate((valid) => {
CaptchaId: this.CaptchaId if (valid) {
} _this.flag = true;
vm.$https({ let requestParams = {};
method: 'post', requestParams.username = _this.form.username;
url: 'ajaxLogin', requestParams.password = _this.form.password;
authType: this.token, let params = this.$qs.stringify(requestParams);
headers:headers _this
}, loginDate, '' , '' ).then((res) => { .$https(
if (res.data.status === 201 || res.data.status === 200) { {
localStorage.setItem("checked", this.checked); method: "post",
/*自动登录状态*/ url: "ajaxLogin",
localStorage.setItem('userId', res.data.employee.id); },
/*登录用户*/ params
localStorage.setItem("backToken", res.data.token); )
/*登录用户token签名*/ .then((res) => {
if (!res.data.employee.avatar || res.data.employee.avatar == "") { _this.flag = false;
res.data.employee.avatar = "./static/images/pic/usericon.png"; if (res.status == 200) {
} let resData = res.data;
localStorage.setItem("bankBranchName", res.data.employee.bankBranchName); /*网点名称*/ if (resData.resultCode == 200) {
localStorage.setItem("roleId", res.data.employee.roleId); /*角色id*/ _this.$message({
localStorage.setItem('roleName', res.data.employee.roleName); /*角色名*/ type: "success",
localStorage.setItem("avatar", res.data.employee.avatar); /*头像*/ message: resData.message,
localStorage.setItem("username", res.data.employee.username); /*用户名*/ });
localStorage.setItem("bankBranchId", res.data.employee.bankBranchId); /*网点ID*/ localStorage.setItem("user", resData.user.userName);
localStorage.setItem("menuList", JSON.stringify(res.data.menuList)); /*菜单*/ localStorage.setItem("backToken", resData.token);
vm.$message({ _this.$router.push("index");
type: 'success', } else {
message: res.data.message _this.$message.error(res.data.message);
}); }
setTimeout(function () { } else {
vm.$router.push('/indexPage'); _this.$message.error(res.data.message);
vm.flag = false; }
}, 1000);
} else {
i = i+1;
vm.$message({
type: 'error',
message: res.data.message,
// message: '用户名或密码错误',
}) })
if (i >= 3) { .catch((error) => {
vm.$router.push('/forgetPassword'); _this.$message.error(error.message);
i = 0; });
return false;
}
this.flag = false;
this.getVerifyCode()
}
}).catch(function (err) {
this.flag = false;
console.log(err);
})
},
submitForm() {
this.$refs.loginForm.validate((valid) => {
if (valid) {
if(!this.flag) {
this.flag = true;
this.initLogout();
}
} else {
this.flag = false;
return false;
}
})
},
initLogin() {
let checked = localStorage.getItem('checked');
if (checked == 'true') {
this.checked = true;
this.autoLogin();
} else { } else {
this.checked = false; this.flag = false;
} return false;
},
autoLogin() {
let _this = this;
let backToken = localStorage.getItem('backToken');
if (backToken) {
this.$router.push('/indexPage');
_this.$https({
method: 'get',
url: 'public/authToken',
authType: this.backToken
}).then((res) => {
if (res.data.status == 200) {
_this.$router.push('/indexPage')
}
}, (error) => {
console.log(error)
}
)
} }
} });
} },
} },
};
</script> </script>
<style lang="less" scoped>
<style lang="less"> #backlogin {
@import '../../style/common'; position: absolute;
left: 0;
#backlogin { top: 0;
width: 100%; width: 100vw;
height: 100%; height: 100vh;
background: url("../../../static/images/pic/bg.png"); background: url("~@/assets/login/login_bg.png") no-repeat center/ 100% 100%;
overflow: hidden; .content {
.content { width: 33.33%;
width: 360px; height: 100vh;
height: 393px; background-color: @party-white;
margin: 10% auto; position: absolute;
h1 { right: 13.5%;
font-size: 36px; box-shadow: 0 0 20px 8px rgba(0, 0, 0, 0.2);
font-weight: 600; &:before,
&::after {
display: inline-block;
content: "";
width: 100%;
height: auto;
}
&:before {
height: 100px;
background: url("~@/assets/login/login_top01.png") no-repeat center/ 100%
100%;
}
&:after {
height: 130px;
position: absolute;
bottom: 0;
left: 0;
background: url("~@/assets/login/login_bt01.png") no-repeat center/ 100%
100%;
}
.page-title {
margin-top: 140px;
p {
text-align: center; text-align: center;
color: rgba(24, 144, 255, 1); font-weight: bold;
font-family: SourceHanSansCN-Bold; font-size: 44px;
} color: @font-color;
h3 { letter-spacing: 0;
font-size: 20px;
font-weight: 500;
color: rgba(0, 0, 0, 1);
margin: 8% 0% 5%;
text-align: center; text-align: center;
line-height: 66px;
margin: 0;
padding: 0;
} }
.el-form { }
padding: 0px 10%; .icon-prefix {
.line { display: inline-block;
width: 100%; width: 24px;
height: 100%; height: 24px;
border-radius: 4px; }
border: 1px solid rgba(217, 217, 217, 1); .icon-username {
background: #fff; background: url("~@/assets/login/user.png") no-repeat center/ 100%;
input { }
margin-left: 10px; .icon-pwd {
height: 100%; background: url("~@/assets/login/pwd.png") no-repeat center/ 100%;
width: 85%; }
font-size: 18px; /deep/.el-form {
background: transparent; margin-top: 120px;
border: none; text-align: center;
} .el-form-item {
margin-bottom: 60px;
::-webkit-input-placeholder { /* WebKit browsers */ }
font-size: 12px; .el-input {
color: rgba(192, 196, 204, 1); width: 320px;
} height: 48px;
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ .el-input__inner {
font-size: 12px; height: 48px;
color: rgba(192, 196, 204, 1); line-height: 48px;
} background-color: @party-bg-gray;
::-moz-placeholder { /* Mozilla Firefox 19+ */ border-color: @party-bg-gray;
font-size: 12px; padding-left: 68px;
color: rgba(192, 196, 204, 1); font-size: 18px;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
font-size: 12px;
color: rgba(192, 196, 204, 1);
}
img {
float: left;
width: 16px;
height: 16px;
margin: 10px 0 0 6px;
}
.verifyCodeImg{
position: absolute;
right: -160px;
top: -8px;
width: 150px;
height: 40px;
}
.verfyRefesh{
position: absolute;
right: -200px;
width: 22px;
height: 22px;
cursor: pointer;
}
}
input {
width: 100%;
height: 40px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
border: 1px solid rgba(217, 217, 217, 1);
} }
.forget-password { .el-input__prefix {
font-size: 14px; left: 20px;
font-weight: 400; padding-top: 12px;
color: rgba(24, 144, 255, 1) !important;
} }
} }
.el-button { .el-button.login {
width: 100%; width: 320px;
height: 40px; height: 48px;
background: rgba(24, 144, 255, 1); background: #a4151d;
border-radius: 4px; border-radius: 4px;
color: #fff; color: @party-white;
margin-top: 20px;
span {
font-size: 18px;
font-weight: bold;
}
&:hover {
opacity: 0.8;
}
} }
} }
} }
}
@media (min-width: 1301px) and (max-width: 1600px) {
#backlogin .content {
.page-title {
margin-top: 50px;
p {
font-size: 30px;
}
}
.el-form {
margin-top: 50px;
}
}
}
@media screen and (max-width: 1300px) {
#backlogin .content {
.page-title {
margin-top: 20px;
p {
font-size: 24px;
}
}
.el-form {
margin-top: 50px;
}
}
}
</style> </style>
<template> <template>
<div class="top-bar"> <div class="top-bar">
<div class="top-bar-left"> <div class="top-bar-left">
<div class="logo"></div> <div class="logo"></div>
<span class="title f24">中国国家博物馆建党百年展点播院线服务平台</span> <span class="title f24">中国国家博物馆建党百年展点播院线服务平台</span>
</div> </div>
<div class="top-bar-right"> <div class="top-bar-right">
<div class="avatar"></div> <!-- <div class="avatar"></div> -->
<div class="user-name f16 ">{{userName}}</div> <div class="user-name f16">Hello, {{ userName }}</div>
<div class="line"></div> <div class="line"></div>
<div class="login-out"></div> <div class="login-out" @click="logout()"></div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default {
export default{ data() {
data() { return {
return{ userName: localStorage.getItem("user"),
userName:'admin,北京市政府' };
} },
mounted() {},
methods: {
logout() {
this.$confirm("确认退出吗?")
.then((_) => {
this.handleLogout();
})
.catch((_) => {});
}, },
mounted(){ handleLogout() {
let _this = this;
_this
.$https( {
method: "get",
url: "logout",
authType:'back'
} )
.then((res) => {
if (res.status == 200) {
let resData = res.data;
if (resData.resultCode == 200) {
_this.$message({
type: "success",
message: resData.message,
});
localStorage.removeItem("user");
localStorage.removeItem("backToken");
_this.$router.push("login");
} else {
_this.$message.error(res.data.message);
}
} else {
_this.$message.error(res.data.message);
}
})
.catch((err) => {
_this.$message.error(error.message);
});
}, },
methods:{ },
};
}
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.top-bar{ .top-bar {
background-color: @party-red; background-color: @party-red;
width: 100%; width: 100%;
height: 76px; height: 76px;
line-height: 76px; line-height: 76px;
padding:0 30px; padding: 0 30px;
overflow:hidden; overflow: hidden;
.top-bar-left{ .top-bar-left {
float: left; float: left;
.logo{ .logo {
width: 46px; width: 46px;
height: 36px; height: 36px;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
background-color: pink; background: url("~@/assets/login/logo.png") no-repeat center/100% 100%;
} }
.title{ .title {
color: @party-white; color: @party-white;
vertical-align: middle; vertical-align: middle;
padding-left: 16px; padding-left: 16px;
} }
}
.top-bar-right {
float: right;
> * {
display: inline-block;
vertical-align: middle;
}
.avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background-color: pink;
}
.user-name {
font-size: 16px;
line-height: 16px;
color: @party-white;
}
.line {
width: 2px;
height: 18px;
background-color: @party-white;
margin: 0 15px;
} }
.top-bar-right{ .login-out {
float: right; width: 20px;
> *{ height: 20px;
display: inline-block; background: url("~@/assets/login/logout.png") no-repeat center/100% 100%;
vertical-align: middle; cursor: pointer;
}
.avatar{
width: 36px;
height: 36px;
border-radius: 50%;
background-color: pink;
}
.user-name{
font-size: 16px;
line-height: 16px;
color: @party-white;
}
.line{
width: 2px;
height: 18px;
background-color: @party-white;
margin: 0 15px;
}
.login-out{
width: 20px;
height: 20px;
background-color: pink;
}
} }
}
} }
</style> </style>
...@@ -89,7 +89,7 @@ const httpServer = (opts,data,file,timeout)=>{ ...@@ -89,7 +89,7 @@ const httpServer = (opts,data,file,timeout)=>{
// Authorization // Authorization
if(opts.authType==="back"){ if(opts.authType==="back"){
//authToken=localStorage.getItem('backToken'); //authToken=localStorage.getItem('backToken');
authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInVzZXJfaWQiOiIxIiwiaXNzIjoiSUFUQSIsImV4cCI6MTYxNjY2NTkzOCwiaWF0IjoxNjE2NjUxNTM4fQ._nqZq0LMwkurIBKJtfX-imXLCxQSNwJ-ueGZ8iwW-0oAW880gY7PjNEfroYYQZ91v0u5yQb73Alzvy6EIp6GGg" authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInVzZXJfaWQiOiIxIiwiaXNzIjoiSUFUQSIsImV4cCI6MTYxNzAzMzM3NSwiaWF0IjoxNjE3MDE4OTc1fQ.NN7nF9aOGJIVZm-8x0uVz00S--YbETfkC1Ifu9R4PbnNPvObhDYlY_u2oxiq2dEkjkJ4sQWy5o2X-fTNaIvnIQ"
}else if(opts.authType==="front"){ }else if(opts.authType==="front"){
authToken = localStorage.getItem("token") || MyLocalStorage.Cache.get('token'); authToken = localStorage.getItem("token") || MyLocalStorage.Cache.get('token');
} }
......
export const menuList = [ export const menuList = [
{ {
title:'内容管理', name: '内容管理',
menu:[ icon: 'icon-headContent',
{ avatar: 'content_head_picture.png',
subtitle:'视频管理', color: '',
subMenu:[ url: '',
{label:'视频版权方管理', imgUrl:'',url:'/videoCopyright'}, children: [
{label:'视频分类管理', imgUrl:'',url:'/videoClassify'}, {
{label:'视频内容管理', imgUrl:'',url:'/videoContent'}, name: '展板管理',
{label:'视频汇出', imgUrl:'',url:'/videoRemit'}, icon: '',
] avatar: '',
}, color: '',
{ url: '',
subtitle:'展板管理', children: [
subMenu:[ { name: '版权方管理', icon: 'icon-copyrights', color: 'index-red', avatar: '', url: '/displayCopyright' },
{label:'展板版权方管理', imgUrl:'',url:'/displayCopyright'}, { name: '分类管理', icon: 'icon-classify', color: 'index-blue', avatar: '', url: '/displayclassify' },
{label:'展板分类管理', imgUrl:'',url:'/displayClassify'}, { name: '内容管理', icon: 'icon-content', color: 'index-green', avatar: '', url: '/displayContent' },
{label:'展板内容管理', imgUrl:'',url:'/displayContent'}, ]
] },
}, {
{ name: '视频管理',
subtitle:'学习内容及互动管理', icon: '',
subMenu:[ avatar: '',
{label:'学习内容管理', imgUrl:'',url:'/learnContent'}, color: '',
{label:'互动管理', imgUrl:'',url:'/interactive'} url: '',
] children: [
}, { name: '版权方管理', icon: 'icon-copyrights', color: 'index-red', avatar: '', url: '/videoCopyright' },
] { name: '分类管理', icon: 'icon-classify', color: 'index-blue', avatar: '', url: '/videoclassifyify' },
{ name: '内容管理', icon: 'icon-content', color: 'index-green', avatar: '', url: '/videoContent' },
{ name: '视频汇出', icon: 'icon-plane', color: 'index-purple', avatar: '', url: '/videoRemit' },
]
},
{
name: '平台学习内容制作',
icon: '',
avatar: '',
color: '',
url: '',
children: [
{ name: '学习内容制作', icon: 'icon-pen', color: 'index-pink', avatar: '', url: '/learnContent' },
{ name: '学习项目管理', icon: 'icon-data', color: 'index-blue', avatar: '', url: '/learnProject' },
]
},
]
}, },
{ {
title:'统计数据', name: '审核管理',
menu:[ icon: 'icon-headAudit',
{ avatar: 'audit_head_picture.png',
subtitle:'统计图表', color: '',
subMenu:[ url: '',
{label:'统计概览', imgUrl:''}, children: [
{label:'互动统计', imgUrl:''}, {
{label:'趋势分析', imgUrl:''} name: '内容及账号审核',
] icon: '',
}, avatar: '',
{ color: '',
subtitle:'统计账号', url: '',
subMenu:[ children: [
{label:'统计账号管理', imgUrl:''} { name: '视频审核', icon: 'icon-video', color: 'index-blue', url: '/checkVideo' },
] { name: '展板审核', icon: 'icon-screen', color: 'index-green', url: '/checkDisplay' },
}, { name: '平台学习内容审核', icon: 'icon-magnifier', color: 'index-pink', url: '/checkLearn' },
] { name: '账号禁用审核', icon: 'icon-disable', color: 'index-red', url: '/checkLearn' }
]
}
]
}, },
{ {
title:'审核管理', title: '单位用户管理',
menu:[ icon: 'icon-headUser',
{ avatar: 'user_head_picture.png',
subtitle:'内容及账号审核', color: '',
subMenu:[ url: '',
{label:'视频审核', imgUrl:'',url:'/checkVideo'}, children: [
{label:'展板审核', imgUrl:'',url:'/checkDisplay'}, {
{label:'平台学习内容审核', imgUrl:'',url:'/checkLearn'}, name: '互动管理',
{label:'账号禁用审核', imgUrl:''} icon: '',
] avatar: '',
} color: '',
] url: '',
children: [
{ label: '互动管理', icon: 'icon-interaction', color: 'index-purple', url: '/interactive' }
]
},
{
name: '账号管理',
icon: '',
avatar: '',
color: '',
url: '',
children: [
{ label: '账号管理', icon: 'icon-account', color: 'index-blue', url: '/unitAdmin' }
]
}
]
}, },
{ {
title:'机顶盒管理', name: '机顶盒管理',
menu:[ icon: 'icon-headStb',
{ avatar: 'stb_head_picture.png',
subtitle:'机顶盒信息及运维管理', color: '',
subMenu:[ url: '',
{label:'机顶盒信息管理', imgUrl:'',url:'/STBbase'}, children: [
{label:'机顶盒运维信息管理', imgUrl:'',url:'/STBoperation'}, {
{label:'机顶盒运维账号管理', imgUrl:''}, name: '机顶盒信息及运维管理',
{label:'app版本管理', imgUrl:'',url:'/appversion'}, icon: '',
{label:'app界面自定义', imgUrl:'',url:'/pagecustom'}, avatar: '',
color: '',
] url: '',
} children: [
] { name: '基础信息管理', icon: 'icon-radio', color: 'index-pink', url: '/STBbase' },
{ name: '运维信息管理', icon: 'icon-message', color: 'index-blue', url: '/STBoperation' },
{ name: '运维账号管理', icon: 'icon-gear', color: 'index-pink', url: '/stbAccount' }
]
},
{
name: 'APP管理',
icon: '',
avatar: '',
color: '',
url: '',
children: [
{ name: '版本管理', icon: 'icon-appversion', color: 'index-red', url: '/appversion' },
{ name: '界面自定义', icon: 'icon-interface', color: 'index-pink', url: '/pagecustom' }
]
}
]
}, },
{ {
title:'系统管理', name: '统计数据',
menu:[ icon: 'icon-headStatistics',
{ avatar: 'statistics_head_picture.png',
subtitle:'机构及信息管理', color: '',
subMenu:[ url: '',
{label:'机构管理', imgUrl:'',url:'/organ'}, menu: [
{label:'日志管理', imgUrl:'',url:'/log'}, {
{label:'修改密码', imgUrl:'',url:'/changePwd'}, name: '统计图表',
] icon: '',
avatar: '',
color: '',
url: '',
children: [
{ name: '统计概览', icon: 'icon-overview', color: 'index-purple', url: '/overview' },
{ name: '互动统计', icon: 'icon-interaction', color: 'index-green', url: '' },
{ name: '趋势分析', icon: 'icon-tend', color: 'index-pink', url: '' }
]
}, },
{ {
subtitle:'系统账号管理', name: '统计账号',
subMenu:[ icon: '',
{label:'用户账号管理', imgUrl:'',url:'/users'}, avatar: '',
{label:'单位管理员账号管理', imgUrl:'',url:'/unitAdmin'}, color: '',
url: '',
children: [
{ name: '统计用户管理', icon: 'icon-statisticsUser', color: 'index-blue', url: '/statisticalUser' }
]
},
]
},
{
name: '系统管理',
icon: 'icon-headSystem',
avatar: 'system_head_picture.png',
color: '',
url: '',
menu: [
{
name: '机构及信息管理',
icon: '',
avatar: '',
color: '',
url: '',
children: [
{ name: '机构管理', icon: 'icon-organ', color: 'index-green', url: '/organ' },
{ name: '日志管理', icon: 'icon-log', color: 'index-pink', url: '/log' },
{ name: '平台用户管理', icon: 'icon-platUser', color: 'index-blue', url: '/users' },
{ name: '修改密码', icon: 'icon-lock', color: 'index-red', url: '/changePwd' },
] ]
}, }
] ]
}, },
] ]
\ No newline at end of file
import rejectDialog from './reject'
export {
rejectDialog
}
\ No newline at end of file
<template>
<el-dialog
custom-class="party-dialog"
title="驳回原因"
:visible.sync="dialogVisible"
width="468px"
:before-close="handleClose"
>
<div class="dialog-content">
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="80px"
label-position="top"
class="party-form"
>
<el-form-item label="请填写驳回原因" prop="remarks">
<el-input
v-model="form.remarks"
placeholder="请填写"
type="textarea"
></el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer btn-group">
<el-button @click="handleClose()">取 消</el-button>
<el-button type="primary" @click="handleSubmit()">确 定</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
data() {
return {
dialogVisible: false,
form: {
status: 2,
content: "",
type: 3, //0,看板;1 视频;2 学习内容;3 账号禁用
},
rules: {
content: [
{ required: true, message: "请填写驳回原因", trigger: "change" },
],
},
};
},
mounted() {},
methods: {
// 弹窗关闭
handleClose() {
this.$confirm("确认关闭?")
.then((_) => {
this.handleReset();
})
.catch((_) => {});
},
handleReset() {
this.dialogVisible = false;
this.$refs.form.resetFields();
this.form = {
remarks: "",
type: "ACCOUNT",
};
},
// 提交
handleSubmit() {
// 校验用户输入值
let _this = this;
this.$refs.form.validate((valid) => {
if (valid) {
this.$https(
{
method: "put",
url: "audit/update",
authType: this.backToken,
},
_this.form
)
.then((res) => {
this.handleReset();
if (res.status == 200) {
if (res.data.resultCode == 200) {
this.$message({
type: "success",
message: res.data.message,
});
this.$emit("success", true);
} else {
this.$message.error(res.data.message);
}
} else {
this.$message.error(res.data);
}
})
.catch((err) => {
console.log(err);
});
} else {
console.log("error submit!!");
return false;
}
});
},
},
};
</script>
<style lang="less" scoped>
.form-row {
display: flex;
justify-content: space-between;
}
</style>
\ No newline at end of file
...@@ -44,6 +44,13 @@ ...@@ -44,6 +44,13 @@
<i class="icon-table icon-enable"></i> <i class="icon-table icon-enable"></i>
</el-button> </el-button>
</el-tooltip> </el-tooltip>
<el-tooltip content="审核详情" placement="top">
<el-button
circle
@click="handleOperate(scope.row,'examine')">
<i class="icon-table icon-detail"></i>
</el-button>
</el-tooltip>
</div> </div>
<div v-else> <div v-else>
<span v-if="item.prop==='type'"> <span v-if="item.prop==='type'">
......
<template> <template>
<div class="party-table"> <div class="party-table">
<el-table border :data="list" style="width: 100%;height:100%" height="100%"> <el-table
<el-table-column border
label="序号" :data="list"
align="center" style="width: 100%; height: 100%"
width="100"> height="100%"
<template slot-scope="scope" > >
<span>{{ (currentPage-1) * 10 * scope.$index + 1}}</span> <el-table-column label="序号" align="center" width="100">
</template> <template slot-scope="scope">
</el-table-column> <span>{{ (currentPage - 1) * 10 * scope.$index + 1 }}</span>
<el-table-column </template>
align="center" </el-table-column>
v-for="(item,index) in feildList" <el-table-column
:key="index" align="center"
:prop="item.prop" v-for="(item, index) in feildList"
:label="item.label" :key="index"
:width="item.width"> :prop="item.prop"
<template slot-scope="scope" > :label="item.label"
<div v-if="item.isEdit" class="table-btn-group"> :width="item.width"
<el-button round class="passed" @click="handleOperate(scope.row,'edit')"> >
通过 <template slot-scope="scope">
</el-button> <div v-if="item.isEdit" class="table-btn-group">
<el-button round class="rejected" @click="handleOperate(scope.row,'edit')"> <el-button
驳回 round
</el-button> class="passed"
</div> :disabled="
<div v-else> scope.row.status === 'REFUSED' ||
<span>{{scope.row[item.prop]}}</span> scope.row.status === 'APPROVED_FINAL'
</div> "
</template> @click="handleOperate(scope.row, 'pass')"
</el-table-column> >
通过
</el-button>
<el-button
round
class="rejected"
:disabled="
scope.row.status === 'REFUSED' ||
scope.row.status === 'APPROVED_FINAL'
"
@click="handleOperate(scope.row, 'reject')"
>
驳回
</el-button>
</div>
<div v-else>
<span v-if="item.prop === 'status'">
{{ scope.row[item.prop] | statusName }}
</span>
<span v-else>{{ scope.row[item.prop] }}</span>
</div>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return { return {};
},
} props: {
currentPage: {
type: Number,
default: 1,
}, },
props:{ list: {
currentPage:{ type: Array,
type:Number, default: () => {
default:1 return [];
}, },
list:{
type:Array,
default:()=>{return []}
},
feildList:{
type:Array,
default:()=>{return []}
}
}, },
methods:{ feildList: {
handleOperate(row,type){ type: Array,
this.$emit( default: () => {
"action", return [];
{ },
row:row, },
type:type },
} filters: {
) statusName(type) {
} switch (type) {
} case "TBC":
} return "待初审";
break;
case "REFUSED":
return "驳回";
break;
case "TBCA":
return "待复审";
break;
case "APPROVED_FINAL":
return "通过";
break;
default:
return "";
}
},
},
methods: {
handleOperate(row, type) {
if (type == "pass") {
this.$confirm("确认进行此操作?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.handlEmitMsg(row, type);
})
.catch(() => {});
} else {
this.handlEmitMsg(row, type);
}
},
handlEmitMsg(row, type) {
this.$emit("action", {
row: row,
type: type,
});
},
},
};
</script> </script>
<style lang="less"> <style lang="less">
@import '../../../style/table.less'; @import "../../../style/table.less";
</style> </style>
\ No newline at end of file
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
data() { data() {
return { return {
form: { form: {
type: 2, //1.用户账号 2.平台单位单位管理员账号 3.机顶盒账号 4.运维账号 type: 2, //1.用户账号 2.平台单位单位管理员账号 3.机顶盒账号 4.运维账号
}, },
feildList: [ feildList: [
{ prop: "userName", label: "管理员姓名" }, { prop: "userName", label: "管理员姓名" },
...@@ -44,13 +44,13 @@ export default { ...@@ -44,13 +44,13 @@ export default {
_size: 10, _size: 10,
total: 0, total: 0,
}, },
activeRow: {} activeRow: {},
}; };
}, },
components: { components: {
partyPagination, partyPagination,
dbUnitTable, dbUnitTable,
editDialog editDialog,
}, },
mounted() { mounted() {
this.getFirstPageList(); this.getFirstPageList();
...@@ -91,19 +91,28 @@ export default { ...@@ -91,19 +91,28 @@ export default {
console.log(err); console.log(err);
}); });
}, },
// 页面返回值为空
getResWithOutData() {
this.list = [];
this.page = {
_index: 1,
_size: 10,
total: 0,
};
},
// 编辑 // 编辑
handleEdit() { handleEdit() {
this.$refs.editDialog.id = this.activeRow.id; this.$refs.editDialog.id = this.activeRow.id;
this.$refs.editDialog.getDetailById(); this.$refs.editDialog.getDetailById();
this.$refs.editDialog.dialogVisible = true; this.$refs.editDialog.dialogVisible = true;
this.$refs.editDialog.isEdit = true this.$refs.editDialog.isEdit = true;
}, },
// 查看详情 // 查看详情
handleDetail() { handleDetail() {
this.$refs.editDialog.id = this.activeRow.id; this.$refs.editDialog.id = this.activeRow.id;
this.$refs.editDialog.getDetailById(); this.$refs.editDialog.getDetailById();
this.$refs.editDialog.dialogVisible = true; this.$refs.editDialog.dialogVisible = true;
this.$refs.editDialog.isEdit = false this.$refs.editDialog.isEdit = false;
}, },
handleAction(params) { handleAction(params) {
this.activeRow = params.row; this.activeRow = params.row;
...@@ -127,10 +136,9 @@ export default { ...@@ -127,10 +136,9 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.dbUnit-wrapper{ .dbUnit-wrapper {
.page-tips{ .page-tips {
white-space: nowrap; white-space: nowrap;
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<!-- 账号禁用审核 --> <!-- 账号禁用审核 -->
<div class="recheck-wrapper height100"> <div class="recheck-wrapper height100">
<div class="search-container"> <div class="search-container">
<el-form :inline="true" :model="form"> <el-form :inline="true" :model="form">
<el-form-item> <el-form-item>
<el-input <el-input
v-model="form.name" v-model="form.name"
placeholder="请输入账号名称、提交人" placeholder="请输入账号名称、提交人"
suffix-icon="el-icon-search" suffix-icon="el-icon-search"
clearable clearable
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select <el-select
v-model="form.status" v-model="form.status"
placeholder="请选择账号状态" placeholder="请选择账号状态"
clearable clearable
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<div class="btn-group"> <div class="btn-group">
<el-button type="primary" @click="handleSubmit">查询</el-button> <el-button type="primary" @click="handleSubmit">查询</el-button>
<el-button @click="handleReset">重置</el-button> <el-button @click="handleReset">重置</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="page-tip"> <div class="page-tip">
<span class="page-tip-title">页面说明:</span> <span class="page-tip-title">页面说明:</span>
<span class="page-tips">展示所有禁用账号的申请,审核通过后,该账号状态为禁用,无法在系统中使用</span> <span class="page-tips"
</div> >展示所有禁用账号的申请,审核通过后,该账号状态为禁用,无法在系统中使用</span
>
</div> </div>
<div class="table-content"> </div>
<check-table <div class="table-content">
class="noAdd" <check-table
:feildList="feildList" class="noAdd"
:list="list" :feildList="feildList"
@action="handleAction" :list="list"
/> @action="handleAction"
<party-pagination/> />
</div> <party-pagination :page="page" @changePage="handleChangeCurrent" />
<!-- <user-dialog/> --> </div>
<reject-dialog ref="rejectDialog" @success="getPageList()" />
</div> </div>
</template> </template>
<script> <script>
import { partyPagination } from '@/components/index' import { partyPagination } from "@/components/index";
import checkTable from './components/checkTable' import checkTable from "./components/checkTable";
import {addDialog, editDialog} from './userDialog/index' import { rejectDialog } from "./checkDialog/index";
export default { export default {
data(){ data() {
return{ return {
form:{ form: {
user:'', name: "",
status:'' status: "",
}, },
options:[ options: [
{label:'待初审',value:1}, { label: "待初审", value: "TBC" },
{label:'驳回',value:2}, { label: "驳回", value: "REFUSED" },
{label:'待复审',value:3}, { label: "待复审", value: "TBCA" },
{label:'通过',value:4} { label: "通过", value: "APPROVED_FINAL" }
], ],
feildList:[ feildList: [
{prop:'username',label:'账号名称'}, { prop: "content", label: "账号名称" },
{prop:'orgName',label:'所在机构'}, { prop: "orgName", label: "所在机构" },
{prop:'endTime',label:'提交人'}, { prop: "userName", label: "提交人" },
{prop:'endTime',label:'提交日期'}, { prop: "createTime", label: "提交日期" },
{prop:'endTime',label:'审核状态'}, { prop: "status", label: "审核状态" },
{prop:'',label:'操作',isEdit:true, width:240}, { prop: "", label: "操作", isEdit: true, width: 240 },
], ],
list: [] list: [],
} activeRow: {},
page: {
_index: 1,
_size: 10,
total: 0,
},
type:'ACCOUNT',
};
},
components: { partyPagination, checkTable, rejectDialog },
mounted() {
this.getFirstPageList();
},
methods: {
// 查询数据
handleSubmit() {
this.getPageList();
}, },
components:{ partyPagination, checkTable, addDialog, editDialog}, handleReset() {
mounted(){ this.form.name = "";
this.form.status = "";
this.getFirstPageList()
}, },
methods:{
handleSubmit(){
// 获取第一页数据列表
getFirstPageList() {
this.page._index = 1;
this.getPageList();
},
getPageList() {
let requestParams = {};
requestParams._index = this.page._index;
requestParams._size = this.page._size;
requestParams.name = this.form.name;
requestParams.status = this.form.status;
this.$https(
{
method: "get",
url: "audit/getUserList",
authType: this.backToken,
}, },
handleReset(){ requestParams
this.form.user = '' )
}, .then((res) => {
// 弹窗关闭 if (res.status != 200) {
handleClose(){ this.getResWithOutData();
this.$confirm('确认关闭?') } else {
.then(_ => { if (res.data.resultCode == 200) {
done(); this.list = res.data.data.records;
}) this.page._size = res.data.data.size;
.catch(_ => {}); this.page.total = res.data.data.total;
} else {
this.getResWithOutData();
}
}
})
.catch((err) => {
console.log(err);
});
},
// 页面返回值为空
getResWithOutData() {
this.list = [];
this.page = {
_index: 1,
_size: 10,
total: 0,
};
},
handleAction(params) {
this.activeRow = params.row;
switch (params.type) {
case "reject":
this.handleRject();
break;
case "pass":
this.handlePass();
break;
default:
break;
}
},
// 驳回
handleRject() {
this.$refs.rejectDialog.dialogVisible = true;
},
// 通过
handlePass() {
let params = {};
params.id = this.activeRow.id;
params.status = 4;
params.type = this.type
this.$https(
{
method: "put",
url: "audit/update",
authType: this.backToken,
}, },
handleAction(params){ params
console.log(params.type) )
} .then((res) => {
} if (res.status == 200) {
} if (res.data.resultCode == 200) {
this.$message({
type: "success",
message: res.data.message,
});
this.getPageList();
} else {
this.$message.error(res.data.message);
}
} else {
this.$message.error(res.data);
}
})
.catch((err) => {
console.log(res);
});
},
// 翻页
handleChangeCurrent() {
this.page._index = val;
this.getPageList();
},
},
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
</style> </style>
\ No newline at end of file
...@@ -160,24 +160,23 @@ export default { ...@@ -160,24 +160,23 @@ export default {
requetsparams requetsparams
) )
.then((res) => { .then((res) => {
debugger this.handleReset();
if (res.status == 200) { if (res.status == 200) {
if (res.data.resultCode == 200) { if (res.data.resultCode == 200) {
this.$message({ this.$message({
type: "success", type: "success",
message: res.data.message, message: res.data.message,
}); });
this.handleReset();
this.$emit("success", true); this.$emit("success", true);
} else { } else {
this.$message.error(res.data.message); this.$message.error(res.data.message || res.data.msg);
} }
} else { } else {
this.$message.error(res.data); this.$message.error(res.data);
} }
}) })
.catch((err) => { .catch((err) => {
console.log(res); this.$message.error(err.message || err.msg);
}); });
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
......
...@@ -193,6 +193,15 @@ export default { ...@@ -193,6 +193,15 @@ export default {
console.log(err); console.log(err);
}); });
}, },
// 页面返回值为空
getResWithOutData(){
this.list = []
this.page = {
_index:1,
_size:10,
total:0
}
},
// 新增账号 // 新增账号
handleAdd() { handleAdd() {
this.$refs.addDialog.dialogVisible = true; this.$refs.addDialog.dialogVisible = true;
......
...@@ -3,21 +3,24 @@ ...@@ -3,21 +3,24 @@
<div class="panel-box" v-for="(item,index) in menuList" :key="index"> <div class="panel-box" v-for="(item,index) in menuList" :key="index">
<div class="panel-box-title"> <div class="panel-box-title">
<span class="panel-box-title-wrapper"> <span class="panel-box-title-wrapper">
<i class="panel-box-title-icon"></i> <i :class="item.icon" class="panel-box-title-icon"></i>
<span>{{item.title}}</span> <span>{{item.name}}</span>
</span> </span>
<div class="panel-box-title-img"></div> <div class="panel-box-title-img">
<img :src="requireImg(item.avatar)" alt="">
</div>
</div> </div>
<div class="panel-box-content"> <div class="panel-box-content">
<div class="panel-sub-box" v-for="(subItem,subIndex) in item.menu" :key="subIndex"> <div class="panel-sub-box" v-for="(subItem,subIndex) in item.children" :key="subIndex">
<div class="panel-box-sub-title"> <div class="panel-box-sub-title">
<span class="line"></span> <span class="line"></span>
<span class="panel-box-sub-title_name">{{subItem.subtitle}}</span> <span class="panel-box-sub-title_name">{{subItem.name}}</span>
</div> </div>
<ul > <ul >
<li v-for="(menu,mIndex) in subItem.subMenu" :key="mIndex" @click="goPage(menu.url)"> <li v-for="(menu,mIndex) in subItem.children" :key="mIndex" @click="goPage(menu.url)" :class="menu.color">
<i class="icon-memu"></i>
<span class="menu-label">{{menu.label}}</span> <i :class="menu.icon" class="icon-memu"></i>
<span class="menu-label">{{menu.name}}</span>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -41,11 +44,15 @@ export default{ ...@@ -41,11 +44,15 @@ export default{
if(path){ if(path){
this.$router.push(path) this.$router.push(path)
} }
},
requireImg(imgSrc){
return require(`@/assets/menu/${imgSrc}`)
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import '~@/style/menu.less';
@media screen and (max-width: 1440px) { @media screen and (max-width: 1440px) {
.index-container{ .index-container{
width: 100%; width: 100%;
...@@ -100,8 +107,6 @@ export default{ ...@@ -100,8 +107,6 @@ export default{
display: inline-block; display: inline-block;
width: 28px; width: 28px;
height: 28px; height: 28px;
border-radius: 50%;
background-color: @party-pink;
vertical-align: middle; vertical-align: middle;
margin-right: 18px; margin-right: 18px;
} }
...@@ -118,8 +123,12 @@ export default{ ...@@ -118,8 +123,12 @@ export default{
height: 10.4vw; height: 10.4vw;
max-width: 200px; max-width: 200px;
max-height: 200px; max-height: 200px;
background-color:@party-pink ;
margin-top: 20px; margin-top: 20px;
img{
width: 100%;
height: 100%;
object-fit: cover;
}
} }
.panel-box-content{ .panel-box-content{
padding-left: 20px; padding-left: 20px;
...@@ -160,7 +169,6 @@ export default{ ...@@ -160,7 +169,6 @@ export default{
max-width: 128px; max-width: 128px;
max-height: 160px; max-height: 160px;
text-align: center; text-align: center;
background: @party-bg-gray;
border-radius: 8px; border-radius: 8px;
color: @font-color; color: @font-color;
&:not(:first-child){ &:not(:first-child){
......
<template> <template>
<div class="change-pwd-wrapper height100"> <div class="change-pwd-wrapper height100">
<div class="page-form-box"> <div class="page-form-box">
<div class="page-form-box-header"> <div class="page-form-box-header">修改密码</div>
修改密码 <div class="page-form-box-content">
</div> <el-form
<div class="page-form-box-content"> ref="form"
<el-form ref="form" :model="form" label-width="80px" label-position="top" class="party-form"> :rules="rules"
<el-form-item label="请输入当前密码" > :model="form"
<el-input v-model="form.name" placeholder="请填写"></el-input> label-width="80px"
</el-form-item> label-position="top"
<el-form-item label="请输入新密码" > class="party-form"
<el-input v-model="form.name" placeholder="请填写"></el-input> >
</el-form-item> <el-form-item label="请输入当前密码" prop="oldPassWord">
<el-form-item label="请再次输入新密码" > <el-input
<el-input v-model="form.name" placeholder="请填写"></el-input> v-model="form.oldPassWord"
</el-form-item> placeholder="请输入当前密码"
</el-form> type="password"
</div> ></el-input>
<div class="page-form-box-footer"> </el-form-item>
<div class="btn-group"> <el-form-item label="请输入新密码" prop="password">
<el-button>取消</el-button> <el-input
<el-button type="primary">确定修改</el-button> v-model="form.password"
</div> placeholder="请输入新密码"
type="password"
>
</el-input>
</el-form-item>
<el-form-item label="请再次输入新密码" prop="checkPass">
<el-input
v-model="form.checkPass"
placeholder="请再次输入新密码"
type="password"
>
</el-input>
</el-form-item>
</el-form>
</div>
<div class="page-form-box-footer">
<div class="btn-group">
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSubmit">确定修改</el-button>
</div> </div>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return { var validatePass = (rule, value, callback) => {
form:{ if (value === "") {
name:'' callback(new Error("请输入密码"));
} } else {
this.$refs.ruleForm.validateField("password");
callback();
} }
};
var validatePass2 = (rule, value, callback) => {
if (value === "") {
callback(new Error("请再次输入密码"));
} else if (value !== this.form.password) {
callback(new Error("两次输入密码不一致!"));
} else {
callback();
}
};
return {
form: {
oldPassWord: "",
password: "",
checkPass: "",
},
rules: {
oldPassWord: [
{ required: true, message: "请输入原密码", trigger: "blur" },
],
password: [
{ required: true, validator: validatePass, trigger: "blur" },
],
checkPass: [
{ required: true, validator: validatePass2, trigger: "blur" },
],
},
};
}, },
mounted(){ mounted() {},
methods: {
handleCancel() {
this.form = {
oldPassWord: "",
password: "",
checkPass: "",
};
},
handleSubmit() {
let _this = this;
this.$refs.validate((valid) => {
if (valid) {
let requestParams = {};
requestParams.oldPassWord = _this.form.oldPassWord;
requestParams.password = _this.form.password;
_this
.$https(
{
method: "put",
url: "tUser/editPwd",
},
requestParams
)
.then((res) => {
if (res.status != 200) {
_this.$message.error(res.data.message);
} else {
if (res.data.resultCode == 200) {
this.$message({
type: "success",
message: res.data.message,
});
_this.redirectLogin()
} else {
_this.$message.error(res.data.message);
}
}
})
.catch((error) => {
_this.$message.error(error.data.message);
});
} else {
console.log("error submit!!");
return false;
}
});
},
redirectLogin(){
this.$router.push('./login')
}
}, },
methods:{ };
}
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.change-pwd-wrapper{ .change-pwd-wrapper {
.party-form{ .party-form {
width: 300px; width: 300px;
margin: 0 auto; margin: 0 auto;
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<el-dialog <div>
custom-class="party-dialog" <el-dialog
title="新建机构" custom-class="party-dialog"
:visible.sync="dialogVisible" title="新建机构"
width="468px" :visible.sync="dialogVisible"
:before-close="handleClose" width="468px"
> :before-close="handleClose"
<div class="dialog-content"> >
<el-form <div class="dialog-content">
ref="form" <el-form
:rules="rules" ref="form"
:model="form" :rules="rules"
label-width="80px" :model="form"
label-position="top" label-width="80px"
class="party-form" label-position="top"
> class="party-form"
<el-form-item label="新增类别:" prop="level"> >
<el-radio-group v-model="form.level"> <el-form-item label="父级节点:">
<el-radio <el-input v-model="form.parentName"></el-input>
v-for="(item, index) in levelOption" <el-button @click="handlefocus" round>修改</el-button>
:key="index" </el-form-item>
:label="item.label" <el-form-item label="机构名称:" prop="name">
<el-input
v-model="form.name"
placeholder="请填写"
clearable
></el-input>
</el-form-item>
<el-form-item label="机构地理位置:" prop="areaId">
<el-cascader
v-model="form.areaId"
change-on-select
:props="cascaderProps"
:options="areaOptions"
> >
{{ item.value }} </el-cascader>
</el-radio> </el-form-item>
</el-radio-group> <el-form-item label="备注">
</el-form-item> <el-input
<el-form-item label="机构名称:" prop="name"> v-model="form.remarks"
<el-input type="textarea"
v-model="form.name" placeholder="请输入"
placeholder="请填写" ></el-input>
clearable </el-form-item>
></el-input> </el-form>
</el-form-item> </div>
<el-form-item label="机构地理位置:" prop="areaId"> <div slot="footer" class="dialog-footer btn-group">
<el-cascader <el-button @click="handleCancle()">取 消</el-button>
v-model="form.areaId" <el-button type="primary" @click="handleSubmit()" :disabled="disabled"
change-on-select >确 定</el-button
:props="cascaderProps" >
:options="areaOptions" </div>
> </el-dialog>
</el-cascader> <org-trees
</el-form-item> ref="orgTree"
<el-form-item label="备注"> :treeData="treeData"
<el-input @selected="handleSelectParent"
v-model="form.remarks" />
type="textarea" </div>
placeholder="请输入"
></el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer btn-group">
<el-button @click="handleCancle()">取 消</el-button>
<el-button type="primary" @click="handleSubmit()" :disabled="disabled"
>确 定</el-button
>
</div>
</el-dialog>
</template> </template>
<script> <script>
import { getAreas } from "@/config/area"; import { getAreas } from "@/config/area";
import orgTrees from './orgTree'
export default { export default {
data() { data() {
return { return {
...@@ -68,21 +69,18 @@ export default { ...@@ -68,21 +69,18 @@ export default {
form: { form: {
name: "", name: "",
areaId: [], areaId: [],
level: "",
remarks: "", remarks: "",
parentId: "",
parentName: "",
}, },
disabled: false, disabled: false,
areaOptions: [], areaOptions: [],
cascaderProps: { cascaderProps: {
label: "name", label: "name",
value: "code", value: "code",
checkStrictly: true checkStrictly: true,
}, },
levelOption: [],
rules: { rules: {
level: [
{ required: true, message: "请选择用户类别", trigger: "change" },
],
name: [ name: [
{ required: true, message: "请输入机构名称", trigger: "change" }, { required: true, message: "请输入机构名称", trigger: "change" },
], ],
...@@ -92,40 +90,46 @@ export default { ...@@ -92,40 +90,46 @@ export default {
}, },
}; };
}, },
components: { orgTrees },
props: { props: {
level: { treeData: {
type: Number, type: Array,
default: 1, default: () => {
return [];
},
}, },
parentId:{
type: String,
default: '0',
}
}, },
mounted() { mounted() {
this.getLevelOption();
getAreas().then((res) => { getAreas().then((res) => {
this.areaOptions = res; this.areaOptions = res;
}); });
}, },
methods: { methods: {
handlefocus() {
this.$refs.orgTree.dialogVisible = true;
},
handleSelectParent(parentData) {
this.form.parentId = parentData.id;
this.form.parentName = parentData.name;
},
// 弹窗关闭 // 弹窗关闭
handleClose() { handleClose() {
this.$confirm("确认关闭?") this.$confirm("确认关闭?")
.then((_) => { .then((_) => {
this.handleReset() this.handleReset();
}) })
.catch((_) => {}); .catch((_) => {});
}, },
handleReset(){ handleReset() {
this.dialogVisible = false this.dialogVisible = false;
this.$refs.form.resetFields() this.$refs.form.resetFields();
this.form = { this.form = {
name: "", name: "",
areaId: [], areaId: [],
level: "", remarks: "",
remarks: "", parentId: "",
} parentName: "",
};
}, },
handleCancle() { handleCancle() {
this.handleClose(); this.handleClose();
...@@ -138,8 +142,7 @@ export default { ...@@ -138,8 +142,7 @@ export default {
params.name = this.form.name; params.name = this.form.name;
params.areaId = [...this.form.areaId].pop(); params.areaId = [...this.form.areaId].pop();
params.remarks = this.form.remarks; params.remarks = this.form.remarks;
params.level = this.form.level; params.parentId = this.form.parentName ? this.form.parentId : "0";
params.parentId = this.parentId
let requestparams = this.$qs.stringify(params); let requestparams = this.$qs.stringify(params);
this.$https( this.$https(
{ {
...@@ -150,60 +153,31 @@ export default { ...@@ -150,60 +153,31 @@ export default {
requestparams requestparams
) )
.then((res) => { .then((res) => {
if(res.status == 200 ){ if (res.status == 200) {
if (res.data.resultCode == 200 ) { if (res.data.resultCode == 200) {
this.$message({ this.$message({
type: "success", type: "success",
message: res.data.message, message: res.data.message,
}); });
this.handleReset() this.handleReset();
this.$emit('success',true) this.$emit("success", true);
} else { } else {
this.$message.error(res.data.message); this.$message.error(res.data.message);
this.$emit('success',false) this.$emit("success", false);
} }
} else { } else {
this.$message.error(res.data); this.$message.error(res.data);
this.$emit('success',false) this.$emit("success", false);
} }
}) })
.catch((err) => { .catch((err) => {
console.log(res); console.log(err);
}); });
} else { } else {
console.log("error submit!!");
return false; return false;
} }
}); });
}, },
getLevelOption() {
this.form.level = this.level;
if (this.level === 1) {
this.levelOption = [
{ label: 1, value: "平级机构" },
{ label: 2, value: "下级机构" },
];
} else if (this.level === 2) {
this.levelOption = [
{ label: 1, value: "上级机构" },
{ label: 2, value: "平级机构" },
{ label: 3, value: "下级机构" },
];
} else if (this.level === 3) {
this.levelOption = [
{ label: 2, value: "上级机构" },
{ label: 3, value: "平级机构" },
];
} else {
this.levelOption = [];
}
},
},
watch: {
level() {
// level 1 没有上级 level 3 没有下级
this.getLevelOption();
},
}, },
}; };
</script> </script>
......
<template> <template>
<p> 编辑</p> <div>
<el-dialog
custom-class="party-dialog"
title="编辑机构"
:visible.sync="dialogVisible"
width="468px"
:before-close="handleClose"
>
<div class="dialog-content">
<el-form
ref="form"
:rules="rules"
:model="form"
label-width="80px"
label-position="top"
class="party-form"
>
<el-form-item label="父级节点:">
<el-input v-model="form.parentName"></el-input>
<el-button @click="handlefocus" round>修改</el-button>
</el-form-item>
<el-form-item label="机构名称:" prop="name">
<el-input
v-model="form.name"
placeholder="请填写"
clearable
></el-input>
</el-form-item>
<el-form-item label="机构地理位置:" prop="areaId">
<el-cascader
v-model="form.areaId"
change-on-select
:props="cascaderProps"
:options="areaOptions"
>
</el-cascader>
</el-form-item>
<el-form-item label="备注">
<el-input
v-model="form.remarks"
type="textarea"
placeholder="请输入"
></el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer btn-group">
<el-button @click="handleCancle()">取 消</el-button>
<el-button type="primary" @click="handleSubmit()" :disabled="disabled"
>确 定</el-button
>
</div>
</el-dialog>
<org-trees
ref="orgTree"
:treeData="treeData"
@selected="handleSelectParent"
>
</org-trees>
</div>
</template> </template>
export default{ <script>
import { getAreas } from "@/config/area";
import orgTrees from "./orgTree";
export default {
data() {
return {
dialogVisible: false,
form: {
name: "",
areaId: [],
remarks: "",
parentId: "",
parentName: "",
},
disabled: false,
areaOptions: [],
cascaderProps: {
label: "name",
value: "code",
checkStrictly: true,
},
rules: {
name: [
{ required: true, message: "请输入机构名称", trigger: "change" },
],
areaId: [
{ required: true, message: "请选择地理位置", trigger: "change" },
],
},
};
},
components: { orgTrees },
props: {
currentInfo: {
type: Object,
default: () => {
return {};
},
},
treeData: {
type: Array,
default: () => {
return [];
},
},
},
mounted() {
getAreas().then((res) => {
this.areaOptions = res;
});
},
methods: {
handlefocus() {
this.$refs.orgTree.dialogVisible = true;
},
handleSelectParent(parentData) {
this.form.parentId = parentData.id;
this.form.parentName = parentData.name;
},
// 弹窗关闭
handleClose() {
this.$confirm("确认关闭?")
.then((_) => {
this.handleReset();
})
.catch((_) => {});
},
handleReset() {
this.dialogVisible = false;
this.$refs.form.resetFields();
this.form = {
name: "",
areaId: [],
remarks: "",
parentId: "",
parentName: "",
};
},
handleCancle() {
this.handleClose();
},
handleSubmit() {
// 校验用户输入值
this.$refs.form.validate((valid) => {
if (valid) {
let params = {};
params.name = this.form.name;
params.areaId = [...this.form.areaId].pop();
params.remarks = this.form.remarks;
params.parentId = this.form.parentName ? this.form.parentId : "";
params.id = this.currentInfo.id;
let requestparams = this.$qs.stringify(params);
this.$https(
{
method: "put",
url: "organ/update",
authType: this.backToken,
},
requestparams
)
.then((res) => {
this.handleReset();
if (res.status == 200) {
if (res.data.resultCode == 200) {
this.$message({
type: "success",
message: res.data.message,
});
} this.$emit("success", true);
} else {
this.$message.error(res.data.message);
// this.$emit("success", false);
}
} else {
this.$message.error(res.data);
// this.$emit("success", false);
}
})
.catch((err) => {
console.log(err);
});
} else {
return false;
}
});
},
},
watch: {
currentInfo() {
this.form = {
name: this.currentInfo.name,
areaId: this.currentInfo.areas,
remarks: this.currentInfo.remarks,
parentId: this.currentInfo.parentId,
parentName: this.currentInfo.parentName,
};
},
},
};
</script>
<style lang="less" scoped> <style lang="less" scoped>
</style> </style>
\ No newline at end of file
import orgAdd from './add' import orgAdd from './add'
import orgEdit from './edit' import orgEdit from './edit'
import orgTrees from './orgTree'
export{ export{
orgAdd, orgAdd,
orgEdit orgEdit,
orgTrees
} }
<template>
<el-dialog
custom-class="party-dialog"
title="选择级别"
:visible.sync="dialogVisible"
width="600px"
>
<el-tree
ref="tree"
:data="treeData"
node-key="id"
highlight-current
:props="defaultProps"
@node-click="handleNodeClick"
>
</el-tree>
</el-dialog>
</template>
<script>
export default {
data() {
return {
dialogVisible: false,
defaultProps: {
children: "children",
label: "name",
},
};
},
props: {
treeData: {
type: Array,
default: () => {
return [];
},
},
},
methods: {
handleNodeClick(data) {
this.$emit('selected', data)
this.dialogVisible = false
},
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
...@@ -5,22 +5,28 @@ ...@@ -5,22 +5,28 @@
<div class="org-tree-box-header">组织结构</div> <div class="org-tree-box-header">组织结构</div>
<div class="org-tree-box-content"> <div class="org-tree-box-content">
<div class="tree-search party-form"> <div class="tree-search party-form">
<el-input <el-input placeholder="请输入组织结构名称" v-model="name">
placeholder="请输入组织结构名称" <i
v-model="name" slot="suffix"
> class="el-input__icon el-icon-search"
<i @click="getOrgTree()"
slot="suffix" >
class="el-input__icon el-icon-search"
@click="getOrgTree()">
</i> </i>
</el-input> </el-input>
<div class="f0"> <div class="f0" style="display: flex">
<el-tooltip content="新建" placement="top"> <el-tooltip content="新建" placement="top">
<i class="icon-add party-icon-20" @click="handleAdd('add')"/> <i class="icon-add party-icon-20" @click="handleAdd('add')" />
</el-tooltip> </el-tooltip>
<el-tooltip content="导入" placement="top"> <el-tooltip content="导入" placement="top">
<i class="icon-import party-icon-20" @click="handleImport('import')"/> <el-upload
action=""
:http-request="handleRequest"
:show-file-list="false"
:before-upload="beforeAvatarUpload"
accept="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
>
<i class="icon-import party-icon-20" />
</el-upload>
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
...@@ -59,39 +65,46 @@ ...@@ -59,39 +65,46 @@
点击相应的机构名称,可查看该机构的详细信息。可新增机构、删除机构及批量导入机构信息。新增机构中“*”为必填项 点击相应的机构名称,可查看该机构的详细信息。可新增机构、删除机构及批量导入机构信息。新增机构中“*”为必填项
</p> </p>
</div> </div>
<el-form label-position="top" :inline="true"> <el-form label-position="top">
<el-form-item label="上级机构" class="w50"> <el-form-item label="上级机构" class="w100">
<span></span> <span>
{{ currentInfo.parentName || "暂无上级机构" }}
</span>
</el-form-item> </el-form-item>
<el-form-item label="下级机构" class="w50"> <el-form-item label="下级机构" class="w100">
<span> <span>
{{ currentInfo.childrenName || "暂无下级机构" }}
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="地理位置" class="w100"> <el-form-item label="地理位置" class="w100">
<span> <span>
{{currentInfo.remarks}} {{ currentInfo.areaName || "暂无地理位置信息" }}
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="备注信息" class="w100"> <el-form-item label="备注信息" class="w100">
<span> <span>
{{currentInfo.remarks}} {{ currentInfo.remarks || "暂无备注信息" }}
</span> </span>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<org-add <org-add
ref="orgAdd" ref="orgAdd"
:parentId="currentInfo.id" :parentId="currentInfo.id"
:level="currentInfo.level" :treeData="data"
@success="getOrgTree()" @success="getOrgTree()"
/> />
<org-edit ref="orgEdit" :currentInfo="currentInfo"/> <org-edit
ref="orgEdit"
:treeData="data"
:currentInfo="currentInfo"
@success="handleSuccessEdit()"
/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import {orgAdd, orgEdit} from './orgDialog' import { orgAdd, orgEdit } from "./orgDialog";
export default { export default {
data() { data() {
return { return {
...@@ -101,126 +114,175 @@ export default { ...@@ -101,126 +114,175 @@ export default {
children: "children", children: "children",
label: "name", label: "name",
}, },
currentId:'', currentId: "",
currentInfo:{}, currentInfo: {},
}; };
}, },
components:{orgAdd,orgEdit}, components: { orgAdd, orgEdit },
mounted(){ mounted() {
this.getOrgTree() this.getOrgTree();
}, },
methods: { methods: {
handleNodeClick(data) { handleNodeClick(data) {
this.currentId = data.id this.currentId = data.id;
this.getInfoById() this.getInfoById();
}, },
// 获取机构数详情 // 获取机构数详情
getInfoById(){ getInfoById() {
this.$https({ this.$https(
method: "get", {
url: "organ/getById", method: "get",
authType: this.backToken, url: "organ/getById",
},{id:this.currentId}).then(res=>{ authType: this.backToken,
if(res.status == 200){ },
if(res.data.resultCode == 200){ { id: this.currentId }
if(res.data.data){ )
this.currentInfo = res.data.data .then((res) => {
}else{ if (res.status == 200) {
this.currentInfo = {} if (res.data.resultCode == 200) {
if (res.data.data) {
this.currentInfo = res.data.data;
this.currentInfo.childrenName = this.currentInfo.children
.map((v) => {
return v.name;
})
.join(" 、");
} else {
this.currentInfo = {};
}
} else {
this.currentInfo = {};
} }
}else{ } else {
this.currentInfo = {} this.currentInfo = {};
} }
}else{ })
this.currentInfo = {} .catch((err) => {
} console.log(res);
}).catch(err=>{ });
console.log(res)
})
}, },
// 获取机构树 // 获取机构树
getOrgTree(){ getOrgTree() {
this.$https({ this.$https(
method: "get", {
url: "organ/getTree", method: "get",
authType: this.backToken, url: "organ/getTree",
},{name:this.name}).then(res=>{ authType: this.backToken,
if(res.status == 200){ },
if(res.data.resultCode == 200){ { name: this.name }
this.data = res.data.data )
}else{ .then((res) => {
this.data = [] if (res.status == 200) {
if (res.data.resultCode == 200) {
this.data = res.data.data;
this.currentId = this.data[0] ? this.data[0].id : "";
this.getInfoById();
} else {
this.data = [];
}
} else {
this.data = [];
} }
}else{ })
this.data = [] .catch((err) => {
} console.log(res);
}).catch(err=>{ });
console.log(res)
})
},
// 新增或者导入 之前判断是否选择父级
handleOperate(type){
if(JSON.stringify(this.currentInfo) === "{}"){
this.currentId.level = 1
this.currentInfo.id = '0'
}
if(type === 'add'){
this.handleAdd()
}
if(type === 'import'){
this.handleImport()
}
}, },
// 新增 // 新增
handleAdd(){ handleAdd() {
this.$refs.orgAdd.dialogVisible = true this.$refs.orgAdd.dialogVisible = true;
}, },
//导入 //导入
handleImport(){ handleImport() {},
handleEdit() {
}, this.$refs.orgEdit.dialogVisible = true;
handleEdit(){
}, },
// 删除 // 删除
handleDel(){ handleDel() {
this.$confirm('此操作将永久删除, 是否继续?', '提示', { let _this = this;
confirmButtonText: '确定', this.$confirm("此操作将永久删除, 是否继续?", "提示", {
cancelButtonText: '取消', confirmButtonText: "确定",
type: 'warning' cancelButtonText: "取消",
}).then(() => { type: "warning",
this.delAction() })
}).catch(() => { .then(() => {
_this.delAction();
})
.catch(() => {
this.$message({ this.$message({
type: 'info', type: "info",
message: '已取消删除' message: "已取消删除",
}); });
}); });
}, },
delAction(){
this.$https({ delAction() {
method: `delete?id=${this.currentId}`, this.$https({
url: "organ/delete", method: "delete",
authType: this.backToken, url: `organ/delete?id=${this.currentId}`,
}).then(res=>{ authType: this.backToken,
if(res.status == 200){
if(res.data.resultCode == 200){
this.$message({
type:'success',
message:res.data.message
})
this.getOrgTree()
}else{
this.$message.error(res.data.message)
}
}else{
this.$message.error(res.data)
}
}).catch(err=>{
console.log(err)
}) })
} .then((res) => {
if (res.status == 200) {
if (res.data.resultCode == 200) {
this.$message({
type: "success",
message: res.data.message,
});
this.getOrgTree();
} else {
this.$message.error(res.data.message);
}
} else {
this.$message.error(res.data);
}
})
.catch((err) => {
console.log(err);
});
},
// 编辑成功
handleSuccessEdit() {
this.getOrgTree();
this.getInfoById();
},
beforeAvatarUpload(file) {
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isLt5M) {
this.$message.error("上传文件大小不能超过 5MB!");
}
return isLt5M;
},
handleRequest(file) {
let formData = new FormData();
formData.append("file", file.file);
let _this = this;
_this
.$https(
{
method: "post",
url: "organ/import",
authType: this.backToken,
},
formData
)
.then((res) => {
let resData = res.data;
if (res.status == 200) {
if (resData.resultCode == 200) {
_this.getOrgTree();
} else {
_this.$message.error(resData.msg || resData.message);
}
} else {
_this.$message.error(resData.msg || resData.message);
}
})
.catch((err) => {
console.log(err);
_this.$message.error(err.msg || err.message);
});
},
}, },
}; };
</script> </script>
...@@ -263,7 +325,7 @@ export default { ...@@ -263,7 +325,7 @@ export default {
.org-tree-box-content { .org-tree-box-content {
padding: 20px; padding: 20px;
height: calc(100% - 56px); height: calc(100% - 56px);
.tree-content{ .tree-content {
height: calc(100% - 60px); height: calc(100% - 60px);
overflow-y: auto; overflow-y: auto;
} }
...@@ -285,10 +347,10 @@ export default { ...@@ -285,10 +347,10 @@ export default {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 24px; padding: 0 24px;
.title{ .title {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color: @font-color; color: @font-color;
} }
.icon-del { .icon-del {
margin-left: 30px; margin-left: 30px;
...@@ -315,10 +377,14 @@ export default { ...@@ -315,10 +377,14 @@ export default {
.el-form { .el-form {
width: 648px; width: 648px;
margin: 0 auto; margin: 0 auto;
.w50 { width: calc(50% - 15px); } .w50 {
.w100 { width: 100%;} width: calc(50% - 15px);
.el-form-item__content{ }
span{ .w100 {
width: 100%;
}
.el-form-item__content {
span {
color: @font-color; color: @font-color;
font-weight: bold; font-weight: bold;
} }
......
...@@ -4,75 +4,75 @@ import Router from 'vue-router' ...@@ -4,75 +4,75 @@ import Router from 'vue-router'
Vue.use(Router); Vue.use(Router);
///首页 ///首页
const indexPage = r => require.ensure([],()=>r(require('@/page/end/indexPage')),'indexPage'); const indexPage = r => require.ensure([], () => r(require('@/page/end/indexPage')), 'indexPage');
// 呼叫记录 // 呼叫记录
const callHistory = r => require.ensure([],()=>r(require('@/page/end/callHistory')),'callHistory'); const callHistory = r => require.ensure([], () => r(require('@/page/end/callHistory')), 'callHistory');
///意见建议及反馈 ///意见建议及反馈
const feedbackPage = r => require.ensure([],()=>r(require('@/page/end/feedbackPage')),'feedbackPage'); const feedbackPage = r => require.ensure([], () => r(require('@/page/end/feedbackPage')), 'feedbackPage');
const hallDirectorPage = r => require.ensure([],()=>r(require('@/page/end/hallDirectorPage')),'hallDirectorPage'); const hallDirectorPage = r => require.ensure([], () => r(require('@/page/end/hallDirectorPage')), 'hallDirectorPage');
const page403 = r => require.ensure([],()=>r(require('@/page/errorPage/page403')),'page403'); const page403 = r => require.ensure([], () => r(require('@/page/errorPage/page403')), 'page403');
const page404 = r => require.ensure([],()=>r(require('@/page/errorPage/page404')),'page404'); const page404 = r => require.ensure([], () => r(require('@/page/errorPage/page404')), 'page404');
const page500 = r => require.ensure([],()=>r(require('@/page/errorPage/page500')),'page500'); const page500 = r => require.ensure([], () => r(require('@/page/errorPage/page500')), 'page500');
/*内容管理*/ /*内容管理*/
// 业务服务指南 // 业务服务指南
const serviceGuidePage = r => require.ensure([],()=>r(require('@/page/end/serviceGuidePage')),'serviceGuidePage'); const serviceGuidePage = r => require.ensure([], () => r(require('@/page/end/serviceGuidePage')), 'serviceGuidePage');
// 网点服务地图 // 网点服务地图
const serviceDirectoryPage = r => require.ensure([],()=>r(require('@/page/end/serviceDirectoryPage')),'serviceDirectoryPage'); const serviceDirectoryPage = r => require.ensure([], () => r(require('@/page/end/serviceDirectoryPage')), 'serviceDirectoryPage');
// 热门产品 // 热门产品
const hotProductsPage = r => require.ensure([],()=>r(require('@/page/end/hotProductsPage')),'hotProductsPage'); const hotProductsPage = r => require.ensure([], () => r(require('@/page/end/hotProductsPage')), 'hotProductsPage');
//热门活动 //热门活动
const popularActivitiesPage = r => require.ensure([],()=>r(require('@/page/end/popularActivitiesPage')),'popularActivitiesPage'); const popularActivitiesPage = r => require.ensure([], () => r(require('@/page/end/popularActivitiesPage')), 'popularActivitiesPage');
// 系统管理 // 系统管理
const userManagePage = r => require.ensure([],()=>r(require('@/page/end/userManagePage')),'userManagePage'); const userManagePage = r => require.ensure([], () => r(require('@/page/end/userManagePage')), 'userManagePage');
const roleManagePage = r => require.ensure([],()=>r(require('@/page/end/roleManagePage')),'roleManagePage'); const roleManagePage = r => require.ensure([], () => r(require('@/page/end/roleManagePage')), 'roleManagePage');
const branchesManagePage = r => require.ensure([],()=>r(require('@/page/end/branchesManagePage')),'branchesManagePage'); const branchesManagePage = r => require.ensure([], () => r(require('@/page/end/branchesManagePage')), 'branchesManagePage');
const permissionsManagePage = r => require.ensure([],()=>r(require('@/page/end/permissionsManagePage')),'permissionsManagePage'); const permissionsManagePage = r => require.ensure([], () => r(require('@/page/end/permissionsManagePage')), 'permissionsManagePage');
//菜单管理 //菜单管理
const menuManagePage = r => require.ensure([],()=>r(require('@/page/end/menuManagePage')),'menuManagePage'); const menuManagePage = r => require.ensure([], () => r(require('@/page/end/menuManagePage')), 'menuManagePage');
const analysisPage = r => require.ensure([],()=>r(require('@/page/end/analysisPage')),'analysisPage'); const analysisPage = r => require.ensure([], () => r(require('@/page/end/analysisPage')), 'analysisPage');
///预约记录 ///预约记录
const hotProductsRecord = r => require.ensure([],()=>r(require('@/page/end/hotProductsRecord')),'hotProductsRecord'); const hotProductsRecord = r => require.ensure([], () => r(require('@/page/end/hotProductsRecord')), 'hotProductsRecord');
const popularActiveRecord = r => require.ensure([],()=>r(require('@/page/end/popularActiveRecord')),'popularActiveRecord'); const popularActiveRecord = r => require.ensure([], () => r(require('@/page/end/popularActiveRecord')), 'popularActiveRecord');
// 内容管理 // 内容管理
const videoCopyright = r => require.ensure([],()=>r(require('@/page/content/video/copyright/index')),'videoCopyright'); const videoCopyright = r => require.ensure([], () => r(require('@/page/content/video/copyright/index')), 'videoCopyright');
const videoCopyrightAdd = r => require.ensure([],()=>r(require('@/page/content/video/copyright/add')),'videoCopyrightAdd'); const videoCopyrightAdd = r => require.ensure([], () => r(require('@/page/content/video/copyright/add')), 'videoCopyrightAdd');
const videoCopyrightUpdate = r => require.ensure([],()=>r(require('@/page/content/video/copyright/add')),'videoCopyrightUpdate'); const videoCopyrightUpdate = r => require.ensure([], () => r(require('@/page/content/video/copyright/add')), 'videoCopyrightUpdate');
const videoContent = r => require.ensure([],()=>r(require('@/page/content/video/content/index')),'videoContent'); const videoContent = r => require.ensure([], () => r(require('@/page/content/video/content/index')), 'videoContent');
const videoContentAdd = r => require.ensure([],()=>r(require('@/page/content/video/content/add')),'videoContentAdd'); const videoContentAdd = r => require.ensure([], () => r(require('@/page/content/video/content/add')), 'videoContentAdd');
const videoContentUpdate = r => require.ensure([],()=>r(require('@/page/content/video/content/add')),'videoContentUpdate'); const videoContentUpdate = r => require.ensure([], () => r(require('@/page/content/video/content/add')), 'videoContentUpdate');
/*跳转的页面*/ /*跳转的页面*/
// 新建服务指南 // 新建服务指南
const newServiceGuide = r => require.ensure([],()=>r(require('@/page/routerPage/newServiceGuide')),'newServiceGuide'); const newServiceGuide = r => require.ensure([], () => r(require('@/page/routerPage/newServiceGuide')), 'newServiceGuide');
// 新建网络服务地图 // 新建网络服务地图
const newDirectory = r => require.ensure([],()=>r(require('@/page/routerPage/newDirectory')),'newDirectory'); const newDirectory = r => require.ensure([], () => r(require('@/page/routerPage/newDirectory')), 'newDirectory');
// 新建网络服务地图 // 新建网络服务地图
const hotSpotManage = r => require.ensure([],()=>r(require('@/page/routerPage/hotSpotManage')),'hotSpotManage'); const hotSpotManage = r => require.ensure([], () => r(require('@/page/routerPage/hotSpotManage')), 'hotSpotManage');
// 新增热门服务 // 新增热门服务
const newHotPro = r => require.ensure([],()=>r(require('@/page/routerPage/newHotPro')),'newHotPro'); const newHotPro = r => require.ensure([], () => r(require('@/page/routerPage/newHotPro')), 'newHotPro');
// 新增业务 // 新增业务
const newPopActivity = r => require.ensure([],()=>r(require('@/page/routerPage/newPopActivity')),'newPopActivity'); const newPopActivity = r => require.ensure([], () => r(require('@/page/routerPage/newPopActivity')), 'newPopActivity');
//审核 auditMsg auditMap auditProductActivity //审核 auditMsg auditMap auditProductActivity
const auditMsg = r => require.ensure([],()=>r(require('@/page/routerPage/auditMsg')),'auditMsg'); const auditMsg = r => require.ensure([], () => r(require('@/page/routerPage/auditMsg')), 'auditMsg');
const auditMap = r => require.ensure([],()=>r(require('@/page/routerPage/auditMap')),'auditMap'); const auditMap = r => require.ensure([], () => r(require('@/page/routerPage/auditMap')), 'auditMap');
const auditProductActivity = r => require.ensure([],()=>r(require('@/page/routerPage/auditProductActivity')),'auditProductActivity'); const auditProductActivity = r => require.ensure([], () => r(require('@/page/routerPage/auditProductActivity')), 'auditProductActivity');
//管理 //管理
const menuRouter = r => require.ensure([],()=>r(require('@/page/end/menuRouter')),'menuRouter'); const menuRouter = r => require.ensure([], () => r(require('@/page/end/menuRouter')), 'menuRouter');
// 登录 // 登录
const login = r => require.ensure([],()=>r(require('@/components/end/login')),'login'); const login = r => require.ensure([], () => r(require('@/components/end/login')), 'login');
// 忘记密码 // 忘记密码
const forgetPassword = r => require.ensure([],()=>r(require('@/components/end/forgetPassword')),'forgetPassword'); const forgetPassword = r => require.ensure([], () => r(require('@/components/end/forgetPassword')), 'forgetPassword');
// 首页 // 首页
import { statisticsRoute } from './statistics' import { statisticsRoute } from './statistics'
import { systemRoute } from './system' import { systemRoute } from './system'
...@@ -80,30 +80,37 @@ import { accoutsRoute } from './accout' ...@@ -80,30 +80,37 @@ import { accoutsRoute } from './accout'
import { STBoxRoute } from './STBox' import { STBoxRoute } from './STBox'
const router = new Router({ const router = new Router({
routes: [ routes: [
{ {
path: '/', path: '/',
name: '登录', redirect:'/login'
component: login },
}, {
{ path: '/login',
path: '/index', name: '登录',
name: '首页', component: login,
component: () => import('@/page/index/index'), meta:{
meta:{ noShowbar:true
isRequireLogin:true, }
showBreadcrumb:false },
} {
}, path: '/index',
...statisticsRoute, name: '首页',
...systemRoute, component: () => import('@/page/index/index'),
...accoutsRoute, meta: {
...STBoxRoute, isRequireLogin: true,
{ showBreadcrumb: false
path: '/forgetPassword', }
name: '忘记密码', },
component: forgetPassword ...statisticsRoute,
}, ...systemRoute,
{ ...accoutsRoute,
...STBoxRoute,
{
path: '/forgetPassword',
name: '忘记密码',
component: forgetPassword
},
{
path: '/menuRouter', path: '/menuRouter',
component: menuRouter, component: menuRouter,
meta: { meta: {
...@@ -216,18 +223,18 @@ const router = new Router({ ...@@ -216,18 +223,18 @@ const router = new Router({
path: '/videoCopyrightAdd', path: '/videoCopyrightAdd',
name: '新建版权方', name: '新建版权方',
component: videoCopyrightAdd, component: videoCopyrightAdd,
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'新建版权方', title: '新建版权方',
} }
}, },
{ {
path: '/videoCopyrightUpdate', path: '/videoCopyrightUpdate',
name: '修改版权方', name: '修改版权方',
component: videoCopyrightUpdate, component: videoCopyrightUpdate,
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'修改版权方', title: '修改版权方',
} }
}, },
...@@ -240,54 +247,54 @@ const router = new Router({ ...@@ -240,54 +247,54 @@ const router = new Router({
path: '/videoContentAdd', path: '/videoContentAdd',
name: '新建视频', name: '新建视频',
component: videoContentAdd, component: videoContentAdd,
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'新建视频', title: '新建视频',
} }
}, },
{ {
path: '/videoContentUpdate', path: '/videoContentUpdate',
name: '修改视频', name: '修改视频',
component: videoContentUpdate, component: videoContentUpdate,
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'修改视频', title: '修改视频',
} }
}, },
{ {
path: '/videoCopyright', path: '/videoCopyright',
name: '视频版权方管理', name: '视频版权方管理',
component: () => import('@/page/content/video/copyright/index'), component: () => import('@/page/content/video/copyright/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'视频版权方管理', title: '视频版权方管理',
} }
}, },
{ {
path: '/videoClassify', path: '/videoClassify',
name: '视频分类管理', name: '视频分类管理',
component: () => import('@/page/content/video/classify/index'), component: () => import('@/page/content/video/classify/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'视频分类管理', title: '视频分类管理',
} }
}, },
{ {
path: '/videoContent', path: '/videoContent',
name: '视频内容管理', name: '视频内容管理',
component: () => import('@/page/content/video/content/index'), component: () => import('@/page/content/video/content/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'视频内容管理', title: '视频内容管理',
} }
}, },
{ {
path: '/videoRemit', path: '/videoRemit',
name: '视频汇出', name: '视频汇出',
component: () => import('@/page/content/video/remit/index'), component: () => import('@/page/content/video/remit/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'视频汇出', title: '视频汇出',
} }
}, },
...@@ -296,54 +303,54 @@ const router = new Router({ ...@@ -296,54 +303,54 @@ const router = new Router({
path: '/displayCopyright', path: '/displayCopyright',
name: '展板版权方管理', name: '展板版权方管理',
component: () => import('@/page/content/display/copyright/index'), component: () => import('@/page/content/display/copyright/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'展板版权方管理', title: '展板版权方管理',
} }
}, },
{ {
path: '/displayClassify', path: '/displayClassify',
name: '展板分类管理', name: '展板分类管理',
component: () => import('@/page/content/display/classify/index'), component: () => import('@/page/content/display/classify/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'展板分类管理', title: '展板分类管理',
} }
}, },
{ {
path: '/displayContent', path: '/displayContent',
name: '展板内容管理', name: '展板内容管理',
component: () => import('@/page/content/display/content/index'), component: () => import('@/page/content/display/content/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'展板内容管理', title: '展板内容管理',
} }
}, },
{ {
path: '/displayContentAdd', path: '/displayContentAdd',
name: '新建展板', name: '新建展板',
component: () => import('@/page/content/display/content/add'), component: () => import('@/page/content/display/content/add'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'新建展板', title: '新建展板',
} }
}, },
{ {
path: '/displayContentUpdate', path: '/displayContentUpdate',
name: '修改展板', name: '修改展板',
component: () => import('@/page/content/display/content/add'), component: () => import('@/page/content/display/content/add'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'修改展板', title: '修改展板',
} }
}, },
{ {
path: '/displayContentDetails', path: '/displayContentDetails',
name: '展板管理详情', name: '展板管理详情',
component: () => import('@/page/content/display/content/details'), component: () => import('@/page/content/display/content/details'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'展板管理详情', title: '展板管理详情',
} }
}, },
// --学习 // --学习
...@@ -351,87 +358,87 @@ const router = new Router({ ...@@ -351,87 +358,87 @@ const router = new Router({
path: '/learnProject', path: '/learnProject',
name: '学习项目制作', name: '学习项目制作',
component: () => import('@/page/content/learn/project/index'), component: () => import('@/page/content/learn/project/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'学习项目制作', title: '学习项目制作',
} }
}, },
{ {
path: '/learnContent', path: '/learnContent',
name: '学习内容制作', name: '学习内容制作',
component: () => import('@/page/content/learn/content/index'), component: () => import('@/page/content/learn/content/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'学习内容制作', title: '学习内容制作',
} }
}, },
{ {
path: '/learnContentAdd', path: '/learnContentAdd',
name: '新建学习内容', name: '新建学习内容',
component: () => import('@/page/content/learn/content/add'), component: () => import('@/page/content/learn/content/add'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'新建学习内容', title: '新建学习内容',
} }
}, },
{ {
path: '/learnContentUpdate', path: '/learnContentUpdate',
name: '修改学习内容', name: '修改学习内容',
component: () => import('@/page/content/learn/content/add'), component: () => import('@/page/content/learn/content/add'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'修改学习内容', title: '修改学习内容',
} }
}, },
{ {
path: '/learnContentDetails', path: '/learnContentDetails',
name: '学习内容详情', name: '学习内容详情',
component: () => import('@/page/content/learn/content/details'), component: () => import('@/page/content/learn/content/details'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'学习内容详情', title: '学习内容详情',
} }
}, },
// 审核 // 审核
{ {
path: '/checkVideo', path: '/checkVideo',
name: '视频审核', name: '视频审核',
component: () => import('@/page/check/video/index'), component: () => import('@/page/check/video/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'视频审核', title: '视频审核',
} }
}, },
{ {
path: '/checkDisplay', path: '/checkDisplay',
name: '展板审核', name: '展板审核',
component: () => import('@/page/check/display/index'), component: () => import('@/page/check/display/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'展板审核', title: '展板审核',
} }
}, },
{ {
path: '/checkLearn', path: '/checkLearn',
name: '平台学习内容审核', name: '平台学习内容审核',
component: () => import('@/page/check/learn/index'), component: () => import('@/page/check/learn/index'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'平台学习内容审核', title: '平台学习内容审核',
} }
}, },
{ {
path: '/checkLearnDetails', path: '/checkLearnDetails',
name: '学习内容详情', name: '学习内容详情',
component: () => import('@/page/check/learn/details'), component: () => import('@/page/check/learn/details'),
meta:{ meta: {
showBreadcrumb:true, showBreadcrumb: true,
title:'学习内容详情', title: '学习内容详情',
} }
}, },
//新建页面 //新建页面
{ {
...@@ -481,17 +488,17 @@ const router = new Router({ ...@@ -481,17 +488,17 @@ const router = new Router({
] ]
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if(to.meta.requireBackLogin){ if (to.meta.requireBackLogin) {
let user = localStorage.getItem("userId"); let user = localStorage.getItem("userId");
if (user) { // 通过vuex state获取当前的token是否存在 if (user) { // 通过vuex state获取当前的token是否存在
return next(); return next();
}else { } else {
next({ next({
path: '/', path: '/',
query: {redirect:to.fullPath}, query: { redirect: to.fullPath },
}) })
} }
}else { } else {
next(); next();
} }
}) })
......
@party-purple:#757BEE;
@party-pink:#CF6BA4;
@party-blue:#5E8DE5;
@party-green:#3DD0C6;
@colors: purple, pink, blue, green,red;
@iconList:headContent,copyrights,classify,content,plane,
pen,data,headAudit,video,screen,magnifier,disable,headUser,interaction,
account,headStb,radio,message,gear,appversion,interface,headStatistics,overview,tend,
statisticsUser,headSystem,organ,log,platUser,lock;
@lenIcon:length(@iconList);
@lenColor:length(@colors);
each(@iconList, {
.icon-@{value} {
background: url("~@/assets/menu/@{value}.png") no-repeat center/100% 100%;
}
});
each(@colors, {
// .index-@{value}{
// background-color: @{party-@{value}}
// }
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment