Merge remote-tracking branch 'origin/codeCheck' into codeCheck
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')
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -1021,6 +1021,7 @@
|
||||
});
|
||||
});
|
||||
}
|
||||
maxValueCopies=null;
|
||||
},
|
||||
handleLineFeed(str,chartWidth){
|
||||
let rlt='';
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -498,6 +498,9 @@
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<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> {{$t("overall.createDatacenter")}}</div></el-menu-item>
|
||||
<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">
|
||||
<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>
|
||||
@@ -84,7 +84,7 @@
|
||||
<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> {{$t("overall.createProject")}}</div></el-menu-item>
|
||||
<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">
|
||||
<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>
|
||||
@@ -408,7 +408,7 @@
|
||||
getProjectList() {
|
||||
this.$get('project', {pageSize:-1}).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.projectData = response.data.list;
|
||||
this.projectData = response.data.list.splice(0,3);
|
||||
let flag = false;
|
||||
//如果currentProject不在新取到的数据里,说明它被删了
|
||||
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() {
|
||||
window.removeEventListener('popstate', this.cancel, false);
|
||||
}
|
||||
|
||||
@@ -702,7 +702,8 @@ const cn = {
|
||||
timezone: "时区",
|
||||
defaultCabinetUsize: "机柜默认U位",
|
||||
second:'秒',
|
||||
day:'天'
|
||||
day:'天',
|
||||
maxSeries:'Query max series',
|
||||
},
|
||||
email: {
|
||||
email: "邮件",
|
||||
@@ -747,6 +748,18 @@ const cn = {
|
||||
nameMaxLength:"长度应小于64",
|
||||
uriRequired:'请填写正确的网址'
|
||||
},
|
||||
notification: {
|
||||
notification:'Notification',
|
||||
name: "名称",
|
||||
filePath: "文件路径",
|
||||
operation: "操作",
|
||||
add: "添加",
|
||||
update: "更新",
|
||||
del: "删除",
|
||||
nameMaxLength:"长度应小于64",
|
||||
uriRequired:'必填项',
|
||||
filePathReg:'请输入正确的文件路径'
|
||||
},
|
||||
reset: {
|
||||
reset: "重置",
|
||||
type: "类型",
|
||||
|
||||
@@ -707,7 +707,8 @@ const en = {
|
||||
timezone:'Timezone',
|
||||
defaultCabinetUsize:'Cabinet U Size',
|
||||
second:'second',
|
||||
day:'day'
|
||||
day:'day',
|
||||
maxSeries:'Query max series',
|
||||
},
|
||||
email:{
|
||||
email:'Email',
|
||||
@@ -744,7 +745,7 @@ const en = {
|
||||
link: {
|
||||
link:'Link',
|
||||
name: "Name",
|
||||
url: "URL",
|
||||
filePath: "FilePath",
|
||||
operation: "Operation",
|
||||
add: "Add",
|
||||
update: "Update",
|
||||
@@ -752,6 +753,18 @@ const en = {
|
||||
nameMaxLength:'The length should be less than 64',
|
||||
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',
|
||||
type:'Type',
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="mc" @click.self="clickOutside">
|
||||
<div class="right-box right-box-edit-endpoint">
|
||||
<!-- 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">
|
||||
<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>
|
||||
@@ -11,11 +11,11 @@
|
||||
<!-- end--顶部按钮-->
|
||||
|
||||
<!-- begin--标题-->
|
||||
<div class="right-box-title" v-if="!lineData.id">
|
||||
<div class="right-box-title" v-if="!lineData.lineId">
|
||||
{{$t('project.topology.addLine')}}
|
||||
</div>
|
||||
<div class="right-box-title" v-if="lineData.id">
|
||||
{{$t("project.topology.editLine") + " ID:" + nodeData.id}}
|
||||
<div class="right-box-title" v-if="lineData.lineId">
|
||||
{{$t("project.topology.editLine") + " ID:" + lineData.lineId}}
|
||||
</div>
|
||||
<!-- end--标题-->
|
||||
|
||||
|
||||
@@ -399,6 +399,9 @@
|
||||
})
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -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(){
|
||||
@@ -707,168 +693,11 @@
|
||||
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(){
|
||||
this.network=null;
|
||||
this.clearData();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1005,6 +1005,7 @@
|
||||
});
|
||||
});
|
||||
}
|
||||
maxValueCopies=null;
|
||||
},
|
||||
handleLineFeed(str,chartWidth){
|
||||
let rlt='';
|
||||
|
||||
@@ -173,6 +173,9 @@
|
||||
this.filter.panelId = this.showPanel.id;
|
||||
// this.getData(this.filter);
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -851,7 +851,7 @@
|
||||
this.selNodeId='';
|
||||
this.$emit('setTopologyData',nodesArray, edgesArray);
|
||||
this.setNetworkData(nodesArray, edgesArray,true);
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
// this.timeInterval=setInterval(()=>{
|
||||
@@ -1040,7 +1040,21 @@
|
||||
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>
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
//初始化表头
|
||||
|
||||
@@ -233,6 +233,9 @@ export default {
|
||||
// }
|
||||
// };
|
||||
},
|
||||
beforeDestroy(){
|
||||
window.onresize=null
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -829,6 +829,8 @@
|
||||
},
|
||||
destroyed() {
|
||||
window.onresize = null;
|
||||
bus.$off("asset-filter-change");
|
||||
bus.$off('alert-message-change');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -492,6 +492,9 @@
|
||||
this.$bottomBoxWindow.showSubListWatch(vm, n);
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
bus.$off("dc-list-change");
|
||||
},
|
||||
destroyed() {
|
||||
window.onresize = null;
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="system" v-scroll-bar>
|
||||
<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">
|
||||
<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-item :label="$t('config.system.basic.systemName')" prop="system_name">
|
||||
<el-input v-model="basic.system_name"></el-input>
|
||||
@@ -29,6 +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.timezone')" prop="timezone">
|
||||
<!-- <el-input v-model.number="basic.timezone" ></el-input>-->
|
||||
<el-select v-model="basic.timezone">
|
||||
@@ -133,6 +136,74 @@
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane :label="$t('config.system.notification.notification')" name="notification"><!–$t('config.system.reset.reset')–>
|
||||
<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>
|
||||
<!–linkAdd–>
|
||||
<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>
|
||||
<!–notificationEdit–>
|
||||
<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">
|
||||
<!–<span class="linkTitleUrlContent" @click="openUrl(item)" @dblclick.stop="linkEdit(item)">–>
|
||||
<!–<el-tooltip class="item" effect="dark" :content="item.url" placement="top" popper-class="linkUrlTip">–>
|
||||
<span>{{item.filePath}}</span>
|
||||
<!–</el-tooltip>–>
|
||||
<!–</span>–>
|
||||
</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')-->
|
||||
<div class="linkBox" >
|
||||
<div class="linkTitle">
|
||||
@@ -256,6 +327,7 @@
|
||||
current_site_url:'',
|
||||
timezone:'',
|
||||
default_cabinet_usize:'',
|
||||
query_max_series:''
|
||||
},
|
||||
basicCopy:null,
|
||||
basicRules:{
|
||||
@@ -267,6 +339,7 @@
|
||||
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'}],
|
||||
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:{
|
||||
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'}],
|
||||
timezone:[{required:true,message:this.$t('validate.required'),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:[
|
||||
{label:'UTC-12:00',value:'-12'},
|
||||
@@ -376,6 +450,22 @@
|
||||
// { 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:{
|
||||
type:[{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();
|
||||
return
|
||||
}
|
||||
if(type == 'notification'){
|
||||
this.getNotificationData();
|
||||
return
|
||||
}
|
||||
this.$get('sysConfig?type='+type).then(response=>{
|
||||
if(response.code == 200){
|
||||
let sets=response.data[type];
|
||||
@@ -537,6 +631,28 @@
|
||||
start: function (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) {
|
||||
let length=this.link.length;
|
||||
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(item){
|
||||
// window.open(item.url)
|
||||
@@ -765,6 +965,9 @@
|
||||
.system-config-form.terminal /deep/ .el-input-number--small{
|
||||
width: 512px;
|
||||
}
|
||||
.system-config-form.basicForm /deep/ .el-input-number--small{
|
||||
width: 512px;
|
||||
}
|
||||
.system-config-form /deep/ .el-input input{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -225,6 +225,9 @@
|
||||
handler(n,o){
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1395,6 +1395,7 @@ export default {
|
||||
//this.metricCascaderList = [...this.metricCascaderListTmp];
|
||||
},
|
||||
beforeDestroy() {
|
||||
bus.$off('clear_history');
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
@@ -650,6 +650,9 @@ export default {
|
||||
this.clearHistory();
|
||||
});
|
||||
},
|
||||
beforeDestroy(){
|
||||
bus.$off('clear_history');
|
||||
}
|
||||
};
|
||||
|
||||
</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,12 +1581,15 @@
|
||||
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);
|
||||
|
||||
@@ -741,6 +741,9 @@
|
||||
temp.search();
|
||||
},1000)
|
||||
},
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user