102 lines
1.8 KiB
JavaScript
102 lines
1.8 KiB
JavaScript
import { h } from 'vue'
|
|
import TableTags from '@/components/DataTable/tools/Tags.vue'
|
|
const table = {
|
|
columns: [
|
|
{
|
|
title: '菜单标题',
|
|
key: 'title',
|
|
align: 'center',
|
|
width: 200
|
|
},
|
|
{
|
|
title: '菜单类型',
|
|
key: 'type',
|
|
align: 'center',
|
|
width: 100,
|
|
render(row) {
|
|
return h(TableTags, {
|
|
data: row.type,
|
|
filters: [
|
|
{
|
|
key: 0,
|
|
label: '菜单'
|
|
},
|
|
{
|
|
key: 1,
|
|
label: '节点'
|
|
}
|
|
]
|
|
})
|
|
}
|
|
},
|
|
{
|
|
title: '路由地址',
|
|
key: 'path',
|
|
align: 'center',
|
|
width: 200
|
|
},
|
|
{
|
|
title: '组件路径',
|
|
key: 'component',
|
|
align: 'center',
|
|
width: 200
|
|
},
|
|
{
|
|
title: '状态',
|
|
key: 'status',
|
|
align: 'center',
|
|
width: 100,
|
|
render(row) {
|
|
return h(TableTags, {
|
|
data: row.status,
|
|
filters: [
|
|
{
|
|
key: 1,
|
|
label: '在用'
|
|
},
|
|
{
|
|
key: 2,
|
|
label: '停用'
|
|
}
|
|
]
|
|
})
|
|
}
|
|
},
|
|
{
|
|
title: '排序',
|
|
key: 'sort',
|
|
align: 'center',
|
|
width: 100
|
|
},
|
|
{
|
|
title: '是否可见',
|
|
key: 'hide',
|
|
align: 'center',
|
|
width: 100,
|
|
render(row) {
|
|
return h(TableTags, {
|
|
data: row.hide,
|
|
filters: [
|
|
{
|
|
key: 1,
|
|
label: '可见'
|
|
},
|
|
{
|
|
key: 2,
|
|
label: '不可见'
|
|
}
|
|
]
|
|
})
|
|
}
|
|
},
|
|
{
|
|
title: '创建时间',
|
|
key: 'createTime',
|
|
align: 'center',
|
|
width: 160
|
|
}
|
|
]
|
|
}
|
|
|
|
export default table
|