|
@ -16,12 +16,13 @@ |
|
|
}" |
|
|
}" |
|
|
:class="item.class" |
|
|
:class="item.class" |
|
|
@click="tableButtonClick(item.name,item)" |
|
|
@click="tableButtonClick(item.name,item)" |
|
|
|
|
|
v-permission="isRoutePermission ? [$route.name+'.'+item.name] : item.permission" |
|
|
>{{ item.label }}</el-button> |
|
|
>{{ item.label }}</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
import permission from "@/directive/permission/index" |
|
|
import permission from "@/directive/permission/index" |
|
|
export default { |
|
|
export default { |
|
|
directives: { permission }, |
|
|
directives: { permission }, |
|
|
props: { |
|
|
props: { |
|
|
Butttondata: { |
|
|
Butttondata: { |
|
@ -30,8 +31,14 @@ export default { |
|
|
return [] |
|
|
return [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 是否按路由配置按钮权限 |
|
|
|
|
|
isRoutePermission:{ |
|
|
|
|
|
type: Boolean, |
|
|
|
|
|
default: false, |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
mounted(){ |
|
|
mounted(){ |
|
|
|
|
|
console.log(36,this.$route,this.$store.getters) |
|
|
window.addEventListener('setItemEvent', (item) => { |
|
|
window.addEventListener('setItemEvent', (item) => { |
|
|
if (item.key.indexOf('tableColumns') > -1) { |
|
|
if (item.key.indexOf('tableColumns') > -1) { |
|
|
this.initButtonType(item) |
|
|
this.initButtonType(item) |
|
@ -56,10 +63,10 @@ export default { |
|
|
this.$emit('tableButtonClick', val,item) |
|
|
this.$emit('tableButtonClick', val,item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
.el-button{ |
|
|
.el-button{ |
|
|
margin-left: 10px; |
|
|
margin-left: 10px; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |