Merge remote-tracking branch 'origin/codeCheck' into codeCheck

This commit is contained in:
chenjinsong
2020-11-20 13:58:22 +08:00
45 changed files with 406 additions and 201 deletions

View File

@@ -1396,6 +1396,7 @@
this.clearChart(); this.clearChart();
//const addChartBox = document.querySelector('.right-box-add-chart'); //const addChartBox = document.querySelector('.right-box-add-chart');
//addChartBox.style.cssText = this.oldChartBoxCss; //addChartBox.style.cssText = this.oldChartBoxCss;
this.echartModalStore.off('magictypechanged')
}, },
}; };

View File

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

View File

@@ -96,6 +96,10 @@
}, },
mounted() { mounted() {
this.initEditor(); this.initEditor();
},
beforeDestroy(){
this.quill.off('selection-change');
this.quill.off('text-change');
} }
} }
</script> </script>

View File

@@ -351,6 +351,9 @@ export default {
}, },
beforeDestroy () { beforeDestroy () {
this.closeSocket(); this.closeSocket();
this.term.off("selection");
this.term.off("data")
} }
} }
</script> </script>

View File

@@ -270,6 +270,9 @@
}) })
} }
}, },
beforeDestroy(){
}
} }
</script> </script>

View File

@@ -920,6 +920,9 @@
} }
*/ */
}, },
beforeDestroy(){
}
} }
</script> </script>

View File

@@ -117,6 +117,9 @@
} }
}); });
}, },
beforeDestroy(){
}
} }
</script> </script>

View File

@@ -105,6 +105,9 @@
} }
}, 500); }, 500);
} }
},
beforeDestroy(){
} }
} }
</script> </script>

View File

@@ -686,6 +686,9 @@
this.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-/alertList") this.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-/alertList")
? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-/alertList")) ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-/alertList"))
: this.tableTitle; : this.tableTitle;
},
beforeDestroy(){
} }
} }
</script> </script>

View File

@@ -278,6 +278,9 @@
}); });
} }
}); });
},
beforeDestroy(){
} }
} }
</script> </script>

View File

@@ -685,6 +685,9 @@
}, 300); }, 300);
//}); //});
},
beforeDestroy(){
} }
} }
</script> </script>

View File

@@ -515,6 +515,17 @@
} }
}); });
this.initEvent(); 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> </script>

View File

@@ -498,6 +498,9 @@
}, 500); }, 500);
} }
} }
},
beforeDestroy(){
} }
} }
</script> </script>

View File

@@ -66,7 +66,7 @@
<template> <template>
<el-menu-item v-if="assetData.length == 0" index="3-0"><div @click="createBox({type: 6})"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createDatacenter")}}</div></el-menu-item> <el-menu-item v-if="assetData.length == 0" index="3-0"><div @click="createBox({type: 6})"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createDatacenter")}}</div></el-menu-item>
<template v-else> <template v-else>
<el-scrollbar :style="{height:assetData.length>10?'360px':'auto'}"> <el-scrollbar :style="{height:assetData.length>10?'360px':assetData.length*36+'px'}">
<el-menu-item :index="'3-' + index" v-for="(item, index) in assetData" :key="index"> <el-menu-item :index="'3-' + index" v-for="(item, index) in assetData" :key="index">
<div @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''" @click="jumpToAsset(item)" :class="{'menu-item-active': route == '/asset' && activeItemIndex == item.id}"> <div @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''" @click="jumpToAsset(item)" :class="{'menu-item-active': route == '/asset' && activeItemIndex == item.id}">
<span class="too-long-split" style="width: 130px;">{{item.name}}</span> <span class="too-long-split" style="width: 130px;">{{item.name}}</span>
@@ -84,7 +84,7 @@
<template> <template>
<el-menu-item v-if="projectData.length == 0" index="2-0"><div @click="createBox({type: 1})"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createProject")}}</div></el-menu-item> <el-menu-item v-if="projectData.length == 0" index="2-0"><div @click="createBox({type: 1})"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createProject")}}</div></el-menu-item>
<template v-else> <template v-else>
<el-scrollbar :style="{height:projectData.length>10?'360px':'auto'}"> <el-scrollbar :style="{height:projectData.length>10?'360px':+projectData.length*36+'px'}">
<el-menu-item :index="'2-' + index" v-for="(item, index) in projectData" :key="index"> <el-menu-item :index="'2-' + index" v-for="(item, index) in projectData" :key="index">
<div @mouseenter="hoverItemIndex = '2-' + index" @mouseleave="hoverItemIndex = ''" @click="jumpToProject(item)" :class="{'menu-item-active': route == '/project' && activeItemIndex == item.id}"> <div @mouseenter="hoverItemIndex = '2-' + index" @mouseleave="hoverItemIndex = ''" @click="jumpToProject(item)" :class="{'menu-item-active': route == '/project' && activeItemIndex == item.id}">
<span class="too-long-split" style="width: 135px;">{{item.name}}</span> <span class="too-long-split" style="width: 135px;">{{item.name}}</span>
@@ -408,7 +408,7 @@
getProjectList() { getProjectList() {
this.$get('project', {pageSize:-1}).then(response => { this.$get('project', {pageSize:-1}).then(response => {
if (response.code == 200) { if (response.code == 200) {
this.projectData = response.data.list; this.projectData = response.data.list.splice(0,3);
let flag = false; let flag = false;
//如果currentProject不在新取到的数据里说明它被删了 //如果currentProject不在新取到的数据里说明它被删了
for (let i = 0; i < this.projectData.length; i++) { for (let i = 0; i < this.projectData.length; i++) {
@@ -546,6 +546,12 @@
} }
} }
}, },
beforeDestroy(){
bus.$off('login');
bus.$off("dc-list-change");
bus.$off("current-project-change");
},
destroyed() { destroyed() {
window.removeEventListener('popstate', this.cancel, false); window.removeEventListener('popstate', this.cancel, false);
} }

View File

@@ -702,7 +702,8 @@ const cn = {
timezone: "时区", timezone: "时区",
defaultCabinetUsize: "机柜默认U位", defaultCabinetUsize: "机柜默认U位",
second:'秒', second:'秒',
day:'天' day:'天',
maxSeries:'Query max series',
}, },
email: { email: {
email: "邮件", email: "邮件",
@@ -747,6 +748,18 @@ const cn = {
nameMaxLength:"长度应小于64", nameMaxLength:"长度应小于64",
uriRequired:'请填写正确的网址' uriRequired:'请填写正确的网址'
}, },
notification: {
notification:'Notification',
name: "名称",
filePath: "文件路径",
operation: "操作",
add: "添加",
update: "更新",
del: "删除",
nameMaxLength:"长度应小于64",
uriRequired:'必填项',
filePathReg:'请输入正确的文件路径'
},
reset: { reset: {
reset: "重置", reset: "重置",
type: "类型", type: "类型",

View File

@@ -707,7 +707,8 @@ const en = {
timezone:'Timezone', timezone:'Timezone',
defaultCabinetUsize:'Cabinet U Size', defaultCabinetUsize:'Cabinet U Size',
second:'second', second:'second',
day:'day' day:'day',
maxSeries:'Query max series',
}, },
email:{ email:{
email:'Email', email:'Email',
@@ -744,7 +745,7 @@ const en = {
link: { link: {
link:'Link', link:'Link',
name: "Name", name: "Name",
url: "URL", filePath: "FilePath",
operation: "Operation", operation: "Operation",
add: "Add", add: "Add",
update: "Update", update: "Update",
@@ -752,6 +753,18 @@ const en = {
nameMaxLength:'The length should be less than 64', nameMaxLength:'The length should be less than 64',
uriRequired:'Please fill in the correct url' uriRequired:'Please fill in the correct url'
}, },
notification: {
notification:'Notification',
name: "Name",
filePath: "filePath",
operation: "Operation",
add: "Add",
update: "Update",
del: "Delete",
nameMaxLength:'The length should be less than 64',
uriRequired:'Required',
filePathReg:'Please enter the correct file path'
},
reset:{ reset:{
reset:'Reset', reset:'Reset',
type:'Type', type:'Type',

View File

@@ -647,6 +647,19 @@
this.$nextTick(() => (this.isRouterAlive = true)) 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> </script>

View File

@@ -212,6 +212,9 @@ export default {
this.popBox.isEdit=n; this.popBox.isEdit=n;
} }
} }
},
beforeDestroy(){
} }
} }
</script> </script>

View File

@@ -70,6 +70,9 @@
} }
} }
}, },
beforeDestroy(){
}
} }
</script> </script>

View File

@@ -120,6 +120,9 @@
return true; return true;
} }
}, },
beforeDestroy(){
}
} }
</script> </script>

View File

@@ -2,7 +2,7 @@
<div class="mc" @click.self="clickOutside"> <div class="mc" @click.self="clickOutside">
<div class="right-box right-box-edit-endpoint"> <div class="right-box right-box-edit-endpoint">
<!-- begin--顶部按钮--> <!-- begin--顶部按钮-->
<div class="right-box-top-btns right-box-form-delete" v-if="lineData.id"> <div class="right-box-top-btns right-box-form-delete" v-if="lineData.lineId">
<button id="edit-ep-del" type="button" @click="del" class="nz-btn nz-btn-size-normal nz-btn-size-alien"> <button id="edit-ep-del" type="button" @click="del" class="nz-btn nz-btn-size-normal nz-btn-size-alien">
<span class="right-box-top-btn-icon"><i class="nz-icon nz-icon-delete"></i></span> <span class="right-box-top-btn-icon"><i class="nz-icon nz-icon-delete"></i></span>
<span class="right-box-top-btn-txt">{{$t('overall.delete')}}</span> <span class="right-box-top-btn-txt">{{$t('overall.delete')}}</span>
@@ -11,11 +11,11 @@
<!-- end--顶部按钮--> <!-- end--顶部按钮-->
<!-- begin--标题--> <!-- begin--标题-->
<div class="right-box-title" v-if="!lineData.id"> <div class="right-box-title" v-if="!lineData.lineId">
{{$t('project.topology.addLine')}} {{$t('project.topology.addLine')}}
</div> </div>
<div class="right-box-title" v-if="lineData.id"> <div class="right-box-title" v-if="lineData.lineId">
{{$t("project.topology.editLine") + " ID" + nodeData.id}} {{$t("project.topology.editLine") + " ID" + lineData.lineId}}
</div> </div>
<!-- end--标题--> <!-- end--标题-->

View File

@@ -399,8 +399,11 @@
}) })
}, },
}, },
beforeDestroy(){
} }
}
</script> </script>
<style scoped> <style scoped>

View File

@@ -22,27 +22,9 @@
<script> <script>
import Vis from 'vis-network/dist/vis-network.js' 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 { export default {
name:"topology", name:"topology",
components: { components: {
ExpressionInfo,
TotalChart,
alertTable,
assetTable,
endpointTable,
'add-model':addNode,
'add-line':addLine,
'popDataMain':popDataMain,
'popDataInfo':popDataInfo,
}, },
props:{ props:{
nodesArray:{ nodesArray:{
@@ -697,6 +679,10 @@
this.selNodeId=''; this.selNodeId='';
this.$emit('setTopologyData',nodesArray, edgesArray); this.$emit('setTopologyData',nodesArray, edgesArray);
this.setNetworkData(nodesArray, edgesArray,true); this.setNetworkData(nodesArray, edgesArray,true);
},
clearData(){
this.nodesArray=null;
this.nodesArray
} }
}, },
mounted(){ mounted(){
@@ -707,168 +693,11 @@
setTimeout(()=>{ setTimeout(()=>{
let this_=this; let this_=this;
this.init('modal'); 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(){
this.network=null;
this.clearData();
} }
} }
</script> </script>

View File

@@ -70,6 +70,9 @@
}) })
}, },
methods:{}, methods:{},
beforeDestroy(){
}
} }
</script> </script>

