From ff16b3b801c64c92061dce4747c98787d239af01 Mon Sep 17 00:00:00 2001 From: baiqi Date: Tue, 23 Apr 2024 16:31:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20ca?= =?UTF-8?q?se=20=E5=A4=8D=E5=88=B6=E4=BD=BF=E7=94=A8=20case=20=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=97=B6=E7=9A=84=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/ms-environment-select/index.vue | 3 +++ .../pure/ms-rich-text/MsRichText.vue | 19 ++++--------------- .../case/createAndEditCaseDrawer.vue | 6 ++++-- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/business/ms-environment-select/index.vue b/frontend/src/components/business/ms-environment-select/index.vue index 603bd99f7f..1f2ce4183e 100644 --- a/frontend/src/components/business/ms-environment-select/index.vue +++ b/frontend/src/components/business/ms-environment-select/index.vue @@ -47,6 +47,9 @@ if (val) { appStore.setEnvConfig(val); } + }, + { + immediate: true, } ); diff --git a/frontend/src/components/pure/ms-rich-text/MsRichText.vue b/frontend/src/components/pure/ms-rich-text/MsRichText.vue index b89b1225bb..6aa8e229f0 100644 --- a/frontend/src/components/pure/ms-rich-text/MsRichText.vue +++ b/frontend/src/components/pure/ms-rich-text/MsRichText.vue @@ -12,13 +12,12 @@ * import rehypeStringify from 'rehype-stringify'; * return unified().use(rehypeParse).use(rehypeFormat).use(rehypeStringify).processSync(content.value); */ - import { useDebounceFn, useLocalStorage, useVModel } from '@vueuse/core'; + import { useDebounceFn, useVModel } from '@vueuse/core'; import type { MsFileItem } from '@/components/pure/ms-upload/types'; import AttachmentSelectorModal from './attachmentSelectorModal.vue'; import { editorUploadFile } from '@/api/modules/case-management/featureCase'; - import { PreviewEditorImageUrl } from '@/api/requrls/case-management/featureCase'; import { useI18n } from '@/hooks/useI18n'; import useLocale from '@/locale/useLocale'; import { useAppStore } from '@/store'; @@ -30,15 +29,12 @@ DecorationSet, Editor, Extension, - ExtensionAudio, ExtensionBlockquote, ExtensionBold, ExtensionBulletList, ExtensionCode, ExtensionCodeBlock, ExtensionColor, - ExtensionColumn, - ExtensionColumns, ExtensionCommands, ExtensionDocument, ExtensionDraggable, @@ -50,7 +46,6 @@ ExtensionHighlight, ExtensionHistory, ExtensionHorizontalRule, - ExtensionIframe, ExtensionIndent, ExtensionItalic, ExtensionLink, @@ -60,19 +55,15 @@ ExtensionStrike, ExtensionSubscript, ExtensionSuperscript, - ExtensionTable, ExtensionTaskList, ExtensionText, ExtensionTextAlign, ExtensionTrailingNode, ExtensionUnderline, - ExtensionVideo, lowlight, Plugin, PluginKey, RichTextEditor, - ToolbarItem, - ToolboxItem, } from '@halo-dev/richtext-editor'; import Mention from '@tiptap/extension-mention'; import type { queueAsPromised } from 'fastq'; @@ -147,10 +138,8 @@ } ); - const showSidebar = useLocalStorage('halo:editor:show-sidebar', true); - const attachmentSelectorModal = ref(false); - const selectedimagesNode = ref(); + const selectedImagesNode = ref(); const selectedCommentNode = ref(); onMounted(() => { @@ -210,9 +199,9 @@ } }); imagesNodesIds.value = images; - if (!selectedimagesNode.value) { + if (!selectedImagesNode.value) { // eslint-disable-next-line prefer-destructuring - selectedimagesNode.value = images[0]; + selectedImagesNode.value = images[0]; } return DecorationSet.empty; }, diff --git a/frontend/src/views/api-test/management/components/management/case/createAndEditCaseDrawer.vue b/frontend/src/views/api-test/management/components/management/case/createAndEditCaseDrawer.vue index f9b38c31e6..76b2241fad 100644 --- a/frontend/src/views/api-test/management/components/management/case/createAndEditCaseDrawer.vue +++ b/frontend/src/views/api-test/management/components/management/case/createAndEditCaseDrawer.vue @@ -122,7 +122,6 @@ import { getGenerateId } from '@/utils'; import { AddApiCaseParams, ApiCaseDetail, ApiDefinitionDetail } from '@/models/apiTest/management'; - import { EnvConfig } from '@/models/projectManagement/environmental'; import { RequestCaseStatus, RequestMethods } from '@/enums/apiEnum'; import { casePriorityOptions, defaultResponse } from '@/views/api-test/components/config'; @@ -188,6 +187,7 @@ const isEdit = ref(false); async function open(apiId: string, record?: ApiCaseDetail | RequestParam, isCopy?: boolean) { + appStore.showLoading(); apiDefinitionId.value = apiId; // 从api下的用例里打开抽屉有api信息,从case下直接复制没有api信息 if (props.apiDetail) { @@ -196,6 +196,7 @@ await getApiDetail(); } // 创建的时候,请求参数为接口定义的请求参数 + environmentId.value = appStore.currentEnvConfig?.id; detailForm.value = { ...cloneDeep(defaultDetail.value), ...(apiDetailInfo.value.protocol === 'HTTP' @@ -215,11 +216,11 @@ if (isCopy) { detailForm.value = cloneDeep(record as RequestParam); detailForm.value.name = `copy_${record?.name}`; + environmentId.value = record?.environmentId; if (detailForm.value.name.length > 255) { detailForm.value.name = detailForm.value.name.slice(0, 255); } } - environmentId.value = appStore.currentEnvConfig?.id; // 编辑 if (!isCopy && record?.id) { isEdit.value = true; @@ -227,6 +228,7 @@ environmentId.value = record.environmentId; detailForm.value.isNew = false; } + appStore.hideLoading(); innerVisible.value = true; await nextTick(); requestCompositionRef.value?.changeVerticalExpand(false); // 响应内容默认折叠