Commit 90d831c09171ee9a6aee92824196c1004819927b

Authored by fengtao
1 parent ee856643

perf: 优化点击跳转openapi接口文档地址

@@ -3,6 +3,7 @@ import { findDictItemByCode } from '/@/api/system/dict'; @@ -3,6 +3,7 @@ import { findDictItemByCode } from '/@/api/system/dict';
3 import { FormSchema } from '/@/components/Form'; 3 import { FormSchema } from '/@/components/Form';
4 import { DictEnum } from '/@/enums/dictEnum'; 4 import { DictEnum } from '/@/enums/dictEnum';
5 import { useI18n } from '/@/hooks/web/useI18n'; 5 import { useI18n } from '/@/hooks/web/useI18n';
  6 +import HelpMessage from '../HelpMessage.vue';
6 7
7 export enum FormFieldsEnum { 8 export enum FormFieldsEnum {
8 NAME = 'name', 9 NAME = 'name',
@@ -62,23 +63,9 @@ export const formSchema: FormSchema[] = [ @@ -62,23 +63,9 @@ export const formSchema: FormSchema[] = [
62 }, 63 },
63 { 64 {
64 field: FormFieldsEnum.INTERFACE_ADDRESS, 65 field: FormFieldsEnum.INTERFACE_ADDRESS,
65 - label: t('application.api.text.interfaceAddress'), 66 + label: h(HelpMessage) as unknown as string,
66 component: 'Input', 67 component: 'Input',
67 required: true, 68 required: true,
68 - helpMessage: [  
69 - h(  
70 - 'span',  
71 - {  
72 - style: {  
73 - cursor: 'pointer',  
74 - },  
75 - onClick: () => {  
76 - window.open('https://yunteng.yuque.com/avshoi/open_api');  
77 - },  
78 - },  
79 - t('common.documentUrl')  
80 - ) as any as string,  
81 - ],  
82 componentProps: { 69 componentProps: {
83 maxLength: 255, 70 maxLength: 255,
84 placeholder: t('application.api.search.interfaceAddressPlaceholder'), 71 placeholder: t('application.api.search.interfaceAddressPlaceholder'),
  1 +<script lang="ts" setup>
  2 + import { BasicHelp } from '/@/components/Basic';
  3 + import { useI18n } from '/@/hooks/web/useI18n';
  4 +
  5 + function handleLinkOpenApiDoc() {
  6 + window.open('https://yunteng.yuque.com/avshoi/open_api');
  7 + }
  8 +
  9 + const { t } = useI18n();
  10 +</script>
  11 +
  12 +<template>
  13 + <div>{{ t('application.api.text.interfaceAddress') }}</div>
  14 +
  15 + <BasicHelp
  16 + placement="top"
  17 + @click="handleLinkOpenApiDoc"
  18 + class="mx-1"
  19 + :text="t('common.documentUrl')"
  20 + />
  21 +</template>