diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue
index f96bdc3cc..2c559c608 100644
--- a/nezha-fronted/src/components/charts/chart-alert-list.vue
+++ b/nezha-fronted/src/components/charts/chart-alert-list.vue
@@ -839,24 +839,30 @@ export default {
},
duplicate(){
this.dropdownMenuShow=false;
- const param = {id:this.data.id};
- this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
- if (response.code === 200) {
- this.$message({
- duration: 2000,
- type: 'success',
- message: this.$t("tip.duplicateSuccess")
- });
- this.$emit('on-duplicate-chart-block', this.data.id,response.data);
- }else {
- if(response.msg){
- this.$message.error(response.msg);
- }else if(response.error){
- this.$message.error(response.error);
+ this.$confirm(this.$t("tip.confirmDuplicate"), {
+ confirmButtonText: this.$t("tip.yes"),
+ cancelButtonText: this.$t("tip.no"),
+ type: 'info'
+ }).then(() => {
+ const param = {id:this.data.id};
+ this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
+ if (response.code === 200) {
+ this.$message({
+ duration: 2000,
+ type: 'success',
+ message: this.$t("tip.duplicateSuccess")
+ });
+ this.$emit('on-duplicate-chart-block', this.data.id,response.data);
}else {
- this.$message.error(response);
+ if(response.msg){
+ this.$message.error(response.msg);
+ }else if(response.error){
+ this.$message.error(response.error);
+ }else {
+ this.$message.error(response);
+ }
}
- }
+ });
});
},
// 全屏查看
diff --git a/nezha-fronted/src/components/charts/chart-single-stat.vue b/nezha-fronted/src/components/charts/chart-single-stat.vue
index 4b0fb674e..987f3581e 100644
--- a/nezha-fronted/src/components/charts/chart-single-stat.vue
+++ b/nezha-fronted/src/components/charts/chart-single-stat.vue
@@ -359,24 +359,30 @@ export default {
},
duplicate(){
this.dropdownMenuShow=false;
- const param = {id:this.data.id};
- this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
- if (response.code === 200) {
- this.$message({
- duration: 2000,
- type: 'success',
- message: this.$t("tip.duplicateSuccess")
- });
- this.$emit('on-duplicate-chart-block', this.data.id,response.data);
- }else {
- if(response.msg){
- this.$message.error(response.msg);
- }else if(response.error){
- this.$message.error(response.error);
+ this.$confirm(this.$t("tip.confirmDuplicate"), {
+ confirmButtonText: this.$t("tip.yes"),
+ cancelButtonText: this.$t("tip.no"),
+ type: 'info'
+ }).then(() => {
+ const param = {id:this.data.id};
+ this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
+ if (response.code === 200) {
+ this.$message({
+ duration: 2000,
+ type: 'success',
+ message: this.$t("tip.duplicateSuccess")
+ });
+ this.$emit('on-duplicate-chart-block', this.data.id,response.data);
}else {
- this.$message.error(response);
+ if(response.msg){
+ this.$message.error(response.msg);
+ }else if(response.error){
+ this.$message.error(response.error);
+ }else {
+ this.$message.error(response);
+ }
}
- }
+ });
});
},
// 全屏查看
diff --git a/nezha-fronted/src/components/charts/chart-table.vue b/nezha-fronted/src/components/charts/chart-table.vue
index 8b2293878..039ffc11b 100644
--- a/nezha-fronted/src/components/charts/chart-table.vue
+++ b/nezha-fronted/src/components/charts/chart-table.vue
@@ -62,10 +62,10 @@
{{ scope.row.element.alias?scope.row.element.alias:scope.row.element.element}}
-
- {{ scope.row.value}}
+ {{ scope.row.value}}
@@ -98,7 +98,7 @@
- {{ scope.row.value}}
+ {{ scope.row.value}}
@@ -334,26 +334,32 @@
clearChart() {
this.data = {};
},
- duplicate() {
- this.dropdownMenuShow = false;
- const param = {id: this.data.id};
- this.$post('panel/' + this.data.panelId + '/charts/duplicate', (param)).then(response => {
- if (response.code === 200) {
- this.$message({
- duration: 2000,
- type: 'success',
- message: this.$t("tip.duplicateSuccess")
- });
- this.$emit('on-duplicate-chart-block', this.data.id, response.data);
- } else {
- if (response.msg) {
- this.$message.error(response.msg);
- } else if (response.error) {
- this.$message.error(response.error);
- } else {
- this.$message.error(response);
+ duplicate(){
+ this.dropdownMenuShow=false;
+ this.$confirm(this.$t("tip.confirmDuplicate"), {
+ confirmButtonText: this.$t("tip.yes"),
+ cancelButtonText: this.$t("tip.no"),
+ type: 'info'
+ }).then(() => {
+ const param = {id:this.data.id};
+ this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
+ if (response.code === 200) {
+ this.$message({
+ duration: 2000,
+ type: 'success',
+ message: this.$t("tip.duplicateSuccess")
+ });
+ this.$emit('on-duplicate-chart-block', this.data.id,response.data);
+ }else {
+ if(response.msg){
+ this.$message.error(response.msg);
+ }else if(response.error){
+ this.$message.error(response.error);
+ }else {
+ this.$message.error(response);
+ }
}
- }
+ });
});
},
// 全屏查看
diff --git a/nezha-fronted/src/components/charts/chart-url.vue b/nezha-fronted/src/components/charts/chart-url.vue
index a33e12f59..cf94d8d08 100644
--- a/nezha-fronted/src/components/charts/chart-url.vue
+++ b/nezha-fronted/src/components/charts/chart-url.vue
@@ -230,24 +230,30 @@ export default {
},
duplicate(){
this.dropdownMenuShow=false;
- const param = {id:this.data.id};
- this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
- if (response.code === 200) {
- this.$message({
- duration: 2000,
- type: 'success',
- message: this.$t("tip.duplicateSuccess")
- });
- this.$emit('on-duplicate-chart-block', this.data.id,response.data);
- }else {
- if(response.msg){
- this.$message.error(response.msg);
- }else if(response.error){
- this.$message.error(response.error);
+ this.$confirm(this.$t("tip.confirmDuplicate"), {
+ confirmButtonText: this.$t("tip.yes"),
+ cancelButtonText: this.$t("tip.no"),
+ type: 'info'
+ }).then(() => {
+ const param = {id:this.data.id};
+ this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
+ if (response.code === 200) {
+ this.$message({
+ duration: 2000,
+ type: 'success',
+ message: this.$t("tip.duplicateSuccess")
+ });
+ this.$emit('on-duplicate-chart-block', this.data.id,response.data);
}else {
- this.$message.error(response);
+ if(response.msg){
+ this.$message.error(response.msg);
+ }else if(response.error){
+ this.$message.error(response.error);
+ }else {
+ this.$message.error(response);
+ }
}
- }
+ });
});
},
setLoadFrameFull(){
diff --git a/nezha-fronted/src/components/charts/chart.scss b/nezha-fronted/src/components/charts/chart.scss
index bf7f85970..e02bb43e9 100644
--- a/nezha-fronted/src/components/charts/chart.scss
+++ b/nezha-fronted/src/components/charts/chart.scss
@@ -663,3 +663,7 @@
background-color: rgba(0,0,0,.1);
z-index: 100;
}*/
+.chart-table .nz-table .el-table__row .costom-value .cell{
+ padding: 1px 0;
+
+}
diff --git a/nezha-fronted/src/components/charts/chartDataFormat.js b/nezha-fronted/src/components/charts/chartDataFormat.js
index 9185438c2..339f5c3f3 100644
--- a/nezha-fronted/src/components/charts/chartDataFormat.js
+++ b/nezha-fronted/src/components/charts/chartDataFormat.js
@@ -3,7 +3,6 @@
* index:yAxis 默认第二个参数 y轴的位置
* type:自定义参数,用于区分是y轴调用还是tooltip调用,以设置不同精度 type =1 y轴调用 type=2 tooltip调用
* */
-import {parse} from "echarts/extension-src/dataTool/gexf";
import bus from "../../libs/bus"
function none(value, index){
@@ -680,14 +679,14 @@ export default {
if(type ==='Time'){
return value
}
-
+
if(type==='Data'){
if(value>1){
while(value>1024){
pow++;
value=value/1024
}
-
+
if(flow==='ceil'){
let length=JSON.stringify(Math.ceil(value)).length;
value=value/Math.pow(10,length-1);
@@ -701,14 +700,14 @@ export default {
return value
}
}
-
+
if(type==='Misc' || type==='DataRate'){
if(value>1){
while(value>1000){
pow++;
value=value/1000
}
-
+
if(flow==='ceil'){
let length=JSON.stringify(Math.ceil(value)).length;
value=value/Math.pow(10,length-1);
@@ -722,9 +721,9 @@ export default {
return value
}
}
-
+
return value;
-
+
},
copies:function(value){
switch(parseInt(value)){
@@ -747,7 +746,7 @@ export default {
}
return value?value:1;
}
-
+
if(value<1024&&type==='Data'){
let interVal=value/copies;
return interVal
diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue
index c4d8a8576..eef12d67d 100644
--- a/nezha-fronted/src/components/charts/line-chart-block.vue
+++ b/nezha-fronted/src/components/charts/line-chart-block.vue
@@ -1311,24 +1311,30 @@
},
duplicate(){
this.dropdownMenuShow=false;
- const param = {id:this.data.id};
- this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
- if (response.code === 200) {
- this.$message({
- duration: 2000,
- type: 'success',
- message: this.$t("tip.duplicateSuccess")
- });
- this.$emit('on-duplicate-chart-block', this.data.id, response.data);
- }else {
- if(response.msg){
- this.$message.error(response.msg);
- }else if(response.error){
- this.$message.error(response.error);
+ this.$confirm(this.$t("tip.confirmDuplicate"), {
+ confirmButtonText: this.$t("tip.yes"),
+ cancelButtonText: this.$t("tip.no"),
+ type: 'info'
+ }).then(() => {
+ const param = {id:this.data.id};
+ this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
+ if (response.code === 200) {
+ this.$message({
+ duration: 2000,
+ type: 'success',
+ message: this.$t("tip.duplicateSuccess")
+ });
+ this.$emit('on-duplicate-chart-block', this.data.id,response.data);
}else {
- this.$message.error(response);
+ if(response.msg){
+ this.$message.error(response.msg);
+ }else if(response.error){
+ this.$message.error(response.error);
+ }else {
+ this.$message.error(response);
+ }
}
- }
+ });
});
},
dateChange(time) {
diff --git a/nezha-fronted/src/components/charts/text-chart.vue b/nezha-fronted/src/components/charts/text-chart.vue
index 60ac5b7b1..9b85226a6 100644
--- a/nezha-fronted/src/components/charts/text-chart.vue
+++ b/nezha-fronted/src/components/charts/text-chart.vue
@@ -170,24 +170,30 @@
},
duplicate(){
this.dropdownMenuShow=false;
- const param = {id:this.data.id};
- this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
- if (response.code === 200) {
- this.$message({
- duration: 2000,
- type: 'success',
- message: this.$t("tip.duplicateSuccess")
- });
- this.$emit('on-duplicate-chart-block', this.data.id,response.data);
- }else {
- if(response.msg){
- this.$message.error(response.msg);
- }else if(response.error){
- this.$message.error(response.error);
+ this.$confirm(this.$t("tip.confirmDuplicate"), {
+ confirmButtonText: this.$t("tip.yes"),
+ cancelButtonText: this.$t("tip.no"),
+ type: 'info'
+ }).then(() => {
+ const param = {id:this.data.id};
+ this.$post('panel/'+ this.data.panelId+'/charts/duplicate',(param)).then(response => {
+ if (response.code === 200) {
+ this.$message({
+ duration: 2000,
+ type: 'success',
+ message: this.$t("tip.duplicateSuccess")
+ });
+ this.$emit('on-duplicate-chart-block', this.data.id,response.data);
}else {
- this.$message.error(response);
+ if(response.msg){
+ this.$message.error(response.msg);
+ }else if(response.error){
+ this.$message.error(response.error);
+ }else {
+ this.$message.error(response);
+ }
}
- }
+ });
});
},
// 全屏查看
diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js
index be54e70f4..2e44a0050 100644
--- a/nezha-fronted/src/components/common/language/cn.js
+++ b/nezha-fronted/src/components/common/language/cn.js
@@ -403,6 +403,7 @@ const cn = {
syncTip:"此操作可能造成原有数据或图表被覆盖,确认同步吗?",
noImportFile:'没有可导入的文件',
noAccess: "无访问权限",
+ confirmDuplicate:"确认复制吗?"
},
asset: {
asset: "资产",
diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js
index f371f0aca..24f063b66 100644
--- a/nezha-fronted/src/components/common/language/en.js
+++ b/nezha-fronted/src/components/common/language/en.js
@@ -407,6 +407,7 @@ const en = {
syncTip:'This operation may cause the original data or chart to be overwritten. Are you sure to synchronize?',
noImportFile:'No import file found',
noAccess: "No access",
+ confirmDuplicate:"Are you sure to duplicate this chart?"
},
asset:{
asset: 'Asset',
diff --git a/nezha-fronted/src/components/common/login.vue b/nezha-fronted/src/components/common/login.vue
index a0c13158a..0fa746487 100644
--- a/nezha-fronted/src/components/common/login.vue
+++ b/nezha-fronted/src/components/common/login.vue
@@ -25,9 +25,9 @@
-
+
+
@@ -229,9 +229,9 @@ export default {
transform: translateX(-50%);
}
.login-foot-buildOn{
- width: 460px;
- text-align: center;
- padding-top: 45px;
+ position: fixed;
+ bottom: 30px;
+ left: calc(50% - 90px);
a{
color: white;
text-decoration: none;