Browse Source

UI tensor add display of scientific notation

tags/v1.1.0
xiayifan 5 years ago
parent
commit
69feb96ff8
4 changed files with 46 additions and 10 deletions
  1. +1
    -1
      mindinsight/ui/src/components/debugger-grid-table-simple.vue
  2. +40
    -4
      mindinsight/ui/src/components/grid-table-simple.vue
  3. +2
    -2
      mindinsight/ui/src/locales/en-us.json
  4. +3
    -3
      mindinsight/ui/src/locales/zh-cn.json

+ 1
- 1
mindinsight/ui/src/components/debugger-grid-table-simple.vue View File

@@ -172,7 +172,7 @@ export default {
shape: '',
categoryArr: [
{label: this.$t('components.value'), value: 'value'},
{label: this.$t('components.ScientificCounting'), value: 'science'},
{label: this.$t('components.scientificCounting'), value: 'science'},
],
category: 'value', // value:Numerical notation science:Scientific notation
};


+ 40
- 4
mindinsight/ui/src/components/grid-table-simple.vue View File

@@ -36,6 +36,10 @@ limitations under the License.
v-if="showOperate && (fullData.length || requestError)">
<div class="filter-container"
@keyup.enter="filterChange">
<div class="filter-input-title">{{$t('components.dimsFilterInputTitle')}}
<span :title="$t('components.dimsFilterInputTip')"
class="el-icon-warning"></span>
</div>
<div v-for="(item, itemIndex) in filterArr"
:key="itemIndex">
<el-input class="filter-input"
@@ -50,11 +54,20 @@ limitations under the License.
size="mini"
v-if="!!filterArr.length"
@click="filterChange">
<i class="el-icon-check"></i></el-button>
<i class="el-icon-check"></i>
</el-button>
<span class="filter-incorrect-text"
v-if="!filterCorrect">{{$t('components.inCorrectInput')}}</span>
</div>
<div class="accuracy-container">
{{$t('components.category')}}<el-select v-model="category"
class="select-category"
@change="accuracyChange">
<el-option v-for="item in categoryArr"
:key="item.label"
:label="item.label"
:value="item.value"></el-option>
</el-select>
{{$t('components.gridAccuracy')}}<el-select v-model="accuracy"
class="select-item"
@change="accuracyChange">
@@ -141,6 +154,17 @@ export default {
rowStartIndex: 0,
colStartIndex: 0,
},
categoryArr: [
{
label: this.$t('components.value'),
value: 'value',
},
{
label: this.$t('components.scientificCounting'),
value: 'science',
},
],
category: 'value', // value: Numerical; science: Scientific notation
};
},
computed: {},
@@ -216,7 +240,7 @@ export default {
id: -1,
name: ' ',
field: -1,
width: 100,
width: 120,
headerCssClass: 'headerStyle',
},
];
@@ -228,7 +252,7 @@ export default {
id: order,
name: order,
field: order,
width: 100,
width: 120,
headerCssClass: 'headerStyle',
formatter: this.formateValueColor,
});
@@ -293,7 +317,11 @@ export default {
if (isNaN(innerData)) {
tempData[innerOrder] = innerData;
} else {
tempData[innerOrder] = innerData.toFixed(this.accuracy);
if (this.category === this.categoryArr[0].value) {
tempData[innerOrder] = innerData.toFixed(this.accuracy);
} else {
tempData[innerOrder] = innerData.toExponential(this.accuracy);
}
}
});
tempArr.push(tempData);
@@ -602,12 +630,20 @@ export default {
line-height: 32px;
color: red;
}
.filter-input-title {
line-height: 34px;
margin-right: 10px;
}
}
.accuracy-container {
float: right;
.select-item {
width: 60px;
}
.select-category {
width: 105px;
margin-left: 5px;
}
}
}
}


+ 2
- 2
mindinsight/ui/src/locales/en-us.json View File

@@ -1,6 +1,6 @@
{
"public": {
"netWorkError": "Network or backend service error. Please check.",
"netWorkError": "Network or backend service error. Ensure that the service is started successfully and reload the page.",
"browserWarning": "Your browser may cause some functions to become invalid or unavailable. You are advised to use Chrome 65 or later.",
"timeout": "Timeout. Try again.",
"noData": "No data",
@@ -469,7 +469,7 @@
"dimsFilterInputTitle": "Dimension Selection",
"dimsFilterInputTip": "The dimension value can be a specific index (consistent with the Python index meaning and supporting negative signs) or a colon (:) that indicates all values of the current dimension.",
"category": "Type",
"ScientificCounting": "Scientific notation"
"scientificCounting": "Scientific notation"
},
"debugger": {
"debugger": "Debugger",


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

@@ -1,6 +1,6 @@
{
"public": {
"netWorkError": "网络或后端服务错误,请检查。",
"netWorkError": "网络或后端服务错误,请确保服务正常并重新加载页面。",
"browserWarning": "您当前的浏览器可能导致部分功能失效或不可使用,建议使用Chrome 65版本以上的浏览器。",
"timeout": "超时,请重新请求。",
"noData": "暂无数据",
@@ -466,9 +466,9 @@
"gridTableNoData": "表格无数据",
"value": "数值",
"dimsFilterInputTitle": "维度选择",
"dimsFilterInputTip": "维度输入值可以是具体的索引(和Python的索引含义一致,支持负号)或者冒号\":\",其中冒号\":\"表示当前维度的所有值",
"dimsFilterInputTip": "维度输入值可以是具体的索引(和Python的索引含义一致支持负号)或者冒号\":\",其中冒号\":\"表示当前维度的所有值",
"category": "分类",
"ScientificCounting": "科学计数"
"scientificCounting": "科学计数"
},
"debugger": {
"debugger": "调试器",


Loading…
Cancel
Save