diff --git a/src/Login.vue b/src/Login.vue
index 63026f3f..a9dd2189 100644
--- a/src/Login.vue
+++ b/src/Login.vue
@@ -56,11 +56,12 @@ export default {
if (!this.username || !this.pin) {
return
}
- // if (!this.blockOperation.query) {
- // this.blockOperation.query = true
- // } else {
- // return
- // }
+ if (!this.blockOperation.query) {
+ this.blockOperation.query = true
+ } else {
+ return
+ }
+ this.loading = true
post('sys/login', { username: this.username, pin: this.pin }).then(
res => {
if (res.code === 200) {
diff --git a/src/utils/constants.js b/src/utils/constants.js
index 33f965fb..d0bd2aa4 100644
--- a/src/utils/constants.js
+++ b/src/utils/constants.js
@@ -77,7 +77,8 @@ export const unitTypes = {
time: 'time',
number: 'number',
byte: 'byte',
- string: 'string'
+ string: 'string',
+ percent: 'percent'
}
export const chartTableDefaultPageSize = 10 // table类型图表默认每页数据量
diff --git a/src/utils/unit-convert.js b/src/utils/unit-convert.js
index 8b2e873f..380c4b37 100644
--- a/src/utils/unit-convert.js
+++ b/src/utils/unit-convert.js
@@ -82,6 +82,7 @@ export default function unitConvert (value, unitType, sourceUnit, targetUnit, do
case unitTypes.time: {
return timeUnitFormatter(value, sourceUnit, targetUnit, dot)
}
+ case unitTypes.percent:
case unitTypes.number: {
return numberUnitConvert(value, sourceUnit, targetUnit, dot)
}
diff --git a/src/views/charts/Chart.vue b/src/views/charts/Chart.vue
index 8363a1ed..6b31c29f 100644
--- a/src/views/charts/Chart.vue
+++ b/src/views/charts/Chart.vue
@@ -110,7 +110,7 @@
{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}
- {{handleSingleValue[0] ? handleSingleValue[0] : '-'}}
+ {{handleSingleValue[0] || handleSingleValue[0] === 0 ? handleSingleValue[0] : '-'}}
{{handleSingleValue[1]}}
@@ -968,7 +968,7 @@ export default {
const unitType = this.chartInfo.params.unitType
const result = unitConvert(value, unitType)
switch (unitType) {
- case unitTypes.number: {
+ case unitTypes.percent: {
result[0] = result[0] < 0.01 ? '< 0.01' : result[0]
break
}