feat: overview-traffic过滤条件去掉tag
This commit is contained in:
@@ -142,13 +142,13 @@
|
|||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
line-height: 1.6rem;
|
line-height: 1.6rem;
|
||||||
background-color: #efefef;
|
background-color: #efefef;
|
||||||
width: 150px;
|
width: 107px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.el-input::after {
|
.el-input::after {
|
||||||
content: "Datacenter & Tag";
|
content: "Datacenter";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
@@ -852,7 +852,9 @@
|
|||||||
getDcTrafficData() {
|
getDcTrafficData() {
|
||||||
this.$get('idc/trafficSetting', {pageSize: -1}).then(response => {
|
this.$get('idc/trafficSetting', {pageSize: -1}).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
console.info(response.data.list)
|
||||||
this.trafficData = this.convertTrafficData(response.data.list);
|
this.trafficData = this.convertTrafficData(response.data.list);
|
||||||
|
|
||||||
//console.info(this.trafficData)
|
//console.info(this.trafficData)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -860,6 +862,16 @@
|
|||||||
convertTrafficData(data) {
|
convertTrafficData(data) {
|
||||||
let result = [];
|
let result = [];
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
|
let hasDc = result.some(dc => { //dc去重
|
||||||
|
if (dc.label == item.idc.name) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!hasDc) {
|
||||||
|
result.push({label: item.idc.name, value: "$dc$::" + item.idc.name, level: 1});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/*data.forEach(item => {
|
||||||
let hasDc = result.some(dc => { //dc去重
|
let hasDc = result.some(dc => { //dc去重
|
||||||
if (dc.label == item.idc.name) {
|
if (dc.label == item.idc.name) {
|
||||||
handleTag(dc, item.tags);
|
handleTag(dc, item.tags);
|
||||||
@@ -872,7 +884,7 @@
|
|||||||
handleTag(dc, item.tags);
|
handleTag(dc, item.tags);
|
||||||
result.push(dc);
|
result.push(dc);
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
function handleTag(dc, tagData) { // dc: cascader数据里的第一级;tagData: 原始数据中的tags
|
function handleTag(dc, tagData) { // dc: cascader数据里的第一级;tagData: 原始数据中的tags
|
||||||
if (tagData) {
|
if (tagData) {
|
||||||
let tags = dc.children;
|
let tags = dc.children;
|
||||||
|
|||||||
Reference in New Issue
Block a user