@ -0,0 +1,122 @@ |
|||
<template> |
|||
<!--标题按钮部分开始--> |
|||
<div class="tab-header webtop"> |
|||
<!--标题--> |
|||
<div>{{ viewTitle }}</div> |
|||
<!--start 按钮部分开始 :icon="item.icon"--> |
|||
<div> |
|||
<el-button v-for="item in btnList" :key="item.btnKey" :type="item.type" :size="item.size" :disabled="btndisabled" @click="btnHandle(item.btnKey)"> |
|||
<svg-icon :iconClass="item.icon"/>{{ item.btnLabel }} |
|||
</el-button> |
|||
</div> |
|||
<!--end 按钮部分结束--> |
|||
</div> |
|||
<!--标题按钮部分结束--> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'ButtonBar', |
|||
props: { |
|||
viewTitle: String, |
|||
btndisabled: { type: Boolean, default: false } |
|||
}, |
|||
data() { |
|||
return { |
|||
currentPath: this.$route.path, |
|||
userSid: this.$store.getters.userInfo ? this.$store.getters.userInfo.userSid : '', |
|||
btnList: [ |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toAdd', |
|||
btnLabel: '新增' |
|||
}, |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'edit', |
|||
btnKey: 'toEdit', |
|||
btnLabel: '编辑' |
|||
}, |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'submit', |
|||
btnKey: 'doSubmit', |
|||
btnLabel: '提交' |
|||
}, |
|||
{ |
|||
type: 'danger', |
|||
size: 'small', |
|||
icon: 'del', |
|||
btnKey: 'doDel', |
|||
btnLabel: '删除' |
|||
}, |
|||
{ |
|||
type: 'success', |
|||
size: 'small', |
|||
icon: 'Import', |
|||
btnKey: 'doImport', |
|||
btnLabel: '导入' |
|||
}, |
|||
{ |
|||
type: 'success', |
|||
size: 'small', |
|||
icon: 'export', |
|||
btnKey: 'build', |
|||
btnLabel: '导出' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
created: function() { |
|||
this.initPermission() |
|||
}, |
|||
methods: { |
|||
initPermission() { |
|||
console.log('*******************当前路径 ' + this.currentPath) |
|||
console.log('*******************当前用户 ' + this.userSid) |
|||
const params = { |
|||
currentPath: this.currentPath, |
|||
userSid: this.userSid |
|||
} |
|||
// req |
|||
// .buttonPermission(params) |
|||
// .then(resp => { |
|||
// if (resp.success) { |
|||
// this.btnList = resp.data |
|||
// } |
|||
// }) |
|||
// .catch(e => { |
|||
// console.log('请求权限按钮组出错:' + e) |
|||
// }) |
|||
}, |
|||
btnHandle(btnKey) { |
|||
this.$emit('btnhandle', btnKey) |
|||
}, |
|||
setButtonList(value) { |
|||
this.btnList = value |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.svg-icon { |
|||
width: 1.2em; |
|||
height: 1.2em; |
|||
vertical-align: -0.16em; |
|||
fill: currentColor; |
|||
overflow: hidden; |
|||
margin-right: 3px; |
|||
} |
|||
</style> |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 954 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 971 B |
After Width: | Height: | Size: 732 B |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 319 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 418 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 356 B |
After Width: | Height: | Size: 724 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 459 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 421 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 320 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1018 B |
After Width: | Height: | Size: 444 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 669 B |
After Width: | Height: | Size: 335 B |
After Width: | Height: | Size: 883 B |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 731 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 873 B |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 757 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 211 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 564 B |
After Width: | Height: | Size: 563 B |
After Width: | Height: | Size: 947 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 679 B |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 655 B |
After Width: | Height: | Size: 787 B |
After Width: | Height: | Size: 689 B |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 805 B |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 906 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |