diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index df7a220b3..956bf0569 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -27,15 +27,15 @@
@@ -150,7 +150,8 @@ export default { default: 0, }, chartInfo:{}, - id:'' + id:'', + from: {type: String} }, data() { return { diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 8882a49c5..ad5ff5bd2 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -432,7 +432,7 @@ from: params.from }; //alert-rule单独处理 - if (param.from == "alertRule") { + if (param.from == this.$CONSTANTS.fromRoute.rule) { this.dataList = []; this.dataList.push({ id: -10, @@ -478,7 +478,7 @@ return; } //endpoint单独处理 - if (param.from == "endpoint") { + if (param.from == this.$CONSTANTS.fromRoute.endpoint) { this.dataList = []; // this.dataList.push({ // id: -8, @@ -571,12 +571,12 @@ this.dataList.forEach((item,index) => { this.setChartSize(item, index);//设置该图表宽度 this.$set(item, "from", params.from); - if (param.from == "asset") { + if (param.from == this.$CONSTANTS.fromRoute.asset) { if (item.type == "assetInfo") { this.$set(item, "draggable", true); this.$set(item, "resizable", true); } - } else if (param.from == "project") { + } else if (param.from == this.$CONSTANTS.fromRoute.project) { if (item.type == "projectInfo") { this.$set(item, "draggable", true); this.$set(item, "resizable", true); @@ -690,7 +690,7 @@ const chartItem = chartInfo; const index = pos; // 指标 if(chartItem.type === 'assetInfo'){ - if (chartItem.from != 'endpoint') { + if (chartItem.from != this.$CONSTANTS.fromRoute.endpoint) { this.$set(chartItem, "draggable", true); this.$set(chartItem, "resizable", true); } diff --git a/nezha-fronted/src/components/charts/chart-single-stat.vue b/nezha-fronted/src/components/charts/chart-single-stat.vue index 84af5567e..12d6a21b3 100644 --- a/nezha-fronted/src/components/charts/chart-single-stat.vue +++ b/nezha-fronted/src/components/charts/chart-single-stat.vue @@ -29,13 +29,13 @@ @@ -100,7 +100,8 @@ export default { chartIndex:{ type: Number, default: 0, - } + }, + from: {type: String} }, data() { return { diff --git a/nezha-fronted/src/components/charts/chart-table.vue b/nezha-fronted/src/components/charts/chart-table.vue index 20ae5e547..8e962879b 100644 --- a/nezha-fronted/src/components/charts/chart-table.vue +++ b/nezha-fronted/src/components/charts/chart-table.vue @@ -34,16 +34,16 @@