-
{{$t('network.customize')}}
+
+ {{$t('network.customize')}}
-
-
-
+
+
+
-
-
-
-
+ @dragenter="dragenter($event, index)"
+ @dragover="dragover($event, index)"
+ @dragstart="dragstart(index)"
+ draggable="true"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
@@ -116,7 +140,7 @@ export default {
name: 'NetworkOverviewTabs',
data () {
return {
- metric: '',
+ metric: 'Bits',
options: [
{
value: 'Bits',
@@ -133,7 +157,7 @@ export default {
],
tableData: [
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'up',
trendValue: '33%',
@@ -141,7 +165,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trendValue: '6%',
trend: '',
@@ -149,7 +173,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'up',
trendValue: '6%',
@@ -157,7 +181,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'down',
trendValue: '2%',
@@ -165,7 +189,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'down',
trendValue: '2%',
@@ -173,7 +197,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: '',
trendValue: '2%',
@@ -181,7 +205,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'down',
trendValue: '2%',
@@ -189,7 +213,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'down',
trendValue: '2%',
@@ -197,7 +221,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'down',
trendValue: '2%',
@@ -205,7 +229,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'up',
trendValue: '2%',
@@ -213,7 +237,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'down',
trendValue: '2%',
@@ -221,7 +245,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'down',
trendValue: '2%',
@@ -229,7 +253,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'down',
trendValue: '2%',
@@ -237,7 +261,7 @@ export default {
outbound: 0.89
},
{
- ips: 'cate',
+ tab: 'cate',
total: 10,
trend: 'down',
trendValue: '2%',
@@ -246,65 +270,81 @@ export default {
}
],
customTableTitles: [
- { label: 'network.ips', prop: 'ips' },
- { label: 'network.total', prop: 'total' },
- { label: 'network.inbound', prop: 'inbound' },
- { label: 'network.outbound', prop: 'outbound' }
+ { label: 'network.ips', prop: 'tab', checked: true, tabColumn: true },
+ { label: 'network.total', prop: 'total', checked: true, tabColumn: false },
+ { label: 'network.inbound', prop: 'inbound', checked: true, tabColumn: false },
+ { label: 'network.outbound', prop: 'outbound', checked: true, tabColumn: false }
],
list: [
{
label: 'network.ips',
+ prop: 'tab',
checked: true
}, {
label: 'network.countries',
+ prop: 'tab',
checked: true
}, {
label: 'network.asns',
+ prop: 'tab',
checked: true
}, {
label: 'network.applications',
+ prop: 'tab',
checked: true
}, {
label: 'network.providers',
+ prop: 'tab',
checked: true
}, {
label: 'network.domains',
+ prop: 'tab',
checked: true
}, {
label: 'network.protocols',
+ prop: 'tab',
checked: true
}, {
label: 'network.idcTenants',
+ prop: 'tab',
checked: true
}, {
label: 'network.provinces',
+ prop: 'tab',
checked: false
}, {
label: 'network.cities',
+ prop: 'tab',
checked: false
}, {
label: 'network.isps',
+ prop: 'tab',
checked: false
}, {
label: 'network.applicationCategories',
+ prop: 'tab',
checked: false
}, {
label: 'network.domainCategories',
+ prop: 'tab',
checked: false
}, {
label: 'network.hosts',
+ prop: 'tab',
checked: false
}, {
label: 'network.snis',
+ prop: 'tab',
checked: false
}, {
label: 'network.protocolPorts',
+ prop: 'tab',
checked: false
}
],
dragIndex: '',
- enterIndex: '',
- endIndex: ''
+ dragMetricIndex: '',
+ showBackground: false
}
},
components: {
@@ -314,13 +354,29 @@ export default {
shuffle () {
this.list = _.shuffle(this.list)
},
+ handleCustomizeButton (status) {
+ console.log(this.showBackground)
+ this.showBackground = status
+ },
tabChange () {
const tabList = this.list.filter(item => item.checked == true)
if (tabList && tabList.length > 0) {
this.activeTab = tabList[0].label
- this.customTableTitles[0].label = this.$t(tabList[0].label)
+ this.customTableTitles.forEach(item => {
+ if (item.tabColumn) {
+ item.label = tabList[0].label
+ item.prop = tabList[0].prop
+ }
+ })
}
},
+ metricChange () {
+ // const metricList = this.customTableTitles.filter(item => item.checked == true)
+ // if (metricList && metricList.length > 0) {
+ // this.activeCustomize = metricList[0].label
+ // this.customTableTitles[0].label = this.$t(metricList[0].label)
+ // }
+ },
dragstart (index) {
this.dragIndex = index
},
@@ -336,10 +392,34 @@ export default {
dragover (e, index) {
e.preventDefault()
},
+ dragMetricStart (index) {
+ this.dragMetricIndex = index
+ },
+ dragMetricEnter (e, index) {
+ e.preventDefault()
+ if (this.dragMetricIndex !== index) {
+ const moving = this.customTableTitles[this.dragMetricIndex]
+ this.customTableTitles.splice(this.dragMetricIndex, 1)
+ this.customTableTitles.splice(index, 0, moving)
+ this.dragMetricIndex = index
+ }
+ },
+ dragMetricOver (e, index) {
+ e.preventDefault()
+ },
handleClick (tab) {
- this.customTableTitles[0].label = tab.paneName
+ this.customTableTitles.forEach(item => {
+ if (item.tabColumn) {
+ item.label = tab.paneName
+ }
+ })
+ // this.customTableTitles[0].label = tab.paneName
// this.activeTab = tab.paneName
},
+ handleCustomizeClick (tab) {
+ // this.customTableTitles[0].label = tab.paneName
+ this.activeCustomize = tab.paneName
+ },
tableCellStyle ({ row, column, rowIndex, columnIndex }) {
let style = 'border-right:0px;font-size:12px;padding:7px 0 !important;border-bottom: 1px solid #ECECEC;'
if (rowIndex === this.tableData.length - 1) {
@@ -364,9 +444,11 @@ export default {
}
// const dataList = [...props.chartInfo.children]
}
+ const activeCustomize = ref('tabs')
return {
activeTab,
+ activeCustomize,
networkOverviewTabs
// dataList
}