diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index b7a612811..c3b526889 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -641,6 +641,7 @@ li{ .main-list { height: 100%; position: relative; + z-index: 0; } .main-list.main-list-with-sub { height: 50%; diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index 99495adda..4e27fed75 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -117,7 +117,7 @@ ps._ps_ && ps._ps_.update(); }); } - vm.$refs.panelTab.$refs.dashboardScrollbar.update(); + vm.$refs.panelTab && vm.$refs.panelTab.$refs.dashboardScrollbar.update(); clearInterval(intervalFunc); } }, 500); diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue index b9c0c0297..052bb5995 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTab.vue @@ -83,25 +83,12 @@ {{severityData[0].value}}  {{severityData[2].value}} -
@@ -137,9 +124,6 @@ - - -
- @@ -36,8 +36,8 @@ > @@ -137,6 +138,7 @@ data() { let temp = this; return { + chart: {}, tableShow: true, tableHover: false, dropdownShow: false, @@ -168,7 +170,6 @@ saveChart() { //新增chart this.rightBox.show = true; this.$nextTick(() => { - this.$refs.addChartModal.setTitle(this.$t("dashboard.panel.createChartTitle")); let chart = { id:'', title: '', @@ -176,9 +177,9 @@ span:12, height:'400', unit: this.chartUnit, - param:{ + param: { url:'', - threshold:'', + threshold: '', }, elements:[], panel: '', @@ -189,7 +190,7 @@ chart.elements.push({chartId: "", expression: this.selectedEndpoints[i].element, type: 'expert'}); } } - this.$refs.addChartModal.editData(chart); + this.chart = chart; }); }, dropdownHandler(show) { diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue index 636c47de3..58e8ef142 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/endpointTab.vue @@ -242,18 +242,12 @@ this.$refs.addEndpointBox.show(true); this.$refs.addEndpointBox.clearEndpoints(); }, - search: function (searchObj) { - /*this.searchLabel = {idcId: this.currentDc.id, pageNo: 1, pageSize: -1}; - for (let item in searchObj) { - if (searchObj[item]) { - this.$set(this.searchLabel, item, searchObj[item]); - } - }*/ - let orderBy=''; + search(searchObj) { + let orderBy = ''; if(this.searchLabel.orderBy){ orderBy=this.searchLabel.orderBy } - this.searchLabel={}; + this.searchLabel = {}; this.pageObj.pageNo = 1; for (let item in searchObj) { if (searchObj[item]) { @@ -265,10 +259,6 @@ } this.getTableData(); }, - closeSubList() { - this.tableData = []; - this.$emit("closeSubList"); - }, elementsetShow(s, e) { var eventfixed = { shezhi: 0, diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTab.vue index 06a45db5f..f8f5e2e34 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTab.vue @@ -27,7 +27,7 @@ - @@ -49,7 +49,7 @@ - @@ -60,14 +60,14 @@
-
- + @@ -92,7 +92,6 @@ visible: false, rightBox: { //面板弹出框相关 show: false, - title: this.$t('dashboard.panel.createPanelTitle') }, tableHover: false, searchTime: [ @@ -121,17 +120,21 @@ id: '', name: '' }, - chart: { - id: '', + chart: {}, + blankChart: { + id:'', title: '', - type: 'line', - span: 12, - height: 400, - elements: { - id: '', - expression: '', - type: '' - } + type:'line', + span:12, + height:'400', + unit:2, + param:{ + url:'', + threshold:'', + }, + elements:[], + panel: '', + sync: 0 }, pageObj: { pageNo: 1, @@ -161,7 +164,6 @@ type: this.from, id: '' }, - panelId: 0, //removeModal: false, // 删除弹出 //deleteObj: {}, // 删除对象 //---图表相关参数--end @@ -182,15 +184,16 @@ const endTime = bus.timeFormate(et, 'yyyy-MM-dd hh:mm'); this.searchTime = [startTime, endTime]; }, - panelReloadForDel: function () { + panelReloadForDel() { this.getTableData(this.obj.id); }, /*图表相关操作--start*/ - toAddChart: function () { + addChart() { + this.chart = this.newChart(); this.rightBox.show = true; - this.$refs.addChartModal.setTitle(this.$t("dashboard.panel.createChartTitle")); - //this.$refs.addChartModal.show(true); - this.$refs.addChartModal.createData(this.panelId); //初始化创建图表需要的初始数据 + }, + newChart() { + return JSON.parse(JSON.stringify(this.blankChart)); }, // 切换tab changeTab(tab) { @@ -223,21 +226,21 @@ }, 100); }, // 编辑图表信息,打开编辑弹窗 - editData(data) { + editChart(data) { + if (!data.param) { + data.param = {url: '', threshold: '',}; + } + this.chart = JSON.parse(JSON.stringify(data)); this.rightBox.show = true; - this.$nextTick(() => { - this.$refs.addChartModal.setTitle(this.$t("dashboard.panel.editChartTitle")); - this.$refs.addChartModal.editData(data, this.panelId); - }); }, // 移除图表:弹出确认框询问 - removeData(data,from) { + delChart(data,from) { this.$confirm(this.$t("tip.confirmDelete"), { confirmButtonText: this.$t("tip.yes"), cancelButtonText: this.$t("tip.no"), type: 'warning' }).then(() => { - this.$delete("panel/" + this.panelId + "/charts?ids=" + data.id).then(response => { + this.$delete("panel/" + this.showPanel.id + "/charts?ids=" + data.id).then(response => { if (response.code === 200) { this.$message({ duration: 2000, @@ -288,7 +291,7 @@ // this.searchTime = [...val]; this.filter.start_time = bus.timeFormate(this.searchTime[0], 'yyyy-MM-dd hh:mm:ss'); this.filter.end_time = bus.timeFormate(this.searchTime[1], 'yyyy-MM-dd hh:mm:ss'); - this.filter.panelId = this.panelId; + this.filter.panelId = this.showPanel.id; this.getData(this.filter); }, /*时间条件查询--end*/ @@ -301,7 +304,7 @@ if (response.code === 200) { this.panelData = response.data.list; if (this.panelData.length > 0) { - this.panelId = this.filter.panelId = this.panelData[0].id; + this.showPanel.id = this.filter.panelId = this.panelData[0].id; this.getData(this.filter); } }else { diff --git a/nezha-fronted/src/components/common/header.vue b/nezha-fronted/src/components/common/header.vue index 77684bcd5..919e8cee1 100644 --- a/nezha-fronted/src/components/common/header.vue +++ b/nezha-fronted/src/components/common/header.vue @@ -64,7 +64,7 @@
  {{$t("overall.createDatacenter")}}