Skip to content

Commit

Permalink
perf: update zone detail
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler committed Jan 22, 2025
1 parent fb9d9d6 commit 27d175a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 20 deletions.
8 changes: 4 additions & 4 deletions src/components/Drawer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ export default {
}
.form-buttons {
position: absolute;
bottom: 13px;
margin-left: 20%;
margin-top: 0;
//position: absolute;
// bottom: 13px;
// margin-left: 20%;
// margin-top: 0;
}
// Form 中的子 form
Expand Down
9 changes: 9 additions & 0 deletions src/components/Table/DrawerListTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ export default {
}
_.set(config, key, value)
}
const columnsMeta = config.columnsMeta
for (const value of Object.values(columnsMeta)) {
if (
value.formatter && value.formatter.name === 'AmountFormatter' &&
value.formatterArgs && !value.formatterArgs.drawer
) {
value.formatterArgs.drawer = this.detailDrawer
}
}
return config
}
},
Expand Down
23 changes: 12 additions & 11 deletions src/components/Table/TableFormatters/DetailFormatter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ export default {
default() {
return {
route: this.$route.name.replace('List', 'Detail'),
can: true,
getRoute: null,
routeQuery: null,
can: true,
drawer: false,
onClick: null,
openInNewPage: false,
removeColorOnClick: false,
drawer: false,
beforeClick: () => {
},
getTitle({ col, row, cellValue }) {
return cellValue
return cellValue || row.name
},
getIcon({ col, row, cellValue }) {
return null
Expand All @@ -59,12 +59,12 @@ export default {
data() {
const formatterArgs = Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
return {
drawerTitle: '',
linkClicked: false,
drawerComponent: '',
showTableDetailDrawer: false,
drawerTitle: '',
currentTemplate: null,
formatterArgs: formatterArgs,
drawerComponent: '',
drawerVisible: false
}
},
Expand Down Expand Up @@ -122,15 +122,15 @@ export default {
const route = this.getDetailRoute()
if (route?.query?.tab) {
this.$cookie.set(route.name, route.query.tab, 1)
this.$route.query.tab = route.query.tab
}
console.log('showDrawer', this.drawerComponent)
this.$store.dispatch('common/setDrawerActionMeta', {
action: 'detail',
row: this.row,
col: this.col,
id: route.params.id
}).then(() => {
this.drawerTitle = this.cellValue
this.drawerTitle = this.iTitle
this.drawerVisible = true
})
},
Expand Down Expand Up @@ -160,7 +160,6 @@ export default {
}
let detailRoute = { replace: true }
if (typeof route === 'string') {
detailRoute.name = route
detailRoute.params = { id: this.row.id }
Expand Down Expand Up @@ -218,9 +217,11 @@ export default {
display: none;
}
.form-drawer ::v-deep {
.el-drawer__header {
border-bottom: none;
.form-drawer {
::v-deep {
.el-drawer__header {
border-bottom: none;
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/views/assets/Asset/AssetList/components/BaseList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ export default {
},
mounted() {
this.setRecentPlatforms()
setInterval(() => {
console.log('ids: ', this.recentPlatformIds, this)
}, 1000 * 2)
},
activated() {
this.setRecentPlatforms()
Expand Down
10 changes: 9 additions & 1 deletion src/views/assets/Domain/DomainList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<GenericListPage :header-actions="headerActions" :help-tip="notice" :table-config="tableConfig" />
<GenericListPage
:create-drawer="createDrawer"
:detail-drawer="detailDrawer"
:header-actions="headerActions"
:help-tip="notice"
:table-config="tableConfig"
/>
</template>

<script>
Expand All @@ -12,6 +18,8 @@ export default {
},
data() {
return {
createDrawer: () => import('./DomainCreateUpdate.vue'),
detailDrawer: () => import('./DomainDetail/index.vue'),
tableConfig: {
url: '/api/v1/assets/domains/',
columnsExclude: ['gateway'],
Expand Down
2 changes: 1 addition & 1 deletion src/views/users/Group/UserGroupList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</template>

<script>
import { GenericListPage } from '@/layout///components'
import { GenericListPage } from '@/layout/components'
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter.vue'
export default {
Expand Down

0 comments on commit 27d175a

Please sign in to comment.