feat:添加beforeDestroy生命周期,解绑bus.$on 以及。on事件
This commit is contained in:
@@ -1396,6 +1396,7 @@
|
||||
this.clearChart();
|
||||
//const addChartBox = document.querySelector('.right-box-add-chart');
|
||||
//addChartBox.style.cssText = this.oldChartBoxCss;
|
||||
this.echartModalStore.off('magictypechanged')
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -96,6 +96,10 @@
|
||||
},
|
||||
mounted() {
|
||||
this.initEditor();
|
||||
},
|
||||
beforeDestroy(){
|
||||
this.quill.off('selection-change');
|
||||
this.quill.off('text-change');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -351,6 +351,9 @@ export default {
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.closeSocket();
|
||||
this.term.off("selection");
|
||||
this.term.off("data")
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -270,6 +270,9 @@
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -920,6 +920,9 @@
|
||||
}
|
||||
*/
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -117,6 +117,9 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -105,6 +105,9 @@
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -686,6 +686,9 @@
|
||||
this.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-/alertList")
|
||||
? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-/alertList"))
|
||||
: this.tableTitle;
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -278,6 +278,9 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -685,6 +685,9 @@
|
||||
}, 300);
|
||||
|
||||
//});
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -498,6 +498,9 @@
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -212,6 +212,9 @@ export default {
|
||||
this.popBox.isEdit=n;
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -70,6 +70,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -120,6 +120,9 @@
|
||||
return true;
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -399,6 +399,9 @@
|
||||
})
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -693,167 +693,6 @@
|
||||
setTimeout(()=>{
|
||||
let this_=this;
|
||||
this.init('modal');
|
||||
this.network.on("click", function (params) {
|
||||
this_.activeIndex='';
|
||||
this_.networkPopClose();
|
||||
this_.network.selectNodes([]);
|
||||
if(!params.edges.length&&!params.nodes.length){
|
||||
this_.popDataShowUpdate('');
|
||||
}
|
||||
let selId=params.nodes[0];
|
||||
// if(this_.selNodeId&& this_.selNodeId===selId){return;}
|
||||
if(selId){
|
||||
this_.selNodeId=selId;
|
||||
}else{
|
||||
this_.selNodeId='';
|
||||
}
|
||||
});
|
||||
|
||||
this.network.on("selectNode", function (params) { //选择节点
|
||||
let selId=params.nodes[0];
|
||||
if(this_.selNodeId&& this_.selNodeId===selId){
|
||||
if(selId){
|
||||
this_.cursorMove=true;
|
||||
if(this_.NodeArr.indexOf(selId)!==-1){
|
||||
let index = this_.NodeArr.indexOf(selId);
|
||||
this_.NodeArr=this_.NodeArr.filter((item,i)=> i !== index);
|
||||
return
|
||||
}
|
||||
if(this_.selectNodeTitle&&this_.NodeArrShow){
|
||||
this_.NodeArr.push(selId);
|
||||
this_.network.selectNodes(this_.NodeArr,true);
|
||||
return
|
||||
}
|
||||
if(this_.NodeArr.length===0&&this_.editVisNetwork){
|
||||
this_.nodeEdit();
|
||||
}
|
||||
this_.setPopPosition(selId,params);
|
||||
}
|
||||
}else{
|
||||
if(selId){
|
||||
this_.selNodeId=selId;
|
||||
this_.cursorMove=true;
|
||||
this_.nodeData=this_.nodesArray.find((item)=>item.id===selId);
|
||||
if(this_.NodeArr.indexOf(selId)!==-1){
|
||||
let index = this_.NodeArr.indexOf(selId);
|
||||
this_.NodeArr=this_.NodeArr.filter((item,i)=> i !== index);
|
||||
return
|
||||
}
|
||||
if(this_.selectNodeTitle&&this_.NodeArrShow){
|
||||
this_.NodeArr.push(selId);
|
||||
this_.network.selectNodes(this_.NodeArr,true);
|
||||
return
|
||||
}
|
||||
if(this_.NodeArr.length===0&&this_.editVisNetwork){
|
||||
this_.nodeEdit();
|
||||
}
|
||||
this_.setPopPosition(selId,params);
|
||||
this_.popDataShowUpdate('main');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.network.on("selectEdge", function (params) { // 选择边
|
||||
this_.selNodeId='';
|
||||
this_.lineData=this_.edgesArray.find((item)=>item.id===params.edges[0]);
|
||||
if(this_.editVisNetwork){
|
||||
this_.lineData.color=this_.lineData.color.color?this_.lineData.color.color:this_.lineData.color;
|
||||
this_.addLineShow=true;
|
||||
this_.isLineAdd=false;
|
||||
}
|
||||
if(!this_.editVisNetwork){
|
||||
if(this_.lineData.expressions&&this_.lineData.expressions.length){
|
||||
this_.expressionsInfoShow=false;
|
||||
this_.popDataShowUpdate('total')
|
||||
}else{
|
||||
this_.popDataShowUpdate()
|
||||
}
|
||||
}
|
||||
// this_.lineData.color=this_.lineData.color.color;
|
||||
// this_.addLineShow=true;
|
||||
});
|
||||
|
||||
this.network.on("dragStart", function (params) {//节点移动开始
|
||||
this_.NodeArrShow=false;
|
||||
this_.networkPopShow=false;
|
||||
this_.index='';
|
||||
this_.activeIndex='';
|
||||
let selId=params.nodes[0];
|
||||
if(selId){
|
||||
this_.selNodeId=selId
|
||||
}
|
||||
// if(!selId){
|
||||
// this_.modelTop.forEach(item=>{
|
||||
// item.show=false;
|
||||
// })
|
||||
// }
|
||||
});
|
||||
|
||||
this.network.on("dragging", function () {//节点移动中
|
||||
this_.viewsCenter=this_.network.getViewPosition();
|
||||
// let selId=params.nodes[0];
|
||||
if(this_.selNodeId){
|
||||
this_.setNodePosition(this_.selNodeId)
|
||||
}
|
||||
if(this_.selNodeId&&this_.networkPopShow){
|
||||
this_.setPopPosition(this_.selNodeId);
|
||||
}
|
||||
if(this_.NodeArr.length>0){
|
||||
this_.NodeArrShow=true;
|
||||
}
|
||||
this_.modelTopUpdate();
|
||||
this_.selNodeArrUpdate();
|
||||
});
|
||||
|
||||
this.network.on("dragEnd", function () {//节点移动结束
|
||||
this_.viewsCenter=this_.network.getViewPosition();
|
||||
if(this_.selNodeId){
|
||||
this_.setNodePosition(this_.selNodeId)
|
||||
}
|
||||
if(this_.selNodeId&&this_.networkPopShow){
|
||||
this_.setPopPosition(this_.selNodeId);
|
||||
}
|
||||
if(this_.NodeArr.length>0){
|
||||
this_.NodeArrShow=true;
|
||||
}
|
||||
if(!this_.networkPopShow){
|
||||
this_.selNodeId=''
|
||||
}
|
||||
this_.modelTopUpdate();
|
||||
this_.selNodeArrUpdate();
|
||||
});
|
||||
|
||||
this.network.on("hoverNode", function () {//hoverNode
|
||||
this_.cursorMove=true;
|
||||
// console.log(123123123);
|
||||
});
|
||||
|
||||
this.network.on("blurNode", function () {//blurNode
|
||||
this_.cursorMove=false;
|
||||
});
|
||||
|
||||
this.network.on("zoom", function (params) {//检测缩放
|
||||
this_.zoom=params.scale;
|
||||
this_.modelTopUpdate();
|
||||
this_.selNodeArrUpdate();
|
||||
if(this_.networkPopShow){
|
||||
this_.setPopPosition(this_.selNodeId);
|
||||
}
|
||||
this_.topologyZoom(params.scale);
|
||||
return false
|
||||
});
|
||||
|
||||
this.network.on("resize", function (params) {//检测resize
|
||||
setTimeout(()=>{
|
||||
this_.zoom=this_.network.canvasToDOM({x:0,y:1}).y-this_.network.canvasToDOM({x:0,y:0}).y;
|
||||
this_.modelTopUpdate();
|
||||
this_.selNodeArrUpdate();
|
||||
if(this_.networkPopShow){
|
||||
this_.setPopPosition(this_.selNodeId);
|
||||
}
|
||||
});
|
||||
return false
|
||||
});
|
||||
})
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
@@ -70,6 +70,9 @@
|
||||
})
|
||||
},
|
||||
methods:{},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -483,8 +483,10 @@
|
||||
this.importBox.show = true;
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -341,8 +341,10 @@
|
||||
this.getAssetList();
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -331,8 +331,10 @@
|
||||
this.getEndpointList();
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -114,6 +114,9 @@
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -173,6 +173,9 @@
|
||||
this.filter.panelId = this.showPanel.id;
|
||||
// this.getData(this.filter);
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1042,6 +1042,17 @@
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.network.off('click');
|
||||
this.network.off('selectNode');
|
||||
this.network.off('selectEdge');
|
||||
this.network.off('hoverEdge');
|
||||
this.network.off('blurEdge');
|
||||
this.network.off('dragStart');
|
||||
this.network.off('dragging');
|
||||
this.network.off('dragEnd');
|
||||
this.network.off('blurNode');
|
||||
this.network.off('zoom');
|
||||
this.network.off('resize');
|
||||
this.network=null;
|
||||
},
|
||||
}
|
||||
|
||||
@@ -233,6 +233,9 @@ export default {
|
||||
// }
|
||||
// };
|
||||
},
|
||||
beforeDestroy(){
|
||||
window.onresize=null
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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">
|
||||
@@ -327,7 +327,7 @@
|
||||
current_site_url:'',
|
||||
timezone:'',
|
||||
default_cabinet_usize:'',
|
||||
// query_max_series:''
|
||||
query_max_series:''
|
||||
},
|
||||
basicCopy:null,
|
||||
basicRules:{
|
||||
|
||||
@@ -225,6 +225,9 @@
|
||||
handler(n,o){
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -872,6 +872,9 @@
|
||||
this.storeSuggestions();
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
this.quill.off('text-change')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -480,6 +480,9 @@
|
||||
destroyed() {
|
||||
if(this.chart){
|
||||
this.chart.clear();
|
||||
this.chart.off('mouseover');
|
||||
this.chart.off('mouseout');
|
||||
EleResize.off(this.$el, this.resize, this.chartType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1581,17 +1581,19 @@
|
||||
this.setFreshDataTimer();
|
||||
})
|
||||
|
||||
window.onresize = () => {
|
||||
let vm = this;
|
||||
setTimeout(() => {
|
||||
//vm.map.
|
||||
}, 500);
|
||||
};
|
||||
// window.onresize = () => {
|
||||
// let vm = this;
|
||||
// setTimeout(() => {
|
||||
// //vm.map.
|
||||
// }, 500);
|
||||
// };
|
||||
},
|
||||
beforeDestroy(){
|
||||
this.allProject=null;
|
||||
},
|
||||
destroyed() {
|
||||
clearInterval(this.freshDataTimer);
|
||||
clearInterval(this.freshDateTimer);
|
||||
this.allProject=null;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -741,6 +741,9 @@
|
||||
temp.search();
|
||||
},1000)
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user