[Update] 增加平台列表组件

This commit is contained in:
jym503558564
2020-04-02 16:31:34 +08:00
parent 911df84460
commit cbfc52adfe
3 changed files with 54 additions and 2 deletions

View File

@@ -252,7 +252,7 @@ const cn = {
'create_platform': '创建系统平台',
'update_platform': '更新系统平台',
'platform_detail': '平台详情',
'base_platform': '基础平台',
'BasePlatform': '基础平台',
'charset': '编码',
'meta': '元数据'
},

View File

@@ -161,7 +161,7 @@ export const constantRoutes = [
{
path: 'platforms',
name: 'PlatformList',
component: () => import('@/views/tree/index'),
component: () => import('@/views/assets/PlatformList'),
meta: { title: 'PlatformList' }
}
]

View File

@@ -0,0 +1,52 @@
<template>
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" />
</template>
<script>
import { GenericListPage } from '@/layout/components'
import DetailFormatter from '@/components/DataTable/formatters/DetailFormatter'
export default {
components: {
GenericListPage
},
data() {
return {
showTree: true,
tableConfig: {
url: '/api/v1/assets/platforms/',
columns: [
{
prop: 'name',
label: this.$t('assets.name'),
formatter: DetailFormatter,
sortable: true,
route: 'CommandFilterDetail'
},
{
prop: 'base',
label: this.$t('assets.BasePlatform')
},
{
prop: '',
label: this.$t('assets.comment')
}
],
tableActions: {
hasEdit: true,
editRoute: '404'
}
},
headerActions: {
hasDelete: false,
hasUpdate: false,
createRoute: 'CommandFilterCreate'
}
}
}
}
</script>
<style>
</style>