fix(测试计划): 修复ts类型报错的缺陷

This commit is contained in:
teukkk 2024-05-08 16:22:54 +08:00 committed by Craftsman
parent a44efef7a3
commit 102aa3a88e
4 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,5 @@
<script lang="tsx">
import { compile, computed, defineComponent, h, ref } from 'vue';
import { computed, defineComponent, h, ref } from 'vue';
import { RouteRecordRaw, useRoute, useRouter } from 'vue-router';
import { Message } from '@arco-design/web-vue';
import { cloneDeep } from 'lodash-es';
@ -461,7 +461,7 @@
key={element?.name}
v-slots={{
icon,
title: () => h(compile(t(element?.meta?.locale || ''))),
title: () => h(t(element?.meta?.locale || '')),
}}
class={BOTTOM_MENU_LIST.includes(element?.name as string) ? 'arco-menu-inline--bottom' : ''}
>

View File

@ -337,7 +337,7 @@
// return `${options.suggestion.char}${userMap[node.attrs.id]}`;
},
suggestion,
}),
}) as Extension<any, any>,
],
autofocus: false,
onUpdate: () => {

View File

@ -55,4 +55,11 @@ export interface AddTestPlanParams {
groupOption?: boolean;
}
export interface SwitchListModel {
key: 'repeatCase' | 'automaticStatusUpdate' | 'testPlanning';
label: string;
desc: string[];
tooltipPosition: 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';
}
export default {};

View File

@ -71,7 +71,7 @@
<MsMoreSettingCollapse>
<template #content>
<div v-for="item in switchList" :key="item.key" class="mb-[24px] flex items-center gap-[8px]">
<a-switch v-model="form[item.key as keyof AddTestPlanParams] as boolean" size="small" />
<a-switch v-model="form[item.key]" size="small" />
{{ t(item.label) }}
<a-tooltip :position="item.tooltipPosition">
<template #content>
@ -111,16 +111,9 @@
import useAppStore from '@/store/modules/app';
import { ModuleTreeNode } from '@/models/common';
import type { AddTestPlanParams } from '@/models/testPlan/testPlan';
import type { AddTestPlanParams, SwitchListModel } from '@/models/testPlan/testPlan';
import { testPlanTypeEnum } from '@/enums/testPlanEnum';
interface SwitchListModel {
key: string;
label: string;
desc: string[];
tooltipPosition: 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';
}
const { t } = useI18n();
const appStore = useAppStore();