Commit afaf4515 by cwq0219

权限按钮

1 parent c0293962
......@@ -96,19 +96,23 @@ export default {
*/
curBtns = showBtnName.length ? curBtns.filter(item => showBtnName.includes(item.label)) : curBtns
curBtns.forEach(btn => {
__aBtns.push(h('el-button', {
props: {
type: btn.type || (btn.category === 'Button' ? '' : 'text'),
icon: btn.icon ? `el-icon-${btn.icon}` : '',
size: size
},
style: {
color: btn.color
},
on: {
click: (e) => btn.handle && _this[btn.handle](data, e)
}
}, [btn.ruleObj ? btn.ruleObj.rule[data[btn.ruleObj.attr]] : btn.label]))
var judgeRes = data ? (data.yqMerchantId === _this.$store.state.d2admin.user.info.detail.merchantId) : true
var isShow = !btn.judgeShow ? true : judgeRes
if ((btn.category === 'Button') || (data && isShow)) {
__aBtns.push(h('el-button', {
props: {
type: btn.type || (btn.category === 'Button' ? '' : 'text'),
icon: btn.icon ? `el-icon-${btn.icon}` : '',
size: size
},
style: {
color: btn.color
},
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])
}
......
......@@ -225,12 +225,14 @@ export const resources = {
authId: '9030203',
parentId: '90302',
label: '编辑',
handle: 'handleEdit'
handle: 'handleEdit',
judgeShow: true
}, {
authId: '9030205',
parentId: '90302',
label: '上架',
handle: 'handleUpOrDown',
judgeShow: true,
ruleObj: {
attr: 'status',
rule: { 0: '上架', 1: '下架' }
......@@ -244,6 +246,7 @@ export const resources = {
authId: '9030206',
parentId: '90302',
label: '删除',
judgeShow: true,
handle: 'handleDelete'
}],
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!