Browse Source

!415 UI add tensors feature (V2)

Merge pull request !415 from 夏易凡/0710master
tags/v0.6.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
9a0150656c
3 changed files with 25 additions and 8 deletions
  1. +16
    -4
      mindinsight/ui/src/components/gridTableSimple.vue
  2. +4
    -1
      mindinsight/ui/src/locales/zh-cn.json
  3. +5
    -3
      mindinsight/ui/src/views/train-manage/tensor.vue

+ 16
- 4
mindinsight/ui/src/components/gridTableSimple.vue View File

@@ -104,6 +104,7 @@ export default {
itemId: '', // Dom id itemId: '', // Dom id
gridObj: null, // slickgrid object gridObj: null, // slickgrid object
columnsData: [], // Column information columnsData: [], // Column information
columnsLength: 0, // Column length
filterArr: [], // Dimension selection array filterArr: [], // Dimension selection array
formateData: [], // formatted data formateData: [], // formatted data
formateArr: [], // formatted Array formateArr: [], // formatted Array
@@ -268,10 +269,15 @@ export default {
this.columnsData, this.columnsData,
this.optionObj, this.optionObj,
); );
this.columnsLength = this.columnsData.length;
} }
this.gridObj.setData(this.formateArr, this.scrollTop); this.gridObj.setData(this.formateArr, this.scrollTop);
this.scrollTop = false; this.scrollTop = false;
this.gridObj.setColumns(this.columnsData);
const columnsLength = this.columnsData.length;
if (this.columnsLength !== columnsLength) {
this.gridObj.setColumns(this.columnsData);
this.columnsLength = columnsLength;
}
this.gridObj.render(); this.gridObj.render();
}); });
}, },
@@ -293,14 +299,19 @@ export default {
let limitCount = 2; let limitCount = 2;
const tempArr = []; const tempArr = [];
this.filterArr.forEach((filter) => { this.filterArr.forEach((filter) => {
const value = filter.model.trim();
tempArr.push(value);
let value = filter.model.trim();
if (!isNaN(value)) { if (!isNaN(value)) {
if (value < -(filter.max + 1) || value > filter.max || value === '') {
if (
value < -(filter.max + 1) ||
value > filter.max ||
value === '' ||
value % 1
) {
filter.showError = true; filter.showError = true;
filterCorrect = false; filterCorrect = false;
} else { } else {
filter.showError = false; filter.showError = false;
value = Number(value);
} }
} else if (value === ':') { } else if (value === ':') {
filter.showError = false; filter.showError = false;
@@ -313,6 +324,7 @@ export default {
filter.showError = true; filter.showError = true;
filterCorrect = false; filterCorrect = false;
} }
tempArr.push(value);
}); });
this.filterCorrect = filterCorrect; this.filterCorrect = filterCorrect;
if (incorrectData && filterCorrect) { if (incorrectData && filterCorrect) {


+ 4
- 1
mindinsight/ui/src/locales/zh-cn.json View File

@@ -418,6 +418,9 @@
"50542215": "查询参数错误", "50542215": "查询参数错误",
"50542216": "Summary日志文件未找到", "50542216": "Summary日志文件未找到",
"50542217": "Summary日志路径错误", "50542217": "Summary日志路径错误",
"50542218": "筛选参数错误"
"50542218": "筛选参数错误",
"50545012": "张量数据不存在,请刷新。",
"50545013": "请求的数据过大,无法返回,请使用其他维度重试。",
"50545014": "查询的张量数据已被新数据替换,请刷新。"
} }
} }

+ 5
- 3
mindinsight/ui/src/views/train-manage/tensor.vue View File

@@ -452,7 +452,7 @@ export default {
if (this.curDataType === 1 && this.curViewName === 1) { if (this.curDataType === 1 && this.curViewName === 1) {
const elementItem = this.$refs[sampleItem.ref]; const elementItem = this.$refs[sampleItem.ref];
if (elementItem) { if (elementItem) {
elementItem.clearZrData();
elementItem[0].clearZrData();
} }
} }
}); });
@@ -474,8 +474,9 @@ export default {
}, },
/** /**
* Refresh the data on the current page * Refresh the data on the current page
* @param {Boolean} isFromTypeChange
*/ */
freshCurPageData() {
freshCurPageData(isFromTypeChange) {
this.curPageArr.forEach((sampleItem, index) => { this.curPageArr.forEach((sampleItem, index) => {
if (!sampleItem || !sampleItem.tagName) { if (!sampleItem || !sampleItem.tagName) {
return; return;
@@ -484,6 +485,7 @@ export default {
if (dataType) { if (dataType) {
this.getHistogramData(sampleItem); this.getHistogramData(sampleItem);
} else { } else {
sampleItem.newDataFlag = !!isFromTypeChange || sampleItem.newDataFlag;
this.getMartixData(sampleItem); this.getMartixData(sampleItem);
} }
}); });
@@ -686,7 +688,7 @@ export default {
this.dataTypeChangeTimer = null; this.dataTypeChangeTimer = null;
} }
this.dataTypeChangeTimer = setTimeout(() => { this.dataTypeChangeTimer = setTimeout(() => {
this.freshCurPageData();
this.freshCurPageData(true);
}, 500); }, 500);
}, },
/** /**


Loading…
Cancel
Save