Parcourir la source

fix: 修改一点类型错误的问题

MTrun il y a 3 ans
Parent
commit
e1a41a2853

+ 2 - 2
src/store/modules/chartEditStore/chartEditStore.d.ts

@@ -12,8 +12,8 @@ export enum EditCanvasTypeEnum {
 }
 export type EditCanvasType = {
   // 编辑区域 DOM
-  [EditCanvasTypeEnum.EDITLAYOUTDOM]?: HTMLElement
-  [EditCanvasTypeEnum.EDITCONTENTDON]?: HTMLElement
+  [EditCanvasTypeEnum.EDITLAYOUTDOM]: HTMLElement | null
+  [EditCanvasTypeEnum.EDITCONTENTDON]: HTMLElement | null
   // 大屏宽度
   [EditCanvasTypeEnum.WIDTH]: number
   // 大屏高度

+ 2 - 3
src/store/modules/chartEditStore/chartEditStore.ts

@@ -12,8 +12,8 @@ export const useChartEditStoreStore = defineStore({
   state: (): chartEditStoreType => ({
     editCanvas: {
       // 编辑区域 Dom
-      editLayoutDom: undefined,
-      editContentDom: undefined,
+      editLayoutDom: null,
+      editContentDom: null,
       // 默认宽度
       width: 1920,
       // 默认高度
@@ -54,7 +54,6 @@ export const useChartEditStoreStore = defineStore({
     ): void {
       const dom = this.getEditCanvas.editContentDom
       if (dom) {
-        // @ts-ignore
         dom.style[key] = value
       }
     },

+ 1 - 1
src/views/chart/components/ContentEdit/components/EditBottom/index.vue

@@ -68,7 +68,7 @@ const themeColor = ref(designStore.getAppTheme)
 
 const chartEditStore = getChartEditStore()
 const chartEditStoreEnum = getChartEditStoreEnum()
-const { lockScale, scale, userScale } = toRefs(chartEditStore.getEditCanvas)
+const { lockScale, scale } = toRefs(chartEditStore.getEditCanvas)
 
 // 缩放选项
 let filterOptions = reactive([

+ 1 - 2
src/views/chart/components/ContentEdit/index.vue

@@ -19,7 +19,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, onUnmounted, onMounted, computed } from 'vue'
+import { onUnmounted, onMounted } from 'vue'
 import { ContentBox } from '../ContentBox/index'
 import { EditRange } from './components/EditRange'
 import { EditBottom } from './components/EditBottom'
@@ -50,7 +50,6 @@ onMounted(() => {
   })
 })
 
-computed(() => { })
 </script>
 
 <style lang="scss" scoped>