perf: 修改 tab 变量

This commit is contained in:
ibuler
2024-03-11 17:09:29 +08:00
parent 5f0fdf326b
commit 9c7606e59b
24 changed files with 43 additions and 37 deletions

View File

@@ -168,4 +168,9 @@ export default {
</script>
<style lang="scss" scoped>
.el-data-table {
>>> .el-pagination.is-background .el-pager li {
margin: 0 1px ;
}
}
</style>

View File

@@ -48,7 +48,7 @@ import Page from '../Page/'
import merge from 'webpack-merge'
import { toSentenceCase } from '@/utils/common'
const ACTIVE_TAB_KEY = 'activeTab'
const ACTIVE_TAB_KEY = 'tab'
export default {
name: 'TabPage',
@@ -107,7 +107,7 @@ export default {
},
watch: {
$route(to, from) {
const activeTab = to.query?.activeTab
const activeTab = to.query?.tab
if (activeTab && this.iActiveMenu !== activeTab) {
this.iActiveMenu = activeTab
this.loading = false

View File

@@ -362,7 +362,7 @@ button, input, optgroup, select, textarea {
}
.el-tabs__item > span {
padding: 6px;
padding: 0 6px 0 4px;
}
.el-form .el-input__inner, .el-dialog__body .el-input__inner {
@@ -396,3 +396,4 @@ button, input, optgroup, select, textarea {
.el-cascader .el-input__inner {
border-radius: 2px;
}

View File

@@ -55,7 +55,7 @@ export default {
return {
name: 'AccountBackupList',
query: {
activeTab: 'AccountBackupPlanExecutionList',
tab: 'AccountBackupPlanExecutionList',
plan_id: row.id
}
}

View File

@@ -61,7 +61,7 @@ export default {
return {
name: 'AccountChangeSecretList',
query: {
activeTab: 'AccountChangeSecretExecutionList',
tab: 'AccountChangeSecretExecutionList',
automation_id: row.id
}
}

View File

@@ -39,7 +39,7 @@ export default {
formatterArgs: {
route: 'AccountGatherTaskDetail',
routeQuery: {
activeTab: 'Detail'
tab: 'Detail'
}
}
},
@@ -65,7 +65,7 @@ export default {
return {
name: 'AccountGatherList',
query: {
activeTab: 'AccountGatherTaskExecutionList',
tab: 'AccountGatherTaskExecutionList',
automation_id: row.id
}
}

View File

@@ -73,7 +73,7 @@ export default {
return {
name: 'AccountPushList',
query: {
activeTab: 'AccountPushExecutionList',
tab: 'AccountPushExecutionList',
automation_id: row.id
}
}

View File

@@ -45,7 +45,7 @@ export default {
vm.$router.push({
name: 'AccountTemplateDetail',
query: {
activeTab: 'Account'
tab: 'Account'
}
})
}

View File

@@ -48,7 +48,7 @@ export default {
return {
name: 'CommandFilterAclList',
query: {
activeTab: 'CommandGroup',
tab: 'CommandGroup',
command_filters: row.id
}
}

View File

@@ -42,7 +42,7 @@ export default {
const query = _.cloneDeep(this.$route.query)
const newQuery = {
...query,
activeTab: tab.name
tab: tab.name
}
this.$nextTick(() => {
this.$router.replace({ query: newQuery })

View File

@@ -137,7 +137,7 @@ export default {
name: 'AppletHostDetail',
params: { id: assetId },
query: {
activeTab: 'Accounts'
tab: 'Accounts'
}
})
return
@@ -146,7 +146,7 @@ export default {
name: 'AssetDetail',
params: { id: assetId },
query: {
activeTab: 'Account'
tab: 'Account'
}
})
}

View File

@@ -149,7 +149,7 @@ export default {
formatterArgs: {
route: 'AssetPermissionDetail',
routeQuery: {
activeTab: 'AssetPermissionUser'
tab: 'AssetPermissionUser'
}
}
},
@@ -160,7 +160,7 @@ export default {
formatterArgs: {
route: 'AssetPermissionDetail',
routeQuery: {
activeTab: 'AssetPermissionUser'
tab: 'AssetPermissionUser'
}
}
},
@@ -171,7 +171,7 @@ export default {
formatterArgs: {
route: 'AssetPermissionDetail',
routeQuery: {
activeTab: 'AssetPermissionAsset'
tab: 'AssetPermissionAsset'
}
}
}

View File

@@ -92,7 +92,7 @@ export default {
const query = _.cloneDeep(this.$route.query)
const newQuery = {
...query,
activeTab: tab.name
tab: tab.name
}
this.$nextTick(() => {
this.$router.replace({ query: newQuery })

View File

@@ -81,7 +81,7 @@ export default {
permissions: 'xpack.view_syncinstancetaskexecution',
route: 'SyncInstanceTaskDetail',
routeQuery: {
activeTab: 'HistoryList'
tab: 'HistoryList'
}
}
},
@@ -91,7 +91,7 @@ export default {
permissions: 'xpack.view_syncinstancetask',
route: 'SyncInstanceTaskDetail',
routeQuery: {
activeTab: 'AssetList'
tab: 'AssetList'
}
}
}

View File

@@ -44,7 +44,7 @@ export default {
id: this.$route.query.domain
},
query: {
activeTab: 'GatewayList'
tab: 'GatewayList'
}
},
updateSuccessNextRoute: {
@@ -53,7 +53,7 @@ export default {
id: this.$route.query.domain
},
query: {
activeTab: 'GatewayList'
tab: 'GatewayList'
}
}
}

View File

@@ -29,7 +29,7 @@ export default {
async: true,
permissions: 'assets.view_asset',
routeQuery: {
activeTab: 'AssetList'
tab: 'AssetList'
}
}
},
@@ -39,7 +39,7 @@ export default {
formatterArgs: {
permissions: 'assets.view_gateway',
routeQuery: {
activeTab: 'GatewayList'
tab: 'GatewayList'
}
}
}

View File

@@ -36,7 +36,7 @@ export const AssetPermissionTableMeta = {
minWidth: '160px',
formatterArgs: {
routeQuery: {
activeTab: 'AssetPermissionDetail'
tab: 'AssetPermissionDetail'
}
}
},
@@ -67,7 +67,7 @@ export const AssetPermissionTableMeta = {
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionUser'
tab: 'AssetPermissionUser'
}
}
},
@@ -77,7 +77,7 @@ export const AssetPermissionTableMeta = {
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionUser'
tab: 'AssetPermissionUser'
}
}
},
@@ -86,7 +86,7 @@ export const AssetPermissionTableMeta = {
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionAsset'
tab: 'AssetPermissionAsset'
}
}
},
@@ -96,7 +96,7 @@ export const AssetPermissionTableMeta = {
formatterArgs: {
async: true,
routeQuery: {
activeTab: 'AssetPermissionAsset'
tab: 'AssetPermissionAsset'
}
}
},
@@ -109,7 +109,7 @@ export const AssetPermissionTableMeta = {
}
},
routeQuery: {
activeTab: 'AssetPermissionAccount'
tab: 'AssetPermissionAccount'
}
}
},

View File

@@ -139,7 +139,7 @@ export default {
},
callbacks: {
click: function() {
this.$router.push({ name: 'ProfileSetting', query: { activeTab: 'PasswordUpdate' }})
this.$router.push({ name: 'ProfileSetting', query: { tab: 'PasswordUpdate' }})
}.bind(this)
}
},
@@ -152,7 +152,7 @@ export default {
},
callbacks: {
click: function() {
this.$router.push({ name: 'ProfileSetting', query: { activeTab: 'SSHUpdate' }})
this.$router.push({ name: 'ProfileSetting', query: { tab: 'SSHUpdate' }})
}.bind(this)
}
},

