mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
字段修改+权限存入
This commit is contained in:
@@ -212,9 +212,9 @@ export const columnList = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '场站运行模式',
|
title: '场站运行模式',
|
||||||
dataIndex: 'work_mode_id',
|
dataIndex: 'work_mode',
|
||||||
key: 'work_mode_id',
|
key: 'work_mode',
|
||||||
scopedSlots: { customRender: 'work_mode_id' }
|
scopedSlots: { customRender: 'work_mode' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '场站运行策略',
|
title: '场站运行策略',
|
||||||
@@ -499,7 +499,7 @@ export const stationOptions = [
|
|||||||
|
|
||||||
label: '场站运行模式',
|
label: '场站运行模式',
|
||||||
value: undefined,
|
value: undefined,
|
||||||
key: 'work_mode_id',
|
key: 'work_mode',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export default {
|
|||||||
async getMarkList() {
|
async getMarkList() {
|
||||||
try {
|
try {
|
||||||
let query = {
|
let query = {
|
||||||
role_id: localStorage.getItem('user')[0].role_id
|
role_id: localStorage.getItem('permission')[0].role_id
|
||||||
}
|
}
|
||||||
const res = await getReq('/queryStationList', query)
|
const res = await getReq('/queryStationList', query)
|
||||||
if (res.errcode === 0) {
|
if (res.errcode === 0) {
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
sysName: '',
|
sysName: '',
|
||||||
user: JSON.parse(localStorage.getItem('user')) || {}
|
user: JSON.parse(localStorage.getItem('permission')) || {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@@ -1,21 +1,17 @@
|
|||||||
|
import route from 'vue-router'
|
||||||
const btnList = [
|
const btnList = [
|
||||||
{ label: '', type: '', disFlag: '' },
|
{ label: '', type: '', disFlag: '' },
|
||||||
{ label: '新增', type: 'add', disFlag: 'isEdit', icon: 'icon-add' },
|
{ label: '新增', type: 'add', disFlag: 'is_add', icon: 'icon-add' },
|
||||||
{ label: '查看', type: 'read', disFlag: 'isQuery' },
|
{ label: '查看', type: 'read', disFlag: 'is_view' },
|
||||||
{ label: '修改', type: 'edit', disFlag: 'isEdit' },
|
{ label: '修改', type: 'edit', disFlag: 'is_edit' },
|
||||||
{ label: '删除', type: 'del', disFlag: 'isEdit', icon: 'icon-del' }
|
{ label: '删除', type: 'del', disFlag: 'is_del', icon: 'icon-del' }
|
||||||
// { label: '批量删除', type: 'del', disFlag: 'isEdit', icon: 'icon-del' }
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// arr:按钮数组
|
|
||||||
// permissions:{
|
|
||||||
// isControl: true;
|
|
||||||
// isEdit: true;
|
|
||||||
// isQuery: true;
|
|
||||||
// }
|
|
||||||
function getBtns(arr) {
|
function getBtns(arr) {
|
||||||
|
console.log(route, 'route')
|
||||||
|
// JSON.parse(localStorage.getItem('permission')).find((item)=>item.route==)
|
||||||
// const permissions =
|
// const permissions =
|
||||||
// JSON.parse(localStorage.getItem('user')) || {}
|
// JSON.parse(localStorage.getItem('permission')) || {}
|
||||||
const btns = []
|
const btns = []
|
||||||
btnList.forEach((item) => {
|
btnList.forEach((item) => {
|
||||||
if (arr.includes(item.label)) {
|
if (arr.includes(item.label)) {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export default {
|
|||||||
if (res.errcode === 0) {
|
if (res.errcode === 0) {
|
||||||
this.$message.success('登录成功')
|
this.$message.success('登录成功')
|
||||||
localStorage.setItem('token', res.token)
|
localStorage.setItem('token', res.token)
|
||||||
localStorage.setItem('user',JSON.stringify( res.permission) )
|
localStorage.setItem('permission',JSON.stringify( res.permission) )
|
||||||
this.$router.push('/')
|
this.$router.push('/')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,15 +149,15 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
initRoute() {
|
initRoute() {
|
||||||
console.log(localStorage.getItem('user'), "localStorage.getItem('user')")
|
console.log(localStorage.getItem('permission'), "localStorage.getItem('permission')")
|
||||||
// 执行过滤
|
// 执行过滤
|
||||||
const filteredRoutes = this.filterRoutes(
|
// const filteredRoutes = this.filterRoutes(
|
||||||
this.menuList,
|
// this.menuList,
|
||||||
JSON.parse(localStorage.getItem('user'))
|
// JSON.parse(localStorage.getItem('permission'))
|
||||||
)
|
// )
|
||||||
console.log( this.$route.matched, 'filteredRoutes')
|
console.log( this.$route.matched, 'filteredRoutes')
|
||||||
this.subMenu = this.$route.matched[1].children || []
|
this.subMenu = this.$route.matched[1].children || []
|
||||||
// this.menuList= JSON.parse(localStorage.getItem('user'))
|
// this.menuList= JSON.parse(localStorage.getItem('permission'))
|
||||||
// this.subMenu =filteredRoutes[0].children||[]
|
// this.subMenu =filteredRoutes[0].children||[]
|
||||||
|
|
||||||
this.currentKey = '/' + this.$route.fullPath.split('/')[1]
|
this.currentKey = '/' + this.$route.fullPath.split('/')[1]
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<template #status="record">
|
<template #status="record">
|
||||||
<span>{{ ['未启用', '启用'][record.status] }}</span>
|
<span>{{ ['未启用', '启用'][record.status] }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #work_mode_id="record">
|
<template #work_mode="record">
|
||||||
<span>{{workModeList.find(item=>record.value==item.value)?.label|| '' }}</span>
|
<span>{{workModeList.find(item=>record.value==item.value)?.label|| '' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #policy_id="record">
|
<template #policy_id="record">
|
||||||
|
|||||||
Reference in New Issue
Block a user