View File

@@ -483,7 +483,9 @@
this.importBox.show = true; this.importBox.show = true;
}, },
}, },
beforeDestroy(){
}
} }
</script> </script>

View File

@@ -341,7 +341,9 @@
this.getAssetList(); this.getAssetList();
}, },
}, },
beforeDestroy(){
}
} }
</script> </script>

View File

@@ -331,7 +331,9 @@
this.getEndpointList(); this.getEndpointList();
}, },
}, },
beforeDestroy(){
}
} }
</script> </script>

View File

@@ -114,6 +114,9 @@
} }
}, },
},
beforeDestroy(){
} }
} }
</script> </script>

View File

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

View File

@@ -173,6 +173,9 @@
this.filter.panelId = this.showPanel.id; this.filter.panelId = this.showPanel.id;
// this.getData(this.filter); // this.getData(this.filter);
}, },
},
beforeDestroy(){
} }
} }
</script> </script>

View File

@@ -851,7 +851,7 @@
this.selNodeId=''; this.selNodeId='';
this.$emit('setTopologyData',nodesArray, edgesArray); this.$emit('setTopologyData',nodesArray, edgesArray);
this.setNetworkData(nodesArray, edgesArray,true); this.setNetworkData(nodesArray, edgesArray,true);
} },
}, },
mounted(){ mounted(){
// this.timeInterval=setInterval(()=>{ // this.timeInterval=setInterval(()=>{
@@ -1040,7 +1040,21 @@
return false return false
}); });
}) })
} },
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;
},
} }
</script> </script>

View File

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

View File

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

View File

