Skip to content

Commit

Permalink
perf: update route
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler committed Oct 22, 2024
1 parent d8a6fd9 commit 6e894c3
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 49 deletions.
22 changes: 11 additions & 11 deletions src/components/Apps/AccountListTable/AccountList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,19 @@ export default {
label: '过滤',
options: [
{
label: '全部账号',
label: '最近发现',
value: ''
},
{
label: '拥有的',
value: 'windows'
label: '最近被登录',
value: ''
},
{
label: '收藏夹',
value: 'linux'
label: '最近修改',
value: ''
},
{
label: '最近访问',
label: '最近改密',
value: ''
}
]
Expand All @@ -178,23 +178,23 @@ export default {
label: '风险账号',
options: [
{
label: '过期的密码',
label: '僵尸账号',
value: 'true'
},
{
label: '冲突的密码',
label: '幽灵账号',
value: 'true'
},
{
label: '违法策略',
label: '弱密码',
value: 'true'
},
{
label: '禁用的资源',
label: '长时间未改密',
value: 'true'
},
{
label: '回收站',
label: '长时间未验证',
value: 'true'
}
]
Expand Down
36 changes: 5 additions & 31 deletions src/components/Table/ListTable/QuickFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
</div>
</div>
<div class="summary-zone">
<div v-show="summary" class="summary-zone">
<span v-for="item of summary" :key="item.title">
<SummaryCard :body="item.body" :title="item.title" />
</span>
Expand All @@ -35,37 +35,11 @@ export default {
props: {
filters: {
type: Array,
default: () => []
default: null
},
summary: {
type: Array,
default: () => {
return [
{
title: '最近一周发现',
body: {
route: { name: `SessionList`, params: { activeMenu: 'OnlineList' }},
count: 10,
disabled: 0
}
},
{
title: '最近一月发现',
body: {
route: { name: `SessionList`, params: { activeMenu: 'OnlineList' }},
count: 321,
disabled: 0
}
},
{
title: '待确认',
body: {
count: 544,
disabled: true
}
}
]
}
default: null
},
expand: {
type: Boolean,
Expand Down Expand Up @@ -114,14 +88,14 @@ export default {
width: calc(100% - 70px);
.summary-zone {
padding-top: 10px;
display: flex;
justify-content: space-between;
}
.quick-filter-zone {
display: flex;
justify-content: flex-start;
padding-bottom: 10px;
h5 {
font-weight: 600;
Expand Down Expand Up @@ -169,7 +143,7 @@ export default {
.expand-bar {
float: right;
display: inline-block;
display: block;
cursor: pointer;
i {
Expand Down
9 changes: 8 additions & 1 deletion src/components/Table/ListTable/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<QuickFilter :filters="quickFilters" />
<QuickFilter :filters="quickFilters" :summary="quickSummary" @filter="handleQuickFilter" />
<TableAction
v-if="hasActions"
:date-pick="handleDateChange"
Expand Down Expand Up @@ -58,6 +58,10 @@ export default {
quickFilters: {
type: Array,
default: () => null
},
quickSummary: {
type: Array,
default: () => null
}
},
data() {
Expand Down Expand Up @@ -215,6 +219,9 @@ export default {
})
},
methods: {
handleQuickFilter() {
},
handleActionInitialDone() {
setTimeout(() => {
this.actionInit = true
Expand Down
1 change: 1 addition & 0 deletions src/components/Table/TreeTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
ref="ListTable"
:header-actions="headerActions"
:quick-filters="quickFilters"
:quick-summary="quickSummary"
:table-config="iTableConfig"
v-on="$listeners"
/>
Expand Down
4 changes: 2 additions & 2 deletions src/router/pam/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import i18n from '@/i18n/i18n'

export default [
{
path: 'scan',
name: 'AccountScan',
path: 'check',
name: 'AccountCheck',
component: empty,
redirect: {
name: 'AccountPushList'
Expand Down
26 changes: 26 additions & 0 deletions src/views/accounts/AccountDiscover/AccountDiscoverList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
ref="AssetTreeTable"
:header-actions="headerActions"
:quick-filters="quickFilters"
:quick-summary="quickSummary"
:table-config="tableConfig"
:tree-setting="treeSetting"
/>
Expand Down Expand Up @@ -51,6 +52,31 @@ export default {
// ?assets=0不显示资产. =1显示资产
treeUrl: '/api/v1/assets/nodes/children/tree/?assets=1'
},
quickSummary: [
{
title: '最近一周发现',
body: {
route: { name: `SessionList`, params: { activeMenu: 'OnlineList' }},
count: 10,
disabled: 0
}
},
{
title: '最近一月发现',
body: {
route: { name: `SessionList`, params: { activeMenu: 'OnlineList' }},
count: 321,
disabled: 0
}
},
{
title: '待确认',
body: {
count: 544,
disabled: true
}
}
],
quickFilters: [
{
label: '快速过滤',
Expand Down
10 changes: 6 additions & 4 deletions src/views/dashboard/components/SummaryCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<span class="title">{{ title }}</span>
</div>
<slot>
<h1 class="no-margins">
<h3 class="no-margins">
<span v-if="body.disabled" class="num">
{{ body.count }}
</span>
<router-link v-else :to="body.route">
<span class="num disabled-link">{{ body.count }}</span>
</router-link>
</h1>
</h3>
</slot>
</div>
</template>
Expand Down Expand Up @@ -42,9 +42,10 @@ export default {
.title {
font-style: normal;
font-weight: 400;
font-weight: 600;
font-size: 12px;
line-height: 20px;
text-transform: uppercase;
line-height: 1.2;
}
}
Expand All @@ -61,6 +62,7 @@ export default {
.disabled-link {
cursor: pointer;
&:hover {
color: var(--color-primary);
}
Expand Down

0 comments on commit 6e894c3

Please sign in to comment.