feat: overview-traffic过滤条件去掉tag

This commit is contained in:
chenjinsong
2020-05-11 11:08:32 +08:00
parent 2c476a958e
commit a694f0ffbb
2 changed files with 15 additions and 3 deletions

View File

@@ -142,13 +142,13 @@
height: 100% !important;
line-height: 1.6rem;
background-color: #efefef;
width: 150px;
width: 107px;
padding-left: 10px;
border: none;
}
}
.el-input::after {
content: "Datacenter & Tag";
content: "Datacenter";
position: absolute;
left: 0;
top: 0;

View File

@@ -852,7 +852,9 @@
getDcTrafficData() {
this.$get('idc/trafficSetting', {pageSize: -1}).then(response => {
if (response.code === 200) {
console.info(response.data.list)
this.trafficData = this.convertTrafficData(response.data.list);
//console.info(this.trafficData)
}
});
@@ -860,6 +862,16 @@
convertTrafficData(data) {
let result = [];
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去重
if (dc.label == item.idc.name) {
handleTag(dc, item.tags);
@@ -872,7 +884,7 @@
handleTag(dc, item.tags);
result.push(dc);
}
});
});*/
function handleTag(dc, tagData) { // dc: cascader数据里的第一级tagData: 原始数据中的tags
if (tagData) {
let tags = dc.children;