Commit 81b2cd99 by liang ce

权限菜单修改

parent 72a6adfa
......@@ -28,7 +28,7 @@ const config = {
'biz.contact.complexPicker'
] // 必填,需要使用的jsapi列表,注意:不要带dd。
})
sessionStorage.setItem('isFirstAction', true)
// sessionStorage.setItem('isFirstAction', true)
dd.error(function (error) {
console.log('dd error: ' + JSON.stringify(error))
return 'no'
......
......@@ -11,10 +11,10 @@
:style="{ lineHeight: '64px' }"
@click="routerPush"
>
<a-menu-item key="accountManagement">支付管理</a-menu-item>
<a-menu-item key="classificationOfDishes">食堂管理</a-menu-item>
<a-menu-item key="accountManagement" v-if="this.$store.state.menuList.indexOf('3000') > -1">支付管理</a-menu-item>
<a-menu-item key="classificationOfDishes" v-if="this.$store.state.menuList.indexOf('4000' > -1)">食堂管理</a-menu-item>
<!-- <a-menu-item key="historicalVisitors">访客管理</a-menu-item> -->
<a-menu-item key="rightsManagement">权限管理</a-menu-item>
<a-menu-item key="rightsManagement" v-if="this.$store.state.menuList.indexOf('9000') > -1">权限管理</a-menu-item>
</a-menu>
</a-layout-header>
<a-layout-content style="padding: 16px 50px 0px 50px">
......@@ -31,18 +31,32 @@
</template>
<script>
import store from './../../store'
import { $http } from '../../api/axios'
import { config } from '../../api/config'
export default {
name: 'home',
components: {},
data () {
return {
title: [],
selectList: [],
defaultSelectedKeys: 'accountManagement'
}
},
created () {
let that = this
this.title = this.$route.meta.title ? this.$route.meta.title.split('/') : ''
this.defaultSelectedKeys = this.$route.matched[2].name ? this.$route.matched[2].name : ''
let data = {
item: 'e-card'
}
$http.post('/admin/menu/user', data).then(res => {
const result = that.getSelectList(res.data.data)
store.dispatch('setMenuList', that.selectList)
console.log(this.$store.state)
})
config.ddconfig()
},
watch: {
$route (to, from) {
......@@ -54,6 +68,17 @@ export default {
methods: {
routerPush (obj) {
this.$router.push({ name: obj.key })
},
getSelectList (data) {
let that = this
const addKey = data => data.map(item => {
if (item.children.length > 0) {
addKey(item.children)
}
that.selectList.push(item.id)
})
const result = addKey(data)
return result
}
},
mounted () {}
......
......@@ -9,16 +9,16 @@
style="height: 100%"
@click="routerPush"
>
<a-menu-item class="itemFlex" key="classificationOfDishes">
<a-menu-item v-if="this.$store.state.menuList.indexOf('4100') > -1" class="itemFlex" key="classificationOfDishes">
<div :class="[chooseMenuList === 'classificationOfDishes' ? 'menuIcon menuIcon1_2' : 'menuIcon menuIcon1_1']"></div><div>菜品分类</div>
</a-menu-item>
<a-menu-item class="itemFlex" key="menuManagement">
<a-menu-item v-if="this.$store.state.menuList.indexOf('4200') > -1" class="itemFlex" key="menuManagement">
<div :class="[chooseMenuList === 'menuManagement' ? 'menuIcon menuIcon2_2' : 'menuIcon menuIcon2_1']"></div>菜品管理
</a-menu-item>
<a-menu-item class="itemFlex" key="consumptionOrder">
<a-menu-item v-if="this.$store.state.menuList.indexOf('4300') > -1" class="itemFlex" key="consumptionOrder">
<div :class="[chooseMenuList === 'consumptionOrder' ? 'menuIcon menuIcon3_2' : 'menuIcon menuIcon3_1']"></div>消费订单
</a-menu-item>
<a-menu-item class="itemFlex" key="consumptionStatistics">
<a-menu-item v-if="this.$store.state.menuList.indexOf('4400') > -1" class="itemFlex" key="consumptionStatistics">
<div :class="[chooseMenuList === 'consumptionStatistics' ? 'menuIcon menuIcon4_2' : 'menuIcon menuIcon4_1']"></div>消费统计
</a-menu-item>
</a-menu>
......
......@@ -78,7 +78,7 @@ export default {
emplId: '',
name: ''
},
payStatus: '',
orderStatus: '',
agentName: ''
},
agentList: [],
......@@ -182,7 +182,7 @@ export default {
return (window.devicePixelRatio || 1) / backingStore
},
selectHandlestatus (value) {
this.searchSource.payStatus = value
this.searchSource.orderStatus = value
},
selectAgent (value) {
this.searchSource.agentName = value
......@@ -196,7 +196,7 @@ export default {
pageNumber: 10,
currentPage: this.pagination.current,
agentName: this.searchSource.agentName,
payStatus: this.searchSource.payStatus,
orderStatus: this.searchSource.orderStatus,
buyerId: this.searchSource.UserMessage.emplId
}
$http.post(`/mingpay/v1/isv/order/list_order_page`, RechargeData).then((res) => {
......
<template>
<a-spin :spinning="spinning" :delay="delayTime">
<a-spin :spinning="this.$store.state" :delay="delayTime">
<div class="allowanceDetails">
<a-button type="primary" @click="back()"><img style="margin-top:-4px;margin-right: 6px;width: 14px" src="../../../assets/back.png"/>返回</a-button>
<div class="title">津贴详情</div>
......@@ -83,7 +83,6 @@ export default {
searchData: '',
isshow: false,
visible: false,
spinning: false,
delayTime: 100,
form: this.$form.createForm(this),
isshowChange: false,
......@@ -141,7 +140,7 @@ export default {
return
}
this.visible = false
this.spinning = true
store.dispatch('setSpinning', true)
// Should format date value before submit.
const values = {
...fieldsValue,
......
<template>
<a-spin :spinning="spinning" :delay="delayTime">
<a-spin :spinning="this.$store.state" :delay="delayTime">
<div class="AllowancePayment">
<div class="searchBox">
<div style="width: 75px">截止时间:</div>
......@@ -104,7 +104,6 @@ export default {
data () {
return {
MINGPAY_SUBSIDY_STATUS: MINGPAY_SUBSIDY_STATUS,
spinning: false,
delayTime: 100,
formItemLayout: {
labelCol: {
......@@ -325,7 +324,7 @@ export default {
return
}
this.visible = false
this.spinning = true
store.dispatch('setSpinning', true)
// Should format date value before submit.
const values = {
...fieldsValue,
......@@ -352,12 +351,8 @@ export default {
this.form.resetFields()
this.userIdListObj = []
this.departmentIdListObj = []
this.spinning = false
this.$message.success(res.data.data)
this.queryCouponRecordList()
} else {
this.spinning = false
this.$message.error(res.data.message)
}
})
})
......
......@@ -9,15 +9,15 @@
style="height: 100%"
@click="routerPush"
>
<a-menu-item class="itemFlex" key="accountManagement"><div :class="[chooseMenuList === 'accountManagement' ? 'menuIcon menuIcon1_2' : 'menuIcon menuIcon1_1']"></div>账户中心</a-menu-item>
<a-menu-item class="itemFlex" key="rechargeRecord"><div :class="[chooseMenuList === 'rechargeRecord' ? 'menuIcon menuIcon2_2' : 'menuIcon menuIcon2_1']"></div>充值记录</a-menu-item>
<a-menu-item class="itemFlex" key="allowancePayment"><div :class="[chooseMenuList === 'allowancePayment' ? 'menuIcon menuIcon3_2' : 'menuIcon menuIcon3_1']"></div>津贴发放</a-menu-item>
<a-menu-item class="itemFlex" key="recordsOfConsumption"><div :class="[chooseMenuList === 'recordsOfConsumption' ? 'menuIcon menuIcon4_2' : 'menuIcon menuIcon4_1']"></div>消费记录</a-menu-item>
<a-menu-item class="itemFlex" key="systemReconciliation"><div :class="[chooseMenuList === 'systemReconciliation' ? 'menuIcon menuIcon6_2' : 'menuIcon menuIcon6_1']"></div>系统对账</a-menu-item>
<a-menu-item v-if="this.$store.state.menuList.indexOf('3100') > -1" class="itemFlex" key="accountManagement"><div :class="[chooseMenuList === 'accountManagement' ? 'menuIcon menuIcon1_2' : 'menuIcon menuIcon1_1']"></div>账户中心</a-menu-item>
<a-menu-item v-if="this.$store.state.menuList.indexOf('3200') > -1" class="itemFlex" key="rechargeRecord"><div :class="[chooseMenuList === 'rechargeRecord' ? 'menuIcon menuIcon2_2' : 'menuIcon menuIcon2_1']"></div>充值记录</a-menu-item>
<a-menu-item v-if="this.$store.state.menuList.indexOf('3300') > -1" class="itemFlex" key="allowancePayment"><div :class="[chooseMenuList === 'allowancePayment' ? 'menuIcon menuIcon3_2' : 'menuIcon menuIcon3_1']"></div>津贴发放</a-menu-item>
<a-menu-item v-if="this.$store.state.menuList.indexOf('3400') > -1" class="itemFlex" key="recordsOfConsumption"><div :class="[chooseMenuList === 'recordsOfConsumption' ? 'menuIcon menuIcon4_2' : 'menuIcon menuIcon4_1']"></div>消费记录</a-menu-item>
<a-menu-item v-if="this.$store.state.menuList.indexOf('3500') > -1" class="itemFlex" key="systemReconciliation"><div :class="[chooseMenuList === 'systemReconciliation' ? 'menuIcon menuIcon6_2' : 'menuIcon menuIcon6_1']"></div>系统对账</a-menu-item>
<!-- <a-menu-item class="itemFlex" key="cashierManagement"><div :class="[chooseMenuList === 'cashierManagement' ? 'menuIcon menuIcon5_2' : 'menuIcon menuIcon5_1']"></div>设置收银员</a-menu-item>
<a-menu-item class="itemFlex" key="SetAdministrators"><div :class="[chooseMenuList === 'SetAdministrators' ? 'menuIcon menuIcon5_2' : 'menuIcon menuIcon5_1']"></div>设置管理员</a-menu-item> -->
<a-menu-item class="itemFlex" key="paymentManagementSetting"><div :class="[chooseMenuList === 'paymentManagementSetting' ? 'menuIcon menuIcon7_2' : 'menuIcon menuIcon7_1']"></div>设置中心</a-menu-item>
<a-menu-item class="itemFlex" key="operationLog"><div :class="[chooseMenuList === 'operationLog' ? 'menuIcon menuIcon8_2' : 'menuIcon menuIcon8_1']"></div>操作日志</a-menu-item>
<a-menu-item v-if="this.$store.state.menuList.indexOf('3600') > -1" class="itemFlex" key="paymentManagementSetting"><div :class="[chooseMenuList === 'paymentManagementSetting' ? 'menuIcon menuIcon7_2' : 'menuIcon menuIcon7_1']"></div>设置中心</a-menu-item>
<a-menu-item v-if="this.$store.state.menuList.indexOf('3700') > -1" class="itemFlex" key="operationLog"><div :class="[chooseMenuList === 'operationLog' ? 'menuIcon menuIcon8_2' : 'menuIcon menuIcon8_1']"></div>操作日志</a-menu-item>
</a-menu>
</a-layout-sider>
<a-layout-content :style="{ padding: '0 24px', minHeight: '280px' }">
......
......@@ -106,6 +106,7 @@ export default {
roleCode: roleCode
}
$http.post(`/admin/manager/modifyFullRole`, data).then(success => {
this.$message.success('编辑成功')
return this.getAllAdminisgtrator()
})
})
......@@ -120,7 +121,8 @@ export default {
cancelText: '取消',
onOk () {
let data = { roleId: record.key }
$http.post(`/admin/role/del`, data).then(res => {
$http.post(`/admin/role/del1`, data).then(res => {
_that.$message.success('删除成功')
_that.getAllAdminisgtrator()
})
}
......@@ -166,7 +168,7 @@ export default {
roleName: item.roleName || '---',
userHasRoles: userHasRoles || '---',
roleDesc: item.roleDesc || '---',
creatTime: item.createTime.replace('T', ' '),
creatTime: item.createTime ? item.createTime.replace('T', ' ') : '',
action: { ddUserId: ddUserId, name: userHasRoles }
})
}
......
......@@ -9,7 +9,7 @@
style="height: 100%"
@click="routerPush"
>
<a-menu-item class="itemFlex" key="rightsManagement">
<a-menu-item v-if="this.$store.state.menuList.indexOf('9100') > -1" class="itemFlex" key="rightsManagement">
<div :class="[chooseMenuList === 'rightsManagement' ? 'menuIcon menuIcon1_2' : 'menuIcon menuIcon1_1']"></div><div>角色管理</div>
</a-menu-item>
</a-menu>
......
......@@ -35,7 +35,6 @@ Vue.use(Input.TextArea)
Vue.use(message)
Vue.use(Pagination)
Vue.config.productionTip = false
Vue.prototype.$confirm = Modal.confirm
Vue.prototype.$message = message
Vue.prototype.$echarts = echarts
......@@ -48,26 +47,27 @@ router.beforeEach(function (to, from, next) {
if (sessionStorage.getItem('isFirstAction')) {
next()
} else {
sessionStorage.setItem('isFirstAction', true)
if (to.redirectedFrom.substr(1) !== localStorage.getItem('orgId')) {
localStorage.clear()
localStorage.setItem('orgId', to.redirectedFrom.substr(1))
}
config.ddconfig().then((res) => {
if (res === 'no') {
next({ name: 'configError' })
// config.ddconfig().then((res) => {
// if (res === 'no') {
// next({ name: 'configError' })
// }
// }).then(() => {
// }).catch((err) => {
// console.log(err, '登录失败')
// })
config.ddready('ddpermission').then((res) => {
if (res === 'noPermission') {
next({ name: 'noPermission' })
} else {
next({ name: 'accountManagement' })
}
}).then(() => {
config.ddready('ddpermission').then((res) => {
if (res === 'noPermission') {
next({ name: 'noPermission' })
} else {
next({ name: 'accountManagement' })
}
}).catch((err) => {
console.log('ddpermission', err)
})
}).catch((err) => {
console.log(err, '登录失败')
console.log('ddpermission', err)
})
}
}
......
......@@ -4,12 +4,19 @@ import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
menuList: [],
spinning: false
},
mutations: {
setMenuList (state, payload) {
state.menuList = payload
},
setSpinning (state, payload) {
state.spinning = payload
}
},
actions: {
setMenuList: ({ commit }, menuList) => commit('setMenuList', menuList),
setSpinning: ({ commit }, spinning) => commit('setSpinning', spinning)
}
})
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