fix(some): 修复没有clone的列表

This commit is contained in:
ibuler
2020-12-17 15:09:26 +08:00
committed by Orange
parent c083f6c4a4
commit 54aa252c20
6 changed files with 31 additions and 117 deletions

View File

@@ -37,6 +37,7 @@ export default {
actions: {
prop: '',
formatterArgs: {
hasClone: true,
performDelete: function({ row, col, cellValue, reload }) {
this.$axios.delete(
`/api/v1/applications/applications/${row.id}/`

View File

@@ -34,6 +34,7 @@ export default {
},
actions: {
formatterArgs: {
hasClone: true,
onUpdate: ({ row }) => {
vm.$router.push({ name: 'RemoteAppUpdate', params: { id: row.id }, query: { type: row.type }})
},

View File

@@ -4,7 +4,7 @@
<script>
import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/ListTable/formatters/index'
import { DetailFormatter } from '@/components/ListTable/formatters/index'
export default {
components: {
@@ -14,62 +14,31 @@ export default {
return {
tableConfig: {
url: '/api/v1/assets/cmd-filters/',
columns: [
{
prop: 'name',
label: this.$t('assets.Name'),
formatter: DetailFormatter,
showOverflowTooltip: true,
sortable: true,
formatterArgs: {
route: 'CommandFilterDetail'
}
},
{
prop: 'rules',
columns: ['name', 'rules', 'system_users', 'comment', 'actions'],
columnsMeta: {
rules: {
label: this.$t('assets.Rules'),
formatter: DetailFormatter,
formatterArgs: {
getTitle: ({ cellValue }) => {
return cellValue.length
},
routeQuery: {
activeTab: 'rules'
},
getTitle: ({ cellValue }) => cellValue.length
}
}
},
{
prop: 'system_users',
system_users: {
label: this.$t('assets.SystemUsers'),
formatter: DetailFormatter,
formatterArgs: {
route: 'CommandFilterDetail',
getTitle: ({ cellValue }) => cellValue.length
}
},
{
prop: 'comment',
showOverflowTooltip: true,
label: this.$t('assets.Comment')
},
{
prop: 'id',
align: 'center',
label: this.$t('assets.Action'),
formatter: ActionsFormatter,
width: '200px',
formatterArgs: {
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/assets/cmd-filters/${id}/`
return this.$axios.delete(url).then(res => {
this.$message.success(this.$t('common.deleteSuccessMsg'))
window.location.reload()
}).catch(error => {
this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error))
})
getTitle: ({ cellValue }) => {
return cellValue.length
}
}
}
]
}
},
headerActions: {
hasRightActions: false,

View File

@@ -4,7 +4,6 @@
<script>
import { GenericListPage } from '@/layout/components'
import { ActionsFormatter } from '@/components/ListTable/formatters/index'
export default {
components: {
@@ -14,39 +13,15 @@ export default {
return {
tableConfig: {
url: '/api/v1/assets/labels/',
columns: [
{
prop: 'name',
label: this.$t('assets.Name'),
showOverflowTooltip: true,
sortable: true
columns: ['name', 'value', 'asset_count', 'actions'],
columnsMeta: {
name: {
formatter: null
},
{
prop: 'value',
label: this.$t('assets.Value'),
showOverflowTooltip: true,
sortable: 'custom'
},
{
prop: 'asset_count',
label: this.$t('assets.Assets'),
width: '80px'
},
{
prop: 'id',
align: 'center',
formatter: ActionsFormatter,
label: this.$t('assets.Action'),
width: '200px',
formatterArgs: {
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/assets/labels/${id}/`
return this.$axios.delete(url)
}
}
asset_count: {
label: this.$t('assets.Assets')
}
]
}
},
headerActions: {
hasRightActions: false,

View File

@@ -4,7 +4,6 @@
<script>
import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/ListTable/formatters/index'
export default {
components: {
@@ -15,49 +14,13 @@ export default {
tableConfig: {
url: '/api/v1/assets/platforms/',
columns: [
{
prop: 'name',
label: this.$t('assets.Name'),
formatter: DetailFormatter,
showOverflowTooltip: true,
sortable: true,
formatterArgs: {
route: 'PlatformDetail'
}
},
{
prop: 'base',
label: this.$t('assets.BasePlatform'),
sortable: 'custom',
'name', 'base', 'comment', 'actions'
],
columnsMeta: {
base: {
width: '140px'
},
{
prop: 'comment',
showOverflowTooltip: true,
label: this.$t('assets.Comment'),
sortable: 'custom'
},
{
prop: 'id',
align: 'center',
label: this.$t('assets.Action'),
formatter: ActionsFormatter,
width: '200px',
formatterArgs: {
canDelete: (row, vaule) => {
return !row.internal
},
canUpdate: (row, vaule) => {
return !row.internal
},
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/assets/platforms/${id}/`
return this.$axios.delete(url)
}
}
}
]
}
},
headerActions: {
hasRightActions: false,

View File

@@ -72,6 +72,11 @@ export default {
activeTab: 'RemoteAppPermissionRemoteApp'
}
}
},
actions: {
formatterArgs: {
hasClone: true
}
}
}
},