CN-627 Dashboard - network overview - 表格组件开发:细节调整(字体,颜色,间距等)

This commit is contained in:
hyx
2022-07-14 17:46:06 +08:00
parent 381a4e1a66
commit 525c44bdd3
3 changed files with 83 additions and 53 deletions

View File

@@ -1,16 +1,16 @@
.tabs { .tabs {
$blue:#046ECA;
$grey:#353636;
height:100%; height:100%;
font-size:12px;
.cn-chart__tabs { .cn-chart__tabs {
height:100%; height:100%;
background-color:white;
.tab-pane { .tab-pane {
height:100%; height:100%;
border: 1px solid #e4e7ed; border: 1px solid #E2E5EC;;
padding:1px; padding:1px;
border-radius: 5px; border-radius: 4px;
.tab-table { .tab-table {
color:#484949;
font-size:12px;
border:0px; border:0px;
} }
.data-total{ .data-total{
@@ -18,93 +18,114 @@
} }
.data-total-trend { .data-total-trend {
display: flex; display: flex;
margin-left: 10px; margin-left: 6px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 2px; margin-top: 2px;
border-radius: 10px;
font-weight:500;
} }
.data-total-trend-black { .data-total-trend-black {
background-color: #ededed; background-color: rgba(113,113,113,0.12);
border-radius: 18px; color: #717171;
width: 36px; width: 36px;
height: 18px; height: 20px;
} }
.data-total-trend-green { .data-total-trend-green {
background-color: #eef2e8; background-color: rgba(126,159,84,0.12);
border-radius: 25px; width: 52px;
width: 50px; height: 20px;
height: 18px; color:#7E9F54;
color:#94b072;
} }
.data-total-trend-red { .data-total-trend-red {
background-color: #fbebe9; background-color: rgba(226,97,84,0.12);
border-radius: 25px; width: 52px;
width: 50px; height: 20px;
height: 18px; color:#E26154;
color:#e97367; .cn-icon-rise1{
color: #E44D3E;
}
} }
.el-table--group::after,.el-table--border::after, .el-table::before { .el-table--group::after,.el-table--border::after, .el-table::before {
height: 0px; height: 0px;
} }
.el-table thead {
color: $grey;
}
}
.el-tabs__header {
margin-bottom: 3px;
width: calc(100% - 272px);
} }
.el-tabs__nav-wrap::after { .el-tabs__nav-wrap::after {
height: 1px; height: 1px;
background-color: white ; background-color: white ;
} }
&>.el-tabs__header {
margin-bottom: 10px;
}
.el-tabs__nav.is-top { .el-tabs__nav.is-top {
margin-left:8px;
.el-tabs__active-bar { .el-tabs__active-bar {
display: none; display: none;
} }
.el-tabs__item { .el-tabs__item {
padding: 0 8px; margin: 0 20px 0 0;
font-size:12px; padding:0px;
font-weight: bold; font-weight: 400;
color:#838383; color:$grey;
font-size:14px;
} }
.el-tabs__item.is-top.is-active { .el-tabs__item.is-top.is-active {
border-bottom: 2px solid #0091ff; border-bottom: 2px solid $blue;
color:#0091ff; color:$blue;
height: 35px; height: 33px;
margin:0 20px 0 0;
padding:0px;
font-weight:400;
} }
} }
&>.el-tabs__content { .el-tabs__content {
height: calc(100% - 40px); height: calc(100% - 40px);
border:none; border:none;
} }
} }
.tab-search { .tab-search {
position:absolute; position:absolute;
right:20px;
height:40px; height:40px;
top:0px; top:0px;
display:flex; display:flex;
font-size:12px;
align-items: center; align-items: center;
right:0px;
.search-select { .search-select {
margin-right:10px; color:#575757;
margin-right:20px;
span {
margin-right:3px;
}
.option__select.select-column { .option__select.select-column {
margin-left:3px;
box-shadow: 0 2px 4px 0 rgba(51,51,51,0.10);
border-radius: 2px;
.el-input__inner { .el-input__inner {
width: 86px; width: 80px;
height:24px;
padding-left: 8px; padding-left: 8px;
color:#2C72C6; color:$blue;
font-weight:400; font-weight:400;
} }
} }
.option-popper { .option-popper {
.el-select-dropdown__item { .el-select-dropdown__item.selected {
height: 24px; span{
line-height: 24px; color: $blue !important;
font-size: 12px; }
} }
} }
} }
.search-customize-tab { .search-customize-tab {
color:#69a7de; color:$blue;
.icon-gear{
color:#2C72C6;
width:12px;
height:12px;
}
} }
} }
} }

