feat:给bus添加off时间 以及手动释放一些内存,隐藏system新增内容

This commit is contained in:
zhangyu
2020-11-20 10:15:17 +08:00
parent ba188b9128
commit 99779334b2
15 changed files with 77 additions and 33 deletions

View File

@@ -1023,6 +1023,7 @@
});
});
}
maxValueCopies=null;
},
handleLineFeed(str,chartWidth){
let rlt='';

View File

@@ -515,6 +515,17 @@
}
});
this.initEvent();
},
beforeDestroy(){
bus.$off("current-project-change", project => {
this.currentProject = project;
});
bus.$on("current-module-change", module => {
this.currentModule = module;
});
// bus.$on("endpoint-list-change", menu => {
// this.getEndpointTableData();
// });
}
}
</script>

View File

@@ -647,6 +647,19 @@
this.$nextTick(() => (this.isRouterAlive = true))
}
},
beforeDestroy(){
/*bus.$off("parent-menu-change");
bus.$off("menu-change");*/
bus.$off("header-dc-change");
bus.$off("clear-asset-filter");
bus.$off("project-list-change");
bus.$off("module-list-change");
bus.$off('asset-list-change');
bus.$off('asset-property-change')
bus.$off('asset-ping-switch-change')
}
}
</script>

View File

@@ -22,27 +22,9 @@
<script>
import Vis from 'vis-network/dist/vis-network.js'
import addNode from './addNode'
import addLine from './addLine'
import popDataMain from './popData/Main'
import popDataInfo from './popData/Info'
import TotalChart from "./popData/totalChart";
import alertTable from "./popData/alertTable";
import assetTable from "./popData/assetTable";
import endpointTable from "./popData/endpointTable";
import ExpressionInfo from "./popData/expressionInfo";
export default {
name:"topology",
components: {
ExpressionInfo,
TotalChart,
alertTable,
assetTable,
endpointTable,
'add-model':addNode,
'add-line':addLine,
'popDataMain':popDataMain,
'popDataInfo':popDataInfo,
},
props:{
nodesArray:{
@@ -697,6 +679,10 @@
this.selNodeId='';
this.$emit('setTopologyData',nodesArray, edgesArray);
this.setNetworkData(nodesArray, edgesArray,true);
},
clearData(){
this.nodesArray=null;
this.nodesArray
}
},
mounted(){
@@ -869,6 +855,10 @@
return false
});
})
},
beforeDestroy(){
this.network=null;
this.clearData();
}
}
</script>

View File

@@ -1005,6 +1005,7 @@
});
});
}
maxValueCopies=null;
},
handleLineFeed(str,chartWidth){
let rlt='';

View File

@@ -851,7 +851,7 @@
this.selNodeId='';
this.$emit('setTopologyData',nodesArray, edgesArray);
this.setNetworkData(nodesArray, edgesArray,true);
}
},
},
mounted(){
// this.timeInterval=setInterval(()=>{
@@ -1040,7 +1040,10 @@
return false
});
})
}
},
beforeDestroy() {
this.network=null;
},
}
</script>

View File

@@ -347,7 +347,11 @@
},
topologyLoad(){
this.topologyLoading=true;
}
},
clearData(){
this.nodesArray=null;
this.nodesArrayOther=null;
},
},
mounted(){
@@ -355,6 +359,7 @@
},
beforeDestroy(){
this.$refs['pickTime'].selectInterval();
this.clearData();
}
}

View File

@@ -533,6 +533,9 @@
},
destroyed() {
window.onresize = null;
bus.$off("alert-rule-list-change");
bus.$off("dc-list-change");
bus.$off('alert-message-change')
},
mounted() {
//初始化表头

View File

@@ -829,6 +829,8 @@
},
destroyed() {
window.onresize = null;
bus.$off("asset-filter-change");
bus.$off('alert-message-change');
}
}
</script>

View File

@@ -492,6 +492,9 @@
this.$bottomBoxWindow.showSubListWatch(vm, n);
},
},
beforeDestroy(){
bus.$off("dc-list-change");
},
destroyed() {
window.onresize = null;
},

View File