@@ -233,6 +233,9 @@ export default {
// } // }
// }; // };
}, },
beforeDestroy(){
window.onresize=null
}
} }
</script> </script>

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
<div class="system" v-scroll-bar> <div class="system" v-scroll-bar>
<el-tabs type="border-card" @tab-click="selectTab" v-model="activeTab" class="system-tabs" > <el-tabs type="border-card" @tab-click="selectTab" v-model="activeTab" class="system-tabs" >
<el-tab-pane :label="$t('config.system.basic.basic')" name="basic"> <el-tab-pane :label="$t('config.system.basic.basic')" name="basic">
<div class="system-config-form"> <div class="system-config-form basicForm">
<el-form :model="basic" label-width="180px" size="small" ref="basicForm" :rules="basic.asset_ping_switch == 'on'?basicRules:basicRules2" :validate-on-rule-change="false"> <el-form :model="basic" label-width="180px" size="small" ref="basicForm" :rules="basic.asset_ping_switch == 'on'?basicRules:basicRules2" :validate-on-rule-change="false">
<el-form-item :label="$t('config.system.basic.systemName')" prop="system_name"> <el-form-item :label="$t('config.system.basic.systemName')" prop="system_name">
<el-input v-model="basic.system_name"></el-input> <el-input v-model="basic.system_name"></el-input>
@@ -29,8 +29,11 @@
<el-form-item :label="$t('config.system.basic.storageRetention')" prop="storage_local_retention"> <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-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>
<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-form-item :label="$t('config.system.basic.timezone')" prop="timezone">
<!-- <el-input v-model.number="basic.timezone" ></el-input>--> <!-- <el-input v-model.number="basic.timezone" ></el-input>-->
<el-select v-model="basic.timezone"> <el-select v-model="basic.timezone">
<el-option v-for="(item,index) in timezoneOption" :key="index" :label="item.label" :value="item.value"></el-option> <el-option v-for="(item,index) in timezoneOption" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
@@ -133,6 +136,74 @@
</el-form> </el-form>
</div> </div>
</el-tab-pane> </el-tab-pane>
<!-- <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>
<div class="linkTitleName">{{$t('config.system.notification.name')}}</div>
<div class="linkTitleUrl">{{$t('config.system.notification.filePath')}}</div>
<div class="linkTitleBtn">{{$t('config.system.notification.operation')}}</div>
</div>
&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">
<el-form-item prop="name">
<el-input v-model="notificationTemp.name" class="linkName"/>
</el-form-item>
<el-form-item prop="filePath">
<el-input v-model="notificationTemp.filePath" class="linkUrl"/>
</el-form-item>
<el-form-item prop="btn">
<i class="nz-icon-create-square nz-icon" @click="notificationAdd"></i>
</el-form-item>
</el-form>
</div>
&lt;!&ndash;notificationEdit&ndash;&gt;
<div class="scrollBox"
v-scrollBar>
<draggable v-model="notification"
:options="{group:'people',animation:150,ghostClass:'sortable-ghost',chosenClass:'chosenClass',scroll:true,scrollSensitivity:200}"
@change="change"
@start="start"
@end="notificationEnd"
:move="move"
handle=".handle"
>
<div v-for="(item,index) in notification" class="linkContent" :id="'notificationDiv'+item.id">
<i class="nz-icon nz-icon-sort4 handle" style="display:none"></i>
<span style="display: inline-block;width: 26px"></span>
<el-form :inline="true" :model="notification[index]" :ref="'notificationForm'+item.id" label-width="180px" size="small" ref="resetForm" :rules="notificationRules" :validate-on-rule-change="false" class="reset-form" :key="index" v-if="item.isEdit" >
<el-form-item prop="name" class="linkName">
<el-input v-model="item.name" width="140px" />
</el-form-item>
<el-form-item prop="filePath" class="linkUrl">
<el-input v-model="item.filePath" width="460px" />
</el-form-item>
<el-form-item prop="btn">
<button type="button" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-normal-new" @click="notificationUpdate(item)">Update</button>
<button type="button" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-light-new" @click="notificationCancel(item)">Cancel</button>
</el-form-item>
</el-form>
<div class="linkFormContent" v-else>
<div class="linkTitleName" :title="item.name">{{item.name}}</div>
<div class="linkTitleUrl">
&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>
&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>
<i class="nz-icon nz-icon-delete" @click="notificationDel(item)"></i>
</div>
</div>
</div>
</draggable>
</div>
</div>
</el-tab-pane>-->
<el-tab-pane :label="$t('config.system.link.link')" name="link"><!--$t('config.system.reset.reset')--> <el-tab-pane :label="$t('config.system.link.link')" name="link"><!--$t('config.system.reset.reset')-->
<div class="linkBox" > <div class="linkBox" >
<div class="linkTitle"> <div class="linkTitle">
@@ -256,6 +327,7 @@
current_site_url:'', current_site_url:'',
timezone:'', timezone:'',
default_cabinet_usize:'', default_cabinet_usize:'',
query_max_series:''
}, },
basicCopy:null, basicCopy:null,
basicRules:{ basicRules:{
@@ -267,6 +339,7 @@
storage_local_retention:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}], storage_local_retention:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}],
timezone:[{required:true,message:this.$t('validate.required'),trigger:'blur'}], timezone:[{required:true,message:this.$t('validate.required'),trigger:'blur'}],
default_cabinet_usize:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'},{validator:uSize,trigger:'blur'}], default_cabinet_usize:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'},{validator:uSize,trigger:'blur'}],
query_max_series:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
}, },
basicRules2:{ basicRules2:{
system_name:[{required:true,message:this.$t('validate.required'),trigger:'blur'},], system_name:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
@@ -276,6 +349,7 @@
storage_local_retention:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}], storage_local_retention:[{required:true,message:this.$t('validate.required'),trigger:'blur'},{validator:positiveInteger,trigger:'blur'}],
timezone:[{required:true,message:this.$t('validate.required'),trigger:'blur'}], timezone:[{required:true,message:this.$t('validate.required'),trigger:'blur'}],
default_cabinet_usize:[{validator:positiveInteger,trigger:'blur'},{validator:uSize,trigger:'blur'}], default_cabinet_usize:[{validator:positiveInteger,trigger:'blur'},{validator:uSize,trigger:'blur'}],
query_max_series:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
}, },
timezoneOption:[ timezoneOption:[
{label:'UTC-12:00',value:'-12'}, {label:'UTC-12:00',value:'-12'},
@@ -376,6 +450,22 @@
// { type: 'url', message: this.$t('config.system.link.uriRequired'), trigger: 'blur' } /*检验网址是否正确*/ // { type: 'url', message: this.$t('config.system.link.uriRequired'), trigger: 'blur' } /*检验网址是否正确*/
] ]
}, },
notificationTemp:{
name:'',filePath:''
},
notification:[],
notificationReserved:[],
notificationRules:{
name:[
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ max: 64, message: this.$t('config.system.link.nameMaxLength'), trigger: 'blur' }
],
filePath:[
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ pattern: /^\/(\w+\/?)+$/, message: this.$t('config.system.notification.filePathReg') }
// { type: 'url', message: this.$t('config.system.link.uriRequired'), trigger: 'blur' } /*检验网址是否正确*/
]
},
resetRules:{ resetRules:{
type:[{required:true,message:this.$t('validate.required'),trigger:'blur'},], type:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
password:[{required:true,message:this.$t('validate.required'),trigger:'blur'},], password:[{required:true,message:this.$t('validate.required'),trigger:'blur'},],
@@ -413,6 +503,10 @@
this.getLinkData(); this.getLinkData();
return return
} }
if(type == 'notification'){
this.getNotificationData();
return
}
this.$get('sysConfig?type='+type).then(response=>{ this.$get('sysConfig?type='+type).then(response=>{
if(response.code == 200){ if(response.code == 200){
let sets=response.data[type]; let sets=response.data[type];
@@ -537,6 +631,28 @@
start: function (evt) { start: function (evt) {
// console.log(evt) // console.log(evt)
}, },
notificationEnd: function (evt) {
let length=this.notification.length;
if(evt.newIndex==evt.oldIndex){ // 如果没有移动返回
return
}
let parmas={
id:this.notification[evt.newIndex].id,
prev:0,
next:-1
}
if(evt.newIndex==length-1){
parmas.prev=this.notification[evt.newIndex-1].id;
}else if(evt.newIndex==0){
parmas.next=this.notification[evt.newIndex+1].id;
}else{
parmas.prev=this.notification[evt.newIndex-1].id;
parmas.next=this.notification[evt.newIndex+1].id;
}
this.$put('/alert/script/modify',parmas).then((response)=>{
// this.$store.commit('setLinkData',this.link);
})
},
end: function (evt) { end: function (evt) {
let length=this.link.length; let length=this.link.length;
if(evt.newIndex==evt.oldIndex){ // 如果没有移动返回 if(evt.newIndex==evt.oldIndex){ // 如果没有移动返回
@@ -645,6 +761,90 @@
} }
}); });
}, },
getNotificationData(){
this.notificationTemp={name:'',filePath:''};
this.$refs['notificationTempForm'].clearValidate();
this.$get('/alert/script').then(response=>{
this.notification=response.data.list;
console.log(this.notification);
this.notificationReserved=[...this.notification];
});
},
// link add
notificationAdd(){
this.$refs['notificationTempForm'].validate((valid) => {
if (valid) {
this.$post('/alert/script',this.notificationTemp).then(response=>{//新增link
if(response.code == 200){
this.notificationTemp={name:'',filePath:''};
this.notificationAddCallBack();
this.$message({duration: 2000, type: 'success', message: this.$t("tip.addSuccess")});
}else{
this.$message.error(response.msg);
}
})
} else {
return false;
}
});
},
notificationAddCallBack(){
this.$get('/link').then(response=>{
this.notification.push(response.data[response.data.length-1]);
this.notificationReserved.push(response.data[response.data.length-1]);
// this.$store.commit('setLinkData',this.link);
});
},
// link edit
notificationEdit(item){
let index=this.notification.findIndex((item1)=>item.id==item1.id);
this.$set(this.notification,index,{...this.notification[index],isEdit:true});
},
// link update
notificationUpdate(item){
this.$refs['notificationForm'+item.id][0].validate((valid) => {
if (valid) {
let params={
id:item.id,
name:item.name,
filePath:item.filePath,
};
this.$put('/alert/script',params).then(response=>{
if(response.code == 200){
let index=this.notification.findIndex((item1)=>item.id==item1.id);
this.$set(this.notification,index,{...this.notification[index],isEdit:false});
this.notificationReserved=[...this.notification];
// this.$store.commit('setLinkData',this.notification);
this.$message({duration: 2000, type: 'success', message: this.$t("tip.saveSuccess")});
}else{
this.$message.error(response.msg);
}
})
} else {
return false;
}
});
},
// link cancel
notificationCancel(item){
let index=this.notification.findIndex((item1)=>item.id==item1.id);
let indexReserved=this.notificationReserved.findIndex((item1)=>item.id==item1.id);
this.$set(this.notification,index,{...this.notificationReserved[indexReserved],isEdit:false});
},
// link del
notificationDel(item){
this.$delete('/alert/script?ids='+item.id).then((response)=>{
if(response.code == 200){
this.notification=this.notification.filter((item1)=>item.id!==item1.id);
this.notificationReserved=this.notificationReserved.filter((item1)=>item.id!==item1.id);
// this.$store.commit('setLinkData',this.link);
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
}else{
this.$message.error(response.msg);
}
});
},
//openUrl 跳转页面 //openUrl 跳转页面
openUrl(item){ openUrl(item){
// window.open(item.url) // window.open(item.url)
@@ -765,6 +965,9 @@
.system-config-form.terminal /deep/ .el-input-number--small{ .system-config-form.terminal /deep/ .el-input-number--small{
width: 512px; width: 512px;
} }
.system-config-form.basicForm /deep/ .el-input-number--small{
width: 512px;
}
.system-config-form /deep/ .el-input input{ .system-config-form /deep/ .el-input input{
text-align: left; text-align: left;
} }

View File

@@ -225,6 +225,9 @@
handler(n,o){ handler(n,o){
} }
} }
},
beforeDestroy(){
} }
} }
</script> </script>

