A1A2菜单配置
This commit is contained in:
@@ -30,21 +30,42 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
roles: this.$store.getters.saveRoles,
|
||||||
userName: '',
|
userName: '',
|
||||||
menuList: [
|
menuList: []
|
||||||
// {id: '1', name: '人工排产', icon: 'RF01', path: '/pages/modules/man-paichan'},
|
|
||||||
// {id: '2', name: '涂线板', icon: 'RF02', path: '/pages/modules/wire-board'},
|
|
||||||
// {id: '3', name: '物料库存', icon: 'RF03', path: '/pages/modules/mater-inventory'}
|
|
||||||
// {id: '1', name: '原材料入库', icon: 'RF03', path: '/pages/modules/rawmater-instore'},
|
|
||||||
{id: '2', name: '原材料出库', icon: 'RF07', path: '/pages/modules/rawmater-outstore'},
|
|
||||||
{id: '3', name: '搬运任务', icon: 'RF01', path: '/pages/modules/carry-task'},
|
|
||||||
// {id: '4', name: '组盘解绑', icon: 'RF04', path: '/pages/modules/zupan-unbind'},
|
|
||||||
{id: '5', name: '指令管理', icon: 'RF02', path: '/pages/modules/zlmanage'},
|
|
||||||
{id: '6', name: '任务管理', icon: 'RF09', path: '/pages/modules/taskmanage'}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
console.log(this.$store.getters.saveRoles, '11111')
|
||||||
|
if (this.roles === 'A1,A2,') {
|
||||||
|
this.menuList = [
|
||||||
|
// {id: '1', name: '人工排产', icon: 'RF01', path: '/pages/modules/man-paichan'},
|
||||||
|
// {id: '2', name: '涂线板', icon: 'RF02', path: '/pages/modules/wire-board'},
|
||||||
|
// {id: '3', name: '物料库存', icon: 'RF03', path: '/pages/modules/mater-inventory'}
|
||||||
|
{id: '1', name: '原材料入库', icon: 'RF03', path: '/pages/modules/rawmater-instore'},
|
||||||
|
{id: '2', name: '原材料出库', icon: 'RF07', path: '/pages/modules/rawmater-outstore'},
|
||||||
|
{id: '3', name: '搬运任务', icon: 'RF01', path: '/pages/modules/carry-task'},
|
||||||
|
{id: '4', name: '组盘解绑', icon: 'RF04', path: '/pages/modules/zupan-unbind'},
|
||||||
|
{id: '5', name: '指令管理', icon: 'RF02', path: '/pages/modules/zlmanage'},
|
||||||
|
{id: '6', name: '任务管理', icon: 'RF09', path: '/pages/modules/taskmanage'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
if (this.roles === 'A1') {
|
||||||
|
this.menuList = [
|
||||||
|
{id: '1', name: '原材料入库', icon: 'RF03', path: '/pages/modules/rawmater-instore'},
|
||||||
|
{id: '2', name: '原材料出库', icon: 'RF07', path: '/pages/modules/rawmater-outstore'},
|
||||||
|
{id: '5', name: '指令管理', icon: 'RF02', path: '/pages/modules/zlmanage'},
|
||||||
|
{id: '6', name: '任务管理', icon: 'RF09', path: '/pages/modules/taskmanage'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
if (this.roles === 'A2') {
|
||||||
|
this.menuList = [
|
||||||
|
{id: '3', name: '搬运任务', icon: 'RF01', path: '/pages/modules/carry-task'},
|
||||||
|
{id: '4', name: '组盘解绑', icon: 'RF04', path: '/pages/modules/zupan-unbind'},
|
||||||
|
{id: '5', name: '指令管理', icon: 'RF02', path: '/pages/modules/zlmanage'},
|
||||||
|
{id: '6', name: '任务管理', icon: 'RF09', path: '/pages/modules/taskmanage'}
|
||||||
|
]
|
||||||
|
}
|
||||||
this.$store.dispatch('setPublicObj', '')
|
this.$store.dispatch('setPublicObj', '')
|
||||||
if (this.$store.getters.userInfo) {
|
if (this.$store.getters.userInfo) {
|
||||||
this.userName = JSON.parse(this.$store.getters.userInfo).username
|
this.userName = JSON.parse(this.$store.getters.userInfo).username
|
||||||
|
|||||||
@@ -104,6 +104,7 @@
|
|||||||
}
|
}
|
||||||
this.$store.dispatch('saveUserInfo', JSON.stringify(res.user.user))
|
this.$store.dispatch('saveUserInfo', JSON.stringify(res.user.user))
|
||||||
this.$store.dispatch('saveToken', res.token)
|
this.$store.dispatch('saveToken', res.token)
|
||||||
|
this.$store.dispatch('saveRoles', res.roles)
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/home/home'
|
url: '/pages/home/home'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ const state = {
|
|||||||
setPrintName: uni.getStorageSync('setPrintName') || '',
|
setPrintName: uni.getStorageSync('setPrintName') || '',
|
||||||
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
|
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
|
||||||
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
|
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
|
||||||
saveToken: uni.getStorageSync('saveToken') || ''
|
saveToken: uni.getStorageSync('saveToken') || '',
|
||||||
|
saveRoles: uni.getStorageSync('saveRoles') || ''
|
||||||
}
|
}
|
||||||
const getters = {
|
const getters = {
|
||||||
baseUrl: state => state.baseUrl,
|
baseUrl: state => state.baseUrl,
|
||||||
@@ -18,7 +19,8 @@ const getters = {
|
|||||||
setPrintName: state => state.setPrintName,
|
setPrintName: state => state.setPrintName,
|
||||||
loginName: state => state.loginName,
|
loginName: state => state.loginName,
|
||||||
userInfo: state => state.userInfo,
|
userInfo: state => state.userInfo,
|
||||||
saveToken: state => state.saveToken
|
saveToken: state => state.saveToken,
|
||||||
|
saveRoles: state => state.saveRoles
|
||||||
}
|
}
|
||||||
const actions = {
|
const actions = {
|
||||||
setConfig ({commit}, res) {
|
setConfig ({commit}, res) {
|
||||||
@@ -43,11 +45,16 @@ const actions = {
|
|||||||
delUserInfo({commit}, res) {
|
delUserInfo({commit}, res) {
|
||||||
uni.removeStorageSync('userInfo')
|
uni.removeStorageSync('userInfo')
|
||||||
uni.removeStorageSync('saveToken')
|
uni.removeStorageSync('saveToken')
|
||||||
|
uni.removeStorageSync('saveRoles')
|
||||||
commit(types.DEL_USER_INFO, res)
|
commit(types.DEL_USER_INFO, res)
|
||||||
},
|
},
|
||||||
saveToken({commit}, res) {
|
saveToken({commit}, res) {
|
||||||
uni.setStorageSync('saveToken', res)
|
uni.setStorageSync('saveToken', res)
|
||||||
commit(types.SAVE_TOKEN, res)
|
commit(types.SAVE_TOKEN, res)
|
||||||
|
},
|
||||||
|
saveRoles({commit}, res) {
|
||||||
|
uni.setStorageSync('saveRoles', res)
|
||||||
|
commit(types.SAVE_ROLES, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@@ -69,9 +76,13 @@ const mutations = {
|
|||||||
[types.DEL_USER_INFO] (state, res) {
|
[types.DEL_USER_INFO] (state, res) {
|
||||||
state.userInfo = res
|
state.userInfo = res
|
||||||
state.saveToken = res
|
state.saveToken = res
|
||||||
|
state.saveRoles = res
|
||||||
},
|
},
|
||||||
[types.SAVE_TOKEN] (state, res) {
|
[types.SAVE_TOKEN] (state, res) {
|
||||||
state.saveToken = res
|
state.saveToken = res
|
||||||
|
},
|
||||||
|
[types.SAVE_ROLES] (state, res) {
|
||||||
|
state.saveRoles = res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export const COM_CONFIG = 'COM_CONFIG'
|
|||||||
export const SAVE_USER_INFO = 'SAVE_USER_INFO'
|
export const SAVE_USER_INFO = 'SAVE_USER_INFO'
|
||||||
export const DEL_USER_INFO = 'DEL_USER_INFO'
|
export const DEL_USER_INFO = 'DEL_USER_INFO'
|
||||||
export const SAVE_TOKEN = 'SAVE_TOKEN'
|
export const SAVE_TOKEN = 'SAVE_TOKEN'
|
||||||
|
export const SAVE_ROLES = 'SAVE_ROLES'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* data
|
* data
|
||||||
|
|||||||
Reference in New Issue
Block a user