mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 修改类型报错
This commit is contained in:
@@ -24,16 +24,16 @@
|
||||
import { toRefs, Ref, reactive } from 'vue'
|
||||
import { renderIcon, goDialog, goHome } from '@/utils'
|
||||
import { icon } from '@/plugins'
|
||||
const { LayersIcon, BarChartIcon, PrismIcon, HomeIcon } = icon.ionicons5
|
||||
import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
|
||||
import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
|
||||
import { useRemoveKeyboard } from '../hooks/useKeyboard.hook'
|
||||
|
||||
const { LayersIcon, BarChartIcon, PrismIcon, HomeIcon } = icon.ionicons5
|
||||
const { setItem } = useChartLayoutStore()
|
||||
const { getLayers, getCharts, getDetails } = toRefs(useChartLayoutStore())
|
||||
|
||||
type ItemType = {
|
||||
key: string
|
||||
interface ItemType {
|
||||
key: ChartLayoutStoreEnum
|
||||
select: Ref<boolean> | boolean
|
||||
title: string
|
||||
icon: any
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { PickCreateComponentType } from '@/packages/index.d'
|
||||
import { EditCanvasConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||
|
||||
type AttrType = PickCreateComponentType<'attr'>
|
||||
|
||||
@@ -19,3 +20,12 @@ export const useSizeStyle = (attr: AttrType, scale?: number) => {
|
||||
}
|
||||
return sizeStyle
|
||||
}
|
||||
|
||||
export const useEditCanvasConfigStyle = (canvas: EditCanvasConfigType) => {
|
||||
return {
|
||||
position: 'relative',
|
||||
width: canvas.width ? `${canvas.width || 100}px` : '100%',
|
||||
height: canvas.height ? `${canvas.height}px` : '100%',
|
||||
border: '1px solid red'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import { usePreviewScale } from '@/hooks/index'
|
||||
import { RenderList } from './components/RenderList/index'
|
||||
import { ChartEditStorageType } from './index.d'
|
||||
import { getLocalStorageInfo } from './utils/index'
|
||||
import { useEditCanvasConfigStyle } from './hooks/useStyle.hook'
|
||||
|
||||
const previewRef = ref()
|
||||
|
||||
@@ -25,13 +26,8 @@ const localStorageInfo: ChartEditStorageType = getLocalStorageInfo() as ChartEdi
|
||||
const width = ref(localStorageInfo?.editCanvasConfig.width)
|
||||
const height = ref(localStorageInfo?.editCanvasConfig.height)
|
||||
|
||||
const previewRefStyle = computed(() => {
|
||||
return {
|
||||
position: 'relative',
|
||||
width: width.value ? `${width.value || 100}px` : '100%',
|
||||
height: height.value ? `${height.value}px` : '100%',
|
||||
border: '1px solid red'
|
||||
}
|
||||
const previewRefStyle: any = computed(() => {
|
||||
return useEditCanvasConfigStyle(localStorageInfo.editCanvasConfig)
|
||||
})
|
||||
|
||||
if (!localStorageInfo) {
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface ChartEditStorageType extends ChartEditStorage {
|
||||
id: string
|
||||
}
|
||||
|
||||
// 根据路由 id 获取存储数据的信息
|
||||
export const getLocalStorageInfo = () => {
|
||||
const urlHash = document.location.hash
|
||||
const toPathArray = urlHash.split('/')
|
||||
|
||||
Reference in New Issue
Block a user