fix: 修改TS报错问题,抽离水印文案
This commit is contained in:
parent
34177e00af
commit
079fc2bdb9
@ -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 = () => {
|
||||
|
@ -85,7 +85,7 @@ export const chartColorsSearch = {
|
||||
// 默认主题详细配置
|
||||
type ThemeJsonType = typeof themeJson
|
||||
export interface GlobalThemeJsonType extends Partial<ThemeJsonType> {
|
||||
dataset: any,
|
||||
dataset?: any,
|
||||
[T:string]: any
|
||||
}
|
||||
export const globalThemeJson = themeJson
|
||||
export const globalThemeJson = {...themeJson, dataset: null,}
|
||||
|
@ -4,7 +4,10 @@ import designColor from './designColor.json'
|
||||
// 默认语言
|
||||
export const lang = LangEnum.zh
|
||||
|
||||
// 水印文字
|
||||
export const watermarkText = "GoView 低代码平台"
|
||||
|
||||
// 主题配置
|
||||
export const theme = {
|
||||
// 默认是否开启深色主题
|
||||
darkTheme: true,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import type { WritableComputedRef } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import { lang } from '@/settings/designSetting'
|
||||
import { LangStateType } from './langStore.d'
|
||||
@ -28,7 +29,7 @@ export const useLangStore = defineStore({
|
||||
changeLang(lang: LangEnum): void {
|
||||
if (this.lang === lang) return
|
||||
this.lang = lang
|
||||
i18n.global.locale = lang
|
||||
i18n.global.locale = (lang as unknown) as WritableComputedRef<LangEnum>
|
||||
setLocalStorage(GO_LANG_STORE, this.$state)
|
||||
|
||||
if (settingStore.getChangeLangReload) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
>
|
||||
<n-watermark
|
||||
id="go-edit-watermark"
|
||||
content="GoView 低代码平台"
|
||||
:content="watermarkText"
|
||||
cross
|
||||
selectable
|
||||
:font-size="16"
|
||||
@ -33,6 +33,7 @@ import { mousedownHandleUnStop } from '../../hooks/useDrag.hook'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { EditAlignLine } from '../EditAlignLine'
|
||||
import { EditRule } from '../EditRule'
|
||||
import { watermarkText } from '@/settings/designSetting'
|
||||
|
||||
const chartEditStore = useChartEditStore()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user