mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
perf: 修改 tab 变量
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
return {
|
||||
name: 'AccountBackupList',
|
||||
query: {
|
||||
activeTab: 'AccountBackupPlanExecutionList',
|
||||
tab: 'AccountBackupPlanExecutionList',
|
||||
plan_id: row.id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
return {
|
||||
name: 'AccountChangeSecretList',
|
||||
query: {
|
||||
activeTab: 'AccountChangeSecretExecutionList',
|
||||
tab: 'AccountChangeSecretExecutionList',
|
||||
automation_id: row.id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ export default {
|
||||
return {
|
||||
name: 'AccountPushList',
|
||||
query: {
|
||||
activeTab: 'AccountPushExecutionList',
|
||||
tab: 'AccountPushExecutionList',
|
||||
automation_id: row.id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
vm.$router.push({
|
||||
name: 'AccountTemplateDetail',
|
||||
query: {
|
||||
activeTab: 'Account'
|
||||
tab: 'Account'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
return {
|
||||
name: 'CommandFilterAclList',
|
||||
query: {
|
||||
activeTab: 'CommandGroup',
|
||||
tab: 'CommandGroup',
|
||||
command_filters: row.id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -208,7 +208,7 @@ export default {
|
||||
this.$router.replace({
|
||||
name: 'TerminalSetting',
|
||||
query: {
|
||||
activeTab: 'TerminalList',
|
||||
tab: 'TerminalList',
|
||||
name: name
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -31,7 +31,7 @@ export default {
|
||||
id: row.id
|
||||
},
|
||||
query: {
|
||||
activeTab: 'GroupUser'
|
||||
tab: 'GroupUser'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
return {
|
||||
name: 'RoleDetail',
|
||||
query: {
|
||||
activeTab: 'RoleUsers',
|
||||
tab: 'RoleUsers',
|
||||
scope: row.scope.value
|
||||
},
|
||||
params: {
|
||||
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
formatter: AmountFormatter,
|
||||
formatterArgs: {
|
||||
routeQuery: {
|
||||
activeTab: 'UserDetail'
|
||||
tab: 'UserDetail'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user