From 2cffb5c95202343d5889454711b10c690b77a6a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com>
Date: Tue, 6 Sep 2022 16:37:28 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=8B=E9=9A=86?=
=?UTF-8?q?=E8=B7=AF=E7=94=B1=E9=97=AE=E9=A2=98=EF=BC=9B=E6=89=B9=E9=87=8F?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/assets/Asset/AssetList/AllList.vue | 13 +--------
.../Asset/AssetList/components/BaseList.vue | 27 +++++++++++++++----
2 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/src/views/assets/Asset/AssetList/AllList.vue b/src/views/assets/Asset/AssetList/AllList.vue
index 2ad4d0f14..ec208bf2d 100644
--- a/src/views/assets/Asset/AssetList/AllList.vue
+++ b/src/views/assets/Asset/AssetList/AllList.vue
@@ -16,11 +16,6 @@
v-bind="tableConfig"
/>
-
-
@@ -28,7 +23,6 @@
import { TreeTable } from '@/components'
import $ from '@/utils/jquery-vendor'
import { mapGetters } from 'vuex'
-import AssetBulkUpdateDialog from './components/AssetBulkUpdateDialog'
import TreeMenu from './components/TreeMenu'
import BaseList from './components/BaseList'
import { setUrlParam } from '@/utils/common'
@@ -36,7 +30,6 @@ import { setUrlParam } from '@/utils/common'
export default {
components: {
TreeTable,
- AssetBulkUpdateDialog,
TreeMenu,
BaseList
},
@@ -66,11 +59,7 @@ export default {
tableConfig: {
url: '/api/v1/assets/assets/'
},
- helpMessage: this.$t('assets.AssetListHelpMessage'),
- updateSelectedDialogSetting: {
- visible: false,
- selectedRows: []
- }
+ helpMessage: this.$t('assets.AssetListHelpMessage')
}
},
computed: {
diff --git a/src/views/assets/Asset/AssetList/components/BaseList.vue b/src/views/assets/Asset/AssetList/components/BaseList.vue
index 41d6aafbc..0058669c8 100644
--- a/src/views/assets/Asset/AssetList/components/BaseList.vue
+++ b/src/views/assets/Asset/AssetList/components/BaseList.vue
@@ -2,6 +2,10 @@
@@ -13,13 +17,15 @@ import {
TagsFormatter,
ChoicesDisplayFormatter
} from '@/components/TableFormatters'
+import AssetBulkUpdateDialog from './AssetBulkUpdateDialog'
import { connectivityMeta } from '@/components/AccountListTable/const'
import PlatformDialog from '../components/PlatformDialog'
export default {
components: {
ListTable,
- PlatformDialog
+ PlatformDialog,
+ AssetBulkUpdateDialog
},
props: {
url: {
@@ -53,6 +59,14 @@ export default {
},
data() {
const vm = this
+ const onAction = (row, action) => {
+ const routeName = _.capitalize(row.category.value) + action
+ vm.$router.push({
+ name: routeName,
+ params: { id: row.id },
+ ...(action === 'Create' && { query: { clone_from: row.id }})
+ })
+ }
return {
showPlatform: false,
defaultConfig: {
@@ -114,10 +128,8 @@ export default {
actions: {
formatter: ActionsFormatter,
formatterArgs: {
- onUpdate: ({ row }) => {
- const routeName = _.capitalize(row.category.value) + 'Update'
- vm.$router.push({ name: routeName, params: { id: row.id }})
- },
+ onUpdate: ({ row }) => onAction(row, 'Update'),
+ onClone: ({ row }) => onAction(row, 'Create'),
performDelete: ({ row }) => {
const id = row.id
const url = `/api/v1/assets/assets/${id}/`
@@ -180,11 +192,16 @@ export default {
vm.$hasPerm('assets.change_asset')
},
callback: ({ selectedRows }) => {
+ console.log('selectedRows: ----------------------ss', selectedRows)
vm.updateSelectedDialogSetting.selectedRows = selectedRows
vm.updateSelectedDialogSetting.visible = true
}
}
]
+ },
+ updateSelectedDialogSetting: {
+ visible: false,
+ selectedRows: []
}
}
},