前后端分目录
This commit is contained in:
56
h5-auth-manager/src/components/page/403.vue
Normal file
56
h5-auth-manager/src/components/page/403.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div class="error-page">
|
||||
<div class="error-code">4<span>0</span>3</div>
|
||||
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div>
|
||||
<div class="error-handle">
|
||||
<router-link to="/">
|
||||
<el-button type="primary" size="large">返回首页</el-button>
|
||||
</router-link>
|
||||
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
goBack(){
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.error-page{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f3f3f3;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.error-code{
|
||||
line-height: 1;
|
||||
font-size: 250px;
|
||||
font-weight: bolder;
|
||||
color: #f02d2d;
|
||||
}
|
||||
.error-code span{
|
||||
color: #00a854;
|
||||
}
|
||||
.error-desc{
|
||||
font-size: 30px;
|
||||
color: #777;
|
||||
}
|
||||
.error-handle{
|
||||
margin-top: 30px;
|
||||
padding-bottom: 200px;
|
||||
}
|
||||
.error-btn{
|
||||
margin-left: 100px;
|
||||
}
|
||||
</style>
|
||||
56
h5-auth-manager/src/components/page/404.vue
Normal file
56
h5-auth-manager/src/components/page/404.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div class="error-page">
|
||||
<div class="error-code">4<span>0</span>4</div>
|
||||
<div class="error-desc">啊哦~ 你所访问的页面不存在</div>
|
||||
<div class="error-handle">
|
||||
<router-link to="/">
|
||||
<el-button type="primary" size="large">返回首页</el-button>
|
||||
</router-link>
|
||||
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
goBack(){
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.error-page{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f3f3f3;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.error-code{
|
||||
line-height: 1;
|
||||
font-size: 250px;
|
||||
font-weight: bolder;
|
||||
color: #2d8cf0;
|
||||
}
|
||||
.error-code span{
|
||||
color: #00a854;
|
||||
}
|
||||
.error-desc{
|
||||
font-size: 30px;
|
||||
color: #777;
|
||||
}
|
||||
.error-handle{
|
||||
margin-top: 30px;
|
||||
padding-bottom: 200px;
|
||||
}
|
||||
.error-btn{
|
||||
margin-left: 100px;
|
||||
}
|
||||
</style>
|
||||
420
h5-auth-manager/src/components/page/Dashboard.vue
Normal file
420
h5-auth-manager/src/components/page/Dashboard.vue
Normal file
@@ -0,0 +1,420 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" class="mgb20" style="height:252px;">
|
||||
<div class="user-info">
|
||||
<img src="../../assets/img/img.jpg" class="user-avator" alt />
|
||||
<div class="user-info-cont">
|
||||
<div class="user-info-name">{{name}}</div>
|
||||
<!-- <div>{{role}}</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-info-list">
|
||||
上次登录时间:
|
||||
<span>{{lastLoginTime | formatDate}}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="hover" style="height:252px;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>引擎详情</span>
|
||||
</div>
|
||||
<span v-if="engineRatio1">{{engineRatio1.engineName}}
|
||||
<el-progress :percentage="engineRatio1.useRatio" color="#42b983"></el-progress>
|
||||
</span>
|
||||
<span v-if="engineRatio2">{{engineRatio2.engineName}}
|
||||
<el-progress :percentage="engineRatio2.useRatio" color="#f1e05a"></el-progress>
|
||||
</span>
|
||||
<span v-if="engineRatio3">{{engineRatio3.engineName}}
|
||||
<el-progress :percentage="engineRatio3.useRatio"></el-progress>
|
||||
</span>
|
||||
<span v-if="engineRatio4">{{engineRatio4.engineName}}
|
||||
<el-progress :percentage="engineRatio4.useRatio" color="#f56c6c"></el-progress>
|
||||
</span>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-row :gutter="20" class="mgb20">
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" :body-style="{padding: '0px'}">
|
||||
<div class="grid-content grid-con-1">
|
||||
<i class="el-icon-lx-people grid-con-icon"></i>
|
||||
<div class="grid-cont-right">
|
||||
<div class="grid-num">{{engineNum}}</div>
|
||||
<div>引擎</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" :body-style="{padding: '0px'}">
|
||||
<div class="grid-content grid-con-2">
|
||||
<i class="el-icon-lx-notice grid-con-icon"></i>
|
||||
<div class="grid-cont-right">
|
||||
<div class="grid-num">{{engineNodeNum}}</div>
|
||||
<div>决策节点</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" :body-style="{padding: '0px'}">
|
||||
<div class="grid-content grid-con-3">
|
||||
<i class="el-icon-lx-goods grid-con-icon"></i>
|
||||
<div class="grid-cont-right">
|
||||
<div class="grid-num">{{engineResultNum}}</div>
|
||||
<div>决策结果</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-card shadow="hover" style="height:403px;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>活动日志</span>
|
||||
</div>
|
||||
<el-table :show-header="false" :data="todoList" style="width:100%;">
|
||||
<el-table-column>
|
||||
<template slot-scope="scope">
|
||||
<div class="todo-item">{{scope.row.opUserName}} {{scope.row.ip}} 在{{scope.row.startTime | formatDate}}
|
||||
{{scope.row.opName}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-card shadow="hover">
|
||||
<charts sid="dashboardLeft" height='250px' width='100%' :option="options"></charts>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card shadow="hover">
|
||||
<charts sid="dashboardRight" height='250px' width='100%' :option="options2"></charts>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import charts from '@/components/common/charts.vue'
|
||||
import bus from '../common/bus';
|
||||
import {
|
||||
getIndexInfo
|
||||
} from '../../api/index';
|
||||
export default {
|
||||
name: 'dashboard',
|
||||
components: {
|
||||
// Schart,
|
||||
charts
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: localStorage.getItem('ms_username'),
|
||||
lastLoginTime: null,
|
||||
engineNum: null,
|
||||
engineNodeNum: null,
|
||||
engineResultNum: null,
|
||||
engineRatio1: {},
|
||||
engineRatio2: {},
|
||||
engineRatio3: {},
|
||||
engineRatio4: {},
|
||||
|
||||
todoList: [],
|
||||
options: {
|
||||
title: {
|
||||
text: '最近几天引擎使用情况',
|
||||
left: 'center'
|
||||
},
|
||||
grid: {
|
||||
bottom: '10% '
|
||||
},
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
data: []
|
||||
}],
|
||||
yAxis: [{
|
||||
type: 'value'
|
||||
}],
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left',
|
||||
},
|
||||
series: []
|
||||
|
||||
},
|
||||
options2: {
|
||||
title: {
|
||||
text: '最近几个月引擎使用趋势图',
|
||||
left: 'center'
|
||||
},
|
||||
grid: {
|
||||
bottom: '10% '
|
||||
},
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
data: []
|
||||
}],
|
||||
yAxis: [{
|
||||
type: 'value'
|
||||
}],
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
series: []
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
role() {
|
||||
return this.name === 'admin' ? '超级管理员' : '普通用户';
|
||||
}
|
||||
},
|
||||
// created() {
|
||||
// this.handleListener();
|
||||
// this.changeDate();
|
||||
// },
|
||||
// activated() {
|
||||
// this.handleListener();
|
||||
// },
|
||||
// deactivated() {
|
||||
// window.removeEventListener('resize', this.renderChart);
|
||||
// bus.$off('collapse', this.handleBus);
|
||||
// },
|
||||
|
||||
created() {
|
||||
// this.getIndexInfos();
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeDate() {
|
||||
const now = new Date().getTime();
|
||||
this.data.forEach((item, index) => {
|
||||
const date = new Date(now - (6 - index) * 86400000);
|
||||
item.name = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
|
||||
});
|
||||
},
|
||||
|
||||
async getIndexInfos() {
|
||||
const result = await getIndexInfo();
|
||||
const data = result.data;
|
||||
|
||||
|
||||
// 引擎基本信息
|
||||
this.engineNum = data.engineBaseInfo.engineNum;
|
||||
this.engineNodeNum = data.engineBaseInfo.engineNodeNum;
|
||||
this.engineResultNum = data.engineBaseInfo.engineResultNum;
|
||||
|
||||
// 引擎使用占比
|
||||
this.engineRatio1 = data.engineUseRatio[0];
|
||||
this.engineRatio2 = data.engineUseRatio[1];
|
||||
this.engineRatio3 = data.engineUseRatio[2];
|
||||
this.engineRatio4 = data.engineUseRatio[3];
|
||||
|
||||
// 最近几天引擎使用情况
|
||||
|
||||
|
||||
|
||||
var labelOption = {
|
||||
show: true,
|
||||
position: 'insideBottomRight',
|
||||
distance: 10,
|
||||
align: 'left',
|
||||
verticalAlign: 'middle',
|
||||
rotate: 90,
|
||||
// formatter: '{c} {name|{a}}',
|
||||
fontSize: 12,
|
||||
rich: {
|
||||
name: {}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.options.xAxis[0].data = data.recentDayMap.labels;
|
||||
let arr = data.recentDayMap.datasets.map(value => {
|
||||
return {
|
||||
name: value.label,
|
||||
type: 'bar',
|
||||
barGap: 0,
|
||||
label: labelOption,
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: value.data
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.options.series = arr.filter((value,index)=>{
|
||||
return index<5
|
||||
})
|
||||
|
||||
// 最近几个月引擎使用情况
|
||||
this.options2.xAxis[0].data = data.recentMonthMap.labels;
|
||||
this.options2.series = data.recentMonthMap.datasets.map(value => {
|
||||
return {
|
||||
name: value.label,
|
||||
type: 'line',
|
||||
barGap: 0,
|
||||
label: labelOption,
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: value.data
|
||||
}
|
||||
})
|
||||
|
||||
// 上次登录时间
|
||||
this.lastLoginTime = data.lastLoginTime;
|
||||
|
||||
// 活动日志
|
||||
this.todoList = data.logList;
|
||||
}
|
||||
},
|
||||
|
||||
filters: {
|
||||
formatDate: function(value) {
|
||||
let date = new Date(value);
|
||||
let y = date.getFullYear();
|
||||
let MM = date.getMonth() + 1;
|
||||
MM = MM < 10 ? ('0' + MM) : MM;
|
||||
let d = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
let h = date.getHours();
|
||||
h = h < 10 ? ('0' + h) : h;
|
||||
let m = date.getMinutes();
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
let s = date.getSeconds();
|
||||
s = s < 10 ? ('0' + s) : s;
|
||||
return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.el-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.grid-cont-right {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.grid-num {
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.grid-con-icon {
|
||||
font-size: 50px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
text-align: center;
|
||||
line-height: 100px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.grid-con-1 .grid-con-icon {
|
||||
background: rgb(45, 140, 240);
|
||||
}
|
||||
|
||||
.grid-con-1 .grid-num {
|
||||
color: rgb(45, 140, 240);
|
||||
}
|
||||
|
||||
.grid-con-2 .grid-con-icon {
|
||||
background: rgb(100, 213, 114);
|
||||
}
|
||||
|
||||
.grid-con-2 .grid-num {
|
||||
color: rgb(45, 140, 240);
|
||||
}
|
||||
|
||||
.grid-con-3 .grid-con-icon {
|
||||
background: rgb(242, 94, 67);
|
||||
}
|
||||
|
||||
.grid-con-3 .grid-num {
|
||||
color: rgb(242, 94, 67);
|
||||
}
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 2px solid #ccc;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.user-avator {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-info-cont {
|
||||
padding-left: 50px;
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.user-info-cont div:first-child {
|
||||
font-size: 30px;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.user-info-list {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.user-info-list span {
|
||||
margin-left: 70px;
|
||||
}
|
||||
|
||||
.mgb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.todo-item {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.todo-item-del {
|
||||
text-decoration: line-through;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.schart {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
||||
47
h5-auth-manager/src/components/page/I18n.vue
Normal file
47
h5-auth-manager/src/components/page/I18n.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<section class="main">
|
||||
<div class="crumbs">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-lx-global"></i> {{$t('i18n.breadcrumb')}}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div class="container">
|
||||
<span>{{$t('i18n.tips')}}</span>
|
||||
<el-button type="primary" @click="$i18n.locale = $i18n.locale === 'zh'?'en':'zh';">{{$t('i18n.btn')}}</el-button>
|
||||
<div class="list">
|
||||
<h2>{{$t('i18n.title1')}}</h2>
|
||||
<p>{{$t('i18n.p1')}}</p>
|
||||
<p>{{$t('i18n.p2')}}</p>
|
||||
<p>{{$t('i18n.p3')}}</p>
|
||||
</div>
|
||||
<h2>{{$t('i18n.title2')}}</h2>
|
||||
<div>
|
||||
<i18n path="i18n.info" tag="p">
|
||||
<a place="action" href="https://element.eleme.cn/2.0/#/zh-CN/component/i18n">{{ $t('i18n.value') }}</a>
|
||||
</i18n>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
data(){
|
||||
return {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.list{
|
||||
padding: 30px 0;
|
||||
}
|
||||
.list p{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
a{
|
||||
color: #409eff;
|
||||
}
|
||||
</style>
|
||||
225
h5-auth-manager/src/components/page/Icon.vue
Normal file
225
h5-auth-manager/src/components/page/Icon.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="crumbs">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-lx-emoji"></i> 自定义图标</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div class="container">
|
||||
<h2>使用方法</h2>
|
||||
<p style="line-height: 50px;">
|
||||
直接通过设置类名为 el-icon-lx-iconName 来使用即可。例如:(共{{iconList.length}}个图标)
|
||||
</p>
|
||||
<p class="example-p">
|
||||
<i class="el-icon-lx-redpacket_fill" style="font-size: 30px;color: #ff5900"></i>
|
||||
<span><i class="el-icon-lx-redpacket_fill"></i></span>
|
||||
</p>
|
||||
<p class="example-p">
|
||||
<i class="el-icon-lx-weibo" style="font-size: 30px;color:#fd5656"></i>
|
||||
<span><i class="el-icon-lx-weibo"></i></span>
|
||||
</p>
|
||||
<p class="example-p">
|
||||
<i class="el-icon-lx-emojifill" style="font-size: 30px;color: #ffc300"></i>
|
||||
<span><i class="el-icon-lx-emojifill"></i></span>
|
||||
</p>
|
||||
<br>
|
||||
<h2>图标</h2>
|
||||
<div class="search-box">
|
||||
<el-input class="search" size="large" v-model="keyword" clearable placeholder="请输入图标名称"></el-input>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="icon-li" v-for="(item,index) in list" :key="index">
|
||||
<div class="icon-li-content">
|
||||
<i :class="`el-icon-lx-${item}`"></i>
|
||||
<span>{{item}}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: function(){
|
||||
return {
|
||||
keyword: '',
|
||||
iconList: [
|
||||
'attentionforbid',
|
||||
'attentionforbidfill',
|
||||
'attention',
|
||||
'attentionfill',
|
||||
'tag',
|
||||
'tagfill',
|
||||
'people',
|
||||
'peoplefill',
|
||||
'notice',
|
||||
'noticefill',
|
||||
'mobile',
|
||||
'mobilefill',
|
||||
'voice',
|
||||
'voicefill',
|
||||
'unlock',
|
||||
'lock',
|
||||
'home',
|
||||
'homefill',
|
||||
'delete',
|
||||
'deletefill',
|
||||
'notification',
|
||||
'notificationfill',
|
||||
'notificationforbidfill',
|
||||
'like',
|
||||
'likefill',
|
||||
'comment',
|
||||
'commentfill',
|
||||
'camera',
|
||||
'camerafill',
|
||||
'warn',
|
||||
'warnfill',
|
||||
'time',
|
||||
'timefill',
|
||||
'location',
|
||||
'locationfill',
|
||||
'favor',
|
||||
'favorfill',
|
||||
'skin',
|
||||
'skinfill',
|
||||
'news',
|
||||
'newsfill',
|
||||
'record',
|
||||
'recordfill',
|
||||
'emoji',
|
||||
'emojifill',
|
||||
'message',
|
||||
'messagefill',
|
||||
'goods',
|
||||
'goodsfill',
|
||||
'crown',
|
||||
'crownfill',
|
||||
'move',
|
||||
'add',
|
||||
'hot',
|
||||
'hotfill',
|
||||
'service',
|
||||
'servicefill',
|
||||
'present',
|
||||
'presentfill',
|
||||
'pic',
|
||||
'picfill',
|
||||
'rank',
|
||||
'rankfill',
|
||||
'male',
|
||||
'female',
|
||||
'down',
|
||||
'top',
|
||||
'recharge',
|
||||
'rechargefill',
|
||||
'forward',
|
||||
'forwardfill',
|
||||
'info',
|
||||
'infofill',
|
||||
'redpacket',
|
||||
'redpacket_fill',
|
||||
'roundadd',
|
||||
'roundaddfill',
|
||||
'friendadd',
|
||||
'friendaddfill',
|
||||
'cart',
|
||||
'cartfill',
|
||||
'more',
|
||||
'moreandroid',
|
||||
'back',
|
||||
'right',
|
||||
'shop',
|
||||
'shopfill',
|
||||
'question',
|
||||
'questionfill',
|
||||
'roundclose',
|
||||
'roundclosefill',
|
||||
'roundcheck',
|
||||
'roundcheckfill',
|
||||
'global',
|
||||
'mail',
|
||||
'punch',
|
||||
'exit',
|
||||
'upload',
|
||||
'read',
|
||||
'file',
|
||||
'link',
|
||||
'full',
|
||||
'group',
|
||||
'friend',
|
||||
'profile',
|
||||
'addressbook',
|
||||
'calendar',
|
||||
'text',
|
||||
'copy',
|
||||
'share',
|
||||
'wifi',
|
||||
'vipcard',
|
||||
'weibo',
|
||||
'remind',
|
||||
'refresh',
|
||||
'filter',
|
||||
'settings',
|
||||
'scan',
|
||||
'qrcode',
|
||||
'cascades',
|
||||
'apps',
|
||||
'sort',
|
||||
'searchlist',
|
||||
'search',
|
||||
'edit'
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list(){
|
||||
return this.iconList.filter((item) => {
|
||||
return item.indexOf(this.keyword) !== -1;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.example-p{
|
||||
height: 45px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.search-box{
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.search{
|
||||
width: 300px;
|
||||
}
|
||||
ul,li{
|
||||
list-style: none;
|
||||
}
|
||||
.icon-li{
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
.icon-li-content{
|
||||
display: flex;
|
||||
height: 100%;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.icon-li-content i{
|
||||
font-size: 36px;
|
||||
color: #606266;
|
||||
}
|
||||
.icon-li-content span{
|
||||
margin-top: 10px;
|
||||
color: #787878;
|
||||
}
|
||||
</style>
|
||||
133
h5-auth-manager/src/components/page/Login.vue
Normal file
133
h5-auth-manager/src/components/page/Login.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<div class="login-wrap">
|
||||
<div class="ms-login">
|
||||
<div class="ms-title">权限系统</div>
|
||||
<el-form :model="param" :rules="rules" ref="login" label-width="0px" class="ms-content">
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="param.username" placeholder="username">
|
||||
<el-button slot="prepend" icon="el-icon-lx-people"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
type="password"
|
||||
placeholder="password"
|
||||
v-model="param.password"
|
||||
@keyup.enter.native="submitForm()"
|
||||
>
|
||||
<el-button slot="prepend" icon="el-icon-lx-lock"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<div class="login-btn">
|
||||
<el-button type="primary" @click="submitForm()">登录</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getLogin } from '../../api/index';
|
||||
export default {
|
||||
created() {
|
||||
// if(this.$route.query.type=="token"){
|
||||
// this.$message.error('登陆授权码已过期')
|
||||
// this.$route.query.type=""
|
||||
// }
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
param: {
|
||||
username: '',
|
||||
password: '',
|
||||
},
|
||||
rules: {
|
||||
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
this.$refs.login.validate(valid => {
|
||||
if (valid) {
|
||||
// 调用登录接口
|
||||
this.getLogins();
|
||||
|
||||
} else {
|
||||
this.$message.error('请输入账号和密码');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
async getLogins() {
|
||||
// var formdata = new FormData();
|
||||
// formdata.append('account', this.param.username);
|
||||
// formdata.append('password', this.param.password);
|
||||
var params ={
|
||||
account:this.param.username,
|
||||
password:this.param.password
|
||||
}
|
||||
|
||||
const data = await getLogin(params);
|
||||
console.log('登录接口返回的数据',data);
|
||||
const code = data.code;
|
||||
|
||||
if(data.status==="1"){
|
||||
this.$message.success('登录成功,即将跳转');
|
||||
localStorage.setItem('ms_username', this.param.username);
|
||||
localStorage.setItem('token', data.data.token);
|
||||
this.$router.push('/');
|
||||
}
|
||||
else{
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login-wrap {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url(../../assets/img/login-bg.jpg);
|
||||
background-size: 100%;
|
||||
}
|
||||
.ms-title {
|
||||
width: 100%;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
.ms-login {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 350px;
|
||||
margin: -190px 0 0 -175px;
|
||||
border-radius: 5px;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
overflow: hidden;
|
||||
}
|
||||
.ms-content {
|
||||
padding: 30px 30px;
|
||||
}
|
||||
.login-btn {
|
||||
text-align: center;
|
||||
}
|
||||
.login-btn button {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.login-tips {
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
6
h5-auth-manager/src/components/page/bus.js
Normal file
6
h5-auth-manager/src/components/page/bus.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
// 使用 Event Bus
|
||||
const bus = new Vue();
|
||||
|
||||
export default bus;
|
||||
13
h5-auth-manager/src/components/page/redirect/index.vue
Normal file
13
h5-auth-manager/src/components/page/redirect/index.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<script>
|
||||
export default {
|
||||
created() {
|
||||
const { params, query } = this.$route
|
||||
console.log(params);
|
||||
const { path } = params
|
||||
this.$router.replace({ path: '/' + path, query })
|
||||
},
|
||||
render: function(h) {
|
||||
return h() // avoid warning message
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<div class="content-wrapper">
|
||||
<div>
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<div >
|
||||
当前时间:
|
||||
<el-date-picker v-model="dateValue" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd" @change="getlist">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div >
|
||||
<el-input placeholder="搜索" v-model="searchVal" class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="getlist"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="tab-wrapper">
|
||||
<div>
|
||||
<el-table border :data="dataList" style="width: 100%">
|
||||
|
||||
<el-table-column prop="id" width="200" label="ID">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="organName" label="组织名称" width="" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="opName" label="操作名称" width="" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="opUserName" label="操作人员名称" width="" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="ip" label="IP" width="" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="startTime" label="开始时间" width="" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{new Date(scope.row.startTime).format('yyyy-MM-dd hh:mm:ss')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="endTime" label="结束时间" width="" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{new Date(scope.row.endTime).format('yyyy-MM-dd hh:mm:ss')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" size="s">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="查看" placement="left">
|
||||
<el-button icon="el-icon-view" circle size="mini" @click="lockData(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination class="pagination-wrapper" background hide-on-single-page :current-page="pager.pageNum" :page-count="pager.lastPage"
|
||||
layout="prev, pager, next" @current-change="surrentChange">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 查看 -->
|
||||
<el-dialog title="日志详情" :visible.sync="dialogVisible" width="30%" center>
|
||||
<div class="log-info-wrapper">
|
||||
<p><strong>操作名称:</strong>{{currentItem.opName}}</p>
|
||||
<p><strong>操作人员名称:</strong>{{currentItem.opUserName}}</p>
|
||||
<p><strong>IP:</strong>{{currentItem.ip}}</p>
|
||||
<p><strong>请求路径:</strong>{{currentItem.requestPath}}</p>
|
||||
<p><strong>请求参数:</strong>{{currentItem.requestParam}}</p>
|
||||
<p><strong>响应参数:</strong>{{currentItem.responseParam}}</p>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
formatDate
|
||||
} from '@/assets/utils.js'
|
||||
import {
|
||||
getLogList
|
||||
} from '@/api/index.js'
|
||||
export default {
|
||||
//过滤
|
||||
name:'logManagement',
|
||||
filters: {
|
||||
formatDate(time) {
|
||||
let date = new Date(time)
|
||||
return formatDate(date, 'yyyy-MM-dd')
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pager: {},
|
||||
dataList: [],
|
||||
dateValue: [formatDate(new Date, 'yyyy-MM-dd'), formatDate(new Date, 'yyyy-MM-dd')],
|
||||
searchVal: "",
|
||||
dialogVisible: false,
|
||||
currentItem: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getlist();
|
||||
},
|
||||
methods: {
|
||||
lockData(e) {
|
||||
this.currentItem = e;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
surrentChange(e) {
|
||||
this.page = e;
|
||||
this.getlist();
|
||||
},
|
||||
async getlist() {
|
||||
const data = await getLogList({
|
||||
searchKey: this.searchVal,
|
||||
startDate: this.dateValue[0],
|
||||
endDate: this.dateValue[1],
|
||||
pageNo: this.page,
|
||||
pageSize: this.pageSize
|
||||
})
|
||||
if (data.status != "0") {
|
||||
const listUser = data.data.logList;
|
||||
const pager = data.data.pager;
|
||||
this.pager = pager;
|
||||
this.dataList = listUser
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.tab-wrapper {
|
||||
padding: 21px 0;
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
margin-right: 40px;
|
||||
margin-top: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.content-wrapper .el-date-editor .el-range-separator {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.el-dialog--center .el-dialog__body {
|
||||
max-height: 500px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.log-info-wrapper p {
|
||||
line-height: 2;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,247 @@
|
||||
<template>
|
||||
<div class="content-wrapper">
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :span="16"> -->
|
||||
<div >
|
||||
<el-button @click="add()" type="primary">新增</el-button>
|
||||
<el-button @click="using(-1)" type="danger">删除</el-button>
|
||||
<el-button @click="using(1)" type="success">启用</el-button>
|
||||
<el-button @click="using(0)" type="warning">停用</el-button>
|
||||
</div>
|
||||
<!-- </el-col> -->
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="tab-wrapper">
|
||||
<div>
|
||||
<el-table border ref="multipleTable" :data="dataList" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="organId" width="200" label="ID">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="name" label="组织名称" width="" show-overflow-tooltip>
|
||||
<!-- <template slot-scope="scope">
|
||||
{{scope.row.name}}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="code" label="组织编号" width="" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="status" width="" label="状态">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.status===0?'停用':'启用'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column label="操作" align="center" size="s">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="编辑" placement="left">
|
||||
<el-button icon="el-icon-edit" circle size="mini" @click="organEdit(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="right">
|
||||
<el-button icon="el-icon-delete" circle size="mini" @click="setStatus(-1,scope.row.organId)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination class="pagination-wrapper" background hide-on-single-page :current-page="pager.pageNum" :page-count="pager.lastPage"
|
||||
layout="prev, pager, next" @current-change="surrentChange">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加编辑 -->
|
||||
<el-dialog title="配置账号" :visible.sync="dialogFormVisible" width="30%" class="edit-password-dialog">
|
||||
<el-form :model="form" ref="changeOrganForm" label-width="100px" label-position="left">
|
||||
<el-form-item label="名称" prop="name" :rules="[
|
||||
{ required: true, message: '不能为空!'}
|
||||
]">
|
||||
<el-input v-model="form.name" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="编号" prop="code" :rules="[
|
||||
{ required: true, message: '不能为空!'}
|
||||
]">
|
||||
<el-input v-model="form.code" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="changeOrgan('changeOrganForm')">确 定</el-button>
|
||||
<el-button @click="cancel()">取 消</el-button>
|
||||
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getOrganList,
|
||||
updateStatusOrgan,
|
||||
saveOrgan,
|
||||
updateOrgan
|
||||
} from '@/api/index.js'
|
||||
export default {
|
||||
name:'organizationManagement',
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pager: {},
|
||||
dataList: [],
|
||||
multipleSelection: [],
|
||||
dialogFormVisible: false,
|
||||
form: {
|
||||
name: "",
|
||||
code: ""
|
||||
},
|
||||
currItem: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getlist();
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.currItem = {};
|
||||
this.dialogFormVisible = false;
|
||||
this.form = {
|
||||
name: "",
|
||||
code: ""
|
||||
}
|
||||
this.$refs["changeOrganForm"].resetFields();
|
||||
},
|
||||
changeOrgan(myForm) {
|
||||
let form = this.form;
|
||||
this.$refs[myForm].validate((valid) => {
|
||||
if (valid) {
|
||||
if (JSON.stringify(this.currItem) == '{}') {
|
||||
this.save(form);
|
||||
} else {
|
||||
form.organId = this.currItem.organId;
|
||||
this.update(form);
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
organEdit(e) {
|
||||
this.currItem = e;
|
||||
this.form = {
|
||||
name: e.name,
|
||||
code: e.code
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
async update(form) {
|
||||
const data = await updateOrgan(form)
|
||||
if (data.status != "0") {
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: "success"
|
||||
});
|
||||
this.getlist();
|
||||
this.cancel();
|
||||
}
|
||||
},
|
||||
async save(form) {
|
||||
const data = await saveOrgan(form)
|
||||
if (data.status != "0") {
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: "success"
|
||||
});
|
||||
this.getlist();
|
||||
this.cancel();
|
||||
}
|
||||
},
|
||||
// 添加
|
||||
add() {
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
setStatus(status, ids) {
|
||||
let msg = "确认修改用户状态?"
|
||||
if (status == -1) {
|
||||
msg = "此操作将永久删除该文件, 是否继续?"
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.updateStatus(status, ids + '');
|
||||
});
|
||||
},
|
||||
using(num) {
|
||||
let selArr = [];
|
||||
this.multipleSelection.forEach(value => {
|
||||
selArr.push(value.organId);
|
||||
})
|
||||
if (selArr.length <= 0) {
|
||||
this.$message({
|
||||
message: '请选择!',
|
||||
type: "warning"
|
||||
});
|
||||
return
|
||||
}
|
||||
this.setStatus(num, selArr.join(','));
|
||||
},
|
||||
selectChanged(e) {
|
||||
this.page = 1;
|
||||
this.value = e;
|
||||
this.getlist();
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
surrentChange(e) {
|
||||
this.page = e;
|
||||
this.getlist();
|
||||
},
|
||||
async getlist() {
|
||||
const data = await getOrganList({
|
||||
pageNo: this.page,
|
||||
pageSize: this.pageSize
|
||||
})
|
||||
if (data.status != "0") {
|
||||
const listData = data.data.listOrgan;
|
||||
const pager = data.data.pager;
|
||||
this.pager = pager;
|
||||
this.dataList = listData
|
||||
}
|
||||
},
|
||||
async updateStatus(status, arrStr) {
|
||||
const data = await updateStatusOrgan({
|
||||
"ids": arrStr,
|
||||
"status": status
|
||||
})
|
||||
if (data.status != "0") {
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: "success"
|
||||
});
|
||||
this.getlist();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.tab-wrapper {
|
||||
padding: 21px 0;
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
margin-right: 40px;
|
||||
margin-top: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.edit-password-dialog .el-input {
|
||||
width: 70%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<div class="content-wrapper">
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<div>
|
||||
<el-button @click="add()" type="primary">新增</el-button>
|
||||
<el-button @click="using(-1)" type="danger">删除</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="tab-wrapper">
|
||||
|
||||
<el-tabs v-model="tabs" @tab-click="pager.pageNum=1;getlist()">
|
||||
<el-tab-pane :label="value.label" :name="value.label" v-for="value in systemList" :key="value.value"></el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
|
||||
<div v-loading="loading">
|
||||
<el-table border ref="multipleTable" :data="dataList" tooltip-effect="dark" style="width: 100%"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="code" width="200" label="资源编号">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="name" label="名称" width="" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="url" label="路径" width="" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="icon" label="图标" width="" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="sort" label="排序" width="" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="birth" label="创建时间" width="" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.birth|formatDate}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" size="s">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="编辑" placement="left">
|
||||
<el-button icon="el-icon-edit" circle size="mini" @click="editDiaglo(scope.row)">
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="right">
|
||||
<el-button icon="el-icon-delete" circle size="mini" @click="setStatus(-1,scope.row.resourceId)">
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination class="pagination-wrapper" background :current-page="pager.pageNum"
|
||||
:total="pager.total" layout="prev, pager, next" @current-change="surrentChange">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<add-resource-dialog v-if="dialogVisible" :dialogVisible="dialogVisible" @closeEvent="handleClose" :dataItem="dataItem">
|
||||
</add-resource-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
formatDate
|
||||
} from '@/assets/utils.js'
|
||||
import {
|
||||
getRsourceMenuList,
|
||||
resourceUpdateStatus
|
||||
} from '@/api/index.js'
|
||||
import AddResourceDialog from '../../models/addResourceDialog.vue'
|
||||
import mixin from '@/utils/mixin.js'
|
||||
export default {
|
||||
name: 'resourceManagement',
|
||||
mixins:[mixin],
|
||||
components: {
|
||||
AddResourceDialog
|
||||
},
|
||||
//过滤
|
||||
filters: {
|
||||
formatDate(time) {
|
||||
let date = new Date(time)
|
||||
return formatDate(date, 'yyyy-MM-dd')
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pager: {},
|
||||
dataList: [],
|
||||
multipleSelection: [],
|
||||
dialogVisible: false,
|
||||
dataItem: {},
|
||||
dialogFormVisible: false,
|
||||
tabs:'EngineX',
|
||||
loading:false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getlist();
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.dataItem = {};
|
||||
this.dialogVisible = false;
|
||||
this.getlist();
|
||||
},
|
||||
// 添加
|
||||
add() {
|
||||
this.dataItem = {};
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
// 权限分配
|
||||
editDiaglo(e) {
|
||||
this.dataItem = e;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
setStatus(status, ids) {
|
||||
let msg = "确认修改用户状态?"
|
||||
if (status == -1) {
|
||||
msg = "此操作将永久删除该文件, 是否继续?"
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.updateStatus(status, ids + '');
|
||||
});
|
||||
},
|
||||
using(num) {
|
||||
let selArr = [];
|
||||
this.multipleSelection.forEach(value => {
|
||||
selArr.push(value.resourceId);
|
||||
})
|
||||
if (selArr.length <= 0) {
|
||||
this.$message({
|
||||
message: '请选择!',
|
||||
type: "warning"
|
||||
});
|
||||
return
|
||||
}
|
||||
this.setStatus(num, selArr.join(','));
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
surrentChange(e) {
|
||||
this.page = e;
|
||||
this.getlist();
|
||||
},
|
||||
async getlist() {
|
||||
this.loading = true
|
||||
const data = await getRsourceMenuList({
|
||||
pageNo: this.page,
|
||||
pageSize: this.pageSize,
|
||||
entity:{
|
||||
resourceSystem:this.tabs
|
||||
}
|
||||
})
|
||||
if (data.status != "0") {
|
||||
const listUser = data.data.listMenu;
|
||||
const pager = data.data.pager;
|
||||
this.pager = pager;
|
||||
this.dataList = listUser
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async updateStatus(status, arrStr) {
|
||||
const data = await resourceUpdateStatus({
|
||||
"ids": arrStr,
|
||||
"status": status
|
||||
})
|
||||
if (data.status != "0") {
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: "success"
|
||||
});
|
||||
this.getlist();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.tab-wrapper {
|
||||
padding: 21px 0;
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
margin-right: 40px;
|
||||
margin-top: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.edit-password-dialog .el-input {
|
||||
width: 70%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<div class="content-wrapper">
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :span="16"> -->
|
||||
<div>
|
||||
<el-button @click="add()" type="primary">新增</el-button>
|
||||
<el-button @click="using(-1)" type="danger" :disabled="multipleSelection.length>0?false:'disabled'">删除</el-button>
|
||||
<el-button @click="using(1)" type="success" :disabled="multipleSelection.length>0?false:'disabled'">启用</el-button>
|
||||
<el-button @click="using(0)" type="warning" :disabled="multipleSelection.length>0?false:'disabled'">停用</el-button>
|
||||
</div>
|
||||
<!-- </el-col> -->
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="tab-wrapper">
|
||||
<div>
|
||||
<el-table border ref="multipleTable" :data="dataList" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="roleId" width="200" label="ID">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="roleName" label="角色名" width="" show-overflow-tooltip>
|
||||
<!-- <template slot-scope="scope">
|
||||
{{scope.row.name}}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="status" width="" label="状态">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.status===0?'禁用':'启用'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="操作" align="center" size="s">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="编辑" placement="left">
|
||||
<el-button icon="el-icon-edit" circle size="mini" @click="roleEdit(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="权限分配" placement="left">
|
||||
<el-button icon="el-icon-edit-outline" circle size="mini" @click="editDiaglo(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="right">
|
||||
<el-button icon="el-icon-delete" circle size="mini" @click="setStatus(-1,scope.row.roleId)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination class="pagination-wrapper" background hide-on-single-page :current-page="pager.pageNum" :page-count="pager.lastPage"
|
||||
layout="prev, pager, next" @current-change="surrentChange">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 权限分配 -->
|
||||
<authority-assignment-dialog :dialogVisible="dialogVisible" @closeEvent="handleClose" :dataItem="dataItem"
|
||||
:listOrganArr="listOrganArr"></authority-assignment-dialog>
|
||||
<!-- 添加编辑角色 -->
|
||||
<el-dialog title="角色配置" :visible.sync="dialogFormVisible" width="30%" class="edit-password-dialog">
|
||||
<el-form :model="form" ref="changeRoleForm" label-width="100px" label-position="left">
|
||||
<el-form-item label="角色名" prop="roleName" :rules="[
|
||||
{ required: true, message: '不能为空!'}
|
||||
]">
|
||||
<el-input v-model="form.roleName" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属组织" prop="organId" :rules="[
|
||||
{ required: true, message: '请选择组织', trigger: 'change'}
|
||||
]">
|
||||
<el-select v-model="form.organId" placeholder="请选择所属组织" :disabled="listOrganArr.length<2?true:false">
|
||||
<el-option v-for="item in listOrganArr" :key="item.organId" :label="item.name" :value="item.organId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="changeRole('changeRoleForm')">确 定</el-button>
|
||||
<el-button @click="cancel()">取 消</el-button>
|
||||
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getRoleList,
|
||||
roleUpdateStatus,
|
||||
getAllValidOrgan,
|
||||
saveRole,
|
||||
updateRole
|
||||
} from '@/api/index.js'
|
||||
import AuthorityAssignmentDialog from '../../models/authorityAssignmentDialog.vue'
|
||||
export default {
|
||||
name:'roleManagement',
|
||||
components: {
|
||||
AuthorityAssignmentDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pager: {},
|
||||
dataList: [],
|
||||
multipleSelection: [],
|
||||
dialogVisible: false,
|
||||
dataItem: {},
|
||||
listOrganArr: [],
|
||||
dialogFormVisible: false,
|
||||
form: {
|
||||
roleName: "",
|
||||
organId: ""
|
||||
},
|
||||
currItem: {},
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getlist();
|
||||
this.organList();
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.currItem = {};
|
||||
this.dialogFormVisible = false;
|
||||
this.form = {
|
||||
roleName: "",
|
||||
organId: ""
|
||||
}
|
||||
this.$refs["changeRoleForm"].resetFields();
|
||||
},
|
||||
changeRole(myForm) {
|
||||
let form = this.form;
|
||||
this.$refs[myForm].validate((valid) => {
|
||||
if (valid) {
|
||||
if (JSON.stringify(this.currItem) == '{}') {
|
||||
this.saveRole(form);
|
||||
} else {
|
||||
form.roleId = this.currItem.roleId;
|
||||
this.updateRole(form);
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
roleEdit(e) {
|
||||
this.disabled = true;
|
||||
this.currItem = e;
|
||||
console.log(e);
|
||||
this.form = {
|
||||
roleName: e.roleName,
|
||||
organId: e.organId
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
if (this.listOrganArr.length == 1) {
|
||||
this.form.organId = this.listOrganArr[0].organId
|
||||
}
|
||||
},
|
||||
async updateRole(form) {
|
||||
const data = await updateRole(form)
|
||||
if (data.status != "0") {
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: "success"
|
||||
});
|
||||
this.getlist();
|
||||
this.cancel();
|
||||
}
|
||||
},
|
||||
async saveRole(form) {
|
||||
const data = await saveRole(form)
|
||||
if (data.status != "0") {
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: "success"
|
||||
});
|
||||
this.getlist();
|
||||
this.cancel();
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.dataItem = {};
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
// 添加
|
||||
add() {
|
||||
this.disabled = false;
|
||||
this.dataItem = {};
|
||||
this.dialogFormVisible = true;
|
||||
if (this.listOrganArr.length == 1) {
|
||||
this.form.organId = this.listOrganArr[0].organId
|
||||
}
|
||||
},
|
||||
// 权限分配
|
||||
editDiaglo(e) {
|
||||
this.dataItem = e;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
setStatus(status, ids) {
|
||||
let msg = "确认修改用户状态?"
|
||||
if (status == -1) {
|
||||
msg = "此操作将永久删除该文件, 是否继续?"
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.updateStatus(status, ids + '');
|
||||
});
|
||||
},
|
||||
using(num) {
|
||||
let selArr = [];
|
||||
this.multipleSelection.forEach(value => {
|
||||
selArr.push(value.roldId);
|
||||
})
|
||||
if (selArr.length <= 0) {
|
||||
this.$message({
|
||||
message: '请选择!',
|
||||
type: "warning"
|
||||
});
|
||||
return
|
||||
}
|
||||
this.setStatus(num, selArr.join(','));
|
||||
},
|
||||
selectChanged(e) {
|
||||
this.page = 1;
|
||||
this.value = e;
|
||||
this.getlist();
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
surrentChange(e) {
|
||||
this.page = e;
|
||||
this.getlist();
|
||||
},
|
||||
async getlist() {
|
||||
const data = await getRoleList({
|
||||
pageNo: this.page,
|
||||
pageSize: this.pageSize
|
||||
})
|
||||
if (data.status != "0") {
|
||||
const listUser = data.data.listRole;
|
||||
const pager = data.data.pager;
|
||||
this.pager = pager;
|
||||
this.dataList = listUser
|
||||
}
|
||||
},
|
||||
async updateStatus(status, arrStr) {
|
||||
const data = await roleUpdateStatus({
|
||||
"ids": arrStr,
|
||||
"status": status
|
||||
})
|
||||
if (data.status != "0") {
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: "success"
|
||||
});
|
||||
this.getlist();
|
||||
}
|
||||
},
|
||||
async organList() {
|
||||
const data = await getAllValidOrgan({})
|
||||
if (data.status != "0") {
|
||||
this.listOrganArr = data.data
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.tab-wrapper {
|
||||
padding: 21px 0;
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
margin-right: 40px;
|
||||
margin-top: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.edit-password-dialog .el-input {
|
||||
width: 70%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,306 @@
|
||||
<template>
|
||||
<div class="content-wrapper">
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :span="16"> -->
|
||||
<div>
|
||||
<el-button @click="add" type="primary">新增</el-button>
|
||||
<el-button @click="using(-1)" type="danger" :disabled="multipleSelection.length>0?false:'disabled'">删除</el-button>
|
||||
<el-button @click="using(1)" type="success" :disabled="multipleSelection.length>0?false:'disabled'">启用</el-button>
|
||||
<el-button @click="using(0)" type="warning" :disabled="multipleSelection.length>0?false:'disabled'">停用</el-button>
|
||||
</div>
|
||||
<!-- </el-col> -->
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="tab-wrapper">
|
||||
<div>
|
||||
<el-table border ref="multipleTable" :data="dataList" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="account" width="" label="账号">
|
||||
</el-table-column>
|
||||
<el-table-column prop="sysOrgan.name" width="" label="组织名称">
|
||||
<!-- <template slot-scope="scope">
|
||||
{{scope.row.status==1?'启用':scope.row.status==0?'停用':'删除'}}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="sysRole.roleName" label="角色" width="" show-overflow-tooltip>
|
||||
<!-- <template slot-scope="scope">
|
||||
{{scope.row.name}}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column prop="nickName" width="" label="姓名">
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" width="" label="备注">
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="status" width="" label="状态">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.status===0?'停用':scope.row.status==1?'启用':'删除'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="birth" label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.birth|formatDate}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" size="s">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="编辑" placement="left">
|
||||
<el-button icon="el-icon-edit" circle size="mini" @click="editDiaglo(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="left">
|
||||
<el-button icon="el-icon-delete" circle size="mini" @click="setStatus(-1,scope.row.userId)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改密码" placement="right">
|
||||
<el-button icon="el-icon-edit-outline" circle size="mini" @click="showDialogChangePassword(scope.row.userId)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination class="pagination-wrapper" background hide-on-single-page :current-page="pager.pageNum" :page-count="pager.lastPage"
|
||||
layout="prev, pager, next" @current-change="surrentChange">
|
||||
</el-pagination>
|
||||
<!-- :page-size="pager.size" -->
|
||||
<!-- :total="pager.total" -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加/编辑 -->
|
||||
<!-- <add-block-white :dialogVisible="dialogVisible" @closeEvent="handleClose" :dataItem="dataItem"></add-block-white> -->
|
||||
<add-user-dialog :dialogVisible="dialogVisible" @closeEvent="handleClose" :dataItem="dataItem" :listOrganArr="listOrganArr"></add-user-dialog>
|
||||
|
||||
<!-- 修改密码 -->
|
||||
<el-dialog title="修改密码" :visible.sync="dialogFormVisible" width="30%" class="edit-password-dialog">
|
||||
<el-form :model="form" ref="changePasswordForm">
|
||||
<el-form-item label="新密码" label-width="100px" prop="password" :rules="[
|
||||
{ required: true, message: '不能为空!'}
|
||||
]">
|
||||
<el-input v-model="form.password" autocomplete="off" type="password"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeChangePasswordForm()">取 消</el-button>
|
||||
<el-button type="primary" @click="changePassword('changePasswordForm')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
formatDate
|
||||
} from '@/assets/utils.js'
|
||||
import {
|
||||
getUserList,
|
||||
userUpdateStatus,
|
||||
getAllValidOrgan,
|
||||
updateUserPassword
|
||||
} from '@/api/index.js'
|
||||
import AddUserDialog from '../../models/addUserDialog.vue'
|
||||
export default {
|
||||
name:'userManagement',
|
||||
components: {
|
||||
AddUserDialog
|
||||
},
|
||||
//过滤
|
||||
filters: {
|
||||
formatDate(time) {
|
||||
let date = new Date(time)
|
||||
return formatDate(date, 'yyyy-MM-dd')
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pager: {},
|
||||
dataList: [],
|
||||
multipleSelection: [],
|
||||
dialogVisible: false,
|
||||
dataItem: {},
|
||||
listOrganArr: [],
|
||||
dialogFormVisible: false,
|
||||
form: {
|
||||
password: ""
|
||||
},
|
||||
currId: ""
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getlist();
|
||||
this.organList();
|
||||
},
|
||||
methods: {
|
||||
closeChangePasswordForm() {
|
||||
this.currId = "";
|
||||
this.dialogFormVisible = false;
|
||||
this.$refs["changePasswordForm"].resetFields();
|
||||
},
|
||||
changePassword(myForm) {
|
||||
this.$refs[myForm].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("确认修改", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.updateUserPassword(this.currId, this.form.password);
|
||||
});
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
showDialogChangePassword(id) {
|
||||
this.currId = id;
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
async updateUserPassword(id, password) {
|
||||
const data = await updateUserPassword({
|
||||
id: id,
|
||||
password: password
|
||||
})
|
||||
if (data.status === "0") {
|
||||
this.$message.error(data.msg);
|
||||
if (data.error === "01000103") {
|
||||
this.$router.push('/login')
|
||||
}
|
||||
return
|
||||
} else {
|
||||
this.$message({
|
||||
message: '修改成功!',
|
||||
type: "success"
|
||||
});
|
||||
this.closeChangePasswordForm();
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.dataItem = {};
|
||||
this.dialogVisible = false;
|
||||
this.getlist();
|
||||
},
|
||||
// 添加
|
||||
add() {
|
||||
this.dialogVisible = true;
|
||||
// let e = "";
|
||||
// this.$router.push({path:'/blackWhiteManage/addBlackWihite/$'})
|
||||
},
|
||||
// 编辑
|
||||
editDiaglo(e) {
|
||||
this.dataItem = e;
|
||||
this.dialogVisible = true;
|
||||
// this.$router.push({path:`/blackWhiteManage/addBlackWihite/${e.id}`})
|
||||
},
|
||||
setStatus(status, ids) {
|
||||
let msg = "确认修改用户状态?"
|
||||
if (status == -1) {
|
||||
msg = "此操作将永久删除该文件, 是否继续?"
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.updateStatus(status, String(ids));
|
||||
});
|
||||
},
|
||||
using(num) {
|
||||
let selArr = [];
|
||||
this.multipleSelection.forEach(value => {
|
||||
selArr.push(value.userId);
|
||||
})
|
||||
if (selArr.length <= 0) {
|
||||
this.$message({
|
||||
message: '请选择!',
|
||||
type: "warning"
|
||||
});
|
||||
return
|
||||
}
|
||||
this.setStatus(num, selArr.join(','));
|
||||
},
|
||||
selectChanged(e) {
|
||||
this.page = 1;
|
||||
this.value = e;
|
||||
this.getlist();
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
surrentChange(e) {
|
||||
this.page = e;
|
||||
this.getlist();
|
||||
},
|
||||
async getlist(e) {
|
||||
const data = await getUserList({
|
||||
pageNo: this.page,
|
||||
pageSize: this.pageSize
|
||||
})
|
||||
if (data.status === "0") {
|
||||
this.$message.error(data.msg);
|
||||
if (data.error === "01000103") {
|
||||
this.$router.push('/login')
|
||||
}
|
||||
return
|
||||
} else {
|
||||
const listUser = data.data.listUser;
|
||||
const pager = data.data.pager;
|
||||
this.pager = pager;
|
||||
this.dataList = listUser
|
||||
}
|
||||
},
|
||||
async updateStatus(status, arrStr) {
|
||||
const data = await userUpdateStatus({
|
||||
"ids": arrStr,
|
||||
"status": status
|
||||
})
|
||||
if (data.status === "0") {
|
||||
this.$message.error(data.msg);
|
||||
if (data.error === "01000103") {
|
||||
this.$router.push('/login')
|
||||
}
|
||||
return
|
||||
} else {
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: "success"
|
||||
});
|
||||
this.getlist();
|
||||
}
|
||||
},
|
||||
async organList() {
|
||||
const data = await getAllValidOrgan({})
|
||||
if (data.status === "0") {
|
||||
this.$message.error(data.msg);
|
||||
if (data.error === "01000103") {
|
||||
this.$router.push('/login')
|
||||
}
|
||||
return
|
||||
} else {
|
||||
this.listOrganArr = data.data
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.tab-wrapper {
|
||||
padding: 21px 0;
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
margin-right: 40px;
|
||||
margin-top: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.edit-password-dialog .el-input {
|
||||
width: 70%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user