Commit 555f2d6c0b5508d9e0829192ef377877ad3571c2

Authored by ww
1 parent a5c64234

fix(types): 修复类型错误

@@ -14,13 +14,10 @@ import { RequestDataTypeEnum } from '@/enums/external/httpEnum' @@ -14,13 +14,10 @@ import { RequestDataTypeEnum } from '@/enums/external/httpEnum'
14 14
15 const { HelpOutlineIcon, FlashIcon } = icon.ionicons5 15 const { HelpOutlineIcon, FlashIcon } = icon.ionicons5
16 const { targetData } = useTargetData() 16 const { targetData } = useTargetData()
17 -  
18 -interface ComponentExpose {  
19 - openModal: ((flag: boolean | undefined, type: RequestDataTypeEnum) => Promise<void>) | undefined  
20 -} 17 +
21 18
22 19
23 -const requestModal = ref<ComponentExpose>() 20 +const requestModal = ref<InstanceType<typeof RequestModal>>()
24 21
25 const designStore = useDesignStore() 22 const designStore = useDesignStore()
26 23
@@ -7,8 +7,6 @@ import GlobalParamsConfiguration from './GlobalParamsConfiguration.vue' @@ -7,8 +7,6 @@ import GlobalParamsConfiguration from './GlobalParamsConfiguration.vue'
7 import { ChevronDown, ChevronUp } from '@vicons/carbon' 7 import { ChevronDown, ChevronUp } from '@vicons/carbon'
8 import { useDesignStore } from '@/store/modules/designStore/designStore'; 8 import { useDesignStore } from '@/store/modules/designStore/designStore';
9 import { selectTimeOptions } from '../../../index.d'; 9 import { selectTimeOptions } from '../../../index.d';
10 -import { RequestConfigType, RequestGlobalConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'  
11 -import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';  
12 import { useTargetData } from '../../../../hooks/useTargetData.hook'; 10 import { useTargetData } from '../../../../hooks/useTargetData.hook';
13 import { RequestHttpIntervalEnum } from '@/enums/httpEnum'; 11 import { RequestHttpIntervalEnum } from '@/enums/httpEnum';
14 12
@@ -12,11 +12,6 @@ import ComponentConfiguration from './ComponentConfiguration.vue'; @@ -12,11 +12,6 @@ import ComponentConfiguration from './ComponentConfiguration.vue';
12 import GlobalPublicConfiguration from './GlobalPublicConfiguration.vue'; 12 import GlobalPublicConfiguration from './GlobalPublicConfiguration.vue';
13 import { createRequestModalContext } from './useRequestModalContext'; 13 import { createRequestModalContext } from './useRequestModalContext';
14 14
15 -interface ComponentExpose {  
16 - getConfigurationData: () => RequestConfigType  
17 - setConfigurationData: (request: RequestConfigType) => void  
18 - validate: () => Promise<boolean>  
19 -}  
20 15
21 const requestDataType = ref<RequestDataTypeEnum>(RequestDataTypeEnum.AJAX) 16 const requestDataType = ref<RequestDataTypeEnum>(RequestDataTypeEnum.AJAX)
22 17
@@ -24,9 +19,9 @@ const showModal = ref(false) @@ -24,9 +19,9 @@ const showModal = ref(false)
24 19
25 const chartEditStore = useChartEditStore() 20 const chartEditStore = useChartEditStore()
26 21
27 -const componentConfigurationEl = ref<ComponentExpose>() 22 +const componentConfigurationEl = ref<InstanceType<typeof ComponentConfiguration>>()
28 23
29 -const publicInterfaceFormEl = ref<ComponentExpose>() 24 +const publicInterfaceFormEl = ref<InstanceType<typeof PublicInterfaceForm>>()
30 25
31 const getRequestTypeName = computed(() => { 26 const getRequestTypeName = computed(() => {
32 return RequestDataTypeNameEnum[RequestDataTypeEnum[unref(requestDataType)] as keyof typeof RequestDataTypeEnum] 27 return RequestDataTypeNameEnum[RequestDataTypeEnum[unref(requestDataType)] as keyof typeof RequestDataTypeEnum]
@@ -74,11 +69,11 @@ const getResult = () => { @@ -74,11 +69,11 @@ const getResult = () => {
74 69
75 const handleSaveAction = async () => { 70 const handleSaveAction = async () => {
76 if (!(await validate())) return 71 if (!(await validate())) return
77 - const value = getResult() 72 + const value = getResult()
78 if (unref(selectTarget)) { 73 if (unref(selectTarget)) {
79 chartEditStore.updateComponentList(chartEditStore.fetchTargetIndex(), { 74 chartEditStore.updateComponentList(chartEditStore.fetchTargetIndex(), {
80 ...unref(selectTarget)!, 75 ...unref(selectTarget)!,
81 - request: value! 76 + request: value as RequestConfigType
82 }) 77 })
83 } 78 }
84 showModal.value = false 79 showModal.value = false