提交 0f7165c5 编写于 作者: P ph

fix issue

上级 f78d7f6d
...@@ -67,7 +67,8 @@ ...@@ -67,7 +67,8 @@
"samplingData": "数据抽样", "samplingData": "数据抽样",
"imagesampleSwitch": "切换标签", "imagesampleSwitch": "切换标签",
"invalidId": "无效的训练作业", "invalidId": "无效的训练作业",
"summaryDirPath": "summary路径:" "summaryDirPath": "summary路径:",
"mixedItemMessage": "该参数含有多种类型数据,无法筛选展示"
}, },
"scalar": { "scalar": {
"titleText": "标量", "titleText": "标量",
......
...@@ -525,7 +525,7 @@ export default { ...@@ -525,7 +525,7 @@ export default {
`<svg xmlns="http://www.w3.org/2000/svg" ` + `<svg xmlns="http://www.w3.org/2000/svg" ` +
`xmlns:xlink="http://www.w3.org/1999/xlink" ` + `xmlns:xlink="http://www.w3.org/1999/xlink" ` +
`width="${bbox.width}" height="${bbox.height}" ` + `width="${bbox.width}" height="${bbox.height}" ` +
`viewBox="${viewBoxSize}">${CommonProperty.graphDownloadStyle}<g>${svgXml}</g></svg>`; `viewBox="${viewBoxSize}">${CommonProperty.dataMapDownloadStyle}<g>${svgXml}</g></svg>`;
// Write the svg stream encoded by base64 to the image object. // Write the svg stream encoded by base64 to the image object.
const src = `data:image/svg+xml;base64, const src = `data:image/svg+xml;base64,
......
...@@ -509,6 +509,7 @@ export default { ...@@ -509,6 +509,7 @@ export default {
}); });
// The summaryList value could not be saved in the destroy state. // The summaryList value could not be saved in the destroy state.
this.dataCheckedSummary = []; this.dataCheckedSummary = [];
this.tableFilter.summary_dir = {in: summaryList};
this.$store.commit('setSummaryDirList', summaryList); this.$store.commit('setSummaryDirList', summaryList);
if (!tempList.length) { if (!tempList.length) {
this.summaryDirList = []; this.summaryDirList = [];
...@@ -967,6 +968,7 @@ export default { ...@@ -967,6 +968,7 @@ export default {
sorted_name: data.prop, sorted_name: data.prop,
sorted_type: data.order, sorted_type: data.order,
}; };
this.pagination.currentPage = 1;
params.body = Object.assign({}, tempParam, this.tableFilter); params.body = Object.assign({}, tempParam, this.tableFilter);
this.queryLineagesData(params); this.queryLineagesData(params);
}, },
......
...@@ -222,6 +222,14 @@ export default { ...@@ -222,6 +222,14 @@ export default {
this.$store.commit('setIsReload', false); this.$store.commit('setIsReload', false);
this.isReloading = false; this.isReloading = false;
} }
if (this.changeAxisTimer) {
clearTimeout(this.changeAxisTimer);
this.changeAxisTimer = null;
}
if (this.changeViewTimer) {
clearTimeout(this.changeViewTimer);
this.changeViewTimer = null;
}
}, },
mounted() { mounted() {
this.init(); this.init();
...@@ -398,6 +406,7 @@ export default { ...@@ -398,6 +406,7 @@ export default {
timeTypeChange(val) { timeTypeChange(val) {
if (this.changeAxisTimer) { if (this.changeAxisTimer) {
clearTimeout(this.changeAxisTimer); clearTimeout(this.changeAxisTimer);
this.changeAxisTimer = null;
} }
this.changeAxisTimer = setTimeout(() => { this.changeAxisTimer = setTimeout(() => {
this.curPageArr.forEach((item) => { this.curPageArr.forEach((item) => {
...@@ -412,6 +421,7 @@ export default { ...@@ -412,6 +421,7 @@ export default {
viewTypeChange(val) { viewTypeChange(val) {
if (this.changeViewTimer) { if (this.changeViewTimer) {
clearTimeout(this.changeViewTimer); clearTimeout(this.changeViewTimer);
this.changeViewTimer = null;
} }
this.changeViewTimer = setTimeout(() => { this.changeViewTimer = setTimeout(() => {
this.curPageArr.forEach((item) => { this.curPageArr.forEach((item) => {
......
...@@ -151,6 +151,7 @@ export default { ...@@ -151,6 +151,7 @@ export default {
'batch_size', 'batch_size',
'device_num', 'device_num',
], // All keys whose values are int ], // All keys whose values are int
keysOfMixed: [],
echart: { echart: {
chart: null, chart: null,
allData: [], allData: [],
...@@ -166,10 +167,7 @@ export default { ...@@ -166,10 +167,7 @@ export default {
}, },
chartFilter: {}, // chart filter condition chartFilter: {}, // chart filter condition
tableFilter: {lineage_type: {in: ['model']}}, // table filter condition tableFilter: {lineage_type: {in: ['model']}}, // table filter condition
sortInfo: { sortInfo: {},
sorted_name: 'summary_dir',
sorted_type: null,
},
showTable: false, showTable: false,
noData: false, noData: false,
haveCustomizedParams: false, haveCustomizedParams: false,
...@@ -281,6 +279,7 @@ export default { ...@@ -281,6 +279,7 @@ export default {
selectAll: false, // Whether to select all columns selectAll: false, // Whether to select all columns
indeterminate: false, indeterminate: false,
}; };
this.keysOfMixed = [];
this.queryLineagesData(true); this.queryLineagesData(true);
}, },
/** /**
...@@ -324,10 +323,15 @@ export default { ...@@ -324,10 +323,15 @@ export default {
tempParam.limit = this.pagination.pageSize; tempParam.limit = this.pagination.pageSize;
tempParam.offset = this.pagination.currentPage - 1; tempParam.offset = this.pagination.currentPage - 1;
params.body = Object.assign(params.body, this.chartFilter); params.body = Object.assign(
params.body,
this.chartFilter,
tempParam,
this.tableFilter,
);
} else {
params.body = Object.assign(params.body, this.tableFilter);
} }
params.body = Object.assign(params.body, tempParam, this.tableFilter);
RequestService.queryLineagesData(params) RequestService.queryLineagesData(params)
.then( .then(
(res) => { (res) => {
...@@ -344,6 +348,10 @@ export default { ...@@ -344,6 +348,10 @@ export default {
this.keysOfIntValue.push(i); this.keysOfIntValue.push(i);
} else if (customized[i].type === 'str') { } else if (customized[i].type === 'str') {
this.keysOfStringValue.push(i); this.keysOfStringValue.push(i);
} else if (customized[i].type === 'mixed') {
// list of type mixed
this.keysOfMixed.push(i);
this.keysOfStringValue.push(i);
} }
if (i.startsWith(this.replaceStr.userDefined)) { if (i.startsWith(this.replaceStr.userDefined)) {
customized[i].label = customized[i].label.replace( customized[i].label = customized[i].label.replace(
...@@ -568,7 +576,16 @@ export default { ...@@ -568,7 +576,16 @@ export default {
}; };
chartAxis.forEach((key) => { chartAxis.forEach((key) => {
if (
(i[key] || i[key] == 0) &&
this.keysOfMixed &&
this.keysOfMixed.length &&
this.keysOfMixed.includes(key)
) {
item.value.push(i[key].toString());
} else {
item.value.push(i[key]); item.value.push(i[key]);
}
}); });
data.push(item); data.push(item);
}); });
...@@ -581,7 +598,7 @@ export default { ...@@ -581,7 +598,7 @@ export default {
const values = {}; const values = {};
this.echart.showData.forEach((i) => { this.echart.showData.forEach((i) => {
if (i[key] || i[key] === 0) { if (i[key] || i[key] === 0) {
values[i[key]] = i[key]; values[i[key].toString()] = i[key].toString();
} }
}); });
obj.type = 'category'; obj.type = 'category';
...@@ -693,6 +710,15 @@ export default { ...@@ -693,6 +710,15 @@ export default {
// select use api // select use api
this.echart.chart.on('axisareaselected', (params) => { this.echart.chart.on('axisareaselected', (params) => {
const key = params.parallelAxisId; const key = params.parallelAxisId;
if (
this.keysOfMixed &&
this.keysOfMixed.length &&
this.keysOfMixed.includes(key)
) {
this.$message.error(this.$t('modelTraceback.mixedItemMessage'));
this.initChart();
return;
}
const list = this.$store.state.selectedBarList || []; const list = this.$store.state.selectedBarList || [];
const selectedAxisId = params.parallelAxisId; const selectedAxisId = params.parallelAxisId;
if (list.length) { if (list.length) {
...@@ -741,6 +767,12 @@ export default { ...@@ -741,6 +767,12 @@ export default {
{}, {},
this.chartFilter, this.chartFilter,
this.tableFilter, this.tableFilter,
);
const tableParams = {};
tableParams.body = Object.assign(
{},
this.chartFilter,
this.tableFilter,
this.sortInfo, this.sortInfo,
); );
RequestService.queryLineagesData(filterParams) RequestService.queryLineagesData(filterParams)
...@@ -752,20 +784,47 @@ export default { ...@@ -752,20 +784,47 @@ export default {
res.data.object && res.data.object &&
res.data.object.length res.data.object.length
) { ) {
let customized = {};
customized = JSON.parse(JSON.stringify(res.data.customized));
const customizedKeys = Object.keys(customized);
if (customizedKeys.length) {
this.keysOfStringValue = [
'summary_dir',
'network',
'optimizer',
'loss_function',
'train_dataset_path',
'test_dataset_path',
'dataset_mark',
];
this.keysOfIntValue = [
'train_dataset_count',
'test_dataset_count',
'epoch',
'batch_size',
'device_num',
];
this.keysOfMixed = [];
customizedKeys.forEach((i) => {
if (customized[i].type === 'int') {
this.keysOfIntValue.push(i);
} else if (customized[i].type === 'str') {
this.keysOfStringValue.push(i);
} else if (customized[i].type === 'mixed') {
// list of type mixed
this.keysOfMixed.push(i);
this.keysOfStringValue.push(i);
}
});
}
const list = this.setDataOfModel(res.data.object); const list = this.setDataOfModel(res.data.object);
const summaryDirList = list.map((i) => i.summary_dir); const summaryDirList = list.map((i) => i.summary_dir);
this.$store.commit('setSummaryDirList', summaryDirList); this.$store.commit('setSummaryDirList', summaryDirList);
this.echart.showData = this.echart.brushData = list; this.echart.showData = this.echart.brushData = list;
this.initChart(); this.initChart();
this.getTableList(tableParams);
this.table.data = this.echart.brushData.slice(
0,
this.pagination.pageSize,
);
this.pagination.currentPage = 1;
this.pagination.total = this.echart.brushData.length;
this.$refs.table.clearSelection();
} else { } else {
this.summaryDirList = []; this.summaryDirList = [];
this.$store.commit('setSummaryDirList', []); this.$store.commit('setSummaryDirList', []);
...@@ -779,6 +838,26 @@ export default { ...@@ -779,6 +838,26 @@ export default {
} }
}); });
}, },
/**
* Get table data
* @param {Object} tableParams
*/
getTableList(tableParams) {
RequestService.queryLineagesData(tableParams)
.then(
(res) => {
if (res && res.data && res.data.object && res.data.object.length) {
const list = this.setDataOfModel(res.data.object);
this.table.data = list.slice(0, this.pagination.pageSize);
this.pagination.currentPage = 1;
this.pagination.total = this.echart.brushData.length;
this.$refs.table.clearSelection();
}
},
(error) => {},
)
.catch(() => {});
},
/** /**
* Resetting the Eechart * Resetting the Eechart
*/ */
...@@ -790,6 +869,7 @@ export default { ...@@ -790,6 +869,7 @@ export default {
this.showTable = false; this.showTable = false;
this.chartFilter = {}; this.chartFilter = {};
this.tableFilter.summary_dir = undefined; this.tableFilter.summary_dir = undefined;
this.sortInfo = {};
this.pagination.currentPage = 1; this.pagination.currentPage = 1;
this.echart.allData = []; this.echart.allData = [];
if (this.echart.chart) { if (this.echart.chart) {
......
...@@ -36,8 +36,7 @@ limitations under the License. ...@@ -36,8 +36,7 @@ limitations under the License.
v-show="!compare"> v-show="!compare">
<multiselectGroupComponents ref="multiselectGroupComponents" <multiselectGroupComponents ref="multiselectGroupComponents"
:checkListArr="tagOperateList" :checkListArr="tagOperateList"
@selectedChange="tagSelectedChanged" @selectedChange="tagSelectedChanged"></multiselectGroupComponents>
></multiselectGroupComponents>
</div> </div>
<!-- Slider --> <!-- Slider -->
<div class="cl-eval-slider-operate-content" <div class="cl-eval-slider-operate-content"
...@@ -56,14 +55,12 @@ limitations under the License. ...@@ -56,14 +55,12 @@ limitations under the License.
<el-slider v-model="smoothValue" <el-slider v-model="smoothValue"
:step="0.01" :step="0.01"
:max="0.99" :max="0.99"
@input="updataInputValue" @input="updataInputValue"></el-slider>
></el-slider>
<el-input v-model="smoothValueNumber" <el-input v-model="smoothValueNumber"
class="w60" class="w60"
@input="smoothValueChange" @input="smoothValueChange"
@blur="smoothValueBlur" @blur="smoothValueBlur"></el-input>
></el-input>
</div> </div>
<!-- Content display --> <!-- Content display -->
<div class="cl-eval-show-data-content" <div class="cl-eval-show-data-content"
...@@ -290,7 +287,7 @@ export default { ...@@ -290,7 +287,7 @@ export default {
const runNmeColor = CommonProperty.commonColorArr[0]; const runNmeColor = CommonProperty.commonColorArr[0];
data.tags.forEach((tagObj) => { data.tags.forEach((tagObj) => {
if (!this.oriDataDictionaries[tagObj]) { if (!this.oriDataDictionaries[tagObj]) {
this.oriDataDictionaries[tagObj]=true; this.oriDataDictionaries[tagObj] = true;
// Add the tag list // Add the tag list
tempTagList.push({ tempTagList.push({
label: tagObj, label: tagObj,
...@@ -337,7 +334,7 @@ export default { ...@@ -337,7 +334,7 @@ export default {
this.initOver = true; this.initOver = true;
this.$nextTick(() => { this.$nextTick(() => {
this.multiSelectedTagNames=this.$refs.multiselectGroupComponents.updateSelectedDic(); this.multiSelectedTagNames = this.$refs.multiselectGroupComponents.updateSelectedDic();
// Obtains data on the current page // Obtains data on the current page
this.updateTagInPage(); this.updateTagInPage();
...@@ -365,10 +362,10 @@ export default { ...@@ -365,10 +362,10 @@ export default {
const curPageArr = []; const curPageArr = [];
for (let i = startIndex; i < endIndex; i++) { for (let i = startIndex; i < endIndex; i++) {
const sampleItem=this.curFilterSamples[i]; const sampleItem = this.curFilterSamples[i];
if (sampleItem) { if (sampleItem) {
sampleItem.updateFlag=true; sampleItem.updateFlag = true;
sampleItem.show=true; sampleItem.show = true;
curPageArr.push(sampleItem); curPageArr.push(sampleItem);
} }
} }
...@@ -381,20 +378,20 @@ export default { ...@@ -381,20 +378,20 @@ export default {
* Load the data on the current page * Load the data on the current page
*/ */
updateCurPageSamples() { updateCurPageSamples() {
this.curPageArr.forEach((sampleObject)=>{ this.curPageArr.forEach((sampleObject) => {
const sampleIndex=sampleObject.sampleIndex; const sampleIndex = sampleObject.sampleIndex;
if (!sampleObject) { if (!sampleObject) {
return; return;
} }
sampleObject.updateFlag = true; sampleObject.updateFlag = true;
const params = { const params = {
train_id: this.trainingJobId, train_id: this.trainingJobId,
tag: sampleObject.tagName, tag: sampleObject.tagName,
}; };
RequestService.getScalarsSample(params).then((res)=>{ RequestService.getScalarsSample(params)
.then((res) => {
// error // error
if (!res || !res.data || !res.data.metadatas) { if (!res || !res.data || !res.data.metadatas) {
if (sampleObject.charObj) { if (sampleObject.charObj) {
...@@ -476,7 +473,8 @@ export default { ...@@ -476,7 +473,8 @@ export default {
this.abort = true; this.abort = true;
} }
}); });
}).catch((e)=>{ })
.catch((e) => {
if (sampleObject.charObj) { if (sampleObject.charObj) {
sampleObject.charObj.clear(); sampleObject.charObj.clear();
} }
...@@ -484,7 +482,6 @@ export default { ...@@ -484,7 +482,6 @@ export default {
}); });
}, },
/** /**
* Formatting Chart Data * Formatting Chart Data
* @param {Number} sampleIndex Chart subscript * @param {Number} sampleIndex Chart subscript
...@@ -499,7 +496,7 @@ export default { ...@@ -499,7 +496,7 @@ export default {
let returnFlag = false; let returnFlag = false;
const seriesData = []; const seriesData = [];
const oriData = sampleObject.charData.oriData; const oriData = sampleObject.charData.oriData;
const runName=sampleObject.runNames; const runName = sampleObject.runNames;
const curBackName = runName + this.backendString; const curBackName = runName + this.backendString;
const dataObj = { const dataObj = {
name: runName, name: runName,
...@@ -886,9 +883,11 @@ export default { ...@@ -886,9 +883,11 @@ export default {
if (sampleObject.fullScreen) { if (sampleObject.fullScreen) {
sampleObject.charData.charOption.toolbox.feature.myToolFullScreen.iconStyle.borderColor = sampleObject.charData.charOption.toolbox.feature.myToolFullScreen.iconStyle.borderColor =
'#3E98C5'; '#3E98C5';
sampleObject.charData.charOption.grid.right = 80;
} else { } else {
sampleObject.charData.charOption.toolbox.feature.myToolFullScreen.iconStyle.borderColor = sampleObject.charData.charOption.toolbox.feature.myToolFullScreen.iconStyle.borderColor =
'#6D7278'; '#6D7278';
sampleObject.charData.charOption.grid.right = 10;
} }
sampleObject.updateFlag = true; sampleObject.updateFlag = true;
...@@ -901,14 +900,13 @@ export default { ...@@ -901,14 +900,13 @@ export default {
}, 0); }, 0);
}, },
/** /**
* Update Chart by tag * Update Chart by tag
* @param {Boolean} noPageDataNumChange No new data is added or deleted * @param {Boolean} noPageDataNumChange No new data is added or deleted
*/ */
updateTagInPage(noPageDataNumChange) { updateTagInPage(noPageDataNumChange) {
const curFilterSamples=[]; const curFilterSamples = [];
// Obtains the chart subscript // Obtains the chart subscript
this.originDataArr.forEach((sampleItem) => { this.originDataArr.forEach((sampleItem) => {
if (this.multiSelectedTagNames[sampleItem.tagName]) { if (this.multiSelectedTagNames[sampleItem.tagName]) {
...@@ -1012,13 +1010,12 @@ export default { ...@@ -1012,13 +1010,12 @@ export default {
if (!selectedItemDict) { if (!selectedItemDict) {
return; return;
} }
this.multiSelectedTagNames=selectedItemDict; this.multiSelectedTagNames = selectedItemDict;
// Reset to the first page // Reset to the first page
this.pageIndex=0; this.pageIndex = 0;
this.updateTagInPage(); this.updateTagInPage();
}, },
/** /**
*window resize *window resize
*/ */
...@@ -1050,7 +1047,7 @@ export default { ...@@ -1050,7 +1047,7 @@ export default {
this.tagOperateList = []; this.tagOperateList = [];
this.pageIndex = 0; this.pageIndex = 0;
this.originDataArr = []; this.originDataArr = [];
this.oriDataDictionaries={}; this.oriDataDictionaries = {};
this.curPageArr = []; this.curPageArr = [];
this.tagPropsList = []; this.tagPropsList = [];
this.propsList = []; this.propsList = [];
...@@ -1090,10 +1087,10 @@ export default { ...@@ -1090,10 +1087,10 @@ export default {
if (!oriData) { if (!oriData) {
return false; return false;
} }
const newTagDictionaries={}; // Index of the tag in the new data const newTagDictionaries = {}; // Index of the tag in the new data
let dataRemoveFlag = false; let dataRemoveFlag = false;
oriData.tags.forEach((tagName) => { oriData.tags.forEach((tagName) => {
newTagDictionaries[tagName]=true; newTagDictionaries[tagName] = true;
}); });
// Delete the tag that does not exist // Delete the tag that does not exist
const oldTagListLength = this.tagOperateList.length; const oldTagListLength = this.tagOperateList.length;
...@@ -1132,7 +1129,7 @@ export default { ...@@ -1132,7 +1129,7 @@ export default {
const runColor = CommonProperty.commonColorArr[0]; const runColor = CommonProperty.commonColorArr[0];
oriData.tags.forEach((tagObj) => { oriData.tags.forEach((tagObj) => {
if (!this.oriDataDictionaries[tagObj]) { if (!this.oriDataDictionaries[tagObj]) {
this.oriDataDictionaries[tagObj]=true; this.oriDataDictionaries[tagObj] = true;
this.tagOperateList.push({ this.tagOperateList.push({
label: tagObj, label: tagObj,
checked: true, checked: true,
...@@ -1198,7 +1195,7 @@ export default { ...@@ -1198,7 +1195,7 @@ export default {
const tagAddFlag = this.checkNewDataAndComplete(data); const tagAddFlag = this.checkNewDataAndComplete(data);
this.$nextTick(() => { this.$nextTick(() => {
this.multiSelectedTagNames=this.$refs.multiselectGroupComponents.updateSelectedDic(); this.multiSelectedTagNames = this.$refs.multiselectGroupComponents.updateSelectedDic();
this.updateTagInPage(!tagRemoveFlag && !tagAddFlag); this.updateTagInPage(!tagRemoveFlag && !tagAddFlag);
this.resizeCallback(); this.resizeCallback();
...@@ -1266,7 +1263,7 @@ export default { ...@@ -1266,7 +1263,7 @@ export default {
if (this.firstNum === 0) { if (this.firstNum === 0) {
return; return;
} }
this.smoothValueNumber=Number(val); this.smoothValueNumber = Number(val);
if (this.smoothSliderValueTimer) { if (this.smoothSliderValueTimer) {
clearTimeout(this.smoothSliderValueTimer); clearTimeout(this.smoothSliderValueTimer);
this.smoothSliderValueTimer = null; this.smoothSliderValueTimer = null;
...@@ -1279,26 +1276,26 @@ export default { ...@@ -1279,26 +1276,26 @@ export default {
smoothValueChange(val) { smoothValueChange(val) {
if (!isNaN(val)) { if (!isNaN(val)) {
if (Number(val)===0) { if (Number(val) === 0) {
this.smoothValue=0; this.smoothValue = 0;
} }
if (Number(val)<0) { if (Number(val) < 0) {
this.smoothValue=0; this.smoothValue = 0;
this.smoothValueNumber=0; this.smoothValueNumber = 0;
} }
if (Number(val)>0) { if (Number(val) > 0) {
if (Number(val)>0.99) { if (Number(val) > 0.99) {
this.smoothValue=0.99; this.smoothValue = 0.99;
this.smoothValueNumber=0.99; this.smoothValueNumber = 0.99;
} else { } else {
this.smoothValue=Number(val); this.smoothValue = Number(val);
} }
} }
} }
}, },
smoothValueBlur() { smoothValueBlur() {
this.smoothValueNumber=this.smoothValue; this.smoothValueNumber = this.smoothValue;
}, },
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册