提交 41d240e7 编写于 作者: W wwx691809

Scalar button information

1 The scalar button prompts the display position
2 The scalar button prompts the display in English
3 formatting code
上级 e5ad3628
......@@ -298,8 +298,8 @@ export default {
thresholdErrorMsg: '',
thresholdRelational: '',
thresholdValue: [
{filterCondition: this.$t('scalar.lessThan'), value: ''},
{filterCondition: this.$t('scalar.lessThan'), value: ''},
{ filterCondition: this.$t('scalar.lessThan'), value: '' },
{ filterCondition: this.$t('scalar.lessThan'), value: '' },
],
filterOptions: [
{
......@@ -412,7 +412,7 @@ export default {
return;
}
document.title = `${decodeURIComponent(
this.$route.query.train_id,
this.$route.query.train_id
)}-${this.$t('scalar.titleText')}-MindInsight`;
// Adding a Listener
window.addEventListener('resize', this.resizeCallback, false);
......@@ -440,7 +440,7 @@ export default {
if (localStorage.getItem('thresholdCache')) {
try {
this.thresholdLocal = JSON.parse(
localStorage.getItem('thresholdCache'),
localStorage.getItem('thresholdCache')
);
this.clearCache();
} catch (e) {
......@@ -468,7 +468,7 @@ export default {
delete this.thresholdLocal[this.decodeTrainingJobId];
localStorage.setItem(
'thresholdCache',
JSON.stringify(this.thresholdLocal),
JSON.stringify(this.thresholdLocal)
);
}
}
......@@ -679,7 +679,7 @@ export default {
}
sampleObject.charData.charOption = this.formateCharOption(
sampleIndex,
sampleIndex
);
const tempOption = sampleObject.charData.charOption;
if (
......@@ -718,7 +718,7 @@ export default {
setOnePoint(sampleObject) {
const that = this;
sampleObject.charObj.on('datazoom', function(params) {
sampleObject.charObj.on('datazoom', function (params) {
const xAxisObject = params.batch[0];
const yAxisObject = params.batch[1];
const charData = sampleObject.charData.charOption.series[0].data;
......@@ -777,7 +777,7 @@ export default {
setRestore(sampleObject) {
const that = this;
sampleObject.charObj.on('restore', function(params) {
sampleObject.charObj.on('restore', function (params) {
const charData = sampleObject.charData.charOption.series[0].data;
const tempCharOption = sampleObject.charData.charOption;
......@@ -846,12 +846,12 @@ export default {
if (curOriData) {
if (sampleObject.log) {
dataObj.data = this.formateSmoothData(
curOriData.logData[this.curBenchX],
curOriData.logData[this.curBenchX]
);
dataObjBackend.data = curOriData.logData[this.curBenchX];
} else {
dataObj.data = this.formateSmoothData(
curOriData.valueData[this.curBenchX],
curOriData.valueData[this.curBenchX]
);
dataObjBackend.data = curOriData.valueData[this.curBenchX];
}
......@@ -981,23 +981,23 @@ export default {
position: (point, params, dom, rect, size) => {
const curDom = document.getElementById(sampleObject.domId);
if (!curDom) {
return {left: 0, bottom: '100%'};
return { left: 0, bottom: '100%' };
}
if (sampleObject.fullScreen) {
if (point[0] + size.contentSize[0] <= size.viewSize[0]) {
return {left: point[0], bottom: '10%'};
return { left: point[0], bottom: '10%' };
} else {
return {right: size.viewSize[0] - point[0], bottom: '10%'};
return { right: size.viewSize[0] - point[0], bottom: '10%' };
}
} else {
const parentNode = curDom.parentNode;
if (!parentNode) {
return {left: 0, bottom: '100%'};
return { left: 0, bottom: '100%' };
}
if (parentNode.offsetLeft > size.contentSize[0]) {
return {right: '100%', bottom: 0};
return { right: '100%', bottom: 0 };
} else {
return {left: '100%', bottom: 0};
return { left: '100%', bottom: 0 };
}
}
},
......@@ -1082,7 +1082,7 @@ export default {
`display:inline-block;"></td><td>${parma.seriesName}</td>` +
`<td>${that.formateYaxisValue(parma.value[1])}</td>` +
`<td>${that.formateYaxisValue(
curSerieOriData.stepData[parma.dataIndex][1],
curSerieOriData.stepData[parma.dataIndex][1]
)}</td>` +
`<td>${curSerieOriData.stepData[parma.dataIndex][0]}</td>` +
`<td>${curSerieOriData.relativeData[
......@@ -1090,8 +1090,8 @@ export default {
][0].toFixed(3)}${unit}</td>` +
`<td>${that.dealrelativeTime(
new Date(
curSerieOriData.absData[parma.dataIndex][0] * 1000,
).toString(),
curSerieOriData.absData[parma.dataIndex][0] * 1000
).toString()
)}</td>` +
`</tr>`;
}
......@@ -1108,6 +1108,7 @@ export default {
emphasis: {
iconStyle: {
textPosition: 'top',
textAlign: 'right',
},
},
// toolbox
......@@ -1151,7 +1152,9 @@ export default {
},
// restore
restore: {},
restore: {
title: this.$t('scalar.restore'),
},
},
},
series: seriesData,
......@@ -1174,8 +1177,8 @@ export default {
) {
const tempStorgeArr = JSON.parse(
JSON.stringify(
this.thresholdLocal[this.decodeTrainingJobId][sampleObject.tagName],
),
this.thresholdLocal[this.decodeTrainingJobId][sampleObject.tagName]
)
);
let pieceStr = '';
pieceStr = this.formatePieceStr(tempStorgeArr);
......@@ -1210,7 +1213,7 @@ export default {
if (sampleObject.updateFlag) {
sampleObject.charObj.setOption(
sampleObject.charData.charOption,
sampleObject.dataRemove,
sampleObject.dataRemove
);
sampleObject.updateFlag = false;
sampleObject.dataRemove = false;
......@@ -1219,7 +1222,7 @@ export default {
// creat chart
sampleObject.charObj = echarts.init(
document.getElementById(sampleObject.domId),
null,
null
);
sampleObject.charObj.setOption(sampleObject.charData.charOption, true);
this.setOnePoint(sampleObject);
......@@ -1325,13 +1328,13 @@ export default {
const oriIndexData = sampleObject.charData.oriData[index];
if (sampleObject.log) {
seriesData[index * 2].data = this.formateSmoothData(
oriIndexData.logData[this.curBenchX],
oriIndexData.logData[this.curBenchX]
);
seriesData[index * 2 + 1].data =
oriIndexData.logData[this.curBenchX];
} else {
seriesData[index * 2].data = this.formateSmoothData(
oriIndexData.valueData[this.curBenchX],
oriIndexData.valueData[this.curBenchX]
);
seriesData[index * 2 + 1].data =
oriIndexData.valueData[this.curBenchX];
......@@ -1702,13 +1705,13 @@ export default {
serie.data = this.formateSmoothData(
sampleObject.charData.oriData[index / 2].logData[
this.curBenchX
],
]
);
} else {
serie.data = this.formateSmoothData(
sampleObject.charData.oriData[index / 2].valueData[
this.curBenchX
],
]
);
}
}
......@@ -1804,13 +1807,13 @@ export default {
tempOriData.forEach((originData, index) => {
if (log) {
tempOption.series[index * 2].data = this.formateSmoothData(
tempOriData[index].logData[this.curBenchX],
tempOriData[index].logData[this.curBenchX]
);
tempOption.series[index * 2 + 1].data =
tempOriData[index].logData[this.curBenchX];
} else {
tempOption.series[index * 2].data = this.formateSmoothData(
tempOriData[index].valueData[this.curBenchX],
tempOriData[index].valueData[this.curBenchX]
);
tempOption.series[index * 2 + 1].data =
tempOriData[index].valueData[this.curBenchX];
......@@ -2264,7 +2267,7 @@ export default {
}
localStorage.setItem(
'thresholdCache',
JSON.stringify(this.thresholdLocal),
JSON.stringify(this.thresholdLocal)
);
this.thresholdDialogVisible = false;
......@@ -2381,7 +2384,7 @@ export default {
this.clearCache();
localStorage.setItem(
'thresholdCache',
JSON.stringify(this.thresholdLocal),
JSON.stringify(this.thresholdLocal)
);
this.delThresholdVisible = false;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册