Skip to content

Commit

Permalink
fix(测试计划): 修复ts类型报错的缺陷
Browse files Browse the repository at this point in the history
  • Loading branch information
1myuan authored and fit2-zhao committed May 8, 2024
1 parent a44efef commit 102aa3a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/business/ms-menu/index.vue
@@ -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';
Expand Down Expand Up @@ -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' : ''}
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/pure/ms-rich-text/MsRichText.vue
Expand Up @@ -337,7 +337,7 @@
// return `${options.suggestion.char}${userMap[node.attrs.id]}`;
},
suggestion,
}),
}) as Extension<any, any>,
],
autofocus: false,
onUpdate: () => {
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/models/testPlan/testPlan.ts
Expand Up @@ -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 {};
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 102aa3a

Please sign in to comment.