View File

@@ -154,7 +154,7 @@ export const listScrollPath = [
'/detection/securityEvent' '/detection/securityEvent'
] ]
export const networkOverviewTable = [ export const networkOverviewTabs = [
'network.categories', 'network.categories',
'network.providers', 'network.providers',
'network.countries', 'network.countries',

View File

@@ -4,7 +4,7 @@
class="cn-chart__tabs" class="cn-chart__tabs"
@tab-click="handleClick" @tab-click="handleClick"
> >
<el-tab-pane v-for="(tab,index) in networkOverviewTable" <el-tab-pane v-for="(tab,index) in networkOverviewTabs"
:label="$t(tab)" :label="$t(tab)"
:name="tab" :name="tab"
:key="index" :key="index"
@@ -54,11 +54,12 @@
</el-tabs> </el-tabs>
<div class="tab-search" > <div class="tab-search" >
<div class="search-select" > <div class="search-select" >
<span class="margin-r-10">{{$t('network.metric')}}:</span> <span>{{$t('network.metric')}}:</span>
<el-select v-model="metric" <el-select v-model="metric"
class="option__select select-column" class="option__select select-column"
placeholder="" placeholder=""
popper-class="option-popper" popper-class="option-popper"
:popper-append-to-body="false"
size="mini"> size="mini">
<el-option <el-option
v-for="item in options" v-for="item in options"
@@ -69,7 +70,7 @@
</el-select> </el-select>
</div> </div>
<div class="search-customize-tab"> <div class="search-customize-tab">
<i class="cn-icon-gear cn-icon"></i> {{$t('network.customizeTabs')}} <i class="cn-icon-gear cn-icon icon-gear"></i> {{$t('network.customizeTabs')}}
</div> </div>
</div> </div>
@@ -79,10 +80,10 @@
<script> <script>
import _ from 'lodash' import _ from 'lodash'
import { ref } from 'vue' import { ref } from 'vue'
import { networkOverviewTable } from '@/utils/constants' import { networkOverviewTabs } from '@/utils/constants'
export default { export default {
name: 'NetworkOverviewTable', name: 'NetworkOverviewTabs',
data () { data () {
return { return {
metric: '', metric: '',
@@ -90,6 +91,14 @@ export default {
{ {
value: 'Bits', value: 'Bits',
label: 'Bits' label: 'Bits'
},
{
value: 'Bits2',
label: 'Bits2'
},
{
value: 'Bits3',
label: 'Bits3'
} }
], ],
tableData: [ tableData: [
@@ -221,21 +230,21 @@ export default {
// this.activeTab = tab.paneName // this.activeTab = tab.paneName
}, },
tableCellStyle ({ row, column, rowIndex, columnIndex }) { tableCellStyle ({ row, column, rowIndex, columnIndex }) {
let style = 'border-right:0px;padding:7px 0 !important;' let style = 'border-right:0px;font-size:12px;padding:7px 0 !important;border-bottom: 1px solid #ECECEC;'
if (rowIndex === this.tableData.length - 1) { if (rowIndex === this.tableData.length - 1) {
style = style + 'border-bottom:0px !important;' style = style + 'border-bottom:0px !important;'
} }
if (columnIndex === 0) { if (columnIndex === 0) {
style = style + 'color:#69a7de;' style = style + 'color:#046ECA;'
} }
return style return style
}, },
tableHeaderCellStyle ({ row, column, rowIndex, columnIndex }) { tableHeaderCellStyle ({ row, column, rowIndex, columnIndex }) {
return 'border-right:0px;font-size:12px;color:#656565;padding:7px 0 !important;' return 'border-right:0px;font-size:12px;font-weight:500;padding:4px 0 !important;border-bottom: 1px solid #E2E5EC;'
} }
}, },
setup (props) { setup (props) {
let activeTab = ref(networkOverviewTable[0]) let activeTab = ref(networkOverviewTabs[0])
if (props.chartInfo) { if (props.chartInfo) {
if (!_.isEmpty(props.chartInfo.children)) { if (!_.isEmpty(props.chartInfo.children)) {
activeTab = `${props.chartInfo.children[0].id}` activeTab = `${props.chartInfo.children[0].id}`
@@ -245,7 +254,7 @@ export default {
return { return {
activeTab, activeTab,
networkOverviewTable networkOverviewTabs
// dataList // dataList
} }