fix:修改问题
1 panel列表报错:dealLegendAlias is not function
This commit is contained in:
@@ -704,7 +704,7 @@ export default {
|
|||||||
this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, this.filter);//????怎么设置的无数据??
|
this.$refs.editChart[index].setData(chartItem, [], this.filter.panelId, this.filter);//????怎么设置的无数据??
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if(this.$refs['editChart'+chartItem.id]){
|
if(this.$refs['editChart'+chartItem.id] && this.$refs['editChart'+chartItem.id].length>0){
|
||||||
this.$refs['editChart'+chartItem.id][0].setData(chartItem, [], this.filter.panelId, this.filter);//????怎么设置的无数据??
|
this.$refs['editChart'+chartItem.id][0].setData(chartItem, [], this.filter.panelId, this.filter);//????怎么设置的无数据??
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -785,7 +785,7 @@ export default {
|
|||||||
// 设置时间-数据格式对
|
// 设置时间-数据格式对
|
||||||
const dpsArr = Object.entries(queryItem.values);//[ ["0",[1577959830.781,"0"]], ["1",[1577959845.781,"0"]] ]
|
const dpsArr = Object.entries(queryItem.values);//[ ["0",[1577959830.781,"0"]], ["1",[1577959845.781,"0"]] ]
|
||||||
// 判断是否有数据, && tagsArr.length > 0
|
// 判断是否有数据, && tagsArr.length > 0
|
||||||
if (dpsArr.length > 0 && this.$refs['editChart'+chartItem.id]) {
|
if (dpsArr.length > 0 && this.$refs['editChart'+chartItem.id] && this.$refs['editChart'+chartItem.id].length>0) {
|
||||||
tagsArr.forEach((tag, i) => {
|
tagsArr.forEach((tag, i) => {
|
||||||
if (tag !== '__name__') {
|
if (tag !== '__name__') {
|
||||||
host += `${tag}="${queryItem.metric[tag]}",`;
|
host += `${tag}="${queryItem.metric[tag]}",`;
|
||||||
@@ -799,6 +799,7 @@ export default {
|
|||||||
host = chartItem.elements[innerPos].expression;
|
host = chartItem.elements[innerPos].expression;
|
||||||
}
|
}
|
||||||
//处理legend别名
|
//处理legend别名
|
||||||
|
|
||||||
let alias=this.$refs['editChart'+chartItem.id][0].dealLegendAlias(host,chartItem.elements[innerPos].legend);
|
let alias=this.$refs['editChart'+chartItem.id][0].dealLegendAlias(host,chartItem.elements[innerPos].legend);
|
||||||
if(!alias || alias===''){
|
if(!alias || alias===''){
|
||||||
alias = chartItem.elements[innerPos].expression;
|
alias = chartItem.elements[innerPos].expression;
|
||||||
@@ -863,7 +864,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(this.$refs['editChart'+chartItem.id]) {
|
if(this.$refs['editChart'+chartItem.id] && this.$refs['editChart'+chartItem.id].length>0) {
|
||||||
if (chartItem.type === 'table') {//表格
|
if (chartItem.type === 'table') {//表格
|
||||||
if (filterType === 'showFullScreen') {//全屏查询
|
if (filterType === 'showFullScreen') {//全屏查询
|
||||||
this.$refs['editChart'+chartItem.id][0].setData(chartItem, tableData,
|
this.$refs['editChart'+chartItem.id][0].setData(chartItem, tableData,
|
||||||
@@ -887,7 +888,7 @@ export default {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const type = chartItem.type;
|
const type = chartItem.type;
|
||||||
if(this.$refs['editChart'+chartItem.id]) {
|
if(this.$refs['editChart'+chartItem.id] && this.$refs['editChart'+chartItem.id].length>0) {
|
||||||
if (type === 'table') {
|
if (type === 'table') {
|
||||||
if (filterType === 'showFullScreen') {//table的全屏查询
|
if (filterType === 'showFullScreen') {//table的全屏查询
|
||||||
this.$refs['editChart'+chartItem.id][0].setData(chartItem, [], this.filter.panelId,
|
this.$refs['editChart'+chartItem.id][0].setData(chartItem, [], this.filter.panelId,
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
showLoad(chartItem) {
|
showLoad(chartItem) {
|
||||||
this.data = chartItem;
|
this.data = chartItem;
|
||||||
console.log('=========',this.data);
|
|
||||||
this.panelIdInner = this.panelId;
|
this.panelIdInner = this.panelId;
|
||||||
//设置高度
|
//设置高度
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -152,7 +151,6 @@ export default {
|
|||||||
this.setLoadFrameFull();
|
this.setLoadFrameFull();
|
||||||
},
|
},
|
||||||
dragResize:function(e){
|
dragResize:function(e){
|
||||||
console.log('========',this.data);
|
|
||||||
var diffWidth =20; //界面的宽度空白的地方的宽度
|
var diffWidth =20; //界面的宽度空白的地方的宽度
|
||||||
var chartBoxPadding = 22;
|
var chartBoxPadding = 22;
|
||||||
var targetDiv= document.getElementById('chartUrlDiv'+this.chartIndex); //e.target.parentNode.parentNode;.children[0]
|
var targetDiv= document.getElementById('chartUrlDiv'+this.chartIndex); //e.target.parentNode.parentNode;.children[0]
|
||||||
@@ -276,9 +274,8 @@ export default {
|
|||||||
prev:parseInt(_this.data.prev),
|
prev:parseInt(_this.data.prev),
|
||||||
next:parseInt(_this.data.next),
|
next:parseInt(_this.data.next),
|
||||||
};
|
};
|
||||||
console.log('========2',_this.data);
|
|
||||||
_this.$put('panel/'+ _this.panelIdInner+'/charts/modify',modifyParams).then(response => {
|
_this.$put('panel/'+ _this.panelIdInner+'/charts/modify',modifyParams).then(response => {
|
||||||
console.log('========3',_this.data);
|
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
//更新当前图表数据
|
//更新当前图表数据
|
||||||
_this.data.span= span;
|
_this.data.span= span;
|
||||||
|
|||||||
Reference in New Issue
Block a user