View File

@@ -41,7 +41,7 @@ export default {
}
},
beforeRouteUpdate(to, from, next) {
if (to.name === from.name && to.path === from.path && to.query?.activeTab) {
if (to.name === from.name && to.path === from.path && to.query?.tab) {
this.$store.commit('common/reload')
}
next()

View File

@@ -208,7 +208,7 @@ export default {
this.$router.replace({
name: 'TerminalSetting',
query: {
activeTab: 'TerminalList',
tab: 'TerminalList',
name: name
}
})

View File

@@ -67,7 +67,7 @@ export default {
}
},
beforeRouteUpdate(to, from, next) {
if (to.name === from.name && to.path === from.path && to.query?.activeTab) {
if (to.name === from.name && to.path === from.path && to.query?.tab) {
this.$store.commit('common/reload')
}
next()

View File

@@ -31,7 +31,7 @@ export default {
id: row.id
},
query: {
activeTab: 'GroupUser'
tab: 'GroupUser'
}
}
}

View File

@@ -55,7 +55,7 @@ export default {
return {
name: 'RoleDetail',
query: {
activeTab: 'RoleUsers',
tab: 'RoleUsers',
scope: row.scope.value
},
params: {

View File

@@ -75,7 +75,7 @@ export default {
formatter: AmountFormatter,
formatterArgs: {
routeQuery: {
activeTab: 'UserDetail'
tab: 'UserDetail'
}
}
},