mirror of
https://gitee.com/dromara/go-view.git
synced 2025-09-21 12:09:58 +08:00
Merge branch 'dev'
This commit is contained in:
commit
115c176c3f
@ -124,7 +124,14 @@ const calcData = (data: any, type?: string) => {
|
|||||||
const calcCapsuleLengthAndLabelData = (dataset: any) => {
|
const calcCapsuleLengthAndLabelData = (dataset: any) => {
|
||||||
try {
|
try {
|
||||||
const { source } = dataset
|
const { source } = dataset
|
||||||
if (!source || !source.length) return
|
if (!source) return
|
||||||
|
|
||||||
|
if (source.length === 0) {
|
||||||
|
// 清空数据
|
||||||
|
state.capsuleLength = []
|
||||||
|
state.labelData = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
state.capsuleItemHeight = numberSizeHandle(state.mergedConfig.itemHeight)
|
state.capsuleItemHeight = numberSizeHandle(state.mergedConfig.itemHeight)
|
||||||
const capsuleValue = source.map((item: DataProps) => item[state.mergedConfig.dataset.dimensions[1]])
|
const capsuleValue = source.map((item: DataProps) => item[state.mergedConfig.dataset.dimensions[1]])
|
||||||
@ -140,9 +147,8 @@ const calcCapsuleLengthAndLabelData = (dataset: any) => {
|
|||||||
const labelData = Array.from(new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth))))
|
const labelData = Array.from(new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth))))
|
||||||
|
|
||||||
state.labelData = labelData
|
state.labelData = labelData
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error);
|
console.warn(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user