|
@@ -16,6 +16,8 @@ export default {
|
|
|
render (h, context) {
|
|
|
const { auth, row } = context.props
|
|
|
const vnodes = []
|
|
|
+
|
|
|
+
|
|
|
if (auth && Object.keys(auth).length) {
|
|
|
//获取按钮配置项
|
|
|
const { servicetype, pagename, pageicon } = auth
|
|
@@ -23,6 +25,8 @@ export default {
|
|
|
//根据服务类型显示按钮类型 1=查询 2=新增 3=编辑 4=删除
|
|
|
const type = servicetype != '4' ? 'primary' : 'danger'
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//根据服务类型显示按钮类型设置按钮方法 1=查询 2=新增 3=编辑 4=删除 ...其他
|
|
|
let func = null
|
|
|
if (servicetype == 1) {
|
|
@@ -38,13 +42,16 @@ export default {
|
|
|
}
|
|
|
|
|
|
//根据显示方式显示按钮类型 1=名称 2=图标 3=名称+图标
|
|
|
+ const isDisplay = auth.isdisplay
|
|
|
let button = null
|
|
|
- if (pageicon) {
|
|
|
+ if(eval(isDisplay)){
|
|
|
+ if (pageicon) {
|
|
|
button = <el-button size="small" icon={pageicon} onClick={() => func(row, auth)} type={type}></el-button>
|
|
|
- } else {
|
|
|
- button = <el-button size="small" onClick={() => func(row, auth)} type={type}>{pagename}</el-button>
|
|
|
+ } else {
|
|
|
+ button = <el-button size="small" onClick={() => func(row, auth)} type={type}>{pagename}</el-button>
|
|
|
+ }
|
|
|
+ vnodes.push(button)
|
|
|
}
|
|
|
- vnodes.push(button)
|
|
|
} else {
|
|
|
vnodes.push(<span></span>)
|
|
|
}
|