feat:新增功能

1.panel图表的表单验证
2.panel图表曲线图全屏展示(查询时间还未添加),表格全屏展示
未实现查询功能)
fix:修改BUG
1.panel图表未选择label时,多了}
2.panel图表图例中第一个和第二个之间少了逗号
This commit is contained in:
hanyuxia
2020-01-09 17:02:33 +08:00
parent 50a8a2c878
commit 24ef367a2f
8 changed files with 134 additions and 56 deletions

View File

@@ -215,7 +215,7 @@
},
rules: {
title: [
{required: true, trigger: 'blur'}
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
/*
heigh: [
@@ -263,7 +263,7 @@
this.$refs['chartForm'].validate((valid) => {
if (valid) {
if (this.chart.id) {//修改
this.$put('panel/'+this.chart.id+'/charts', this.project).then(response => {
this.$put('panel/'+this.chart.id+'/charts').then(response => {
if (response.code === 200) {
this.esc();
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
@@ -356,24 +356,33 @@
// 格式化tag为字符串表达式
tagsToString(metric,arr) {
let str = metric;
let sepStr = '';
arr.forEach((item, index) => {
if (index === 0) {
str +="{"
if(item.value.length===1){
str += `${item.name}='${item.value.join('|')}'`;
sepStr = ',';
}else if(item.value.length>1){
str += `${item.name}=~'${item.value.join('|')}'`;
sepStr = ',';
}
} else {
if(item.value.length===1){
str += `,${item.name}='${item.value.join('|')}'`;
str += sepStr+`${item.name}='${item.value.join('|')}'`;
sepStr = ',';
}else if(item.value.length>1){
str += `,${item.name}=~'${item.value.join('|')}'`;
str += sepStr+`${item.name}=~'${item.value.join('|')}'`;
sepStr = ',';
}
}
});
str +="}";
if(str.indexOf('{')>-1){
str +="}";
}
if(str.endsWith('{}')){
str = str.substring(0,str.indexOf('{'));
}
return str;
},
// 新建图表