fix: 修改TS报错问题,抽离水印文案

This commit is contained in:
奔跑的面条
2022-04-07 14:20:18 +08:00
parent b5ea97e239
commit be0c0566df
20 changed files with 40 additions and 40 deletions
@@ -6,8 +6,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
dur: 0.5,
colors: ['#4fd2dd', '#235fa7'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#6586ec', '#2cf7fe'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#6586ec', '#2cf7fe'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -10,8 +10,7 @@ export const option = {
borderTitleSize: 18,
borderTitleColor: '#fff',
colors: ['#8aaafb', '#1f33a2'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#1d48c4', '#d3e1f8'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#3140ad', '#1089ff'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#11eefd', '#0078d2'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -7,8 +7,7 @@ export const option = {
colors: ['#235fa7', '#4fd2dd'],
dur: 3,
reverse: false,
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#3140ad', '#235fa7'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#1089ff', '#0000ff'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#2862b7', '#2862b7'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#2862b7', '#2862b7'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,8 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#2862b7', '#4b77b7'],
backgroundColor: '#00000000',
dataset: null
backgroundColor: '#00000000'
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -6,7 +6,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#ffffff4d', '#ffffff4d'],
dur: 3,
lineHeight: 3,
lineHeight: 3
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -5,7 +5,7 @@ import cloneDeep from 'lodash/cloneDeep'
export const option = {
colors: ['#00c2ff', '#00c2ff4d'],
dur: 3,
dur: 3
}
export default class Config extends publicConfig implements CreateComponentType {
@@ -52,21 +52,29 @@ const { rowNum, unit, color, textColor, borderColor } = toRefs(
const status = reactive({
mergedConfig: props.chartConfig.option,
rowsData: [],
rows: [],
heights: [],
rows: [{
scroll: 0,
ranking: 1,
name: '',
value: '',
percent: 0
}],
heights: [0],
animationIndex: 0,
animationHandler: '',
animationHandler: 0,
updater: 0,
avgHeight: 0
})
const calcRowsData = () => {
let { dataset, rowNum, sort } = status.mergedConfig
sort &&
dataset.sort(({ value: a }, { value: b }) => {
// @ts-ignore
sort && dataset.sort(({ value: a }, { value: b }) => {
if (a > b) return -1
if (a < b) return 1
if (a === b) return 0
})
// @ts-ignore
const value = dataset.map(({ value }) => value)
const min = Math.min(...value) || 0
// abs of min
@@ -75,7 +83,7 @@ const calcRowsData = () => {
// abs of max
const maxAbs = Math.abs(max)
const total = max + minAbs
dataset = dataset.map((row, i) => ({
dataset = dataset.map((row: any, i:number) => ({
...row,
ranking: i + 1,
percent: ((row.value + minAbs) / total) * 100,
@@ -84,7 +92,7 @@ const calcRowsData = () => {
if (rowLength > rowNum && rowLength < 2 * rowNum) {
dataset = [...dataset, ...dataset]
}
dataset = dataset.map((d, i) => ({ ...d, scroll: i }))
dataset = dataset.map((d:any, i:number) => ({ ...d, scroll: i }))
status.rowsData = dataset
status.rows = dataset
}
@@ -118,7 +126,7 @@ const animation = async (start = false) => {
if (back >= 0) animationIndex = back
status.animationIndex = animationIndex
status.animationHandler = setTimeout(animation, waitTime * 1000 - 300)
status.animationHandler = setTimeout(animation, waitTime * 1000 - 300) as any
}
const stopAnimation = () => {