@@ -29,9 +29,9 @@
<el-form-item :label="$t('config.system.basic.storageRetention')" prop="storage_local_retention">
<el-input v-model.number="basic.storage_local_retention" ></el-input><span class="nz-input-append">{{$t('config.system.basic.day')}}</span>
</el-form-item>
<el-form-item :label="$t('config.system.basic.maxSeries')" prop="storage_local_retention">
<el-input-number v-model="basic.query_max_series" controls-position="right" :min="-1" :max="1000" :precision="0"></el-input-number>
</el-form-item>
<!--<el-form-item :label="$t('config.system.basic.maxSeries')" prop="storage_local_retention">-->
<!--<el-input-number v-model="basic.query_max_series" controls-position="right" :min="-1" :max="1000" :precision="0"></el-input-number>-->
<!--</el-form-item>-->
<el-form-item :label="$t('config.system.basic.timezone')" prop="timezone">
<!-- <el-input v-model.number="basic.timezone" ></el-input>-->
<el-select v-model="basic.timezone">
@@ -136,7 +136,7 @@
</el-form>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('config.system.notification.notification')" name="notification"><!--$t('config.system.reset.reset')-->
<!-- <el-tab-pane :label="$t('config.system.notification.notification')" name="notification">&lt;!&ndash;$t('config.system.reset.reset')&ndash;&gt;
<div class="linkBox" >
<div class="linkTitle">
<span class="linkTitleHandle"></span>
@@ -144,7 +144,7 @@
<div class="linkTitleUrl">{{$t('config.system.notification.filePath')}}</div>
<div class="linkTitleBtn">{{$t('config.system.notification.operation')}}</div>
</div>
<!--linkAdd-->
&lt;!&ndash;linkAdd&ndash;&gt;
<div class="linkContent linkAddBox">
<span class="linkTitleHandle"></span>
<el-form :inline="true" :model="notificationTemp" label-width="180px" size="small" ref="notificationTempForm" :rules="notificationRules" :validate-on-rule-change="false" class="reset-form">
@@ -159,7 +159,7 @@
</el-form-item>
</el-form>
</div>
<!--notificationEdit-->
&lt;!&ndash;notificationEdit&ndash;&gt;
<div class="scrollBox"
v-scrollBar>
<draggable v-model="notification"
@@ -188,11 +188,11 @@
<div class="linkFormContent" v-else>
<div class="linkTitleName" :title="item.name">{{item.name}}</div>
<div class="linkTitleUrl">
<!--<span class="linkTitleUrlContent" @click="openUrl(item)" @dblclick.stop="linkEdit(item)">-->
<!--<el-tooltip class="item" effect="dark" :content="item.url" placement="top" popper-class="linkUrlTip">-->
&lt;!&ndash;<span class="linkTitleUrlContent" @click="openUrl(item)" @dblclick.stop="linkEdit(item)">&ndash;&gt;
&lt;!&ndash;<el-tooltip class="item" effect="dark" :content="item.url" placement="top" popper-class="linkUrlTip">&ndash;&gt;
<span>{{item.filePath}}</span>
<!--</el-tooltip>-->
<!--</span>-->
&lt;!&ndash;</el-tooltip>&ndash;&gt;
&lt;!&ndash;</span>&ndash;&gt;
</div>
<div class="linkFormBtn">
<i class="nz-icon nz-icon-edit" @click.stop="notificationEdit(item)"></i>
@@ -203,7 +203,7 @@
</draggable>
</div>
</div>
</el-tab-pane>
</el-tab-pane>-->
<el-tab-pane :label="$t('config.system.link.link')" name="link"><!--$t('config.system.reset.reset')-->
<div class="linkBox" >
<div class="linkTitle">
@@ -327,7 +327,7 @@
current_site_url:'',
timezone:'',
default_cabinet_usize:'',
query_max_series:''
// query_max_series:''
},
basicCopy:null,
basicRules:{

View File

@@ -1395,6 +1395,7 @@ export default {
//this.metricCascaderList = [...this.metricCascaderListTmp];
},
beforeDestroy() {
bus.$off('clear_history');
},
};

View File

@@ -650,6 +650,9 @@ export default {
this.clearHistory();
});
},
beforeDestroy(){
bus.$off('clear_history');
}
};
</script>

View File

@@ -1591,6 +1591,7 @@
destroyed() {
clearInterval(this.freshDataTimer);
clearInterval(this.freshDateTimer);
this.allProject=null;
}
}
</script>

View File

@@ -854,6 +854,13 @@
},
destroyed(){
window.onresize=null;
bus.$off("project-page-type");
bus.$off("current-project-change");
bus.$off("current-module-change");
bus.$off("project-list-change");
bus.$off("module-list-change");
bus.$off("endpoint-list-change");
bus.$off('alert-message-change')
}
}
</script>