View File

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

View File

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

View File

@@ -872,6 +872,9 @@
this.storeSuggestions(); this.storeSuggestions();
} }
} }
},
beforeDestroy(){
this.quill.off('text-change')
} }
} }
</script> </script>

View File

@@ -480,6 +480,9 @@
destroyed() { destroyed() {
if(this.chart){ if(this.chart){
this.chart.clear(); this.chart.clear();
this.chart.off('mouseover');
this.chart.off('mouseout');
EleResize.off(this.$el, this.resize, this.chartType);
} }
} }
} }

View File

@@ -1581,12 +1581,15 @@
this.setFreshDataTimer(); this.setFreshDataTimer();
}) })
window.onresize = () => { // window.onresize = () => {
let vm = this; // let vm = this;
setTimeout(() => { // setTimeout(() => {
//vm.map. // //vm.map.
}, 500); // }, 500);
}; // };
},
beforeDestroy(){
this.allProject=null;
}, },
destroyed() { destroyed() {
clearInterval(this.freshDataTimer); clearInterval(this.freshDataTimer);

View File

@@ -741,6 +741,9 @@
temp.search(); temp.search();
},1000) },1000)
}, },
},
beforeDestroy(){
} }
} }
</script> </script>

View File

@@ -854,6 +854,13 @@
}, },
destroyed(){ destroyed(){
window.onresize=null; 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> </script>