Commit 76128e0e authored by 杨硕's avatar 杨硕

优化中间页面权限问题

parent c0e36fad
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>home_logo.png"> <link rel="icon" href="<%= BASE_URL %>liulanqi_logo.png">
<link rel="stylesheet" href="//at.alicdn.com/t/font_2011217_f70ptj9y4oc.css"> <link rel="stylesheet" href="//at.alicdn.com/t/font_2011217_f70ptj9y4oc.css">
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>
...@@ -24,10 +24,11 @@ export function delErrLog(data) { ...@@ -24,10 +24,11 @@ export function delErrLog(data) {
} }
// 清空异常日志 // 清空异常日志
export function cleanErrLog() { export function cleanErrLog(query) {
return request({ return request({
url: '/monitor/errorLog/clean', url: '/monitor/errorLog/clean',
method: 'delete' method: 'delete',
params: query
}) })
} }
......
import request from '@/utils/request' import request from '@/utils/request'
import Qs from 'qs' import Qs from 'qs'
// 查询登录日志列表 // 查询操作日志列表
export function list(query) { export function list(query) {
return request({ return request({
url: '/monitor/loginInfo/querySysLoginListByPagination', url: '/monitor/operLog/queryOperLogListByPagination',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 删除登录日志 // 删除操作日志
export function delLogininfo(data) { export function delOperLog(data) {
// data = Qs.stringify(data) // data = Qs.stringify(data)
return request({ return request({
url: '/monitor/loginInfo/delete', url: '/monitor/operLog/delete',
method: 'post', method: 'post',
data, data,
headers: { headers: {
...@@ -23,21 +23,21 @@ export function delLogininfo(data) { ...@@ -23,21 +23,21 @@ export function delLogininfo(data) {
}) })
} }
// 清空登录日志 // 清空操作日志
export function cleanLogininfo() { export function cleanOperLog(query) {
return request({ return request({
url: '/monitor/loginInfo/clean', url: '/monitor/operLog/clean',
method: 'delete' method: 'delete',
params: query
}) })
} }
// 导出登录日志 // 导出操作日志
export function exportLogininfo(query) { export function exportOperLog(query) {
return request({ return request({
url: '/monitor/loginInfo/export', url: '/monitor/operLog/export',
method: 'get', method: 'get',
params: query, params: query,
responseType: 'blob' responseType: 'blob'
}) })
} }
...@@ -103,7 +103,7 @@ export function exportType(query) { ...@@ -103,7 +103,7 @@ export function exportType(query) {
// 获取字典选择框列表 // 获取字典选择框列表
export function selectDictType(dictType) { export function selectDictType(dictType) {
return request({ return request({
url: '/system/dict/type/optionselect' + dictType, url: '/system/dict/data/type/' + dictType,
method: 'get' method: 'get'
}) })
} }
<template> <template>
<el-button <el-button
v-if="isShow"
:size="size"
:type="type"
:icon="icon"
:disabled="disabled"
@click="defaultClick"
>{{ name }}</el-button>
<el-button
v-else
v-hasPermi="hasper" v-hasPermi="hasper"
:size="size" :size="size"
:type="type" :type="type"
...@@ -10,8 +19,8 @@ ...@@ -10,8 +19,8 @@
</template> </template>
<script> <script>
import { getInfo } from '@/api/login' // import { getInfo } from '@/api/login'
import store from '../../store/index'
export default { export default {
name: 'CoolButton', name: 'CoolButton',
props: {// 调用该组件时需要传递过来的属性 props: {// 调用该组件时需要传递过来的属性
...@@ -51,16 +60,22 @@ export default { ...@@ -51,16 +60,22 @@ export default {
}, },
getInfoMessage() { getInfoMessage() {
const data = this.haspermi const data = this.haspermi
getInfo().then(res => { // getInfo().then(res => {
if (res.data.permissions[0] === '*:*:*') { // if (res.data.permissions[0] === '*:*:*') {
this.isShow = true // this.isShow = true
this.hasper = [] // this.hasper = []
} else { // } else {
this.hasper = data // this.isShow = false
} // this.hasper = data
// TODO: clear this log // }
console.log(`this.hasper`, this.hasper) // })
}) if (store.getters.permissions[0] === '*:*:*') {
this.isShow = true
this.hasper = []
} else {
this.isShow = false
this.hasper = data
}
} }
} }
} }
......
<template> <template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}"> <div class="sidebar-logo-container" :class="{'collapse':collapse}">
<transition name="sidebarLogoFade"> <transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/home">
<img v-if="logo" :src="logo" class="sidebar-logo"> <img v-if="logo" :src="logo" class="sidebar-logo">
<h1 v-else class="sidebar-title">{{ title }} </h1> <h1 v-else class="sidebar-title">{{ title }} </h1>
</router-link> </router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/"> <router-link v-else key="expand" class="sidebar-logo-link" to="/home">
<img v-if="logo" :src="logo" class="sidebar-logo"> <img v-if="logo" :src="logo" class="sidebar-logo">
<h1 class="sidebar-title">{{ title }} </h1> <h1 class="sidebar-title">{{ title }} </h1>
</router-link> </router-link>
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
data() { data() {
return { return {
title: '信息化管理系统', title: '信息化管理系统',
logo: require('@/assets/image/logo.png') logo: require('@/assets/image/denglu_logo@2x.png')
} }
} }
} }
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" /> <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
</template> </template>
<sidebar-item <sidebar-item
v-for="child in item.children" v-for="(child,index) in item.children"
:key="child.path" :key="child.path+index"
:is-nest="true" :is-nest="true"
:item="child" :item="child"
:base-path="resolvePath(child.path)" :base-path="resolvePath(child.path)"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
:collapse-transition="false" :collapse-transition="false"
mode="vertical" mode="vertical"
> >
<sidebar-item v-for="route in permission_routes" :key="route.path" :item="route" :base-path="route.path" /> <sidebar-item v-for="(route,index) in permission_routes" :key="route.path+index" :item="route" :base-path="route.path" />
</el-menu> </el-menu>
</el-scrollbar> </el-scrollbar>
</div> </div>
......
...@@ -6,25 +6,25 @@ ...@@ -6,25 +6,25 @@
class="hamburger-container" class="hamburger-container"
@toggleClick="toggleSideBar" @toggleClick="toggleSideBar"
/> />
<!-- <el-dropdown--> <!-- <el-dropdown-->
<!-- class="change-sys"--> <!-- class="change-sys"-->
<!-- @command="handleCommand"--> <!-- @command="handleCommand"-->
<!-- >--> <!-- >-->
<!--&lt;!&ndash; <span class="el-dropdown-link">&ndash;&gt;--> <!--&lt;!&ndash; <span class="el-dropdown-link">&ndash;&gt;-->
<!--&lt;!&ndash; 业务中台<i class="el-icon-arrow-down el-icon&#45;&#45;right" />&ndash;&gt;--> <!--&lt;!&ndash; 业务中台<i class="el-icon-arrow-down el-icon&#45;&#45;right" />&ndash;&gt;-->
<!--&lt;!&ndash; </span>&ndash;&gt;--> <!--&lt;!&ndash; </span>&ndash;&gt;-->
<!-- <el-dropdown-menu--> <!-- <el-dropdown-menu-->
<!-- slot="dropdown"--> <!-- slot="dropdown"-->
<!-- >--> <!-- >-->
<!-- <el-dropdown-item--> <!-- <el-dropdown-item-->
<!-- v-for="(item) in appList"--> <!-- v-for="(item) in appList"-->
<!-- :key="item.businessId"--> <!-- :key="item.businessId"-->
<!-- :command="specialTag !== '1' ? item.pcUrl : ''"--> <!-- :command="specialTag !== '1' ? item.pcUrl : ''"-->
<!-- >--> <!-- >-->
<!-- {{ item.system }}--> <!-- {{ item.system }}-->
<!-- </el-dropdown-item>--> <!-- </el-dropdown-item>-->
<!-- </el-dropdown-menu>--> <!-- </el-dropdown-menu>-->
<!-- </el-dropdown>--> <!-- </el-dropdown>-->
</div> </div>
<div class="right-menu"> <div class="right-menu">
<!-- <i class="el-icon-info" />--> <!-- <i class="el-icon-info" />-->
...@@ -36,12 +36,13 @@ ...@@ -36,12 +36,13 @@
<!-- <el-badge :value="200" :max="99" class="item">--> <!-- <el-badge :value="200" :max="99" class="item">-->
<!-- <i class="el-icon-message-solid" />--> <!-- <i class="el-icon-message-solid" />-->
<!-- </el-badge>--> <!-- </el-badge>-->
<span class="username-text">
[您好,{{ userName }}]
</span>
<el-dropdown class="avatar-container" trigger="click"> <el-dropdown class="avatar-container" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<!-- <img :src="avatar" class="user-avatar">--> <div class="username-text">
[您好,{{ userName }}]
</div>
<!-- <img :src="avatar" class="user-avatar">-->
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
<el-dropdown-menu slot="dropdown" class="user-dropdown"> <el-dropdown-menu slot="dropdown" class="user-dropdown">
...@@ -64,6 +65,9 @@ import { mapGetters } from 'vuex' ...@@ -64,6 +65,9 @@ import { mapGetters } from 'vuex'
import { queryInAdhibitions } from '@/api/internal.js' import { queryInAdhibitions } from '@/api/internal.js'
import Hamburger from '@/components/Hamburger' import Hamburger from '@/components/Hamburger'
export default { export default {
components: {
Hamburger
},
data() { data() {
return { return {
appList: [], appList: [],
...@@ -71,9 +75,6 @@ export default { ...@@ -71,9 +75,6 @@ export default {
specialTag: this.$store.state.user.specialTag specialTag: this.$store.state.user.specialTag
} }
}, },
components: {
Hamburger
},
computed: { computed: {
...mapGetters([ ...mapGetters([
'sidebar', 'sidebar',
...@@ -166,7 +167,14 @@ export default { ...@@ -166,7 +167,14 @@ export default {
.breadcrumb-container { .breadcrumb-container {
float: left; float: left;
} }
.username-text {
font-size: 16px;
//margin-right: 12px;
}
.username-text :hover {
cursor: pointer;
//margin-right: 12px;
}
.right-menu { .right-menu {
float: right; float: right;
height: 100%; height: 100%;
...@@ -180,9 +188,6 @@ export default { ...@@ -180,9 +188,6 @@ export default {
margin-right: 50px; margin-right: 50px;
font-size: 18px; font-size: 18px;
} }
.username-text {
margin-right: 12px;
}
.right-menu-item { .right-menu-item {
display: inline-block; display: inline-block;
padding: 0 8px; padding: 0 8px;
...@@ -202,6 +207,9 @@ export default { ...@@ -202,6 +207,9 @@ export default {
.avatar-container { .avatar-container {
margin-right: 30px; margin-right: 30px;
.avatar-wrapper :hover{
cursor: pointer;
}
.avatar-wrapper { .avatar-wrapper {
position: relative; position: relative;
height: 40px; height: 40px;
......
...@@ -20,14 +20,19 @@ const permission = { ...@@ -20,14 +20,19 @@ const permission = {
return new Promise(resolve => { return new Promise(resolve => {
// TODO: clear this log // TODO: clear this log
console.log(`menuName`, menuName) console.log(`menuName`, menuName)
const menuList = menuName.menuName.split(',')
// TODO: clear this log
console.log(`menuList`, menuList)
// 向后端请求路由数据 // 向后端请求路由数据
getInfo().then(res => { getInfo().then(res => {
const newRoute = [] const newRoute = []
// 根据点击的菜单名匹配对应的菜单 // 根据点击的菜单名匹配对应的菜单
res.data.menus.forEach(item => { res.data.menus.forEach(item => {
if (item.meta.title === menuName.menuName) { menuList.forEach(menuItem => {
newRoute.push(item) if (item.meta.title === menuItem) {
} newRoute.push(item)
}
})
}) })
const accessedRoutes = filterAsyncRouter(newRoute) const accessedRoutes = filterAsyncRouter(newRoute)
if (accessedRoutes[0]) { if (accessedRoutes[0]) {
......
...@@ -13,7 +13,7 @@ const user = { ...@@ -13,7 +13,7 @@ const user = {
roles: [], roles: [],
permissions: [], permissions: [],
specialTag: '', specialTag: '',
menuName: '' menuName: []
}, },
...@@ -87,7 +87,8 @@ const user = { ...@@ -87,7 +87,8 @@ const user = {
// TODO: clear this log // TODO: clear this log
console.log(`menuName-getInfo`, menuName) console.log(`menuName-getInfo`, menuName)
commit('SET_MENUNAME', menuName) // 存入菜单名 commit('SET_MENUNAME', menuName) // 存入菜单名
Cookies.set('menuname', menuName) const b = menuName.join(',')
Cookies.set('menuname', b)
resolve(menuName) resolve(menuName)
}) })
}, },
......
<template>
<div>
设备管理
</div>
</template>
<script>
export default {
name: 'Index'
}
</script>
<style scoped>
</style>
<template> <template>
<div class="home"> <div class="home">
<div class="home-const" @click="gotoIndex('系统管理')"> <div class="home-const" @click="gotoIndex(systemManage)">
<div> <div>
<img src="../assets/image/img5@2x.png" style="width: 100%;height: 392px"> <img src="../assets/image/img5@2x.png" style="width: 100%;height: 392px">
</div> </div>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<span class="card-title">系统管理</span> <span class="card-title">系统管理</span>
</div> </div>
</div> </div>
<div class="home-const" @click="gotoIndex('日志管理')"> <div class="home-const" @click="gotoIndex(logManage)">
<div> <div>
<img src="../assets/image/img6@2x.png" style="width: 100%;height: 392px"> <img src="../assets/image/img6@2x.png" style="width: 100%;height: 392px">
</div> </div>
...@@ -18,22 +18,22 @@ ...@@ -18,22 +18,22 @@
<span class="card-title">日志管理</span> <span class="card-title">日志管理</span>
</div> </div>
</div> </div>
<div class="home-const" @click="gotoIndex('消息管理')"> <div class="home-const" @click="gotoIndex(productionManage)">
<div> <div>
<img src="../assets/image/img7@2x.png" style="width: 100%;height: 392px"> <img src="../assets/image/img7@2x.png" style="width: 100%;height: 392px">
</div> </div>
<div class="card-bottom"> <div class="card-bottom">
<img src="../assets/image/icon7@2x.png" style="width: 40px;height: 40px;margin: 0 14px 0 20px"> <img src="../assets/image/icon7@2x.png" style="width: 40px;height: 40px;margin: 0 14px 0 20px">
<span class="card-title">消息管理</span> <span class="card-title">生产管理</span>
</div> </div>
</div> </div>
<div class="home-const" @click="gotoIndex('运维管理')"> <div class="home-const" @click="gotoIndex(equipmentManage)">
<div> <div>
<img src="../assets/image/img8@2x.png" style="width: 100%;height: 392px"> <img src="../assets/image/img8@2x.png" style="width: 100%;height: 392px">
</div> </div>
<div class="card-bottom"> <div class="card-bottom">
<img src="../assets/image/icon8@2x.png" style="width: 40px;height: 40px;margin: 0 14px 0 20px"> <img src="../assets/image/icon8@2x.png" style="width: 40px;height: 40px;margin: 0 14px 0 20px">
<span class="card-title">运维管理</span> <span class="card-title">设备管理</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -46,7 +46,10 @@ export default { ...@@ -46,7 +46,10 @@ export default {
name: 'Home', name: 'Home',
data() { data() {
return { return {
systemManage: ['系统管理'],
logManage: ['日志管理'],
productionManage: ['生产管理'],
equipmentManage: ['设备管理', '工序管理']
} }
}, },
created() { created() {
...@@ -57,16 +60,21 @@ export default { ...@@ -57,16 +60,21 @@ export default {
this.$store.dispatch('removeRole') this.$store.dispatch('removeRole')
}, },
gotoIndex(menuName) { gotoIndex(menuName) {
// TODO: clear this log
console.log(`menuName`, menuName)
getInfo().then(res => { getInfo().then(res => {
if (res.data.permissions) { if (res.data.permissions) {
// 判断用户是否有点击菜单的权限 // 判断用户是否有点击菜单的权限
var index = 0 var index = 0
res.data.menus.forEach(item => { res.data.menus.forEach(item => {
if (item.meta.title === menuName) { menuName.forEach(menuItem => {
index = index + 1 if (item.meta.title === menuItem) {
} index = index + 1
}
})
}) })
if (index > 0) { if (index > 0) {
// this.$message.success('用户有权限')
// 存入点击的菜单名,便于后边路由跳转 // 存入点击的菜单名,便于后边路由跳转
this.$store.dispatch('GetInfoMessage', menuName).then(() => { this.$store.dispatch('GetInfoMessage', menuName).then(() => {
this.$router.push('/welcome') this.$router.push('/welcome')
......
...@@ -20,20 +20,20 @@ ...@@ -20,20 +20,20 @@
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="code"> <!-- <el-form-item prop="code">-->
<el-input <!-- <el-input-->
v-model="loginForm.code" <!-- v-model="loginForm.code"-->
auto-complete="off" <!-- auto-complete="off"-->
placeholder="验证码" <!-- placeholder="验证码"-->
style="width: 63%" <!-- style="width: 63%"-->
@keyup.enter.native="handleLogin" <!-- @keyup.enter.native="handleLogin"-->
> <!-- >-->
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" /> <!-- <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />-->
</el-input> <!-- </el-input>-->
<!--<div class="login-code"> <!-- &lt;!&ndash;<div class="login-code">-->
<img :src="codeUrl" @click="getCode"> <!-- <img :src="codeUrl" @click="getCode">-->
</div>--> <!-- </div>&ndash;&gt;-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item style="width:80%;margin-bottom: 20px"> <el-form-item style="width:80%;margin-bottom: 20px">
<el-button <el-button
class="blue-btn" class="blue-btn"
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
class="buttons-content" class="buttons-content"
> >
<el-checkbox v-model="loginForm.rememberMe" class="rem-code">记住密码</el-checkbox> <el-checkbox v-model="loginForm.rememberMe" class="rem-code">记住密码</el-checkbox>
<el-link <!-- <el-link-->
:underline="false" <!-- :underline="false"-->
@click="goDetail('/forgetPwd')" <!-- @click="goDetail('/forgetPwd')"-->
> <!-- >-->
<router-link to="/forgetPwd">忘记密码</router-link> <!-- <router-link to="/forgetPwd">忘记密码</router-link>-->
</el-link> <!-- </el-link>-->
</div> </div>
</div> </div>
</el-form> </el-form>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -31,15 +31,15 @@ ...@@ -31,15 +31,15 @@
<el-form-item <el-form-item
prop="checkPass" prop="checkPass"
label="确认密码" label="确认密码"
placeholder="请再次输入新密码"
> >
<el-input <el-input
v-model="pwdList.checkPass" v-model="pwdList.checkPass"
placeholder="请再次输入新密码"
type="password" type="password"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="blue-btn" type="primary" @click="onSubmit">修改密码</el-button> <el-button class="blue-btn" type="primary" @click="onSubmit">确定</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</section> </section>
...@@ -121,30 +121,30 @@ export default { ...@@ -121,30 +121,30 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.forget-pwd-content{ .forget-pwd-content{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
min-height: calc(100vh - 110px); min-height: calc(100vh - 110px);
.title{ .title{
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
margin-top: 40px; margin-top: 40px;
}
.el-form{
margin-top: 40px;
width: 40%;
.el-form-item__label{
color: #333333;
font-weight: normal;
} }
.el-form{ .el-input__inner{
margin-top: 40px; border-radius: 4px;
width: 40%; }
.el-form-item__label{ .blue-btn{
color: #333333; height: 32px;
font-weight: normal; border-radius: 4px;
}
.el-input__inner{
border-radius: 4px;
}
.blue-btn{
height: 32px;
border-radius: 4px;
}
} }
} }
}
</style> </style>
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="leader" label="负责人" width="200" />
<el-table-column :show-overflow-tooltip="true" prop="phone" label="联系电话" width="200" />
<el-table-column :show-overflow-tooltip="true" label="创建时间" align="center" prop="createDate" width="200"> <el-table-column :show-overflow-tooltip="true" label="创建时间" align="center" prop="createDate" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
...@@ -133,7 +135,7 @@ ...@@ -133,7 +135,7 @@
<!-- type="text"--> <!-- type="text"-->
<!-- @click="handleDelete(scope.row)"--> <!-- @click="handleDelete(scope.row)"-->
<!-- >删除</el-button>--> <!-- >删除</el-button>-->
<coolbutton :type="typeParent" :name="nameParent" :size="size" :icon="delicon" :haspermi="delHaspermi" @btn-click="handleDelete(scope.row)" /> <coolbutton :type="typeParent" :name="nameParent" :size="size" :haspermi="delHaspermi" @btn-click="handleDelete(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -246,7 +248,16 @@ export default { ...@@ -246,7 +248,16 @@ export default {
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 状态数据字典 // 状态数据字典
statusOptions: [], statusOptions: [
{
dictLabel: '启用',
dictValue: '1'
},
{
dictLabel: '停用',
dictValue: '0'
}
],
// 查询参数 // 查询参数
queryParams: { queryParams: {
deptName: undefined, deptName: undefined,
...@@ -299,9 +310,9 @@ export default { ...@@ -299,9 +310,9 @@ export default {
this.queryParams = { ...param } this.queryParams = { ...param }
} }
this.getList() this.getList()
this.getDicts('sys_normal_disable'.toUpperCase()).then(response => { // this.getDicts('sys_normal_disable'.toUpperCase()).then(response => {
this.statusOptions = response.data // this.statusOptions = response.data
}) // })
}, },
methods: { methods: {
/** 查询部门列表 */ /** 查询部门列表 */
...@@ -341,9 +352,9 @@ export default { ...@@ -341,9 +352,9 @@ export default {
} }
}, },
// 字典状态字典翻译 // 字典状态字典翻译
statusFormat(row, column) { // statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.flag) // return this.selectDictLabel(this.statusOptions, row.flag)
}, // },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false this.open = false
...@@ -359,7 +370,7 @@ export default { ...@@ -359,7 +370,7 @@ export default {
leader: undefined, leader: undefined,
phone: undefined, phone: undefined,
email: undefined, email: undefined,
flag: '0' flag: '1'
} }
this.resetForm('form') this.resetForm('form')
}, },
......
...@@ -35,9 +35,7 @@ ...@@ -35,9 +35,7 @@
<el-button type="primary" size="small" @click="handleQuery">搜索</el-button> <el-button type="primary" size="small" @click="handleQuery">搜索</el-button>
<el-button size="small" @click="resetQuery">重置</el-button> <el-button size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> <el-form-item style="float: right">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:dict:add']"--> <!-- v-hasPermi="['sys:dict:add']"-->
<!-- type="primary"--> <!-- type="primary"-->
...@@ -47,8 +45,7 @@ ...@@ -47,8 +45,7 @@
<!-- >新增--> <!-- >新增-->
<!-- </el-button>--> <!-- </el-button>-->
<coolbutton :type="typePrimary" :name="addName" :icon="addIcon" :size="size" :haspermi="addHaspermi" @btn-click="handleAdd" /> <coolbutton :type="typePrimary" :name="addName" :icon="addIcon" :size="size" :haspermi="addHaspermi" @btn-click="handleAdd" />
</el-col>
<el-col :span="1.5">
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:dict:update']"--> <!-- v-hasPermi="['sys:dict:update']"-->
<!-- type="success"--> <!-- type="success"-->
...@@ -58,9 +55,7 @@ ...@@ -58,9 +55,7 @@
<!-- @click="handleUpdate"--> <!-- @click="handleUpdate"-->
<!-- >修改--> <!-- >修改-->
<!-- </el-button>--> <!-- </el-button>-->
<!-- <coolbutton :type="typeSuccess" :name="updataName" :icon="updateIcon" :size="size" :haspermi="updateHaspermi" @btn-click="handleUpdate" />-->
</el-col>
<el-col :span="1.5">
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:dict:delete']"--> <!-- v-hasPermi="['sys:dict:delete']"-->
<!-- type="danger"--> <!-- type="danger"-->
...@@ -70,31 +65,31 @@ ...@@ -70,31 +65,31 @@
<!-- @click="handleDelete"--> <!-- @click="handleDelete"-->
<!-- >删除--> <!-- >删除-->
<!-- </el-button>--> <!-- </el-button>-->
<!-- <coolbutton :type="typeDanger" :name="nameParent" :icon="delicon" :size="size" :haspermi="delHaspermi" @btn-click="handleDelete" />--> <!-- <coolbutton :type="typeDanger" :name="nameParent" :icon="delicon" :size="size" :haspermi="delHaspermi" @btn-click="handleDelete" />-->
</el-col>
<el-col :span="1.5">
<el-button <el-button
v-has-permi="['sys:dict:export']"
type="success" type="success"
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
>导出 >导出
</el-button> </el-button>
</el-col>
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" /> <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
</el-row>
</el-form-item>
</el-form>
<div class="placeholder" /> <div class="placeholder" />
<div style="padding:10px"> <div style="padding:10px">
<div class="mb12 font-small-bold">字典参数列表</div> <div class="mb12 font-small-bold">字典参数列表</div>
<el-table v-loading="loading" :data="dataList" border @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dataList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<!-- <el-table-column :show-overflow-tooltip="true" label="参数编码" prop="dictCode">--> <!-- <el-table-column :show-overflow-tooltip="true" label="参数编码" prop="dictCode">-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- {{ scope.row.dictCode || '-' }}--> <!-- {{ scope.row.dictCode || '-' }}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column label="字典编码" align="center" prop="businessId" /> <!-- <el-table-column label="字典编码" align="center" prop="businessId" />-->
<el-table-column :show-overflow-tooltip="true" label="字典标签" prop="dictLabel"> <el-table-column :show-overflow-tooltip="true" label="字典标签" prop="dictLabel">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.dictLabel || '-' }} {{ scope.row.dictLabel || '-' }}
...@@ -140,14 +135,14 @@ ...@@ -140,14 +135,14 @@
<!-- style="color: #49cec9"--> <!-- style="color: #49cec9"-->
<!-- @click="handleUpdate(scope.row)"--> <!-- @click="handleUpdate(scope.row)"-->
<!-- >修改</el-button>--> <!-- >修改</el-button>-->
<coolbutton style="color: #49cec9" :type="typeParent" :name="updataName" :size="size" :haspermi="editHaspermi" @btn-click="handleUpdate(scope.row)" /> <coolbutton style="color: #49cec9" :type="typeParent" :name="updataName" :size="size" :haspermi="updateHaspermi" @btn-click="handleUpdate(scope.row)" />
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:dictConfig:remove']"--> <!-- v-hasPermi="['sys:dictConfig:remove']"-->
<!-- size="mini"--> <!-- size="mini"-->
<!-- type="text"--> <!-- type="text"-->
<!-- @click="handleDelete(scope.row)"--> <!-- @click="handleDelete(scope.row)"-->
<!-- >删除</el-button>--> <!-- >删除</el-button>-->
<coolbutton :type="typeParent" :icon="delicon" :name="nameParent" :size="size" :haspermi="removeHaspermi" @btn-click="handleDelete(scope.row)" /> <coolbutton :type="typeParent" :name="nameParent" :size="size" :haspermi="delHaspermi" @btn-click="handleDelete(scope.row)" />
<!-- <el-switch--> <!-- <el-switch-->
<!-- v-model="scope.row.status"--> <!-- v-model="scope.row.status"-->
<!-- v-hasPermi="['sys:dictConfig:toggle']"--> <!-- v-hasPermi="['sys:dictConfig:toggle']"-->
...@@ -213,7 +208,7 @@ import Coolbutton from '@/components/coolbutton' ...@@ -213,7 +208,7 @@ import Coolbutton from '@/components/coolbutton'
export default { export default {
name: 'Data', name: 'Data',
components: {Coolbutton }, components: { Coolbutton },
data() { data() {
const verifyIDProp = (rule, value, callback) => { const verifyIDProp = (rule, value, callback) => {
if (value === '' || value === undefined || value === null) { if (value === '' || value === undefined || value === null) {
......
...@@ -100,15 +100,15 @@ ...@@ -100,15 +100,15 @@
<!-- >导出</el-button>--> <!-- >导出</el-button>-->
<coolbutton :type="typeSuccess" :name="exportName" :icon="exportIcon" :size="size" :haspermi="exportHaspermi" @btn-click="handleExport" /> <coolbutton :type="typeSuccess" :name="exportName" :icon="exportIcon" :size="size" :haspermi="exportHaspermi" @btn-click="handleExport" />
</el-col> </el-col>
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" /> <!-- <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />-->
</el-row> </el-row>
</el-form> </el-form>
<div class="placeholder" /> <div class="placeholder" />
<div style="min-height: 445px;padding:10px"> <div style="min-height: 445px;padding:10px">
<h5 style="margin: 0 0 12px 0;font-size: 14px">字典管理列表</h5> <h5 style="margin: 0 0 12px 0;font-size: 14px">字典管理列表</h5>
<el-table v-loading="loading" border :data="typeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" border :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="字典编号" align="center" prop="businessId" /> <!-- <el-table-column label="字典编号" align="center" prop="businessId" />-->
<el-table-column label="字典名称" prop="dictName" :show-overflow-tooltip="true"> <el-table-column label="字典名称" prop="dictName" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.dictName || '-' }} {{ scope.row.dictName || '-' }}
...@@ -157,14 +157,14 @@ ...@@ -157,14 +157,14 @@
<!-- style="color: #49cec9"--> <!-- style="color: #49cec9"-->
<!-- @click="handleUpdate(scope.row)"--> <!-- @click="handleUpdate(scope.row)"-->
<!-- >修改</el-button>--> <!-- >修改</el-button>-->
<coolbutton :type="typeParent" style="color: #49cec9" :name="updataName" :size="size" :haspermi="editHaspermi" @btn-click="handleUpdate(scope.row)" /> <coolbutton :type="typeParent" style="color: #49cec9" :name="updataName" :size="size" :haspermi="updateHaspermi" @btn-click="handleUpdate(scope.row)" />
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:dict:remove']"--> <!-- v-hasPermi="['sys:dict:remove']"-->
<!-- size="mini"--> <!-- size="mini"-->
<!-- type="text"--> <!-- type="text"-->
<!-- @click="handleDelete(scope.row)"--> <!-- @click="handleDelete(scope.row)"-->
<!-- >删除</el-button>--> <!-- >删除</el-button>-->
<coolbutton :type="typeParent" :icon="delicon" :name="nameParent" :size="size" :haspermi="removeHaspermi" @btn-click="handleDelete(scope.row)" /> <coolbutton :type="typeParent" :name="nameParent" :size="size" :haspermi="delHaspermi" @btn-click="handleDelete(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -205,21 +205,20 @@ ...@@ -205,21 +205,20 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item v-show="form.parentId">--> <el-form-item v-show="form.parentId">
<!-- <el-select v-model="form.dataId" style="width: 100%" clearable placeholder="请选择父字典类型" @visible-change="clearSelected">--> <el-select v-model="form.dataId" style="width: 100%" clearable placeholder="请选择父字典数据" @visible-change="clearSelected">
<!-- <el-option--> <el-option
<!-- v-for="item in optionsDict"--> v-for="item in optionsDict"
<!-- :key="item.dictCode"--> :key="item.dictValue"
<!-- :label="item.dictLabel"--> :label="item.dictLabel"
<!-- :disabled="item.status == 1"--> :disabled="item.status == 1"
<!-- :value="item.dictCode"--> :value="item.dictValue"
<!-- >--> >
<span style="float: left">{{ item.dictLabel }}</span>
<!-- <span style="float: left">{{ item.dictLabel }}</span>--> <span v-if="item.status === '1'" style="float: right; color: #8492a6; font-size: 12px;padding-left: 10px">{{ '已停用' }}</span>
<!-- <span v-if="item.status === '1'" style="float: right; color: #8492a6; font-size: 12px;padding-left: 10px">{{ '已停用' }}</span>--> </el-option>
<!-- </el-option>--> </el-select>
<!-- </el-select>--> </el-form-item>
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input v-model.trim="form.remarks" maxlength="200" type="textarea" placeholder="请输入内容" /> <el-input v-model.trim="form.remarks" maxlength="200" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
...@@ -250,7 +249,7 @@ import Template from '@/views/instance/Template' ...@@ -250,7 +249,7 @@ import Template from '@/views/instance/Template'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
export default { export default {
name: 'Dict', name: 'Dict',
components: { Template,Coolbutton }, components: { Template, Coolbutton },
data() { data() {
const verifyTypeProp = (rule, value, callback) => { const verifyTypeProp = (rule, value, callback) => {
if (value === '' || value === undefined || value === null) { if (value === '' || value === undefined || value === null) {
...@@ -424,7 +423,7 @@ export default { ...@@ -424,7 +423,7 @@ export default {
selectDictType(this.options.find(item => { return item.businessId === val }).dictType).then(response => { selectDictType(this.options.find(item => { return item.businessId === val }).dictType).then(response => {
this.optionsDict = response.data this.optionsDict = response.data
}) })
this.form.dataId = '' // this.form.dataId = ''
}, },
clearSelected(flag) { clearSelected(flag) {
// flag = true 为下拉框选项展开时的标识 // flag = true 为下拉框选项展开时的标识
...@@ -440,7 +439,7 @@ export default { ...@@ -440,7 +439,7 @@ export default {
}, },
handleStatusChange(row) { handleStatusChange(row) {
const text = row.flag === '1' ? '启用' : '停用' const text = row.flag === '1' ? '启用' : '停用'
this.$confirm('确认要"' + text + '""' + row.dictName + '"吗?', '提示', { this.$confirm('确认确认操作?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
...@@ -506,6 +505,11 @@ export default { ...@@ -506,6 +505,11 @@ export default {
const dictId = row.businessId || this.ids const dictId = row.businessId || this.ids
getType(dictId).then(response => { getType(dictId).then(response => {
this.form = response.data this.form = response.data
this.$nextTick(() => {
this.form.dataId = response.data.dataId.toString()
this.$forceUpdate()
})
this.getOptions(this.form.parentId)
this.open = true this.open = true
this.title = '修改字典类型' this.title = '修改字典类型'
}) })
...@@ -548,21 +552,26 @@ export default { ...@@ -548,21 +552,26 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const dictIds = row.businessId || this.ids const dictIds = row.businessId || this.ids
this.$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', '警告', { const that = this
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(function() { }).then(function() {
return delType(dictIds) delType(dictIds).then(res => {
}).then(() => { if (res.code === 200) {
this.getList() that.getList()
this.msgSuccess('删除成功') that.msgSuccess('删除成功')
} else {
that.$message.error(res.message)
}
})
}) })
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams const queryParams = this.queryParams
this.$confirm('是否确认导出所有类型数据项?', '警告', { this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="handleQuery">查询</el-button> <el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
...@@ -67,12 +67,7 @@ ...@@ -67,12 +67,7 @@
<div class="mb12 font-small-bold">角色管理列表</div> <div class="mb12 font-small-bold">角色管理列表</div>
<el-table v-loading="loading" border :data="roleList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" border :data="roleList" @selection-change="handleSelectionChange">
<el-table-column type="index" label="序号" width="50" /> <el-table-column type="index" label="序号" width="50" />
<el-table-column label="角色编号" prop="businessId"> <el-table-column label="名称" prop="roleName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.businessId || '-' }}
</template>
</el-table-column>
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.roleName || '-' }} {{ scope.row.roleName || '-' }}
</template> </template>
...@@ -122,7 +117,6 @@ ...@@ -122,7 +117,6 @@
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button> >删除</el-button>
</template> </template>
...@@ -138,39 +132,39 @@ ...@@ -138,39 +132,39 @@
/> />
<!-- 添加或修改角色配置对话框 --> <!-- 添加或修改角色配置对话框 -->
<el-dialog title="角色信息" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="角色名称" prop="roleName"> <el-form-item label="名称" prop="roleName">
<el-input v-model.trim="form.roleName" show-word-limit :maxlength="30" placeholder="请输入角色名称" /> <el-input v-model.trim="form.roleName" show-word-limit :maxlength="30" placeholder="请输入角色名称" />
</el-form-item> </el-form-item>
<el-form-item label="权限字符" prop="roleKey"> <el-form-item label="权限字符" prop="roleKey">
<el-input v-model.trim="form.roleKey" show-word-limit :maxlength="30" placeholder="请输入权限字符" /> <el-input v-model.trim="form.roleKey" show-word-limit :maxlength="30" placeholder="请输入权限字符" />
</el-form-item> </el-form-item>
<el-form-item label="角色排序" prop="roleSort"> <el-form-item label="排序" prop="roleSort">
<el-input-number v-model="form.roleSort" style="width: 100%" controls-position="right" :min="0" /> <el-input-number v-model="form.roleSort" style="width: 100%" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
<el-form-item label="角色状态"> <el-form-item label="状态">
<el-radio-group v-model="form.flag"> <!-- <el-radio-group v-model="form.flag">-->
<el-radio <!-- <el-radio :label="1">启用</el-radio>-->
v-for="dict in statusOptions" <!-- <el-radio :label="0">停用</el-radio>-->
:key="dict.dictValue" <!-- </el-radio-group>-->
:label="dict.dictValue" <el-radio v-model="form.flag" label="1">启用</el-radio>
>{{ dict.dictLabel }}</el-radio> <el-radio v-model="form.flag" label="0">停用</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="菜单权限"> <el-form-item label="菜单权限">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox> <!-- <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>-->
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox> <!-- <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>-->
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox> <!-- <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>-->
<el-tree <el-tree
ref="menu" ref="menu"
class="tree-border" class="tree-border"
:data="menuOptions" :data="menuOptions"
show-checkbox show-checkbox
node-key="id" node-key="id"
:check-strictly="!form.menuCheckStrictly" check-strictly
empty-text="加载中,请稍后" empty-text="加载中,请稍后"
:props="defaultProps" :props="defaultProps"
@check-change="handleMenuCheckChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
...@@ -235,10 +229,10 @@ ...@@ -235,10 +229,10 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="form.dataScope == 2" label="数据权限"> <el-form-item v-show="form.dataScope === 2" label="数据权限">
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox> <!-- <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>-->
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox> <!-- <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>-->
<el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox> <!-- <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>-->
<el-tree <el-tree
ref="dept" ref="dept"
class="tree-border" class="tree-border"
...@@ -365,7 +359,9 @@ export default { ...@@ -365,7 +359,9 @@ export default {
flag: undefined flag: undefined
}, },
// 表单参数 // 表单参数
form: {}, form: {
},
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -437,6 +433,29 @@ export default { ...@@ -437,6 +433,29 @@ export default {
this.deptOptions = response.data this.deptOptions = response.data
}) })
}, },
// 树状图节点点击选中事件
handleMenuCheckChange(data, check, subCheck) { // data为选中节点信息,check选中状态
if (data.children !== undefined && data.children !== null) { // 是否包含子节点
this.checkNode(data.children, check) // 调用checkNode方法
}
// // 获取所有被选中的节点信息
// const nodes = this.$refs.menu.getCheckedNodes(false, false)
// // 将获取到的信息赋值(根据自己的需求)
// this.custGroupDesc = nodes.map(item => item.CN_NAME)
// this.searchForm.custGroup = nodes.map(item => item.code)
},
// 选中所有下级节点
checkNode(data, check) {
// 遍历所有下级节点信息
data.forEach(item => {
// 通过节点信息设置选中状态
this.$refs.menu.setChecked(item, check, false)
// 是否包含下级节点,包含下级节点则选中所有下级节点
if (item.children !== undefined) {
this.checkNode(item.children, check)
}
})
},
// 所有菜单节点数据 // 所有菜单节点数据
getMenuAllCheckedKeys() { getMenuAllCheckedKeys() {
// 目前被选中的菜单节点 // 目前被选中的菜单节点
...@@ -474,7 +493,7 @@ export default { ...@@ -474,7 +493,7 @@ export default {
// 角色状态修改 // 角色状态修改
handleStatusChange(row) { handleStatusChange(row) {
const text = row.flag === '1' ? '启用' : '停用' const text = row.flag === '1' ? '启用' : '停用'
this.$confirm('确认要"' + text + '""' + row.roleName + '"角色吗?', '警告', { this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
...@@ -514,12 +533,12 @@ export default { ...@@ -514,12 +533,12 @@ export default {
roleName: undefined, roleName: undefined,
roleKey: undefined, roleKey: undefined,
roleSort: 0, roleSort: 0,
flag: undefined, flag: '1',
menuIds: [], menuIds: [],
menuName: undefined, menuName: undefined,
deptIds: [], deptIds: [],
menuCheckStrictly: true, menuCheckStrictly: false,
deptCheckStrictly: true, deptCheckStrictly: false,
remark: undefined remark: undefined
} }
this.resetForm('form') this.resetForm('form')
...@@ -541,14 +560,14 @@ export default { ...@@ -541,14 +560,14 @@ export default {
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
// 树权限(父子联动) // // 树权限(父子联动)
handleCheckedTreeConnect(value, type) { // handleCheckedTreeConnect(value, type) {
if (type === 'menu') { // if (type === 'menu') {
this.form.menuCheckStrictly = !!value // this.form.menuCheckStrictly = !!value
} else if (type === 'dept') { // } else if (type === 'dept') {
this.form.deptCheckStrictly = !!value // this.form.deptCheckStrictly = !!value
} // }
}, // },
// 树权限(全选/全不选) // 树权限(全选/全不选)
handleCheckedTreeNodeAll(value, type) { handleCheckedTreeNodeAll(value, type) {
if (type === 'menu') { if (type === 'menu') {
...@@ -625,6 +644,7 @@ export default { ...@@ -625,6 +644,7 @@ export default {
submitForm: function() { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.form.menuCheckStrictly = false
if (this.form.businessId !== undefined) { if (this.form.businessId !== undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys() this.form.menuIds = this.getMenuAllCheckedKeys()
updateRole(this.form).then(response => { updateRole(this.form).then(response => {
...@@ -657,7 +677,7 @@ export default { ...@@ -657,7 +677,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const roleIds = row.businessId || this.ids const roleIds = row.businessId || this.ids
this.$confirm('所选择数据被删除后不可再恢复,是否继续?', '提示', { this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
...@@ -675,7 +695,7 @@ export default { ...@@ -675,7 +695,7 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams const queryParams = this.queryParams
this.$confirm('是否确认导出所有用户信息?', '警告', { this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
......
This diff is collapsed.
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