Commit afaf4515 by cwq0219

权限按钮

1 parent c0293962
...@@ -96,19 +96,23 @@ export default { ...@@ -96,19 +96,23 @@ export default {
*/ */
curBtns = showBtnName.length ? curBtns.filter(item => showBtnName.includes(item.label)) : curBtns curBtns = showBtnName.length ? curBtns.filter(item => showBtnName.includes(item.label)) : curBtns
curBtns.forEach(btn => { curBtns.forEach(btn => {
__aBtns.push(h('el-button', { var judgeRes = data ? (data.yqMerchantId === _this.$store.state.d2admin.user.info.detail.merchantId) : true
props: { var isShow = !btn.judgeShow ? true : judgeRes
type: btn.type || (btn.category === 'Button' ? '' : 'text'), if ((btn.category === 'Button') || (data && isShow)) {
icon: btn.icon ? `el-icon-${btn.icon}` : '', __aBtns.push(h('el-button', {
size: size props: {
}, type: btn.type || (btn.category === 'Button' ? '' : 'text'),
style: { icon: btn.icon ? `el-icon-${btn.icon}` : '',
color: btn.color size: size
}, },
on: { style: {
click: (e) => btn.handle && _this[btn.handle](data, e) color: btn.color
} },
}, [btn.ruleObj ? btn.ruleObj.rule[data[btn.ruleObj.attr]] : btn.label])) on: {
click: (e) => btn.handle && _this[btn.handle](data, e)
}
}, [btn.ruleObj ? btn.ruleObj.rule[data[btn.ruleObj.attr]] : btn.label]))
}
}) })
return h('span', {}, [...__aBtns, ctx.children]) return h('span', {}, [...__aBtns, ctx.children])
} }
......
...@@ -225,12 +225,14 @@ export const resources = { ...@@ -225,12 +225,14 @@ export const resources = {
authId: '9030203', authId: '9030203',
parentId: '90302', parentId: '90302',
label: '编辑', label: '编辑',
handle: 'handleEdit' handle: 'handleEdit',
judgeShow: true
}, { }, {
authId: '9030205', authId: '9030205',
parentId: '90302', parentId: '90302',
label: '上架', label: '上架',
handle: 'handleUpOrDown', handle: 'handleUpOrDown',
judgeShow: true,
ruleObj: { ruleObj: {
attr: 'status', attr: 'status',
rule: { 0: '上架', 1: '下架' } rule: { 0: '上架', 1: '下架' }
...@@ -244,6 +246,7 @@ export const resources = { ...@@ -244,6 +246,7 @@ export const resources = {
authId: '9030206', authId: '9030206',
parentId: '90302', parentId: '90302',
label: '删除', label: '删除',
judgeShow: true,
handle: 'handleDelete' handle: 'handleDelete'
}], }],
component: _import('goods/commodity') component: _import('goods/commodity')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!