perf: update route

This commit is contained in:
ibuler
2024-10-22 17:30:30 +08:00
parent d8a6fd96ce
commit 6e894c31a1
7 changed files with 59 additions and 49 deletions

View File

@@ -157,19 +157,19 @@ export default {
label: '过滤',
options: [
{
label: '全部账号',
label: '最近发现',
value: ''
},
{
label: '拥有的',
value: 'windows'
label: '最近被登录',
value: ''
},
{
label: '收藏夹',
value: 'linux'
label: '最近修改',
value: ''
},
{
label: '最近访问',
label: '最近改密',
value: ''
}
]
@@ -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'
}
]

View File

@@ -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>
@@ -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,
@@ -114,6 +88,7 @@ export default {
width: calc(100% - 70px);
.summary-zone {
padding-top: 10px;
display: flex;
justify-content: space-between;
}
@@ -121,7 +96,6 @@ export default {
.quick-filter-zone {
display: flex;
justify-content: flex-start;
padding-bottom: 10px;
h5 {
font-weight: 600;
@@ -169,7 +143,7 @@ export default {
.expand-bar {
float: right;
display: inline-block;
display: block;
cursor: pointer;
i {

View File

@@ -1,6 +1,6 @@
<template>
<div>
<QuickFilter :filters="quickFilters" />
<QuickFilter :filters="quickFilters" :summary="quickSummary" @filter="handleQuickFilter" />
<TableAction
v-if="hasActions"
:date-pick="handleDateChange"
@@ -58,6 +58,10 @@ export default {
quickFilters: {
type: Array,
default: () => null
},
quickSummary: {
type: Array,
default: () => null
}
},
data() {
@@ -215,6 +219,9 @@ export default {
})
},
methods: {
handleQuickFilter() {
},
handleActionInitialDone() {
setTimeout(() => {
this.actionInit = true

View File

@@ -44,6 +44,7 @@
ref="ListTable"
:header-actions="headerActions"
:quick-filters="quickFilters"
:quick-summary="quickSummary"
:table-config="iTableConfig"
v-on="$listeners"
/>

View File

@@ -3,8 +3,8 @@ import i18n from '@/i18n/i18n'
export default [
{
path: 'scan',
name: 'AccountScan',
path: 'check',
name: 'AccountCheck',
component: empty,
redirect: {
name: 'AccountPushList'

View File

@@ -9,6 +9,7 @@
ref="AssetTreeTable"
:header-actions="headerActions"
:quick-filters="quickFilters"
:quick-summary="quickSummary"
:table-config="tableConfig"
:tree-setting="treeSetting"
/>
@@ -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: '快速过滤',

View File

@@ -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>
@@ -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;
}
}
@@ -61,6 +62,7 @@ export default {
.disabled-link {
cursor: pointer;
&:hover {
color: var(--color-primary);
}