fix: 修改 值为 “0” 对取最大值的影响
This commit is contained in:
@@ -133,9 +133,14 @@ export default {
|
||||
})
|
||||
minTime = timeSorted.length ? timeSorted[0][0] : ''
|
||||
maxTime = timeSorted.length ? timeSorted[timeSorted.length - 1][0] : ''
|
||||
minValue = valueSorted.length ? valueSorted[0][1] : ''
|
||||
maxValue = valueSorted.length ? valueSorted[valueSorted.length - 1][1] : ''
|
||||
minValue = valueSorted.length ? valueSorted[0][1] : 0
|
||||
maxValue = valueSorted.length ? valueSorted[valueSorted.length - 1][1] : 0
|
||||
const unit = chartDataFormat.getUnit(chartUnit)
|
||||
if (!isNaN(maxValue)) {
|
||||
maxValue = Number(maxValue)
|
||||
} else {
|
||||
maxValue = 0
|
||||
}
|
||||
maxValue = chartDataFormat.formatDatas(maxValue, unit.type, 'ceil', unit.ascii) // 取最大值后 需要对其进行取整
|
||||
let oldValue = maxValue
|
||||
let dot = 0
|
||||
@@ -154,7 +159,8 @@ export default {
|
||||
maxValue = Math.floor(oldValue) / Math.pow(10, dot)
|
||||
dot++
|
||||
}
|
||||
const copies = chartDataFormat.copies(oldValue, unit.type)
|
||||
console.log(oldValue)
|
||||
const copies = chartDataFormat.copies(Number(oldValue), unit.type)
|
||||
return { minTime, maxTime, minValue, maxValue, copies, unit, dot }
|
||||
},
|
||||
xAxisLabelFormatter (minTime, maxTime) {
|
||||
|
||||
@@ -790,6 +790,9 @@ export default {
|
||||
}
|
||||
},
|
||||
Interval: function (value, copies, type, interValType) {
|
||||
if (!copies) {
|
||||
copies = 1
|
||||
}
|
||||
if (interValType === 'max' && value < 1) {
|
||||
if (value < 1) {
|
||||
value = 1
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
id="asset-list"
|
||||
:params="filter"
|
||||
:params-type="paramsType"
|
||||
:permissions="{import: 'main_add', export: 'panel_edit'}"
|
||||
:permissions="{import: 'main_add', export: 'main_edit'}"
|
||||
class="top-tool-export margin-r-10"
|
||||
export-file-name="asset-charts"
|
||||
export-url="visual/panel/export"
|
||||
@@ -60,8 +60,8 @@
|
||||
:showLock="from === fromRoute.endpoint"
|
||||
class="top-tool-export margin-r-10"
|
||||
export-file-name="endpoint-charts"
|
||||
export-url="visual/panel/export"
|
||||
import-url="visual/panel/import"
|
||||
:export-url="'visual/panel/export'"
|
||||
:import-url="'visual/panel/import'"
|
||||
@afterImport="getTableData"
|
||||
@panelLockChange="panelLockChange"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user