提交 65493933 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!530 Scalar button information

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