fix(测试计划): 修复测试计划详情执行弹窗和切换优先级问题

This commit is contained in:
xinxin.wu 2024-10-21 12:03:23 +08:00 committed by Craftsman
parent 4ba7ee7dfc
commit 474d7e2930
3 changed files with 51 additions and 12 deletions

View File

@ -494,7 +494,9 @@
Message.success(t('caseManagement.featureCase.editSuccess')); Message.success(t('caseManagement.featureCase.editSuccess'));
detailInfo.value.name = titleName.value; detailInfo.value.name = titleName.value;
isEditTitle.value = false; isEditTitle.value = false;
updateSuccess(); nextTick(() => {
updateSuccess();
});
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} finally { } finally {

View File

@ -11,7 +11,7 @@
</div> </div>
</a-form-item> </a-form-item>
<a-form-item field="content" asterisk-position="end" class="mb-0"> <a-form-item field="content" asterisk-position="end" class="mb-0">
<div class="flex w-full items-center"> <div class="textarea-input flex w-full items-center">
<a-textarea <a-textarea
v-if="props.isDblclickPlaceholder && !achievedForm" v-if="props.isDblclickPlaceholder && !achievedForm"
v-model="form.content" v-model="form.content"
@ -20,7 +20,6 @@
:auto-size="{ minRows: 1 }" :auto-size="{ minRows: 1 }"
style="resize: vertical" style="resize: vertical"
:max-length="1000" :max-length="1000"
@click="achievedForm = true"
/> />
<MsRichText <MsRichText
v-if="!props.isDblclickPlaceholder || achievedForm" v-if="!props.isDblclickPlaceholder || achievedForm"

View File

@ -4,7 +4,8 @@
v-model:form="form" v-model:form="form"
is-dblclick-placeholder is-dblclick-placeholder
class="execute-form" class="execute-form"
@dblclick="dblclickHandler" @dblclick="dblOrClickHandler"
@click="dblOrClickHandler"
> >
<template #headerRight> <template #headerRight>
<slot name="headerRight"></slot> <slot name="headerRight"></slot>
@ -64,6 +65,7 @@
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'done', status: LastExecuteResults, content: string): void; (e: 'done', status: LastExecuteResults, content: string): void;
(e: 'dblclick'): void;
}>(); }>();
const { t } = useI18n(); const { t } = useI18n();
@ -74,14 +76,52 @@
const modalVisible = ref(false); const modalVisible = ref(false);
const submitLoading = ref(false); const submitLoading = ref(false);
// //
function dblclickHandler() { const achievedForm = ref<boolean>(props.isDefaultActivate);
const clickTimeout = ref<ReturnType<typeof setTimeout> | null>();
//
function handleDblClick() {
if (clickTimeout.value) {
clearTimeout(clickTimeout.value); //
clickTimeout.value = null;
}
modalVisible.value = true;
dialogForm.value = cloneDeep(form.value); //
}
//
function handleClick() {
if (clickTimeout.value) {
clearTimeout(clickTimeout.value);
}
clickTimeout.value = setTimeout(() => {
if (!achievedForm.value) {
achievedForm.value = true; //
}
clickTimeout.value = null;
}, 200);
}
function dblOrClickHandler() {
nextTick(() => { nextTick(() => {
const editorContent = document.querySelector('.execute-form')?.querySelector('.editor-content'); const editorContent = document.querySelector('.execute-form')?.querySelector('.editor-content');
useEventListener(editorContent, 'dblclick', () => { const textareaContent = document.querySelector('.execute-form')?.querySelector('.textarea-input');
modalVisible.value = true;
dialogForm.value = cloneDeep(form.value); const bindEvents = (element: Element | null) => {
}); if (element) {
useEventListener(element, 'dblclick', handleDblClick);
useEventListener(element, 'click', handleClick);
}
};
if (editorContent) {
bindEvents(editorContent);
}
if (textareaContent) {
bindEvents(textareaContent);
}
}); });
} }
@ -107,8 +147,6 @@
} }
); );
const achievedForm = ref<boolean>(props.isDefaultActivate);
function cancel(e: Event) { function cancel(e: Event) {
// / // /
if (!(e.target as any)?.classList.contains('arco-modal-wrapper')) { if (!(e.target as any)?.classList.contains('arco-modal-wrapper')) {